/* THE FEED ROOM — the console cut down to the rail and the deck.
   Left: the rail (which feed, which tape). Right: the deck, one tape per
   screen, vertical snap. On a phone the rail folds into a tab strip. */

.room { display: grid; grid-template-columns: var(--rail-w) 1fr; height: 100dvh; overflow: hidden; }

/* ── the rail ── */
.rail {
  display: grid; grid-template-rows: auto auto 1fr auto; min-height: 0;
  background: var(--space-deep); border-right: 1px solid var(--space-line);
}
.rail__brand {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-4) var(--s-4) var(--s-3); border-bottom: 1px solid var(--space-line);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-family: "Bowlby One", var(--font-display); font-size: 1.25rem; letter-spacing: 0.04em; color: var(--neon-cyan);
}
.wordmark__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--on-air); box-shadow: var(--glow-red); }
.rail__clock { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.16em; color: var(--ink-faint); }

.feeds { display: grid; gap: 6px; padding: var(--s-3); }
.feed {
  position: relative; display: grid; gap: 2px; text-align: left; cursor: pointer;
  padding: 10px 44px 10px 12px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--space-line); color: var(--ink-dim);
  font-family: var(--font-display); transition: border-color var(--dur-fast), background var(--dur-fast);
}
.feed b { font-size: 0.82rem; letter-spacing: 0.14em; color: var(--ink); }
.feed span { font-size: 0.72rem; color: var(--ink-faint); }
.feed kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 0.58rem; color: var(--ink-faint);
  padding: 2px 6px; border: 1px solid var(--space-line); border-radius: 4px;
}
.feed:hover { border-color: var(--space-line-bright); }
.feed.on { background: var(--space-panel); border-color: var(--neon-cyan); }
.feed.on b { color: var(--neon-cyan); }
.feed.on kbd { color: var(--neon-cyan); border-color: var(--neon-cyan); }
.feed[data-live="1"] b::after {
  content: "LIVE"; margin-left: 8px; padding: 1px 6px; border-radius: 999px;
  background: var(--on-air); color: #fff; font-family: var(--font-mono); font-size: 0.5rem; letter-spacing: 0.14em; vertical-align: 2px;
}

