/* TV display mode (index.html?view=tv). The TV is a hands-free shared
   screen: phones control everything, so the TV shows no buttons, no
   focus rings and no tutorial cards.

   Everything is sized in rem, and rem follows the screen width, so the
   layout looks the same whether the TV browser reports 960, 1280 or
   1920 pixels across. */

[data-view="tv"] {
  --base-size: clamp(9px, 1.05vw, 28px);
  --rail-w: 15rem;
  --top-h: 4rem;
  --tick-h: 2.3rem;
}

/* Keep the two-column layouts on any TV size (desktop collapses them under 1100px). */
[data-view="tv"] .cols-main-side { grid-template-columns: minmax(0, 1fr) 19rem; }
[data-view="tv"] .cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
[data-view="tv"] .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
[data-view="tv"] .rx-main,
[data-view="tv"] .sky-panel,
[data-view="tv"] .dec-main,
[data-view="tv"] .decgrid { min-height: 0; }
[data-view="tv"] .rx-main,
[data-view="tv"] .sky-panel,
[data-view="tv"] .dec-main { height: calc(95vh - var(--top-h) - var(--tick-h) - 2rem); }

/* Hands-free: nothing on the TV looks clickable. */
[data-role="display"] .app { pointer-events: none; }
[data-role="display"] .top .warp,
[data-role="display"] .top .btn,
[data-role="display"] .main button,
[data-role="display"] .main input[type="range"],
[data-role="display"] .main select,
[data-role="display"] .devtray,
[data-role="display"] .coach-spot,
[data-role="display"] .coach-card,
[data-role="display"] .popover,
[data-role="display"] .next-unlock { display: none !important; }
[data-role="display"] .main input[type="number"] {
  border: 0; background: none; font-family: var(--font-display); font-size: 1.6rem; color: var(--sig); width: 4ch; padding: 0;
}
[data-role="display"] :focus { outline: none !important; }
[data-role="display"] .rail .tab { cursor: default; }

/* Crew list and join box under the stations */
.tv-crew { margin: 1.2rem 0.8rem 0.5rem; padding-top: 0.8rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.3rem; }
.tv-crew-row { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.85rem; }
.tv-crew-row .muted { font-size: 0.75rem; }
.tv-join-small { font-size: 0.72rem; color: var(--ink-2); word-break: break-all; }
.tv-code-small { font-family: var(--font-display); font-size: 1.8rem; letter-spacing: 0.2em; color: var(--sig); line-height: 1; }

/* Lobby: full-screen join card until the first phone arrives */
.tv-lobby { position: fixed; inset: 0; z-index: 78; display: none; background: var(--bg); padding: 6vh 7vw; }
.tv-lobby.show { display: flex; align-items: center; animation: fade 0.4s ease; }
.tv-lobby-inner { display: flex; flex-direction: column; gap: 2rem; max-width: 70rem; }
.tv-lobby-title { font-family: var(--font-display); font-size: 4.4rem; color: var(--sig); line-height: 1; }
.tv-lobby-steps { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; }
.tv-lobby-steps > div { display: flex; flex-direction: column; gap: 0.5rem; font-size: 1.15rem; }
.tv-lobby-steps b { font-family: var(--font-display); font-size: 2.2rem; color: var(--sig-dim); font-weight: 500; }
.tv-lobby-url { font-size: 1.5rem; color: var(--ink); white-space: nowrap; }
.tv-lobby-code { font-family: var(--font-display); font-size: 4.8rem; letter-spacing: 0.25em; color: var(--sig); line-height: 1; }
html[data-crt="full"] .tv-lobby { text-shadow: 0 0 6px var(--glow), 0 0 14px var(--glow); }

/* Shown only when the TV browser blocks sound until a button press */
.tv-sound { position: fixed; z-index: 90; left: 50%; bottom: 4vh; transform: translateX(-50%); display: none;
  background: var(--panel-2); border: 1px solid var(--sig-dim); border-radius: var(--radius); padding: 0.6rem 1.2rem; font-size: 0.95rem; }
.tv-sound.show { display: block; }

/* No scrollbars on a TV: nobody can scroll it. Panels clip instead. */
[data-role="display"] .main,
[data-role="display"] .main * { scrollbar-width: none; }
[data-role="display"] .main::-webkit-scrollbar,
[data-role="display"] .main *::-webkit-scrollbar { display: none; }
[data-role="display"] .main { overflow: hidden; }
[data-role="display"] .main .stack { max-height: calc(95vh - var(--top-h) - var(--tick-h) - 2rem); overflow: hidden; }

/* Analyst desk on the TV */
.desk-wrap { position: relative; width: 100%; aspect-ratio: 96 / 110; margin: 0.4rem 0; border: 1px solid var(--line); }
.desk-strip, .desk-trace { position: absolute; inset: 0; width: 100%; height: 100%; }
.desk-strip { image-rendering: pixelated; }
.desk-scans { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; font-size: 0.65rem; text-align: center; }
.desk-scan { border: 1px solid var(--line); padding: 0.15rem 0; color: var(--ink-3); }
.desk-scan.seen { border-color: var(--sig); color: var(--sig); }
.desk-line { margin-top: 0.5rem; font-size: 0.85rem; }
.desk-call { margin-top: 0.4rem; font-family: var(--font-display); font-size: 1.3rem; }

/* Join QR codes. Kept crisp and out of the CRT glow so phone cameras read them. */
.tv-lobby-main { display: grid; grid-template-columns: auto 1fr; gap: 3rem; align-items: center; }
.tv-lobby-main .tv-lobby-steps { grid-template-columns: 1fr; gap: 1.4rem; }
.tv-lobby-scan { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; font-size: 1.1rem; color: var(--ink-2); }
.tv-qr { width: min(32vh, 22rem); aspect-ratio: 1; }
.tv-qr-small { width: 100%; max-width: 9rem; aspect-ratio: 1; margin: 0.3rem 0; }
.tv-qr svg, .tv-qr-small svg { width: 100%; height: 100%; display: block; image-rendering: pixelated; filter: none; }
