html, body { overflow: hidden; }
#stage { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; overflow: hidden; background: var(--night); }
#game { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; display: block; }
#vignette { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 55%, rgba(7,3,15,0) 60%, rgba(7,3,15,.7) 100%); }
#stage > section { position: absolute; inset: 0; display: none; }
body[data-mode="lobby"] #lobby,
body[data-mode="count"] #hud, body[data-mode="play"] #hud,
body[data-mode="over"] #hud, body[data-mode="scores"] #hud { display: block; }
body[data-mode="scores"] #scores, body[data-mode="podium"] #podium { display: flex; }
body[data-mode="scores"] .feed { display: none; }

/* ---------- lobby ---------- */
#lobby::before { content: ""; position: absolute; left: 0; top: 0; width: 900px; height: 640px;
  background: radial-gradient(ellipse 100% 100% at 0% 0%, rgba(7,3,15,.94) 0%, rgba(7,3,15,.82) 55%, rgba(7,3,15,0) 100%); }
.lob-left { position: absolute; left: 64px; top: 50px; width: 680px; }
/* Fire TV perf: no infinite animation that repaints (background-position, box-shadow, filter). Transform/opacity loops run on the
   compositor and are allowed, on their own layer (will-change). */
#logo { width: max-content; font-size: 112px; padding: 0 10px 6px 0; background-size: 100% 220%; background-position: 0 30%; white-space: nowrap; }
.tagline { margin-top: 12px; font-size: 23px; font-weight: 500; color: #eadfff; }
.how { list-style: none; margin-top: 26px; display: grid; gap: 9px; }
.how li { display: flex; gap: 16px; align-items: baseline; font-size: 21px; color: var(--muted); }
.how b { font-family: var(--mono); font-size: 15px; color: var(--hot); }
.how em { font-style: normal; font-weight: 700; color: #fff; }
.roster { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; min-height: 50px; }
.chip { --c: #fff; display: flex; align-items: center; gap: 10px; padding: 8px 18px 8px 9px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 2px solid var(--c); font-size: 20px; font-weight: 700; }
.chip i { width: 24px; height: 24px; border-radius: 50%; background: var(--c); box-shadow: 0 0 16px var(--c); }
.chip.off { opacity: .4; }
.chip.new { animation: chipIn .55s cubic-bezier(.2,1.6,.4,1); }
.chip.empty { border-style: dashed; border-color: var(--line); color: var(--muted); font-weight: 500; }
.chip.empty i { background: transparent; box-shadow: none; border: 2px dashed var(--line); }
.chip .ok { display: none; margin-left: -2px; font-size: 18px; color: var(--lime); }
.chip.rdy { background: color-mix(in srgb, var(--c) 22%, transparent); }
.chip.rdy .ok { display: inline; }
@keyframes chipIn { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }

.join-card { position: absolute; right: 64px; top: 64px; width: 330px; padding: 22px 22px 18px; border-radius: 28px; text-align: center;
  background: rgba(20,7,38,.86); border: 2px solid rgba(255,43,214,.55);
  box-shadow: 0 0 0 7px rgba(255,43,214,.08), 0 30px 80px rgba(0,0,0,.55); }
.scan { font-family: var(--mono); font-weight: 700; font-size: 15px; letter-spacing: .32em; color: var(--cyan); }
#qr { display: block; width: 250px; height: 250px; margin: 14px auto 10px; border-radius: 14px; background: #fff; }
.room { font-family: var(--mono); font-weight: 700; font-size: 56px; line-height: 1; letter-spacing: .16em; padding-left: .16em; }
.url { margin-top: 8px; font-family: var(--mono); font-size: 14px; color: var(--muted); word-break: break-all; }
.lob-status { position: absolute; left: 64px; bottom: 42px; font-family: var(--mono); font-weight: 700; font-size: 19px;
  letter-spacing: .22em; color: var(--muted); padding: 10px 18px; border-radius: 12px; background: rgba(7,3,15,.7); }
.lob-status.go { color: var(--night); background: var(--lime); box-shadow: 0 0 24px rgba(198,255,46,.4); animation: pulse 1.2s ease-in-out infinite; will-change: transform; }
@keyframes pulse { 50% { transform: scale(1.04); } }

/* ---------- in-round HUD ---------- */
.hud-tl { position: absolute; left: 40px; top: 28px; }
.hud-round { font-family: var(--mono); font-weight: 700; font-size: 17px; letter-spacing: .26em; color: var(--cyan); }
.hud-left { margin-top: 2px; font-weight: 800; font-style: italic; font-size: 46px; line-height: 1; text-shadow: 0 4px 20px rgba(0,0,0,.6); }
.hud-tr { position: absolute; right: 40px; top: 20px; text-align: right; }
.hud-big span { font-weight: 800; font-style: italic; font-size: 60px; line-height: 1; font-variant-numeric: tabular-nums;
  background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 6px; }
.hud-big small { font-family: var(--mono); font-size: 14px; color: var(--muted); margin-left: 4px; }
.hud-players { position: absolute; right: 40px; top: 104px; width: 230px; list-style: none; display: grid; gap: 6px; }
.hud-players li { --c: #fff; display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 10px;
  background: rgba(7,3,15,.62); border-left: 5px solid var(--c); font-size: 18px; font-weight: 700; transition: opacity .3s; }
.hud-players li .nm { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hud-players li .tag { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--gold); white-space: nowrap; }
.hud-players li b { margin-left: auto; font-family: var(--mono); font-size: 17px; }
.hud-players li.dead { opacity: .5; }
.hud-players li.dead .nm { text-decoration: line-through; text-decoration-thickness: 2px; }
.hud-players li.dead .tag { color: var(--hot); }
.hud-players li.off .nm::after { content: " · offline"; font-weight: 400; color: var(--muted); font-size: 13px; }
.feed { position: absolute; left: 40px; top: 108px; list-style: none; display: grid; gap: 7px; justify-items: start; }
.feed li { padding: 7px 15px; border-radius: 11px; background: rgba(7,3,15,.68); font-size: 19px; font-weight: 600;
  animation: feedIn .35s cubic-bezier(.2,1.4,.4,1); transition: opacity .5s, transform .5s; }
.feed li.bye { opacity: 0; transform: translateX(-30px); }
.feed li span { font-weight: 800; }
@keyframes feedIn { from { transform: translateX(-60px); opacity: 0; } }

#count { position: absolute; left: 0; right: 0; top: 170px; text-align: center; pointer-events: none; }
#count span { display: inline-block; font-weight: 800; font-style: italic; font-size: 230px; line-height: 1; padding: 0 30px 10px 0;
  background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: countPop .95s cubic-bezier(.2,1.2,.3,1) forwards; }
#count span.go { font-size: 200px; background: linear-gradient(180deg, #fff 0%, #eaff9a 45%, #c6ff2e 60%, #22e6ff 100%);
  -webkit-background-clip: text; background-clip: text; animation-duration: .8s; }
@keyframes countPop { 0% { transform: scale(2.2) skewX(-8deg); opacity: 0; } 25% { transform: scale(1) skewX(-8deg); opacity: 1; }
  75% { transform: scale(.96) skewX(-8deg); opacity: 1; } 100% { transform: scale(.7) skewX(-8deg); opacity: 0; } }

#banner { position: absolute; left: 0; right: 0; top: 96px; text-align: center; pointer-events: none; opacity: 0;
  font-weight: 800; font-style: italic; font-size: 62px; letter-spacing: -.02em; text-shadow: 0 6px 30px rgba(0,0,0,.7); }
