/* topbar + stories + bottom nav */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 10px;
  background: rgba(235, 230, 216, 0.94);
  border-bottom: 3px solid #000;
  backdrop-filter: blur(6px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-logo {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border: 2px solid #000;
  background: #000;
  flex-shrink: 0;
}

.wordmark { margin: 0; font-size: 1.35rem; font-weight: 700; }

.wordmark .wm-j {
  display: inline-block;
  padding: 0.08em 0.2em 0.06em;
  background: #000;
  color: var(--acid);
  border: 2px solid #000;
  box-shadow: 3px 3px 0 var(--stamp);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

body.ui-app .wordmark .wm-j {
  animation: none;
}

.topbar-actions { display: flex; align-items: center; gap: 4px; }

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--ink);
}

.icon-btn:active { background: var(--acid); }

.icon-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  line-height: 16px;
  text-align: center;
  background: var(--stamp);
  color: #fff;
  border: 1.5px solid #000;
}

.icon-btn.more {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
}

.feed-scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--bottom-h) + 12px);
  -webkit-overflow-scrolling: touch;
}

.stories {
  display: flex;
  gap: 14px;
  padding: 12px 12px 10px;
  overflow-x: auto;
  border-bottom: 2px solid #000;
  background: var(--paper-card);
  scrollbar-width: none;
}

.stories::-webkit-scrollbar { display: none; }

.story {
  flex: 0 0 auto;
  width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.story-ring {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(var(--stamp), var(--acid), var(--magenta-glitch), var(--stamp));
  display: grid;
  place-items: center;
  animation: film-jitter 0.55s steps(2) infinite;
}

.story.yours .story-ring { background: #000; }

.story-ring img,
.story-initial {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--paper);
  background: #111;
  object-fit: cover;
  display: grid;
  place-items: center;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--acid);
}

.story-ring.tone-0 { background: conic-gradient(#c4122f, #f0e100, #c4122f); }
.story-ring.tone-1 { background: conic-gradient(#00e5ff, #ff2a6d, #00e5ff); }
.story-ring.tone-2 { background: conic-gradient(#f0e100, #000, #f0e100); }
.story-ring.tone-3 { background: conic-gradient(#ff2a6d, #ebe6d8, #ff2a6d); }

.story-label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticker {
  border-top: 2px solid #000;
  border-bottom: 2px solid #000;
  background: #000;
  color: var(--acid);
  overflow: hidden;
  padding: 0.3rem 0;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: marquee 26s linear infinite;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ticker-track span { padding: 0 1.5rem; }
.ticker-track span::after { content: " ✦ "; color: var(--stamp); }

.bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 40;
  height: var(--bottom-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: rgba(235, 230, 216, 0.96);
  border-top: 3px solid #000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--ink);
}

.nav-item.active { background: var(--acid); }

.nav-create .create-box {
  width: 28px;
  height: 28px;
  border: 2.5px solid #000;
  display: grid;
  place-items: center;
  font-family: var(--font-ui);
  font-size: 1.25rem;
  line-height: 1;
  background: #fff;
  box-shadow: 2px 2px 0 var(--stamp);
}

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #000;
  overflow: hidden;
  display: block;
}

.nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.loader {
  margin: 16px 12px 8px;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px;
  border: 2px dashed #000;
  background: rgba(240, 225, 0, 0.25);
}

#feed-sentinel { height: 1px; }
