/* TV: designed at 1920x1080, everything in rem so it scales to any TV */
html.tv{font-size:calc(100vw / 120);background:#0f0f13;overflow:hidden}
html.tv body{height:100vh;width:100vw;overflow:hidden;color:#fff;
  background:radial-gradient(120rem 60rem at 20% -10%,#26263a 0%,transparent 60%),radial-gradient(90rem 50rem at 110% 110%,#2a1f2e 0%,transparent 60%),#121217}
.tvtop{position:absolute;left:0;right:0;top:0;height:6.5rem;display:flex;align-items:center;padding:0 3rem;gap:2rem;z-index:5}
.brand{display:flex;align-items:center;gap:1rem;font-weight:900;font-size:2.4rem;letter-spacing:-.02em}
.brand .lh{width:3.6rem;height:3.6rem}
.brand small{font-size:1rem;font-weight:800;opacity:.55;letter-spacing:.12em;text-transform:uppercase;margin-left:.4rem}
.pl{margin-left:auto;display:flex;gap:1.2rem}
.pchip{display:flex;align-items:center;gap:.8rem;background:rgba(255,255,255,.07);border:.15rem solid rgba(255,255,255,.12);border-radius:3rem;padding:.4rem 1.4rem .4rem .4rem;font-weight:800;font-size:1.5rem}
.pchip .av{width:3.4rem;height:3.4rem;border:.2rem solid #fff}
.pchip.p1 .av{border-color:var(--p1)}.pchip.p2 .av{border-color:var(--p2)}
.pchip .dot{width:.8rem;height:.8rem;border-radius:50%;background:#555}.pchip.on .dot{background:var(--green);box-shadow:0 0 .6rem var(--green)}
.pchip .sc{background:#fff;color:var(--ink);border-radius:2rem;padding:.1rem .8rem;font-size:1.3rem}
#stage{position:absolute;left:0;right:0;top:6.5rem;bottom:0;padding:1rem 3rem 3rem}
/* Lavi host */
#host{position:absolute;right:1.6rem;bottom:.6rem;width:13rem;z-index:20;transition:transform .5s cubic-bezier(.3,1.4,.5,1),opacity .4s;pointer-events:none}
#host.away{transform:translateY(120%)}
#host.big{transform:translate(-40rem,-14rem) scale(1.9)}
#bubble{position:absolute;right:12rem;bottom:9rem;max-width:40rem;background:#fff;color:var(--ink);border-radius:2rem;padding:1.2rem 1.6rem;font-weight:800;font-size:1.7rem;line-height:1.25;z-index:21;
  box-shadow:0 .6rem 0 rgba(0,0,0,.25);transform-origin:100% 100%;transition:transform .35s cubic-bezier(.3,1.5,.5,1),opacity .3s}
#bubble:after{content:"";position:absolute;right:-1rem;bottom:1.6rem;border:1rem solid transparent;border-left-color:#fff;border-right:0}
#bubble.hide{transform:scale(.3);opacity:0}
/* cards and type */
.card{background:#fff;color:var(--ink);border-radius:2rem;box-shadow:0 .5rem 0 rgba(0,0,0,.35)}
.h1{font-size:4.2rem;font-weight:900;letter-spacing:-.03em;line-height:1.05;margin:0}
.h2{font-size:2.6rem;font-weight:900;letter-spacing:-.02em;margin:0}
.sub{font-size:1.6rem;font-weight:700;opacity:.65}
.pill{display:inline-flex;align-items:center;gap:.5rem;border-radius:2rem;padding:.4rem 1.2rem;font-weight:900;font-size:1.3rem;letter-spacing:.06em;text-transform:uppercase;background:rgba(255,255,255,.12)}
.pill.y{background:var(--yellow);color:var(--ink)}.pill.p{background:var(--pink);color:#fff}.pill.g{background:var(--green);color:var(--ink)}.pill.b{background:var(--blue);color:#fff}
.timer{display:inline-grid;place-items:center;width:7rem;height:7rem;border-radius:50%;background:#fff;color:var(--ink);font-size:3.2rem;font-weight:900;box-shadow:0 .4rem 0 rgba(0,0,0,.35)}
.timer.low{background:var(--pink);color:#fff;animation:pulse .5s infinite alternate}
@keyframes pulse{to{transform:scale(1.08)}}
.bar{height:.8rem;border-radius:1rem;background:rgba(255,255,255,.15);overflow:hidden}.bar i{display:block;height:100%;background:var(--yellow);transform-origin:0 50%}
/* lobby */
.lobby{display:grid;grid-template-columns:44rem 1fr;gap:4rem;align-items:center;height:100%;padding:0 4rem 6rem}
.qrcard{padding:2.4rem;text-align:center}
.qrcard img{width:34rem;height:34rem;display:block;margin:0 auto}
.qrcard .url{font-size:1.6rem;font-weight:800;margin-top:1rem;word-break:break-all}
.seats{display:flex;gap:3rem;margin-top:3rem}
.seat{width:24rem;height:28rem;border-radius:2rem;border:.3rem dashed rgba(255,255,255,.25);display:flex;flex-direction:column;align-items:center;justify-content:flex-end;padding:1.4rem;font-weight:900;font-size:2.2rem;position:relative}
.seat .fig{width:17rem;height:22rem;opacity:.25;filter:grayscale(1);transition:.4s}
.seat .fig svg{width:100%;height:100%}
.seat.on{border-style:solid;background:rgba(255,255,255,.06)}.seat.on .fig{opacity:1;filter:none;animation:popin .6s cubic-bezier(.3,1.6,.5,1)}
.seat.p1.on{border-color:var(--p1)}.seat.p2.on{border-color:var(--p2)}
.seat .st{font-size:1.2rem;letter-spacing:.1em;text-transform:uppercase;opacity:.6}
@keyframes popin{from{transform:scale(.4) translateY(30%)}}
/* menu */
.menu{display:grid;grid-template-columns:1fr 30rem;gap:2.4rem;height:100%}
.mgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:1.4rem;align-content:start;overflow:hidden}
.mcat{grid-column:1/-1;font-weight:900;font-size:1.3rem;letter-spacing:.12em;text-transform:uppercase;opacity:.55;margin-top:.6rem}
.mt{background:#fff;color:var(--ink);border-radius:1.6rem;padding:1.2rem 1.4rem;display:flex;gap:1rem;align-items:center;box-shadow:0 .35rem 0 rgba(0,0,0,.35)}
.mt .ic{font-size:2.6rem;width:3.6rem;text-align:center}
.mt b{display:block;font-size:1.55rem;font-weight:900}
.mt span{display:block;font-size:1.05rem;font-weight:700;opacity:.55;line-height:1.2}
.mt.sea{outline:.3rem solid var(--orange)}
.mside{display:flex;flex-direction:column;gap:1.4rem}
.mside .card{padding:1.6rem}
.rec{display:flex;align-items:center;gap:1rem;font-size:1.5rem;font-weight:900}
.rec .av{width:3rem;height:3rem}
/* game frame */
.gframe{position:absolute;inset:0;padding:0 3rem 2rem}
.over{position:absolute;inset:0;display:grid;place-items:center;background:rgba(10,10,14,.72);z-index:10;animation:fade .4s}
@keyframes fade{from{opacity:0}}
.over .card{padding:2.4rem 4rem;text-align:center;min-width:60rem;animation:popin .6s cubic-bezier(.3,1.5,.5,1)}
.over .pair{display:flex;justify-content:center;gap:5rem;margin:1rem 0}
.over .pair .f{width:16rem;height:20rem}.over .pair .f svg{width:100%;height:100%}
.over .pair .f.w{transform:scale(1.12)}
.over .h1{color:var(--ink)}
.over .sumx{font-size:1.6rem;font-weight:800;opacity:.65}
.nextup{margin-top:1rem;font-size:1.3rem;font-weight:900;letter-spacing:.1em;text-transform:uppercase;opacity:.5}
/* recap */
.recap{display:grid;grid-template-columns:1fr 1fr;gap:4rem;height:100%;align-items:center;padding:0 4rem 5rem}
.champ{text-align:center;position:relative}
.champ .f{width:26rem;height:34rem;margin:0 auto}.champ .f svg{width:100%;height:100%}
.champ .crown{position:absolute;left:50%;top:-1rem;width:10rem;transform:translateX(-50%);animation:crown 1.2s cubic-bezier(.3,1.4,.5,1)}
@keyframes crown{from{transform:translate(-50%,-40rem) rotate(-30deg)}}
.log{padding:2rem 2.4rem}
.log div{display:flex;align-items:center;gap:1rem;font-size:1.6rem;font-weight:800;padding:.6rem 0;border-bottom:.15rem solid var(--line)}
.log div:last-child{border:0}.log .av{width:2.8rem;height:2.8rem;margin-left:auto}
.offline #stage:after{content:"Reconnecting to the game box...";position:absolute;left:50%;top:1rem;transform:translateX(-50%);background:var(--pink);color:#fff;font-weight:900;padding:.6rem 1.4rem;border-radius:2rem;font-size:1.3rem}
/* intro (app open, Lavi TV style: TV static then Lavi) */
#intro{position:fixed;inset:0;z-index:100;background:#000;display:grid;place-items:center;overflow:hidden}
#intro canvas{position:absolute;inset:0;width:100%;height:100%;opacity:.55}
#intro .ilogo{position:relative;text-align:center;animation:ilogo 2.6s ease both}
#intro .ilogo .lavi{width:16rem}
#intro .ilogo b{display:block;font-size:6rem;font-weight:900;letter-spacing:-.03em;color:#fff;text-shadow:0 0 1.4rem rgba(255,79,123,.9),0 0 3rem rgba(255,79,123,.5)}
#intro .ilogo small{display:block;font-size:1.6rem;font-weight:900;letter-spacing:.5em;color:#FFC83D;margin-top:.4rem}
@keyframes ilogo{0%{opacity:0;transform:scale(1.4);filter:blur(1rem)}20%{opacity:1;transform:none;filter:none}80%{opacity:1}100%{opacity:1}}
#intro.out{animation:iout .6s ease forwards}@keyframes iout{to{opacity:0;visibility:hidden}}
/* TV board (phone app games shown big) */
.board{display:grid;grid-template-columns:1fr 36rem;gap:2rem;height:100%}
.board .bw{position:relative;border-radius:2rem;overflow:hidden;background:#fff}
.board .bw iframe{border:0;position:absolute;left:50%;top:50%;transform-origin:50% 50%}
.board .bside{display:flex;flex-direction:column;gap:1.4rem}

/* in a game Lavi moves up to the top bar so she never covers the board */
html.ingame #host{width:6.2rem;right:auto;left:50%;bottom:auto;top:.2rem;transform:translateX(-50%)}
html.ingame #host.away{transform:translate(-50%,-120%)}
html.ingame #bubble{right:auto;left:50%;bottom:auto;top:6.6rem;transform:translateX(-50%);transform-origin:50% 0;max-width:70rem;text-align:center;z-index:30}
html.ingame #bubble:after{right:auto;left:50%;bottom:auto;top:-1rem;border:1rem solid transparent;border-bottom-color:#fff;border-top:0;transform:translateX(-50%)}
html.ingame #bubble.hide{transform:translateX(-50%) scale(.3)}
.bpl{display:flex;align-items:center;gap:1.2rem;background:rgba(255,255,255,.07);border-radius:2rem;padding:1rem 1.4rem;font-size:2rem;border:.3rem solid transparent}
.bpl .av{width:6rem;height:6rem}.bpl.on{border-color:var(--yellow)}
.board .bw{background:#fff}
#soundon{position:fixed;left:3rem;bottom:2rem;z-index:50;background:var(--yellow);color:var(--ink);font-weight:900;font-size:1.5rem;padding:.8rem 1.6rem;border-radius:2rem;animation:pulse 1s infinite alternate}

/* xmas-p4 dropped phone notice */
#dropban{position:fixed;left:50%;bottom:2.4rem;transform:translateX(-50%);z-index:60;background:var(--pink);color:#fff;font-weight:900;font-size:1.7rem;padding:.9rem 2rem;border-radius:2.4rem;box-shadow:0 .4rem 0 rgba(0,0,0,.3);max-width:90vw;text-align:center}

/* multi-p1 up to 8 seats: lobby grid, smaller chips, player-count pill */
.pchip .av{border-color:var(--pc,#fff)}
.pchip.sm{font-size:1.15rem;padding:.3rem 1rem .3rem .3rem;gap:.5rem}.pchip.sm .av{width:2.6rem;height:2.6rem}
.seat.on{border-color:var(--pc,#fff)}
.seats.many{display:grid;grid-template-columns:repeat(4,minmax(0,13.5rem));gap:1.4rem;margin-top:2.4rem}
.seats.many .seat{width:auto;height:17rem;font-size:1.6rem;padding:1rem}
.seats.many .seat .fig{width:10rem;height:12.5rem}
.seat.more{border-style:dashed;justify-content:center;gap:.4rem;opacity:.75}
.seat.more b{font-size:4.4rem;line-height:1}
.hwho .hpc{background:rgba(255,255,255,.12);border-radius:2rem;padding:.3rem 1rem;font-weight:900}

/* multi-p1 podium with 5+ players: top three on the steps, everyone else in a row below */
.podrest{display:flex;flex-wrap:wrap;justify-content:center;gap:1rem;margin-top:1.4rem;max-width:100rem}
.prc{display:flex;align-items:center;gap:.8rem;padding:.6rem 1.4rem .6rem .8rem;border-radius:3rem;background:rgba(255,255,255,.08);border:.25rem solid var(--pc);font-weight:900;animation:rise .8s .4s cubic-bezier(.3,1.3,.5,1) both}
.prc em{font-style:normal;font-size:1.5rem;opacity:.7;min-width:2.2rem;text-align:center}
.prc .av{width:4rem;height:4rem}
.prc b{font-size:1.9rem}.prc span{font-size:1.9rem;color:var(--yellow);font-variant-numeric:tabular-nums}
.over.pod.many{padding-top:5.5rem}
.over.pod.many .podt{font-size:4.4rem}
.over.pod.many .podium{gap:3rem}
.over.pod.many .step .pf{width:12rem;height:15.5rem}.over.pod.many .step.s1 .pf{width:14rem;height:18rem}
.over.pod.many .step .blk{height:7.5rem;width:24rem}.over.pod.many .step.s1 .blk{height:9rem}
.over.pod.many .podrest{flex-wrap:wrap;max-width:74rem;margin-top:1.2rem}
.over.pod.many{padding-right:22rem;box-sizing:border-box} /* keep the crowd clear of Lavi and her bubble on the right */
.over.pod.many .prc{padding:.4rem 1.1rem .4rem .6rem;gap:.6rem}.over.pod.many .prc .av{width:3.4rem;height:3.4rem}
.over.pod.many .prc b,.over.pod.many .prc span{font-size:1.6rem}
.over.pod.many .hls{margin-top:1rem}

/* xmas-p5 Lavi's bubble sits above her on the menu (off the tiles) and below the name cards in the lobby; remote hint */
html[data-scr=menu] #bubble{right:1.6rem;bottom:15.5rem;max-width:22rem;font-size:1.5rem}
html[data-scr=menu] #bubble:after{right:5rem;bottom:-1rem;border:1rem solid transparent;border-top-color:#fff;border-bottom:0}
html[data-scr=lobby] #bubble{bottom:1.6rem}
.hwho .okhint{background:#FFC83D;color:#111;border-radius:2rem;padding:.4rem 1.2rem;font-weight:900}

/* xmas-p6 sticker icons */
img.gico{display:inline-block;width:1.3em;height:1.3em;object-fit:contain;vertical-align:middle;user-select:none;-webkit-user-drag:none}
.mt2 img.gico{width:1.55em;height:1.55em;margin:-.2em 0}
.hic img.gico{width:1em;height:1em}

/* onelink-p1: small scan-to-play card in the corner of the menu, so people can join any time (the lobby has the big one) */
#joinqr{position:fixed;right:3rem;top:8.2rem;z-index:40;display:none;align-items:center;gap:1rem;background:#fff;color:#16122a;border-radius:1.4rem;padding:.8rem 1.4rem .8rem .8rem;box-shadow:0 .5rem 1.6rem rgba(0,0,0,.25)}
#joinqr img{width:9rem;height:9rem;display:block}
#joinqr span{display:flex;flex-direction:column;font-weight:800;font-size:1.5rem;line-height:1.2}
#joinqr b{font-size:1.15rem;opacity:.75;font-weight:700}
html:not(.ingame) #joinqr{display:flex}
html:has(#stage .lobby) #joinqr,html:has(#intro:not(.hide):not(.gone)) #joinqr{display:none}

/* hostctl-p1 remote hint */
#remhint{position:fixed;left:50%;bottom:1.6rem;transform:translate(-50%,1rem);z-index:60;background:rgba(20,24,40,.82);color:#fff;font:600 1.35rem/1.2 inherit;padding:.6rem 1.4rem;border-radius:2rem;opacity:0;pointer-events:none;transition:opacity .3s,transform .3s}
#remhint.on{opacity:1;transform:translate(-50%,0)}#remhint b{color:#FFD84D}
