/* The TV screen (/tv, html.is-tv), user 2 Nov: built for a big screen across a room, not a stretched phone. A bar
   along the top, the screen filling the middle (question big and centred, the four answers as big coloured tiles,
   a big timer), and a strip of players along the bottom that light up as they answer. Every theme's colours, scene
   and 3D look still apply: this only sets sizes and layout. Sizes use vmin so any TV size works. */

html.is-tv #app { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 1.4vmin; height: 100vh; overflow: hidden;
  padding: 2vmin 3vmin 1.6vmin; max-width: none; }
html.is-tv #app > .screen { margin: 0; height: auto; }

/* the top bar: logo left, how to join right */
.is-tv .topbar { flex: none; align-items: center; gap: 1.4vmin; }
.is-tv .topbar .logo.small .l1, .is-tv .topbar .logo.small .l2 { font-size: 4vmin; }
.is-tv .topbar .chip { font-size: 2.2vmin; padding: .5vmin 1.6vmin; }
.is-tv .topbar .codechip { font-size: 3.2vmin; letter-spacing: .25em; padding: .6vmin 2vmin; }

/* the screen: fills the middle, its content centred */
.is-tv .screen { flex: 1; min-height: 0; justify-content: center; gap: 2.4vmin; padding: 4vmin 6vmin; border-radius: 3vmin; }
.is-tv .screen .qhead { justify-content: center; gap: 1.2vmin; }
.is-tv .screen .qhead .chip { font-size: 2.2vmin; padding: .6vmin 1.8vmin; }
.is-tv .screen .qhead .chip .ic, .is-tv .screen .qhead .chip .tic { width: 2.8vmin; height: 2.8vmin; }
.is-tv .screen .qtext { font-size: clamp(2rem, 5.2vmin, 6rem); line-height: 1.15; text-align: center; max-width: 85%; margin: 0 auto; text-wrap: balance; }