#banner.show { animation: bannerIn 2.4s ease forwards; }
#banner small { display: block; font-family: var(--mono); font-style: normal; font-weight: 700; font-size: 18px; letter-spacing: .3em; color: var(--cyan); }
@keyframes bannerIn { 0% { opacity: 0; transform: translateY(-20px) scale(1.15); } 12% { opacity: 1; transform: none; }
  85% { opacity: 1; } 100% { opacity: 0; } }
#banner.stay { animation: bannerStay .5s ease forwards; }
@keyframes bannerStay { from { opacity: 0; transform: scale(1.3); } to { opacity: 1; transform: none; } }

/* ---------- between rounds ---------- */
#scores { flex-direction: column; align-items: center; justify-content: center; background: rgba(7,3,15,.72); }
.sc-title { font-size: 64px; padding: 0 10px 6px 0; }
.sc-sub { margin: 4px 0 22px; font-family: var(--mono); font-weight: 700; font-size: 16px; letter-spacing: .3em; color: var(--cyan); }
.sc-row { --c: #fff; display: grid; grid-template-columns: 64px 1fr 44px 100px 100px; align-items: center; width: 700px;
  margin: 4px 0; padding: 10px 20px; border-radius: 14px; background: rgba(20,7,38,.9); border-left: 7px solid var(--c);
  font-size: 26px; font-weight: 700; animation: rowIn .45s cubic-bezier(.2,1.3,.4,1) backwards; }
