/* Wahey TV screen. Laid out on a fixed 1280 x 720 "screen" that is scaled to fit the TV (--k), so it looks
   the same on any set. Sizes here are in px of that screen; anything in style.css sized by vw is pinned here. */

html, body { height: 100%; overflow: hidden; }
.tvbody { cursor: none; }
.tvbody:has(.tvjoin:not([hidden])) { cursor: auto; }

.tvframe {
  position: fixed; left: 50%; top: 50%;
  width: 1280px; height: 720px;
  transform: translate(-50%, -50%) scale(var(--k, 1));
  transform-origin: center center;
}

/* ---------- join screen ---------- */
.tvjoin { height: 100%; display: grid; place-content: center; justify-items: center; gap: 26px; text-align: center; }
.tvjoin .logo { font-size: 120px; width: auto; white-space: nowrap; }
.tvjoin-tag { font-size: 24px; color: var(--bulb-dim); }
.tvjoin-form { display: grid; gap: 12px; justify-items: center; font-size: 20px; font-weight: 600; }
.tvjoin-row { display: flex; gap: 14px; }
.tvjoin-row input {
  width: 260px; min-height: 76px; padding: 6px 18px; border: 0; border-radius: 14px;
  background: var(--bulb); color: var(--ink); font: 400 48px var(--display); text-align: center; letter-spacing: 0.18em;
}
.tvjoin-row .btn { min-height: 76px; font-size: 24px; padding: 0 28px; }
.tvjoin-note { min-height: 1.4em; color: var(--gold); }

