/* TV board (Pantouflard). Laid out for 1280×720 and kept light for the Chromecast (Chrome 90, ~25 fps):
   no shadows, filters, blur or running animations (toasts only fade), static images painted once,
   and the drawing canvas (#board) is never clipped, rounded or covered. */
:root {
  --bg: #25132f;
  --panel: #3a1f4a;
  --line: #553069;
  --text: #fbf3ff;
  --muted: #c4aed4;
  --accent: #4fd1c5;
  --warm: #f6ad55;
  --cream: #f3eee3;
  --good: #68d391;
  /* Text on light colours (cream, accents, avatars). */
  --ink: #0f1530;
  /* The running (or selected) game's accent; set by tv.ts from GameInfo.accent. */
  --game: #4fd1c5;
  --display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --hand: 'Caveat', 'Bradley Hand', cursive;
  --mono: 'DM Mono', Menlo, monospace;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: var(--display);
}
[hidden] { display: none !important; }
.label { font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
/* The host's handwritten asides. */
.aside { font-family: var(--hand); font-weight: 700; letter-spacing: 0; text-transform: none; }
.mono { font-family: var(--mono); }

/* Avatars (src/client/common/avatar.ts): a mascot on a circle of the player's colour, or their initial. */
.avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; color: var(--ink); font-weight: 800; line-height: 1; vertical-align: middle; }
.avatar-img { position: absolute; left: 4%; top: 4%; width: 92%; height: 92%; object-fit: contain; }
.avatar.more { background: var(--panel); color: var(--text); font-weight: 600; }
.avatar-stack { display: inline-flex; align-items: center; }
/* Game covers (src/client/common/art.ts), on a gradient of the game's accent when the art is missing. */
.cover { position: relative; border-radius: 8px; }
.cover-img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