.sc-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-row .ok { visibility: hidden; text-align: center; color: var(--lime); font-size: 24px; }
.sc-row.rdy .ok { visibility: visible; animation: chipIn .4s cubic-bezier(.2,1.6,.4,1); }
.sc-row .pl { font-family: var(--mono); color: var(--muted); font-size: 20px; }
.sc-row .gain { text-align: right; font-family: var(--mono); color: var(--lime); }
.sc-row .gain.zero { color: var(--muted); }
.sc-row .tot { text-align: right; font-family: var(--mono); font-size: 30px; }
.sc-row.lead { box-shadow: 0 0 0 2px var(--gold), 0 0 30px rgba(255,216,74,.25); }
@keyframes rowIn { from { opacity: 0; transform: translateY(24px); } }
.sc-next { margin-top: 20px; font-family: var(--mono); font-size: 16px; letter-spacing: .25em; color: var(--muted); }

#podium { flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(60,10,90,.55), rgba(7,3,15,.9) 70%); }
.pd-title { font-size: 92px; padding: 0 12px 8px 0; }
.pd-steps { display: flex; align-items: flex-end; gap: 18px; margin-top: 20px; }
.pd-step { --c: #fff; width: 230px; text-align: center; animation: rowIn .6s cubic-bezier(.2,1.3,.4,1) backwards; }
.pd-step .nm { font-size: 32px; font-weight: 800; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-step .pts { font-family: var(--mono); font-size: 18px; color: var(--muted); margin-bottom: 10px; }
.pd-step .blk { display: flex; justify-content: center; padding-top: 12px; border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, var(--c) 0%, rgba(255,255,255,.08) 100%); box-shadow: 0 0 40px -6px var(--c);
  font-weight: 800; font-style: italic; font-size: 68px; color: var(--night); }
.pd-step.p1 .blk { height: 190px; } .pd-step.p2 .blk { height: 140px; } .pd-step.p3 .blk { height: 100px; }
.pd-step.p1 .nm { font-size: 40px; }
.pd-awards { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 26px; max-width: 1100px; }
.award { min-width: 210px; padding: 12px 18px; border-radius: 14px; background: rgba(20,7,38,.9); border: 1px solid var(--line); text-align: center;
  animation: rowIn .5s ease backwards; }
.award small { display: block; font-family: var(--mono); font-weight: 700; font-size: 13px; letter-spacing: .2em; color: var(--gold); }
.award b { display: block; margin-top: 4px; font-size: 24px; }
.award span { display: block; font-size: 14px; color: var(--muted); }
.pd-again { margin-top: 24px; font-family: var(--mono); font-weight: 700; font-size: 18px; letter-spacing: .24em; color: var(--lime);
  animation: blink 1.4s ease-in-out infinite; will-change: opacity; }
@keyframes blink { 50% { opacity: .35; } }

#mute { position: absolute; right: 24px; bottom: 20px; display: none; padding: 6px 12px; border-radius: 8px;
  background: rgba(7,3,15,.75); font-family: var(--mono); font-size: 13px; color: var(--muted); }
body.muted #mute { display: block; }
#offline { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); display: none; padding: 8px 18px; border-radius: 10px;
  background: var(--red); color: #fff; font-family: var(--mono); font-weight: 700; font-size: 15px; letter-spacing: .15em; z-index: 5; }