/* ---------- show screen ---------- */
.tv { height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.tvbar { min-height: 64px; padding: 10px 26px; gap: 20px; }
.tvbar .brand { font-size: 30px; }
.tvbar .roundinfo b { font-size: 24px; }
.tvbar .roundinfo span { font-size: 19px; }
.tvbar .count { font-size: 46px; }
.tvbar .roomtag { font-size: 18px; }
.tv .timer { height: 8px; margin: 0 26px; border-radius: 4px; }
.tvstage { padding: 14px 30px; overflow: hidden; }
.tvwaiting { font-size: 28px; }

/* players along the bottom */
.tvplayers { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; padding: 0 26px 18px; }
.tvp {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 96px; padding: 12px 16px; border-radius: 18px;
  background: rgba(11, 14, 68, 0.7); box-shadow: inset 0 0 0 2px var(--bulb-faint);
  transition: box-shadow 0.25s, background 0.25s, opacity 0.25s;
}
.tvp-av {
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pc); color: var(--ink); font: 400 28px/1 var(--display);
}
.tvp-main { display: grid; min-width: 0; }
.tvp-name { font-weight: 800; font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvp-flag { font-size: 17px; font-weight: 600; color: var(--bulb-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvp-score { font: 400 40px/1 var(--display); font-variant-numeric: tabular-nums; }
.tvp-gain {
  position: absolute; right: 14px; top: -16px; padding: 2px 10px; border-radius: 999px;
  background: var(--good); color: var(--ink); font: 400 24px/1.2 var(--display); opacity: 0;
}
.tvp-gain.pop { animation: gainpop 2.6s ease-out forwards; }
@keyframes gainpop { 0% { opacity: 0; transform: translateY(14px) scale(0.6); } 12% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0.9; } }
.tvp.is-locked { box-shadow: inset 0 0 0 3px var(--gold); background: rgba(255, 197, 61, 0.16); }
.tvp.is-locked .tvp-flag { color: var(--gold); }
.tvp.is-good { box-shadow: inset 0 0 0 3px var(--good); background: rgba(46, 229, 157, 0.16); }
.tvp.is-good .tvp-flag { color: var(--good); }
.tvp.is-bad { box-shadow: inset 0 0 0 3px var(--bad); }
.tvp.is-bad .tvp-flag { color: var(--bad); }
.tvp.is-out, .tvp.is-off { opacity: 0.45; }
.tvp.is-picker { box-shadow: inset 0 0 0 3px var(--gold); }
.tvp.is-leader .tvp-score { color: var(--gold); }
.tvp.is-leader .tvp-av::after { content: '👑'; position: absolute; transform: translate(22px, -30px) rotate(18deg); font-size: 24px; }
.tvp-av { position: relative; }

/* 5 to 12 players: two rows of smaller cards */
.tvplayers.is-many { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding-bottom: 12px; }
.tvplayers.is-many .tvp { min-height: 58px; padding: 6px 10px; gap: 8px; border-radius: 14px; }
.tvplayers.is-many .tvp-av { width: 38px; height: 38px; font-size: 17px; }
.tvplayers.is-many .tvp-name { font-size: 17px; }
.tvplayers.is-many .tvp-flag { font-size: 13px; }
.tvplayers.is-many .tvp-score { font-size: 24px; }
.tvplayers.is-many .tvp-gain { font-size: 17px; top: -10px; right: 8px; }
.tvplayers.is-many .tvp-av::after { font-size: 16px; transform: translate(14px, -20px) rotate(18deg); }
.tvplayers.is-many[data-n="5"], .tvplayers.is-many[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tvplayers.is-many[data-n="7"], .tvplayers.is-many[data-n="8"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tvplayers.is-many[data-n="9"], .tvplayers.is-many[data-n="10"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* ---------- lobby ---------- */
.tvlobby { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 44px; align-items: center; width: 100%; }
.tvjoincard { display: flex; gap: 24px; align-items: center; padding: 22px; border-radius: 24px; background: var(--bulb); color: var(--ink); }
.tvjoincard .qr { width: 220px; height: 220px; }
.tvjoincard-text { display: grid; gap: 4px; }
.tvj-label { font-weight: 700; font-size: 18px; color: rgba(21, 26, 99, 0.75); }
.tvj-url { font-weight: 800; font-size: 22px; }
.tvjoincard .bigcode { gap: 8px; margin-top: 8px; }
.tvjoincard .bigcode span { width: 66px; height: 78px; font-size: 56px; border-radius: 12px; }
.tvshow { display: grid; gap: 18px; align-content: center; }
.tvshow h2 { font: 400 52px/1 var(--display); color: var(--gold); letter-spacing: 0.01em; }
.tvorder { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; counter-reset: o; }
.tvorder li {
  counter-increment: o; display: inline-flex; align-items: baseline; gap: 10px;
  padding: 8px 18px 8px 10px; border-radius: 999px; background: var(--bulb-faint); font-weight: 800; font-size: 24px;
}
.tvorder li::before { content: counter(o); width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--ink); font: 400 20px/1 var(--display); align-self: center; }
.tvorder li em { font-style: normal; font-weight: 600; font-size: 17px; color: var(--bulb-dim); }
.tvorder li.is-surprise { background: transparent; box-shadow: inset 0 0 0 2px var(--bulb-faint); color: var(--bulb-dim); }
.tvorder-empty, .tvwait { font-size: 24px; color: var(--bulb-dim); font-weight: 600; }

/* ---------- pinned sizes for the shared screens ---------- */
.tv .marquee { font-size: 96px; }
.tv .intro { width: 1000px; gap: 22px; }
.tv .intro-num, .tv .final-cap { font-size: 24px; }
.tv .intro-by { font-size: 26px; }
.tv .intro-blurb { font-size: 25px; max-width: 58ch; }
.tv .qwrap { width: 1120px; gap: 18px; }
.tv .qnum { font-size: 20px; }
.tv .qtext { font-size: 44px; }
.tv .answers { gap: 18px; }
.tv .ans { min-height: 88px; font-size: 30px; padding: 12px 20px; gap: 18px; }
.tv .ans .key { width: 52px; height: 52px; font-size: 30px; }
.tv .who i { font-size: 17px; padding: 3px 10px; }
.tv .rung-pct { font-size: 76px; }
.tv .rung-cap { font-size: 19px; }
.tvtyped { text-align: center; font-size: 30px; color: var(--bulb-dim); font-weight: 600; }
.tvtally { text-align: center; font-size: 22px; color: var(--bulb-dim); }
.tvtally b { font: 400 34px/1 var(--display); color: var(--gold); margin-right: 4px; }
.tvtally span { color: var(--bad); }
.tv .answer-big b { font-size: 72px; }
.tv .answer-big span { font-size: 22px; }
.tv .typed-list b { font-size: 28px; }
.tv .typed-list li { font-size: 20px; }
.tv .explain { font-size: 24px; }
.tv .bonus { font-size: 26px; }

.tv .letters { width: 1120px; gap: 20px; }
.tv .rack { gap: 12px; }
.tv .tile { width: 100px; font-size: 64px; border-radius: 14px; }
.tv .pick-who { font-size: 30px; }
.tv .rule { font-size: 18px; }
.tv .wordresults { width: 760px; }
.tv .wordresults li { font-size: 20px; }
.tv .wordresults.is-many { width: 1120px; grid-template-columns: 1fr 1fr; }
.tv .wword { font-size: 32px; }
.tv .best { font-size: 19px; }
.tv .best b { font-size: 30px; }

.tv .scores { width: 900px; gap: 18px; }
.tv .scores h2 { font-size: 52px; }
.tv .board { width: 900px; gap: 12px; }
.tv .board li { grid-template-columns: 40px 200px 1fr auto; }
.tv .bname { font-size: 26px; }
.tv .bbar { height: 28px; border-radius: 14px; }
.tv .bbar i { background: var(--pc, var(--gold)); }
.tv .bscore { font-size: 38px; }
.tv .bgain { font-size: 16px; }
.tv .board.is-many { width: 1180px; grid-template-columns: 1fr 1fr; column-gap: 40px; row-gap: 8px; grid-auto-flow: column; grid-template-rows: repeat(6, auto); }
.tv .board.is-many li { grid-template-columns: 30px 150px 1fr auto; }
.tv .board.is-many .bname { font-size: 20px; }
.tv .board.is-many .bscore { font-size: 28px; }
.tv .board.is-many .bbar { height: 18px; }
.tv .board.is-many .bgain { display: none; }
.tv .final .marquee { font-size: 84px; }
.tv .final-score { font-size: 36px; }
.tv .final .board { width: 760px; }
.tv .final .board.is-many { width: 1180px; }
.tv[data-phase="final"] .tvplayers { display: none; }

/* ---------- games ---------- */
.tvcap { text-align: center; color: var(--bulb-dim); font-size: 19px; }
.tvbig { text-align: center; font: 400 54px/1.1 var(--display); color: var(--gold); letter-spacing: 0.01em; }
.tvsub { text-align: center; font-size: 24px; color: var(--bulb-dim); }

/* Five Letters boards */
.tvfive { display: grid; gap: 14px; width: 100%; }
.tvboards { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
.tvboard { display: grid; gap: 6px; justify-items: center; padding: 10px 14px; border-radius: 16px; background: rgba(11, 14, 68, 0.55); box-shadow: inset 0 4px 0 var(--pc); }
.tvboard.is-solved { box-shadow: inset 0 4px 0 var(--pc), inset 0 0 0 3px var(--good); }
.tvboard-name { font-weight: 800; font-size: 20px; }
.tvboard-state { font-size: 16px; color: var(--bulb-dim); }
.tvboard-state .ok { color: var(--good); }
.tvboard .fgrid { gap: 5px; }
.tvboard .frow { gap: 5px; }
.tvboard .ftile { width: 40px; height: 40px; border-radius: 6px; font-size: 0; }
.tvfive[data-n="5"] .ftile, .tvfive[data-n="6"] .ftile { width: 30px; height: 30px; }
.tvfive[data-n="7"] .ftile, .tvfive[data-n="8"] .ftile { width: 24px; height: 24px; }
.tvfive[data-n="9"] .ftile, .tvfive[data-n="10"] .ftile, .tvfive[data-n="11"] .ftile, .tvfive[data-n="12"] .ftile { width: 17px; height: 17px; border-radius: 4px; }
.tvfive[data-n="9"] .frow, .tvfive[data-n="10"] .frow, .tvfive[data-n="11"] .frow, .tvfive[data-n="12"] .frow,
.tvfive[data-n="9"] .fgrid, .tvfive[data-n="10"] .fgrid, .tvfive[data-n="11"] .fgrid, .tvfive[data-n="12"] .fgrid { gap: 3px; }
.tvfive[data-n="9"] .tvboards, .tvfive[data-n="10"] .tvboards, .tvfive[data-n="11"] .tvboards, .tvfive[data-n="12"] .tvboards { gap: 10px; }
.tv .five-res { width: 1120px; }

/* City Spotter */
.tv .city { width: 1180px; grid-template-columns: 700px minmax(0, 1fr); gap: 26px; }
.tv .city .answers { grid-template-columns: 1fr; gap: 12px; }
.tv .cityans .ans { min-height: 76px; font-size: 28px; }
.tv .city-q { font-size: 30px; }

/* Jumbled */
.tv .jumble { gap: 40px; }
.tv .jlist li { font-size: 28px; padding: 12px 18px; }
.tv .jmsg { font-size: 22px; }
.tv .jgrid { grid-template-columns: repeat(4, 100px); gap: 10px; }
.tv .jgrid.is-result { grid-template-columns: repeat(4, 80px); }

/* Duck Challenge */
.tv .dhead { font-size: 30px; }
.tv .dbig { font-size: 60px; }
.tv .dnext { font-size: 28px; }

/* Noisy */
.tvnoisy { display: grid; gap: 26px; width: 1100px; }
.tvnoisy .ans { font-size: 32px; }
.tv .nline { font-size: 22px; }

/* Draw It */
.tv .draw { width: 1180px; grid-template-columns: auto minmax(0, 1fr); gap: 26px; }
.tv .dpad { width: 600px; }
.tv .draw .nq, .tv .draw .nready { font-size: 28px; font-weight: 800; }
.tv .draw .nopt { min-height: 74px; font-size: 28px; }

/* Trolley Dash race */
.tvrace { display: grid; gap: 18px; justify-items: center; width: 100%; }
.tvrace .bscore { font-size: 44px; }

/* game result lists */
.tv .gres { width: 900px; }
.tv .gres li { font-size: 20px; }
.tv .gres .wpts { font-size: 30px; }
.tv .gres .wnote { font-size: 17px; }

.tvframe .banner { position: absolute; }
.tv .dline span { width: 92px; }
.tv .dline span svg { width: 100%; height: auto; }
.tv .minis b { font-size: 19px; width: 26px; height: 28px; }
.tv .scores, .tv .final { width: 1180px; justify-items: center; }

/* Number Crunch */
.tv .numbers { width: 1180px; gap: 22px; }
.tv .ntarget b { font-size: 96px; }
.tv .ntarget span { font-size: 26px; }
.tv .ncard0 { width: 110px; height: 110px; font-size: 58px; border-radius: 16px; }
.tv .nres .ncard0 { width: 70px; height: 70px; font-size: 36px; }
.tv .ntarget.small b { font-size: 60px; }
.tv .nmethod em { font-size: 16px; }
.tv .nbest { font-size: 20px; }

/* Who Am I? */
.tv .whoami { width: 1180px; gap: 16px; }
.tv .wgrid { grid-template-columns: repeat(8, minmax(0, 1fr)); width: 1100px; gap: 10px; }
.tv .wgrid.small { grid-template-columns: repeat(8, 84px); width: auto; }
.tv .wres { grid-template-columns: auto minmax(0, 1fr); }
.tv .wanswer .wbig { width: 200px; }
.tv .wanswer .nsay { font-size: 20px; }
.tv .wwho { font-size: 12px; }

/* Emoji Films, Fake Out, Rarest Answer, Imposter */
.tv .eclue { font-size: 130px; }
.tv .emoji, .tv .fakeout, .tv .rarest, .tv .imposter { width: 1180px; }
.tv .ffact { font-size: 42px; }
.tv .fakeout .ans { min-height: 70px; font-size: 26px; }
.tv .flist { width: 1000px; }
.tv .ftext { font-size: 26px; }
.tv .fwho, .tv .fpicked { font-size: 16px; }
.tv .rq { font-size: 76px; }
.tv .rq.small { font-size: 48px; }
.tv .rgroups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tv .rans { font-size: 24px; }
.tv .rwho { font-size: 16px; }
.tv .iclues b { font-size: 28px; }
.tv .iname { font-size: 15px; }
.tv .iclues li { min-width: 140px; padding: 8px 18px; }
.tv .imposter.ires { grid-template-columns: 340px minmax(0, 1fr); }
.tv .ivlist li { font-size: 20px; }
.tv .icard.small .iword { font-size: 48px; }

/* You Said on the TV: the alarm fills the 1280 x 720 frame */
#ysTv .ys-alarm { position: absolute; inset: 0; }
#ysTv .ys-alarm h2 { font-size: 110px; }
#ysTv .ys-siren { font-size: 100px; }
#ysTv .ys-line { font-size: 30px; }
#ysTv .ys-bigword { font-size: 96px; }
.tv .ys-final { margin-top: 10px; padding: 10px 16px; }
.tv .ys-final ul { grid-template-columns: repeat(2, 1fr); }

/* Sounds on the TV: browsers need one click before they'll play sound */
.tvsoundbtn { position: absolute; right: 24px; bottom: 120px; z-index: 30; font-size: 22px; padding: 14px 22px; }