.index { min-height: 0; overflow-y: auto; padding: 0 var(--s-3) var(--s-3); scrollbar-width: thin; scrollbar-color: var(--space-line) transparent; }
.index__k { margin: var(--s-2) 0 var(--s-2) 4px; font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.2em; color: var(--ink-faint); }
.index__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.index__list button {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; width: 100%;
  padding: 6px 8px; text-align: left; cursor: pointer; border: 0; border-radius: 6px;
  background: transparent; color: var(--ink-dim); font-family: var(--font-display);
}
.index__list button:hover { background: var(--space-panel); color: var(--ink); }
.index__list li.on button { background: var(--space-panel); color: var(--neon-cyan); box-shadow: inset 2px 0 0 var(--neon-cyan); }
.index__list img, .index__list .mono-ava {
  width: 28px; height: 28px; border-radius: 7px; object-fit: cover;
  border: 1px solid var(--space-line); display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.5rem; color: var(--ink-faint); background: var(--space-void);
}
.index__list .ix { min-width: 0; display: grid; }
.index__list .ix b { font-size: 0.74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.index__list .ix small { font-family: var(--font-mono); font-size: 0.54rem; letter-spacing: 0.1em; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rail__foot { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--space-line); }
.rail__foot p { margin: 0 0 4px; font-family: var(--font-mono); font-size: 0.56rem; letter-spacing: 0.1em; color: var(--ink-faint); }
.rail__foot b { color: var(--ink-dim); }
.rail__law { line-height: 1.5; }
.rail__board { color: var(--neon-cyan); text-decoration: none; letter-spacing: 0.16em; }
.rail__board:hover, .rail__board:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

/* ── the deck ── */
.deck {
  height: 100dvh; min-width: 0; overflow-y: auto; overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory; scrollbar-width: none; background: var(--space-void); outline: 0;
}
.deck::-webkit-scrollbar { display: none; }
.card {
  position: relative; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always;
  display: grid; grid-template-rows: 1fr auto; overflow: hidden;
}
.card--boot, .card--end { display: grid; place-items: center; grid-template-rows: none; }
.boot { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.2em; color: var(--ink-faint); }

.tube { position: relative; display: grid; place-items: center; background: #050301; min-height: 0; }
.tube video, .tube .face img { width: 100%; height: 100%; object-fit: contain; }
.tube video { position: absolute; inset: 0; background: #050301; }
.card.card--wide .tube video { object-fit: contain; }
.face { position: absolute; inset: 0; border: 0; padding: 0; cursor: pointer; background: #050301; }
.face img { position: absolute; inset: 0; object-fit: contain; }
.face .haze { object-fit: cover; filter: blur(28px) saturate(0.8); opacity: 0.45; transform: scale(1.1); }
.play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 74px; height: 74px; border-radius: 50%; pointer-events: none;
  background: rgba(10, 6, 4, 0.72) no-repeat center / 40% url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M8 5v14l11-7z' fill='%23ffb020'/></svg>");
  border: 1px solid var(--space-line-bright); box-shadow: var(--glow-soft);
}
.face:hover .play, .face:focus-visible .play { box-shadow: var(--glow-cyan); }
.player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.card.is-playing .face { display: none; }

.card--file .tube { cursor: pointer; }
.card--file.is-paused .play { display: block; }
.card--file .play { display: none; }

.chip {
  position: absolute; z-index: 3; padding: 5px 10px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.16em; font-weight: 700;
  background: rgba(10, 6, 4, 0.7); border: 1px solid var(--space-line-bright); color: var(--ink-dim);
}
.chip--live { top: calc(14px + env(safe-area-inset-top, 0px)); left: 14px; background: var(--on-air); color: #fff; border-color: transparent; box-shadow: 0 0 14px rgba(255, 64, 48, 0.6); }
.chip--kicker { top: calc(14px + env(safe-area-inset-top, 0px)); left: 14px; color: var(--neon-cyan); }
.chip--sound {
  top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; cursor: pointer; pointer-events: auto;
}
.chip--sound.off { color: var(--neon-cyan); border-color: var(--neon-cyan); }
.chip--sound::before { content: "SOUND ON"; }
.chip--sound.off::before { content: "TAP FOR SOUND"; }

.strip {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-3) calc(var(--s-3) + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(10, 6, 4, 0.4), rgba(10, 6, 4, 0.95));
  border-top: 1px solid var(--space-line);
}
.who { display: flex; align-items: center; gap: var(--s-2); min-width: 0; flex: 1; text-decoration: none; color: var(--ink); }
.who img, .who .mono-ava {
  width: 40px; height: 40px; border-radius: 11px; object-fit: cover; flex: none; display: grid; place-items: center;
  border: 1px solid var(--space-line-bright); font-family: var(--font-mono); font-size: 0.6rem; color: var(--neon-cyan); background: var(--space-panel);
}
.meta { min-width: 0; display: grid; }
.meta b { font-size: 0.86rem; }
.meta span { font-size: 0.76rem; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta small { font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.12em; color: var(--ink-faint); }
.act {
  flex: none; width: 42px; height: 42px; display: grid; place-items: center; text-decoration: none;
  background: transparent; color: var(--ink-dim); border: 1px solid var(--space-line-bright);
  border-radius: 50%; cursor: pointer; font-family: var(--font-mono); font-size: 0.6rem;
}
.act:hover, .act:focus-visible { color: var(--neon-cyan); border-color: var(--neon-cyan); }

.hint {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 3; pointer-events: none;
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.2em;
  color: var(--phosphor); text-shadow: 0 0 10px rgba(255, 208, 138, 0.5);
  animation: nudge 1.8s ease-in-out infinite;
}
@keyframes nudge { 0%, 100% { transform: translate(-50%, 0); opacity: 0.7; } 50% { transform: translate(-50%, -8px); opacity: 1; } }

.end { text-align: center; padding: 24px; max-width: 420px; }
.end__guide { width: 96px; height: 96px; border-radius: 22px; object-fit: cover; border: 1px solid var(--space-line-bright); box-shadow: var(--glow-soft); }
.end h1 { margin: 16px 0 8px; font-size: 1.7rem; letter-spacing: 0.04em; }
.end p { color: var(--ink-dim); font-weight: 300; line-height: 1.5; }
.doors { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }
.doors button {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer;
  padding: 0.65rem 1rem; border-radius: 10px; background: transparent;
  color: var(--ink-dim); border: 1px dashed var(--space-line-bright);
}
.doors button:first-child { color: #1a1002; background: var(--neon-cyan); border-style: solid; font-weight: 700; }
.doors button:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }
.doors button:first-child:hover { color: #1a1002; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px);
  z-index: 60; padding: 9px 16px; border-radius: 999px; opacity: 0; pointer-events: none;
  background: var(--neon-cyan); color: #1a1002; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700;
  transition: opacity var(--dur-fast), transform var(--dur-fast);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── the phone: rail folds into a tab strip over the deck ── */
@media (max-width: 900px) {
  .room { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .rail { grid-template-rows: auto; grid-template-columns: auto 1fr; border-right: 0; border-bottom: 1px solid var(--space-line); }
  .rail__brand { padding: 8px 12px; border: 0; }
  .rail__clock, .index, .rail__foot, .feed span, .feed kbd { display: none; }
  .feeds { grid-auto-flow: column; padding: 6px 8px; gap: 6px; }
  .feed { padding: 8px 10px; }
  .feed b { font-size: 0.68rem; }
  .deck, .card { height: calc(100dvh - 52px); }
}
@media (prefers-reduced-motion: reduce) { .hint { animation: none; } .deck { scroll-behavior: auto; } }