/* the four answers: exactly the phones' answer buttons (.abtn, styled by each theme), just bigger */
.is-tv .screen .opts { gap: 2.4vmin; margin-top: 1vmin; }
.is-tv .screen .opt.abtn { position: relative; min-height: 15vmin; font-size: clamp(1.4rem, 3.6vmin, 3.6rem); padding: 2vmin 3vmin; gap: 1.2vmin; border-radius: 2.4vmin; }
.is-tv .screen .opt.abtn .badge { width: 6vmin; height: 6vmin; font-size: 3.4vmin; flex: none; }
.is-tv .screen .opt.wrong { opacity: .35; }
.is-tv .screen .opt.right { box-shadow: 0 0 0 .5vmin #fff, 0 0 4vmin color-mix(in srgb, var(--good) 70%, transparent); transform: scale(1.03); }
/* who picked each answer, shown on the reveal */
.is-tv .screen .opt .who { position: absolute; right: 2vmin; bottom: -2.2vmin; display: flex; }
.is-tv .screen .opt .who svg, .is-tv .screen .opt .who .avemoji { width: 6vmin; height: 6vmin; margin-left: -1.6vmin; filter: drop-shadow(0 .4vmin .4vmin rgba(0, 0, 0, .35)); }
.is-tv .screen .fact { font-size: clamp(1rem, 2.6vmin, 2.4rem); max-width: 80%; margin: 1vmin auto 0; text-align: center; padding: 1.6vmin 2.4vmin; }

/* the big countdown ring */
.is-tv .screen .timer { top: 2.6vmin; right: 2.6vmin; width: 11vmin; height: 11vmin; font-size: 4.4vmin; font-weight: 900; }
.is-tv .screen .timer::before { inset: 1vmin; }

/* the other kinds of screen */
.is-tv .screen[data-screen="banner"] .banner .title { font-size: 9vmin; }
.is-tv .screen .promptcard { font-size: clamp(1.8rem, 5vmin, 5.4rem); text-align: center; }
.is-tv .screen .bignum { font-size: 14vmin; text-align: center; }
.is-tv .screen .votes { gap: 2vmin; }
.is-tv .screen .vcard { font-size: clamp(1.2rem, 3.2vmin, 3.2rem); padding: 2.4vmin 3vmin; border-radius: 2vmin; }
.is-tv .screen .vcard .by svg { width: 4.6vmin; height: 4.6vmin; }
.is-tv .screen .slot { font-size: clamp(1.2rem, 3.2vmin, 3.2rem); min-height: 9vmin; }
.is-tv .screen[data-screen="scores"] > div, .is-tv .screen[data-screen="number"] > div[style*="grid"] { max-width: 70%; width: 100%; margin: 0 auto; }
.is-tv .screen[data-screen="scores"] .title { font-size: 6vmin !important; }
.is-tv .screen .rank { font-size: clamp(1.2rem, 3.2vmin, 3.2rem); grid-template-columns: 6vmin 8vmin 1fr auto; padding: 1.4vmin 2.4vmin; border-radius: 2vmin; }
.is-tv .screen .rank .av svg, .is-tv .screen .rank .av .avemoji { width: 7vmin; height: 7vmin; }
.is-tv .screen .rank .gain { font-size: .7em; }
.is-tv .screen[data-screen="winner"] .banner .em svg { width: 26vmin; height: 26vmin; }
.is-tv .screen[data-screen="winner"] .banner .title { font-size: 10vmin; }

/* the join screen: a QR card on the left, the code and the players on the right */
.is-tv .lobby-tv { grid-template-columns: auto 1fr; gap: 6vmin; padding: 0 2vmin; }
.is-tv .tvjoin { display: grid; justify-items: center; gap: 2vmin; padding: 3vmin; border-radius: 3vmin; }
.is-tv .tvjoin .qr { padding: 1.6vmin; background: #fff; border-radius: 2vmin; box-shadow: 0 1vmin 3vmin rgba(0, 0, 0, .25); }
.is-tv .tvjoin .qr img, .is-tv .tvjoin .qr canvas { width: 34vmin !important; height: 34vmin !important; display: block; }
.is-tv .tvstep { font: 400 4vmin 'Lilita One', var(--body); color: var(--ink); text-align: center; }
.is-tv .tvor { font-size: 2.4vmin; font-weight: 800; color: var(--ink-dim); text-align: center; max-width: 40vmin; }
.is-tv .tvor b { color: var(--ink); }
.is-tv .tvroom { display: flex; flex-direction: column; gap: 2vmin; align-items: center; }
.is-tv .tvroom .bigcode { font-size: 20vmin; line-height: 1; letter-spacing: .12em; }
.is-tv .tvroom .chip { font-size: 2.2vmin; padding: .6vmin 1.8vmin; }
.is-tv .tvroom .players { gap: 2.4vmin; justify-content: center; }
.is-tv .tvroom .pl { width: 14vmin; }
.is-tv .tvroom .pl .av { width: 11vmin; height: 11vmin; }
.is-tv .tvroom .pl .av svg { width: 100%; height: 100%; }
.is-tv .tvroom .pl .nm { font-size: 2.2vmin; }
.is-tv .tvwait { font-size: 3vmin; font-weight: 800; color: var(--ink-dim); animation: tvpulse 1.6s ease-in-out infinite; }
@keyframes tvpulse { 50% { opacity: .45; } }

/* the players' strip along the bottom: dim while thinking, lit with a tick once they've answered */
#tvstrip { flex: none; display: flex; justify-content: center; gap: 1.6vmin; flex-wrap: wrap; max-height: 17vmin; overflow: hidden; }
#tvstrip[hidden] { display: none; }
.tvp { display: grid; justify-items: center; gap: .3vmin; width: 11vmin; transition: transform .25s, opacity .25s; }
.tvp .av { position: relative; width: 8vmin; height: 8vmin; border-radius: 50%; padding: .5vmin;
  background: color-mix(in srgb, var(--card) 80%, transparent); box-shadow: 0 .5vmin 1.2vmin rgba(0, 0, 0, .3); transition: box-shadow .25s; }
.tvp .av svg, .tvp .av .avemoji { width: 100%; height: 100%; }
.tvp b { font-size: 1.8vmin; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-shadow: 0 .2vmin .6vmin rgba(0, 0, 0, .35); }
.tvp span { font: 400 2vmin 'Lilita One', var(--body); color: var(--gold); text-shadow: 0 .2vmin .4vmin rgba(0, 0, 0, .35); }
.tvp.thinking { opacity: .6; }
.tvp.thinking .av { animation: tvthink 1.4s ease-in-out infinite; }
@keyframes tvthink { 50% { transform: translateY(-.6vmin); } }
.tvp.answered { transform: translateY(-.8vmin); }
.tvp.answered .av { box-shadow: 0 0 0 .5vmin var(--good), 0 0 2.4vmin color-mix(in srgb, var(--good) 70%, transparent); }
.tvp .tick { position: absolute; right: -.6vmin; bottom: -.6vmin; width: 3.4vmin; height: 3.4vmin; }
.tvp .tick :is(svg, .ic) { width: 100%; height: 100%; }
.tvp.off { opacity: .3; }
@media (prefers-reduced-motion: reduce) { .tvp.thinking .av, .is-tv .tvwait { animation: none; } }
