/* Big screen. Everything is laid out on a 1920×1080 stage that scales to fit any TV or laptop. */
body.tv { overflow: hidden; width: 100vw; height: 100vh; background-color: #2E1470; cursor: default; }
#stage {
  position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px;
  transform-origin: center center;
  background: var(--grape);
  background-image:
    radial-gradient(circle at 10% 6%, rgba(111, 195, 255, 0.2), transparent 38%),
    radial-gradient(circle at 92% 94%, rgba(255, 122, 122, 0.18), transparent 40%),
    radial-gradient(rgba(255, 255, 255, 0.07) 2px, transparent 2.2px);
  background-size: auto, auto, 36px 36px;
  overflow: hidden;
  font-size: 30px;
}
#tvmain { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
#stage[data-phase="play"] #tvmain, #stage[data-phase="results"] #tvmain, #stage[data-phase="intro"] #tvmain, #stage[data-phase="wheel"] #tvmain { top: 96px; }

.splash { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; text-align: center; }
.logo.big { font-size: 150px; text-shadow: 0 10px 0 var(--grape-deep); }
.tagline { font-size: 40px; margin: 0; font-weight: 800; color: var(--sky); }
.splash .btn.big { font-size: 48px; min-height: 110px; padding: 0 60px; box-shadow: 0 10px 0 #C98F00; }
.splash .btn.big:focus { outline: 6px solid var(--white); outline-offset: 6px; }
.small-note { font-size: 26px; }
.setup-note { max-width: 1100px; font-size: 32px; }
.setup-note code { background: rgba(61, 28, 143, 0.1); padding: 2px 8px; border-radius: 8px; }

/* Top bar */
.topbar { position: absolute; left: 0; right: 0; top: 0; height: 96px; display: flex; align-items: center; gap: 30px; padding: 0 44px; background: rgba(43, 20, 100, 0.55); z-index: 5; }
.topbar .logo { font-size: 50px; text-shadow: 0 4px 0 var(--grape-deep); }
.tround { font-family: var(--head); font-weight: 800; font-size: 38px; flex: 1; text-align: center; }
.tjoin { font-size: 32px; font-weight: 800; background: rgba(255, 255, 255, 0.12); padding: 8px 24px; border-radius: 999px; }
.tjoin b { color: var(--yellow); letter-spacing: 3px; font-family: var(--head); }

/* Lobby */
.lobby { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: 760px 1fr; gap: 50px; padding: 50px 60px; }
.lobby-left { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lobby-left .logo.big { font-size: 128px; margin-top: 10px; }
.lobby-left .tagline { font-size: 34px; margin-bottom: 20px; }
.joincard { display: flex; gap: 30px; align-items: center; padding: 30px; width: 100%; }
.qr { width: 300px; height: 300px; background: #fff; border-radius: 18px; padding: 6px; flex: 0 0 auto; }
.qr svg { width: 100%; height: 100%; display: block; }
.joininfo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.joininfo small { font-size: 26px; font-weight: 700; color: #6A5A9A; }
.joininfo .url { font-size: 30px; word-break: break-all; color: var(--grape); line-height: 1.15; }
.joininfo .code { font-family: var(--head); font-weight: 800; font-size: 104px; line-height: 1; color: var(--grape); letter-spacing: 6px; margin-top: 8px; white-space: nowrap; }
.joininfo .locked { color: var(--coral); font-size: 30px; }
.lobby-right { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.lobby-head { display: flex; align-items: center; justify-content: space-between; }
.lobby-head h2 { font-size: 64px; }
.groupname { font-size: 30px; font-weight: 800; background: rgba(255, 255, 255, 0.12); padding: 8px 22px; border-radius: 999px; }
.ptiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 22px; }
.ptile { position: relative; background: rgba(255, 255, 255, 0.1); border-radius: 26px; padding: 20px 10px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: pop 0.4s both; min-width: 0; }
.ptile b { font-size: 30px; font-family: var(--head); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptile small { font-size: 22px; color: var(--muted); margin-top: -8px; }
.ptile.off { opacity: 0.45; }
.ptile.empty { background: transparent; border: 4px dashed rgba(255, 255, 255, 0.18); justify-content: center; min-height: 196px; animation: none; }
.ptile .slot { font-family: var(--head); font-size: 70px; color: rgba(255, 255, 255, 0.2); }
.ptile .av.xl { width: 120px; height: 120px; }
.crown { position: absolute; top: -4px; right: 18px; font-size: 44px; transform: rotate(18deg); }
.lobby-bottom { display: flex; gap: 24px; align-items: stretch; margin-top: auto; }
.upnext { flex: 1; display: flex; align-items: center; gap: 24px; background: var(--yellow); color: var(--ink); border-radius: 26px; padding: 22px 30px; box-shadow: var(--shadow); }
.upnext .big-emoji { font-size: 90px; line-height: 1; }
.upnext div { display: flex; flex-direction: column; min-width: 0; }
.upnext small { font-size: 24px; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; opacity: 0.7; }
.upnext b { font-family: var(--head); font-size: 52px; line-height: 1.05; }
.upnext span { font-size: 26px; font-weight: 700; }
.minimedals { width: 520px; background: rgba(255, 255, 255, 0.1); border-radius: 26px; padding: 18px 22px; }
.minimedals h3 { font-size: 32px; margin-bottom: 8px; }
.hosthint { font-size: 28px; font-weight: 800; color: var(--sky); margin: 0; text-align: center; }

/* Medal / leaderboard tables */
.mtable { display: flex; flex-direction: column; gap: 8px; }
.mrow { display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 800; }
.mpos { width: 30px; text-align: center; font-family: var(--head); color: var(--muted); }
.mname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcount { display: inline-flex; align-items: center; gap: 4px; font-size: 24px; }
.mcount .medal { font-size: 18px; }
.mpts { font-family: var(--head); font-size: 32px; color: var(--yellow); min-width: 56px; text-align: right; }
.mrow .av.sm { width: 40px; height: 40px; }

/* Wheel */
.wheelwrap { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; }
.wheelwrap h1 { font-size: 72px; }
.wheel { position: relative; width: 640px; height: 640px; }
.wheel svg { width: 100%; height: 100%; }
.wheel .pointer { position: absolute; top: -40px; left: 50%; transform: translateX(-50%); font-size: 80px; color: var(--yellow); z-index: 2; text-shadow: 0 6px 0 var(--grape-deep); }

/* Intro */
.intro { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 0 200px 60px; }
.intro-emoji { font-size: 170px; line-height: 1; animation: pop 0.5s both, bob 2.4s 0.5s infinite ease-in-out; }
.intro-title { font-size: 130px; color: var(--yellow); text-shadow: 0 8px 0 var(--grape-deep); }
.intro-blurb { font-size: 40px; font-weight: 800; margin: 0; max-width: 1300px; }
.howto { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 10px; font-size: 32px; font-weight: 700; }
.howto li::before { content: "★ "; color: var(--mint); }
.intro-settings { font-size: 28px; font-weight: 800; color: var(--sky); margin-top: 10px; }
.countdown { height: 150px; display: grid; place-items: center; }
.cd { font-family: var(--head); font-weight: 800; font-size: 140px; color: var(--mint); text-shadow: 0 8px 0 var(--grape-deep); display: inline-block; }

/* Results */
.results { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: 1fr 620px; gap: 44px; padding: 30px 56px 40px; }
.res-left h1 { font-size: 72px; margin-bottom: 14px; }
.res-summary { font-size: 28px; font-weight: 700; background: rgba(255, 255, 255, 0.1); border-radius: 20px; padding: 14px 22px; margin-bottom: 16px; }
.res-summary b { color: var(--yellow); }
.res-rows { display: flex; flex-direction: column; gap: 12px; }
.res-row { display: flex; align-items: center; gap: 18px; background: rgba(255, 255, 255, 0.1); border-radius: 22px; padding: 10px 20px; animation: pop 0.4s both; }
.res-row .av.lg { width: 64px; height: 64px; }
.res-mid { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.res-mid b { font-family: var(--head); font-size: 34px; line-height: 1.1; }
.res-mid small { font-size: 21px; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-bar { height: 12px; background: rgba(0, 0, 0, 0.2); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.res-bar i { display: block; height: 100%; background: var(--mint); border-radius: 99px; animation: grow 1s both; }
@keyframes grow { from { width: 0 !important; } }
.res-pts { font-family: var(--head); font-size: 54px; color: var(--yellow); min-width: 90px; text-align: right; }
.res-medal { width: 60px; font-size: 34px; display: grid; place-items: center; }
.res-right { display: flex; flex-direction: column; gap: 22px; }
.res-right h2 { font-size: 38px; margin-bottom: 12px; }
.res-right .hosthint { margin-top: auto; }

/* Podium */
.podium { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; padding-top: 36px; }
.podium .logo.big { font-size: 96px; }
.pods { display: flex; align-items: flex-end; gap: 30px; margin-top: 20px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 330px; animation: pop 0.6s both; }
.pod b { font-family: var(--head); font-size: 44px; }
.pod small { font-size: 26px; font-weight: 800; color: var(--sky); }
.pod .block { width: 100%; border-radius: 24px 24px 0 0; display: grid; place-items: center; font-size: 90px; box-shadow: inset 0 -12px 0 rgba(0, 0, 0, 0.15); }
.pod.p1 .block { height: 300px; background: var(--gold); }
.pod.p2 .block { height: 220px; background: var(--silver); }
.pod.p3 .block { height: 160px; background: var(--bronze); }
.pod.p1 .av.xl { width: 170px; height: 170px; }
.pod.empty { visibility: hidden; }
.awards { display: flex; gap: 20px; margin-top: 30px; flex-wrap: wrap; justify-content: center; padding: 0 40px; }
.award { display: flex; align-items: center; gap: 16px; padding: 14px 22px; animation: pop 0.5s both; max-width: 580px; }
.award .aicon { font-size: 60px; }
.award b { display: block; font-family: var(--head); font-size: 30px; }
.award span { font-weight: 800; font-size: 26px; vertical-align: middle; }
.award small { display: block; font-size: 21px; font-weight: 700; color: #5B4B8A; }

/* Quirky comments */
#tvquip { position: absolute; left: 0; right: 0; bottom: 34px; display: flex; justify-content: center; z-index: 20; pointer-events: none; }
.quip { background: var(--yellow); color: var(--ink); font-family: var(--head); font-weight: 800; font-size: 38px; padding: 18px 40px; border-radius: 40px; box-shadow: 0 8px 0 #C98F00, 0 12px 40px rgba(0, 0, 0, 0.35); max-width: 1500px; display: flex; gap: 16px; align-items: center; position: relative; }
.quip::after { content: ""; position: absolute; left: 80px; bottom: -22px; border: 16px solid transparent; border-top: 18px solid var(--yellow); }

/* Overlay */
.overlay { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(30, 10, 80, 0.8); display: grid; place-items: center; z-index: 30; }
.board { width: 1200px; padding: 40px 50px; }
.board h1 { font-size: 64px; color: var(--grape); }
.board .mrow { font-size: 32px; }
.board .mpts { color: var(--grape); }
.board .mpos { color: #8A7BB8; }
.muted-ink { color: #6A5A9A; font-weight: 700; font-size: 26px; }

/* Shared game pieces on the TV */
.pchip { display: inline-flex; align-items: center; gap: 8px; }
.pname { font-weight: 800; }
.scorelist { display: flex; flex-direction: column; gap: 10px; }
.srow { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, 0.1); border-radius: 18px; padding: 8px 14px; font-size: 28px; font-weight: 800; }
.srow.done { background: rgba(31, 199, 164, 0.25); }
.spos { font-family: var(--head); color: var(--muted); width: 26px; text-align: center; }
.sname { flex: 0 0 200px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; flex-direction: column; line-height: 1.1; }
.sname small { font-size: 19px; color: var(--muted); }
.sbar { flex: 1; height: 12px; background: rgba(0, 0, 0, 0.22); border-radius: 99px; overflow: hidden; }
.sbar i { display: block; height: 100%; background: var(--yellow); border-radius: 99px; transition: width 0.5s; }
.spts { font-family: var(--head); font-size: 36px; color: var(--yellow); min-width: 60px; text-align: right; }
.sflag { font-size: 26px; }
.srow .av.sm { width: 44px; height: 44px; }
.timer { position: relative; width: 150px; height: 150px; display: grid; place-items: center; }
.timer svg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; transform: rotate(-90deg); }
.timer .tbg { fill: rgba(0, 0, 0, 0.2); stroke: rgba(255, 255, 255, 0.15); stroke-width: 4; }
.timer .tfg { fill: none; stroke: var(--mint); stroke-width: 4; stroke-linecap: round; transition: stroke-dasharray 0.25s linear; }
.timer span { position: relative; font-family: var(--head); font-weight: 800; font-size: 44px; }
.timer.low .tfg { stroke: var(--coral); }
.timer.low span { color: var(--coral); animation: pulse 1s infinite; }
