/* Booth screen attract mode (templates/tv.html, static/js/tv.js). Tokens only (invariant 10).
   Sizes are in vmin so one rule set reads at ~5 m in landscape (1920x1080) and portrait (1080x1920) alike:
   1vmin = 10.8 px on both. Older .tv-* rules in app.css are unused by this template. */

body.tv--attract { overflow: hidden; background: var(--bg); }
body.tv--attract main { max-width: none; height: 100dvh; padding: 3.2vmin 4vmin 2.4vmin; display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto; gap: 2.4vmin; }

/* ---- head ---- */
.tvx-head { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 1vmin 4vmin; }
.tvx-brand { display: grid; gap: 1.4vmin; }
.tvx-logo { height: 3.2vmin; width: auto; }
.tvx-title { font-size: 5.6vmin; font-weight: var(--weight-light); letter-spacing: var(--tracking-display); line-height: 1; margin: 0; }
.tvx-sub { margin: 0; font-size: 2vmin; color: var(--muted); align-self: end; padding-bottom: 0.5vmin; }
.tvx-sub .tag { font-size: 1.6vmin; padding: 0.2vmin 1vmin; }
.tvx-status { display: flex; align-items: center; gap: 2vmin; }
.tvx-clock { font-family: var(--font-mono); font-size: 2.6vmin; color: var(--muted); }
.tvx-live { font-size: 2vmin; padding: 0.6vmin 1.6vmin; }
.tvx-live::before { width: 0.8vmin; height: 0.8vmin; }
.tvx-live.is-off { background: transparent; color: var(--muted); border-color: var(--line-strong); }
.tvx-live.is-off::before { animation: none; }

/* ---- stage + slides ---- */
.tvx-stage { position: relative; min-height: 0; overflow: hidden; }
.tvx-slide { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 2vmin;
  opacity: 0; visibility: hidden; transform: translateY(2.4vmin);
  transition: opacity var(--dur-slow) var(--ease), transform 0.7s var(--ease), visibility 0s linear var(--dur-slow); }
.tvx-slide.is-active { opacity: 1; visibility: visible; transform: none;
  transition: opacity var(--dur-slow) var(--ease) 0.15s, transform 0.7s var(--ease) 0.15s, visibility 0s; }
.tvx-slide.is-leaving { transform: translateY(-2.4vmin); }
html:not(.tvx-ready) .tvx-slide { transition: none; }       /* first paint: no slide-in */
.tvx-slide > *:not(.tvx-motif) { position: relative; z-index: 1; }
.tvx-motif { position: absolute; right: -4vmin; top: -2vmin; width: 62vmin; height: auto; opacity: 0.75; pointer-events: none; z-index: 0; }