/* ---------------- saved leaderboard (games with cfg.board) ---------------- */
#panes { position: relative; margin-top: 18px; height: 200px; }
.pane { position: absolute; inset: 0; opacity: 0; transform: translateY(12px); transition: opacity .5s, transform .5s; pointer-events: none; }
.pane.on { opacity: 1; transform: none; }
.pane .how { margin-top: 0; }
.pane-h { display: flex; align-items: baseline; gap: 14px; margin-bottom: 10px; }
.pane-h b { font-weight: 800; font-style: italic; font-size: 26px; color: var(--gold); text-shadow: 0 0 18px rgba(255,216,74,.4); }
.pane-h small { font-family: var(--mono); font-size: 13px; letter-spacing: .18em; color: var(--muted); }
#paneDots { display: flex; gap: 8px; height: 8px; margin-top: 4px; }
#paneDots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: background .3s, width .3s; }
#paneDots i.on { width: 26px; border-radius: 4px; background: var(--hot); }
#panes + #paneDots + .roster { margin-top: 18px; }
.lb, .hs { list-style: none; display: grid; gap: 4px; }
.lb li, .hs li { display: grid; align-items: center; gap: 12px; padding: 2px 14px; min-height: 28px; border-radius: 10px; background: rgba(20,7,38,.72);
  font-size: 19px; font-weight: 700; }
.lb li { grid-template-columns: 44px 1fr 70px 110px 70px; }
.hs li { grid-template-columns: 250px 1fr auto; }
.lb li.top { box-shadow: inset 0 0 0 2px var(--gold); }
.lb .n { font-family: var(--mono); font-size: 16px; color: var(--muted); }
.lb li.top .n { color: var(--gold); }
.lb .nm, .hs .nm { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lb .w { font-family: var(--mono); color: var(--lime); text-align: right; }
.lb .x, .lb .a { font-family: var(--mono); font-size: 16px; color: var(--muted); text-align: right; }
.hs .k { font-family: var(--mono); font-size: 14px; letter-spacing: .12em; color: var(--cyan); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hs .v { font-family: var(--mono); color: var(--gold); text-align: right; }
.hs li.open .nm, .hs li.open .v { color: var(--muted); font-weight: 400; }
.pd-unlocks { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; max-width: 1180px; }
.pd-unlocks:empty { display: none; }
.unl { --c: #fff; display: flex; align-items: center; gap: 9px; padding: 7px 16px 7px 10px; border-radius: 999px; background: rgba(20,7,38,.92);
  border: 2px solid var(--c); font-size: 18px; animation: unlIn .6s cubic-bezier(.2,1.6,.4,1) backwards; box-shadow: 0 0 22px -6px var(--c); }
.unl i { font-style: normal; font-size: 22px; }
.unl b { color: var(--c); }
.unl span { font-family: var(--mono); font-weight: 700; font-size: 14px; letter-spacing: .1em; }
.unl.rec { border-color: var(--gold); box-shadow: 0 0 28px -4px var(--gold); }
.unl.rec span { color: var(--gold); }
.unl.more { border-color: var(--line); color: var(--muted); font-family: var(--mono); font-size: 14px; }
@keyframes unlIn { from { opacity: 0; transform: scale(.4); } }
/* picked gradient colours (games with cfg.pickColor): the stops slide back and forth */
@keyframes gslide { to { background-position: 100% 0; } }
@keyframes gslide2 { to { background-position: 0 0, 100% 0; } }
.chip.grad i { background: var(--g); background-size: 300% 100%; animation: gslide 2.4s ease-in-out infinite alternate; }
.pd-step.grad .blk { background: linear-gradient(180deg, transparent 0%, rgba(20,7,38,.55) 100%), var(--g);
  background-size: 100% 100%, 300% 100%; animation: gslide2 3s ease-in-out infinite alternate; }
/* gradient picks on the standings rows and the HUD list: the left bar shows the gradient (border over a gradient border-box) */
.sc-row.grad { border-left-color: transparent; background: linear-gradient(#140726, #140726) padding-box, var(--gv) border-box; }
.hud-players li.grad { border-left-color: transparent; background: linear-gradient(#0b0518, #0b0518) padding-box, var(--gv) border-box; }
/* public server: CLICK FOR SOUND / FULL SCREEN pill (lobby and podium only) */
#pubBar { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); z-index: 30; padding: 4px 14px; border-radius: 999px;
  background: rgba(20, 7, 38, .9); border: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-weight: 700;
  letter-spacing: .1em; white-space: pre; cursor: pointer; font-size: 12px; }
#pubBar:hover { color: #fff; border-color: var(--cyan); }
body:not([data-mode="lobby"]):not([data-mode="podium"]) #pubBar { display: none; }