/* ---------- Lobby ---------- */
.lobby {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; gap: 60px; align-items: center; padding: 0 64px;
  background: linear-gradient(rgba(37, 19, 47, .5), rgba(37, 19, 47, .5)), url(/art/lobby.jpg?v=6a90c0a4c7) center / cover no-repeat var(--bg);
}
.ticket { width: 404px; flex: none; background: var(--cream); color: var(--ink); padding: 22px 22px 20px; text-align: center; border-radius: 22px; }
.ticket-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: #6b6f80; margin-bottom: 12px; }
.qr { width: 340px; height: 340px; background: #fff; border: 1px solid #e2dccd; border-radius: 12px; display: block; margin: 0 auto; }
.ticket-tear { border-top: 2px dashed #cfc6b2; margin: 16px -22px 12px; }
.join-title { font-size: 34px; font-weight: 800; line-height: 1; }
.join-url { font-size: 17px; color: #5b5470; margin-top: 8px; }
.join-url b { color: #1d8a80; font-weight: 500; }

.lobby-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.brand { display: flex; align-items: center; gap: 20px; }
.logo { width: 92px; height: 92px; object-fit: contain; flex: none; }
.wordmark { font-size: 92px; font-weight: 800; letter-spacing: -.04em; line-height: .85; }
.wordmark-dot { color: var(--accent); }
.tagline { font-size: 32px; color: var(--warm); margin-top: 8px; line-height: 1; }
/* « Bêta gratuite jusqu'au 30 novembre » in the lobby, while the beta runs (src/shared/beta.ts). */
.beta-badge { display: inline-block; margin-top: 12px; padding: 4px 14px; border: 2px solid var(--accent); border-radius: 999px; color: var(--accent); font: 700 20px/1.3 var(--display); }
.beta-badge[hidden] { display: none; }

.seats-head { display: flex; justify-content: space-between; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.seats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.seat { height: 118px; min-width: 0; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; }
.seat.taken { background: var(--panel); border-top: 5px solid var(--line); }
.seat.away { opacity: .45; }
.seat.free { border: 2px dashed var(--line); background: rgba(37, 19, 47, .6); font-family: var(--hand); font-weight: 700; font-size: 24px; color: #9a77b0; }
.seat-name { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 6px; max-width: 100%; font-size: 20px; font-weight: 600; line-height: 1.15; text-align: center; }
.seat-name.long { font-size: 16px; }
.seat-name .n { max-width: 100%; }
.seat-name .n { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { flex: none; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--warm); }
.tag.off { color: var(--muted); }

.next-card { display: flex; gap: 18px; align-items: center; background: var(--panel); border-radius: 14px; padding: 12px; border-left: 6px solid var(--game); }
.next-card .cover { width: 176px; height: 99px; flex: none; }
.next-text { flex: 1; min-width: 0; }
.next-label { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--game); }
.next-name { font-size: 34px; font-weight: 800; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-desc { font-size: 18px; color: var(--muted); margin-top: 2px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.status { font-size: 30px; line-height: 1.1; }

/* ---------- Stage: the frame of a running game ---------- */
.stage {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; padding: 16px 28px 22px;
  /* The stage art at half strength: a flat veil of the background colour over it, in one paint. */
  background: linear-gradient(rgba(37, 19, 47, .5), rgba(37, 19, 47, .5)), url(/art/stage.jpg?v=b514eb68e6) center / cover no-repeat var(--bg);
}
.topbar { display: flex; align-items: center; height: 80px; gap: 24px; flex: none; }
.who { flex: 0 1 auto; max-width: 470px; min-width: 0; display: flex; align-items: center; gap: 14px; }
.who-icon { flex: none; display: flex; }
.who-icon:empty { display: none; }
.who-text { min-width: 0; }
.who-title { font-size: 27px; font-weight: 800; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-title:empty { display: none; }
.who-title .aside { font-size: 31px; color: var(--accent); }
.who-sub { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.who-title:empty + .who-sub { font-size: 20px; gap: 12px; }
.game-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--game); flex: none; }
.who-title:empty + .who-sub .game-dot { width: 14px; height: 14px; }
.game-name { color: var(--game); font-weight: 600; flex: none; }
.who-title:empty + .who-sub .game-name { color: var(--text); }
.turn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.turn:not(:empty)::before { content: '· '; }
.mask { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800; text-align: center; white-space: nowrap; overflow: hidden; }
.clock { flex: none; width: 96px; display: flex; justify-content: flex-end; }
/* The countdown ring. */
.timer { width: 78px; height: 78px; border-radius: 50%; border: 6px solid var(--game); display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.timer:empty { display: none; }
.timer.low { border-color: var(--warm); color: var(--warm); }
/* Shrinks once a second (tv.ts), no smooth animation. */
.progress { flex: none; height: 8px; background: var(--panel); border-radius: 4px; margin: 8px 0 16px; }
.progress.off { visibility: hidden; }
.progress-fill { height: 8px; width: 100%; background: var(--game); border-radius: 4px; }
.progress.low .progress-fill { background: var(--warm); }

.body { flex: 1; display: flex; gap: 22px; min-height: 0; }
.main { flex: 1; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.board-box { flex: 1; align-self: stretch; min-width: 0; display: flex; align-items: center; justify-content: center; }
.board-mat { flex: none; }
/* Paper and tape for the drawing games. The tape stays outside the canvas (it ends 4 px above it,
   rotation included), so the canvas is never overlaid. */
.board-mat.on { position: relative; background: var(--cream); padding: 14px; }
.board-mat.on::before, .board-mat.on::after { content: ''; position: absolute; top: -16px; width: 96px; height: 22px; background: #efe2b5; }
.board-mat.on::before { left: 30px; transform: rotate(-4deg); }
.board-mat.on::after { right: 30px; transform: rotate(5deg); }
/* Square corners on purpose: clipping the canvas to rounded corners cost the Chromecast
   more than half its frame rate (12 vs 27 fps with four people painting). */
#board { background: #fff; display: block; }

.side { width: 250px; display: flex; flex-direction: column; min-height: 0; }
.scores { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.scores li { display: flex; align-items: center; gap: 10px; font-size: 20px; padding: 5px 0; }
.scores.crowded li { font-size: 18px; padding: 2px 0; }
.scores li.active { background: var(--panel); padding-left: 8px; padding-right: 8px; margin: 0 -8px; border-radius: 8px; }
.scores .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scores li.active .name { color: var(--accent); font-weight: 600; }
.scores .badge { flex: none; font-size: 20px; color: var(--accent); }
.scores .check { flex: none; color: var(--good); font-weight: 800; }
.scores .pts { flex: none; width: 40px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.scores li.done .pts { color: var(--text); font-weight: 600; }
.scores li.away { opacity: .45; }
.side-extra { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* Guesses as chat bubbles; correct ones in green. */
.feed { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; }
.feed div { flex: none; font-size: 18px; background: var(--panel); border-radius: 10px 10px 10px 2px; padding: 7px 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed b { font-weight: 700; }
.feed .ok { background: var(--good); color: var(--ink); border-radius: 10px; font-weight: 600; }
.mini-join { flex: none; display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.mini-join img { width: 64px; height: 64px; background: #fff; border-radius: 8px; flex: none; }
.mini-url { word-break: break-all; }

/* Overlays: a turn's or round's result, over the frame. */
.overlay { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 3; background: rgba(37, 19, 47, .95); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.overlay .small { font-size: 24px; color: var(--muted); }
.overlay .word { font-size: 84px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--accent); margin: 8px 0 22px; }
.overlay .line { font-size: 28px; margin: 6px 0; }
.overlay .gain { color: var(--good); font-variant-numeric: tabular-nums; }

/* ---------- Finale: shared by every game (tv.ts) ---------- */
.finale {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; padding-top: 40px; text-align: center;
  /* A static veil over the top of the art, so the headline reads over the spotlights. */
  background: linear-gradient(rgba(37, 19, 47, .7), rgba(37, 19, 47, .35) 32%, rgba(37, 19, 47, 0) 50%), url(/art/finale.jpg?v=11b382d7ea) center / cover no-repeat var(--bg);
}
.finale-kicker { font-size: 38px; color: var(--warm); line-height: 1.15; }
.finale-winner { font-size: 84px; font-weight: 800; letter-spacing: -.035em; line-height: 1; color: var(--warm); max-width: 1180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-bottom: 4px; }
.finale-body { flex: 1; min-height: 0; display: flex; align-items: flex-end; gap: 40px; margin-top: 10px; }
.finale-podium { display: flex; align-items: flex-end; gap: 20px; }
.podium-col { width: 230px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.podium-col.p1 { width: 250px; }
/* Players tied on a step stand on it together (tv.ts widens the step for them). */
.podium-avatars { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.podium-gap { visibility: hidden; }
.trophy { object-fit: contain; display: block; }
.p1 .trophy { width: 120px; height: 120px; }
.p2 .trophy { width: 96px; height: 96px; }
.p3 .trophy { width: 84px; height: 84px; }
.podium-block { align-self: stretch; background: var(--panel); border-radius: 16px 16px 0 0; border-top: 8px solid; display: flex; flex-direction: column; align-items: center; padding: 16px 10px 0; }
.p1 .podium-block { height: 250px; border-top-color: #f6e05e; }
.p2 .podium-block { height: 200px; border-top-color: #cbd5e0; }
.p3 .podium-block { height: 160px; border-top-color: #ed8936; }
.podium-name { font-size: 28px; font-weight: 800; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p1 .podium-name { font-size: 32px; }
/* Tied names ("Ana & Dom"): up to two lines. */
.podium-col.shared .podium-name { font-size: 24px; line-height: 1.15; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.podium-pts { font-size: 20px; color: var(--muted); }
.podium-rank { margin-top: auto; font-size: 64px; font-weight: 800; line-height: 1.1; color: var(--line); }
.p1 .podium-rank { font-size: 80px; }
.p3 .podium-rank { font-size: 56px; }
.finale.crowded { padding-top: 22px; }
.finale.crowded .p1 .podium-block { height: 220px; }
.finale.crowded .p2 .podium-block { height: 175px; }
.finale.crowded .p3 .podium-block { height: 140px; }
/* A game's extra column (TvSlots.finale), e.g. the night's titles. */
.finale-extra { width: 340px; align-self: center; max-height: 100%; overflow: hidden; background: var(--panel); border-radius: 16px; padding: 14px 20px; text-align: left; }
.finale-extra:empty { display: none; }
.finale-head { font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 8px 0 6px; }
.finale-line { font-size: 21px; font-weight: 600; margin: 4px 0 8px; overflow-wrap: anywhere; }
.finale-line .sub { display: block; font-size: 16px; font-weight: 400; color: var(--muted); }
.finale-foot { align-self: stretch; flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 36px; padding: 14px; background: var(--panel); font-size: 20px; color: var(--muted); }
.finale.crowded .finale-foot { font-size: 17px; gap: 4px 22px; padding: 10px; }
.finale-foot .decides { color: var(--text); }

/* ---------- A game's intro clip (intro.ts): opacity fades only ---------- */
.intro { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 5; background: var(--bg); opacity: 1; transition: opacity .4s; }
.intro.out { opacity: 0; }
.intro-video, .intro-cover { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* The still card (a late TV, or a clip that can't play): the game's cover under the scrim. */
.intro-cover { display: none; }
.intro.still .intro-cover { display: block; }
.intro.still .intro-video { display: none; }
.intro-scrim { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(32, 16, 38, .8); opacity: 0; transition: opacity .6s; }
.intro-title { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 60px; text-align: center; color: var(--cream); opacity: 0; transition: opacity .6s; }
.intro.titled .intro-scrim, .intro.titled .intro-title { opacity: 1; }
.intro-kicker { font-family: var(--mono); font-weight: 500; font-size: 2.6vh; letter-spacing: .22em; text-transform: uppercase; color: var(--warm); }
.intro-name { font-size: 13vh; font-weight: 800; letter-spacing: -.035em; line-height: 1.02; margin-top: 1.2vh; }
.intro-desc { font-family: var(--hand); font-weight: 700; font-size: 4.6vh; line-height: 1.15; margin-top: 1.6vh; max-width: 1000px; }

.banner { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 7; background: var(--warm); color: var(--ink); font-size: 20px; font-weight: 600; padding: 8px 18px; border-radius: 20px; }

/* Short notices (player joined, left, back…), bottom left. Only opacity animates: cheap on the Chromecast. */
.toasts { position: absolute; left: 28px; bottom: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; z-index: 6; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--panel); border-left: 6px solid var(--accent); border-radius: 10px; padding: 8px 18px 8px 10px; font-size: 20px; opacity: 1; transition: opacity .5s; }
.toast.out { opacity: 0; }
.sound-note { position: absolute; right: 28px; bottom: 24px; z-index: 6; background: var(--warm); color: var(--ink); font-size: 18px; font-weight: 600; padding: 8px 16px; border-radius: 10px; }