.tvx-eyebrow { margin: 0; font-size: 2.2vmin; font-weight: var(--weight-medium); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.tvx-eyebrow .tag { font-size: 2vmin; padding: 0.4vmin 1.6vmin; letter-spacing: 0.04em; }
.tvx-display { margin: 0; font-size: 8vmin; font-weight: var(--weight-light); letter-spacing: var(--tracking-display); line-height: 1.02; max-width: 22ch; text-wrap: balance; }
.tvx-lede { margin: 0; font-size: 3.2vmin; font-weight: var(--weight-light); color: var(--text); max-width: 46ch; }
.tvx-small { margin: 0; font-size: 2vmin; line-height: 1.35; color: var(--muted); max-width: 90ch; }
.tvx-note { margin: 0; font-size: 2.8vmin; color: var(--text); }
.tvx-note strong { color: var(--highlight); font-weight: var(--weight-medium); font-family: var(--font-mono); }
.tvx-empty { font-size: 2.8vmin; color: var(--muted); margin: 2vmin 0 0; }

/* ---- board slide ---- */
.tvx-slide[data-slide="board"] { justify-content: flex-start; }
.tvx-boards { display: grid; grid-template-columns: 1.15fr 1fr; gap: 4vmin; min-height: 0; height: 100%; }
.tvx-board { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 1.2vmin; }
.tvx-table { table-layout: fixed; }
.tvx-table td { padding: 1.05vmin 1.2vmin; line-height: 1.15; border-bottom-color: var(--line); }
.tvx-table .rank { width: 7.2vmin; font-size: 2.8vmin; }
.tvx-table .who { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tvx-table .who .n { font-size: 3.4vmin; display: inline; overflow-wrap: normal; }
.tvx-table .who .a { font-size: 2vmin; display: inline; margin-left: 1.6vmin; }
.tvx-table .score { width: 18vmin; font-size: 3.4vmin; font-family: var(--font-mono); font-weight: var(--weight-regular); }
.tvx-table .tag { font-size: 1.5vmin; padding: 0.15vmin 0.9vmin; vertical-align: 0.5vmin; }
.tvx-board--all .tvx-table .who .n, .tvx-board--all .tvx-table .score { font-size: 3vmin; }
.tvx-board--all .tvx-table td { padding: 1.15vmin 1.2vmin; }
@media (orientation: landscape) { .tvx-board--all .tvx-table .who .a { display: none; } .tvx-board--all .tvx-table td { padding: 1.3vmin 1.2vmin; } }   /* same row height as Today: #1..#10 line up across the two boards (25/11) */   /* the narrow all-time column cut labs to "Dem…": they show in Today */
.tvx-table tr.top1 td { background: var(--highlight); color: var(--on-highlight); }
.tvx-table tr.top1 .a, .tvx-table tr.top1 .rank, .tvx-table tr.top1 .score { color: var(--on-highlight); }
.tvx-table tr.top1 .tag { color: var(--on-highlight); border-color: var(--on-highlight); background: transparent; }
.tvx-table tr.top2 .rank, .tvx-table tr.top3 .rank { color: var(--text); }
/* the ticket line: under the last row inside today's ticket zone */
.tvx-table tr.wins + tr:not(.wins) td { border-top: 0.35vmin dashed var(--highlight); }
.tvx-table tr.is-new td { animation: tvx-rowin 1.4s var(--ease); }
.tvx-table tr.is-up .rank::after { content: "▲"; color: var(--highlight); font-size: 0.6em; margin-left: 0.6vmin; vertical-align: 0.3em; }
.tvx-table tr.top1.is-up .rank::after { color: var(--on-highlight); }
@keyframes tvx-rowin { from { background: var(--surface-2); } }

.tvx-board-empty { display: none; }
.tvx-slide.is-empty .tvx-boards { display: none; }
.tvx-slide.is-empty { justify-content: center; }
.tvx-slide.is-empty .tvx-board-empty { display: flex; align-items: center; gap: 6vmin; }
.tvx-board-empty .tvx-join-qr .qr-svg { width: 40vmin; height: 40vmin; }
@media (orientation: portrait) { .tvx-slide.is-empty .tvx-board-empty { flex-direction: column; align-items: flex-start; } }

/* ---- race ---- */
.tvx-countdown { display: flex; align-items: baseline; gap: 1vmin; font-family: var(--font-mono); font-size: 17vmin; line-height: 1; letter-spacing: -0.04em; color: var(--highlight); }
.tvx-countdown i { font-style: normal; color: var(--muted); font-size: 0.6em; transform: translateY(-0.12em); }
.tvx-countdown.is-soon { animation: tvx-pulse 1s steps(2, start) infinite; }
@keyframes tvx-pulse { 50% { opacity: 0.55; } }

/* ---- winners ---- */
.tvx-winners { list-style: none; margin: 1vmin 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.6vmin 2vmin; max-width: 100%; }
.tvx-winners li { font-size: 4.2vmin; padding: 1vmin 2.4vmin; border: var(--border-strong) solid var(--highlight); color: var(--text);
  animation: tvx-pop 0.6s var(--ease) both; }
.tvx-winners li:nth-child(2n) { animation-delay: 0.08s; } .tvx-winners li:nth-child(3n) { animation-delay: 0.16s; }
.tvx-winners li:nth-child(5n) { animation-delay: 0.24s; }
.tvx-slide:not(.is-active) .tvx-winners li { animation: none; }
@keyframes tvx-pop { from { opacity: 0; transform: translateY(1.6vmin); } }

/* ---- join ---- */
.tvx-slide--join { flex-direction: row; align-items: center; justify-content: flex-start; gap: 6vmin; }
.tvx-join-qr { background: var(--qr-bg); color: var(--qr-fg); padding: 2vmin; line-height: 0; flex: none; }
.tvx-join-qr .qr-svg { width: 52vmin; height: 52vmin; }
.tvx-join-copy { display: grid; gap: 2.4vmin; }
.tvx-url { margin: 0; font-size: 2vmin; color: var(--muted); overflow-wrap: anywhere; }

/* ---- talks ---- */
.tvx-talks { list-style: none; padding: 0; margin: 1vmin 0 0; display: grid; gap: 0; max-width: 140vmin; }
.tvx-talks li { display: grid; grid-template-columns: 34vmin 1fr; gap: 0.4vmin 3vmin; padding: 2vmin 0; border-top: var(--border) solid var(--line-strong); }
.tvx-talk-when { font-family: var(--font-mono); font-size: 2.6vmin; color: var(--highlight); }
.tvx-talk-title { font-size: 3.4vmin; line-height: 1.15; }
.tvx-talk-room { grid-column: 2; font-size: 2vmin; color: var(--muted); }

/* ---- how ---- */
.tvx-steps { list-style: none; padding: 0; margin: 2vmin 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3vmin; }
.tvx-steps li { border-top: var(--border-strong) solid var(--text); padding-top: 2vmin; display: grid; gap: 1.2vmin; align-content: start; }
.tvx-steps li:last-child { border-top-color: var(--highlight); }
.tvx-step-n { font-family: var(--font-mono); font-size: 2.6vmin; color: var(--muted); }
.tvx-step-t { font-size: 4vmin; line-height: 1.1; letter-spacing: var(--tracking-tight); }
.tvx-step-d { font-size: 2.3vmin; line-height: 1.35; color: var(--muted); }

/* ---- moment: someone takes #1 / wins a ticket ---- */
.tvx-moment { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: var(--highlight); color: var(--on-highlight);
  clip-path: inset(0 0 0 0); animation: tvx-wipe 0.7s var(--ease); overflow: hidden; }
.tvx-moment[hidden] { display: none; }
.tvx-moment.is-out { animation: tvx-wipe-out 0.6s var(--ease) forwards; }
.tvx-moment__inner { text-align: center; display: grid; gap: 2vmin; padding: 4vmin; position: relative; z-index: 1; }
.tvx-moment .tvx-eyebrow { color: var(--on-highlight); font-size: 2.6vmin; }
.tvx-moment__who { margin: 0; font-size: 13vmin; line-height: 1; letter-spacing: var(--tracking-display); font-weight: var(--weight-regular); overflow-wrap: anywhere; }
.tvx-moment__who.is-many { font-size: 6vmin; line-height: 1.2; }
.tvx-moment__what { margin: 0; font-size: 3.4vmin; font-family: var(--font-mono); }
.tvx-moment__nodes i { position: absolute; width: 2.2vmin; height: 2.2vmin; background: var(--on-highlight); opacity: 0;
  animation: tvx-node 2.4s var(--ease) both; }
.tvx-moment__nodes i:nth-child(1) { left: 8%; top: 20%; } .tvx-moment__nodes i:nth-child(2) { left: 18%; top: 72%; animation-delay: 0.15s; }
.tvx-moment__nodes i:nth-child(3) { left: 30%; top: 12%; animation-delay: 0.3s; } .tvx-moment__nodes i:nth-child(4) { left: 46%; top: 86%; animation-delay: 0.1s; }
.tvx-moment__nodes i:nth-child(5) { left: 64%; top: 10%; animation-delay: 0.25s; } .tvx-moment__nodes i:nth-child(6) { left: 76%; top: 78%; animation-delay: 0.4s; }
.tvx-moment__nodes i:nth-child(7) { left: 88%; top: 30%; animation-delay: 0.05s; } .tvx-moment__nodes i:nth-child(8) { left: 92%; top: 64%; animation-delay: 0.35s; }
@keyframes tvx-wipe { from { clip-path: inset(0 100% 0 0); } }
@keyframes tvx-wipe-out { to { clip-path: inset(0 0 0 100%); } }
@keyframes tvx-node { 0% { opacity: 0; transform: translateY(4vmin) scale(0.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8vmin) scale(1); } }

/* ---- foot ---- */
.tvx-foot { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 3vmin; min-height: 10vmin; }
.tvx-corner { display: flex; align-items: center; gap: 1.4vmin; font-size: 1.8vmin; color: var(--muted); transition: opacity var(--dur-slow) var(--ease); }
.tvx-corner-qr { background: var(--qr-bg); color: var(--qr-fg); padding: 0.6vmin; line-height: 0; }
.tvx-corner-qr .qr-svg { width: 10vmin; height: 10vmin; }
body.tvx-on-join .tvx-corner { opacity: 0; }
/* game_mode = official_link: the join slide's second, smaller code opens the booth app itself */
.tvx-join-app { display: flex; align-items: center; gap: 1.4vmin; margin-top: 2.4vmin; font-size: 1.8vmin; color: var(--muted); }
.tvx-lines { display: grid; gap: 1vmin; min-width: 0; }
.tvx-booth { margin: 0; font-size: 2.4vmin; display: flex; gap: 1.4vmin; align-items: center; min-width: 0; }
.tvx-booth[hidden] { display: none; }
.tvx-booth .tag { font-size: 1.7vmin; flex: none; }
.tvx-booth .tag::before { display: none; }
.tvx-tagline { margin-top: 3vmin; }
.tvx-ticker { margin: 0; font-size: 2.2vmin; display: flex; gap: 1.4vmin; align-items: center; min-width: 0; }
/* two lines, never "cut-off 23:…": the cut-off time is the point of the line (it was cut when the status on the right got long, 25/11) */
.tvx-ticker [data-tv-ticket-line], .tvx-booth [data-tv-booth-text] { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.25; }
.tvx-ticker .tag { font-size: 1.7vmin; flex: none; }
.tvx-ticker[hidden] { display: none; }
.tvx-dots { display: flex; gap: 1vmin; }
.tvx-dot { width: 4.4vmin; height: 4.4vmin; padding: 0; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.tvx-dot i { display: block; width: 3.2vmin; height: 0.5vmin; background: var(--line-strong); position: relative; overflow: hidden; }
.tvx-dot[hidden] { display: none; }
.tvx-dot[aria-current="true"] i { background: var(--line-strong); }
.tvx-dot[aria-current="true"] i::after { content: ""; position: absolute; inset: 0; background: var(--text); transform-origin: left;
  animation: tvx-progress var(--tvx-dur, 12s) linear both; }
body.tvx-held .tvx-dot[aria-current="true"] i::after { animation: none; transform: none; }
@keyframes tvx-progress { from { transform: scaleX(0); } }
.tvx-updated { font-size: 1.7vmin; color: var(--muted); white-space: nowrap; }

/* ---- portrait wall (1080x1920) ---- */
@media (orientation: portrait) {
  .tvx-head { grid-template-columns: 1fr auto; }
  .tvx-sub { grid-column: 1 / -1; grid-row: 2; }
  .tvx-boards { grid-template-columns: 1fr; grid-template-rows: auto auto; gap: 3vmin; align-content: start; }
  .tvx-board--all tbody tr:nth-child(n+6) { display: none; }       /* all time: top 5 under today's top 10 */
  .tvx-table .who .n, .tvx-table .score { font-size: 4.2vmin; }
  .tvx-table td { padding: 1.5vmin 1.2vmin; }
  .tvx-display { font-size: 9vmin; }
  .tvx-lede { font-size: 3.8vmin; }
  .tvx-countdown { font-size: 19vmin; }
  .tvx-slide--join { flex-direction: column; align-items: flex-start; justify-content: center; }
  .tvx-join-qr .qr-svg { width: 70vmin; height: 70vmin; }
  .tvx-steps { grid-template-columns: 1fr; gap: 4vmin; }
  .tvx-step-t { font-size: 5vmin; } .tvx-step-d { font-size: 3vmin; }
  .tvx-talks li { grid-template-columns: 1fr; }
  .tvx-talk-room { grid-column: 1; }
  .tvx-foot { grid-template-columns: auto 1fr; grid-template-rows: auto auto; }
  .tvx-lines { grid-column: 2; grid-row: 1; }
  .tvx-ticker [data-tv-ticket-line] { white-space: normal; }
  .tvx-dots { grid-column: 1; grid-row: 2; }
  .tvx-updated { grid-column: 2; grid-row: 2; justify-self: end; }
}

/* ---- reduced motion: cross-fade only, no movement, no wipes, no pulsing ---- */
@media (prefers-reduced-motion: reduce) {
  .tvx-slide, .tvx-slide.is-active, .tvx-slide.is-leaving { transform: none; }
  .tvx-moment, .tvx-moment.is-out, .tvx-winners li, .tvx-table tr.is-new td, .tvx-countdown.is-soon { animation: none; }
  .tvx-moment__nodes { display: none; }
  .tvx-dot[aria-current="true"] i::after { animation: none; transform: none; }
}
body:has(.tvx-slide.is-empty.is-active) .tvx-corner { opacity: 0; }   /* the empty board already shows a big QR */

/* ---- "Explain it to me" (onboarding 18/11/2026) ---- */
.tvx-beats { list-style: none; padding: 0; margin: 2vmin 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3vmin; }
.tvx-beats li { border-top: var(--border-strong) solid var(--text); padding-top: 2vmin; display: grid; gap: 1.2vmin; align-content: start; }
.tvx-beats li:last-child { border-top-color: var(--highlight); }
.tvx-beat-n { font-size: 3.2vmin; color: var(--highlight); }
.tvx-explain-score { display: flex; gap: 4vmin; align-items: center; margin-top: 4vmin; }
.tvx-curves { width: 34vmin; height: auto; flex: none; }
.tvx-curve { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.tvx-curve--jumpy { stroke: var(--muted); stroke-width: 2; }
.tvx-curve--smooth { stroke: var(--highlight); }
.tvx-slide--explain.is-active .tvx-curve { stroke-dasharray: 1; animation: tvx-draw 2.4s var(--ease) both; }
.tvx-slide--explain.is-active .tvx-curve--smooth { animation-delay: 0.8s; }
@keyframes tvx-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .tvx-slide--explain.is-active .tvx-curve { animation: none; stroke-dashoffset: 0; } }
@media (orientation: portrait) {
  .tvx-beats { grid-template-columns: 1fr 1fr; gap: 4vmin; }
  .tvx-explain-score { flex-direction: column; align-items: flex-start; }
  .tvx-curves { width: 60vmin; }
}
