/* TV: palco fisso 1920×1080 scalato (--k) */
body.tv { overflow: hidden; height: 100vh; }
#stage { position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; transform: translate(-50%, -50%) scale(var(--k, 1)); overflow: hidden; }
.screen { position: absolute; inset: 0; }
.spot { position: absolute; top: -200px; width: 700px; height: 1400px; pointer-events: none; opacity: .5; filter: blur(8px);
  background: linear-gradient(180deg, rgba(255, 226, 150, .22), rgba(255, 226, 150, 0) 75%); clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%); animation: sway 9s ease-in-out infinite; }
.spot.s1 { left: 120px; transform-origin: 50% 0; transform: rotate(-18deg); }
.spot.s2 { right: 120px; transform-origin: 50% 0; transform: rotate(18deg); animation-delay: -4.5s; }
@keyframes sway { 0%, 100% { rotate: -5deg; } 50% { rotate: 5deg; } }

/* ---------- sala d'attesa ---------- */
#lobby { display: grid; grid-template-columns: 1.15fr 1fr; gap: 80px; padding: 90px 110px; }
.lobby-left { display: flex; flex-direction: column; gap: 34px; justify-content: center; }
.lobby-logo .logo { font-size: 190px; }
.tagline { font-size: 38px; color: var(--muted); margin: 0; font-weight: 700; }
.join { display: flex; align-items: center; gap: 46px; padding: 36px 44px; }
.join-text { flex: 1; display: flex; flex-direction: column; gap: 20px; }
.step { display: flex; gap: 18px; align-items: center; font-size: 30px; font-weight: 700; line-height: 1.25; }
.step b { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #2a1a00; font-family: var(--f-num); font-size: 30px; flex: none; }
.url { color: var(--gold); }
.code { font-size: 140px; letter-spacing: .14em; color: var(--gold-hi); text-shadow: 0 0 40px rgba(245, 196, 81, .45); line-height: 1; }
.qr { width: 300px; height: 300px; background: #fff; border-radius: 18px; padding: 12px; }
.lobby-right { display: flex; flex-direction: column; gap: 28px; justify-content: center; }
.lobby-right h2 { font-size: 76px; }
.seats { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.seat { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 34px 20px; min-height: 290px; justify-content: center; text-align: center; }
.seat .avbox { width: 150px; height: 150px; }
.seat b { font-size: 42px; }
.seat small { font-size: 22px; color: var(--muted); font-weight: 700; }
.seat.empty { border-style: dashed; color: var(--muted); font-size: 30px; font-weight: 700; }
.seat.empty .ghost { width: 150px; height: 150px; border-radius: 50%; border: 4px dashed rgba(255, 255, 255, .2); animation: glow 2s infinite; }
.hint { font-size: 30px; font-weight: 700; color: var(--gold); min-height: 40px; }
.summary { display: flex; gap: 12px; flex-wrap: wrap; }
.summary span { padding: 10px 20px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); font-size: 22px; font-weight: 700; }
.howto { padding: 22px 30px; font-size: 24px; line-height: 1.4; color: var(--muted); }
.howto p { margin: 6px 0; } .howto b { color: var(--cream); }

/* ---------- partita ---------- */
.top { position: absolute; left: 0; right: 0; top: 0; height: 130px; display: flex; align-items: center; gap: 30px; padding: 0 50px; }
.game-logo .logo { font-size: 74px; }
.round-pills { display: flex; gap: 14px; margin-left: 10px; }
.pill { padding: 10px 22px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); font-size: 28px; color: var(--gold-hi); letter-spacing: .06em; text-transform: uppercase; }
.players { margin-left: auto; display: flex; gap: 20px; }
.pl { display: flex; align-items: center; gap: 16px; padding: 12px 26px 12px 14px; min-width: 360px; }
.pl .avbox { width: 74px; height: 74px; }
.pl .pn { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.pl b { font-size: 30px; line-height: 1.1; }
.role { font-size: 17px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.role.conc { color: var(--lo); } .role.sens { color: var(--gold); }
.pl .sc { font-family: var(--f-num); font-size: 38px; color: var(--cream); }
.pl.off { opacity: .55; }
.pl .offl { color: var(--bad); font-size: 18px; font-weight: 800; }

.arena { position: absolute; top: 130px; bottom: 150px; left: 50px; right: 50px; display: grid; grid-template-columns: 290px 1fr 290px; gap: 44px; }
.board { display: grid; grid-template-rows: repeat(10, 1fr); gap: 11px; padding: 10px 0; }
.board .val { font-size: 34px; }
.grid { display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(4, 1fr); gap: 20px 22px; padding: 10px 0; }
.grid .box { aspect-ratio: auto; width: 100%; height: 100%; }
.grid .box.own { z-index: 2; }
.grid .box .tag { position: absolute; z-index: 4; top: 6px; left: 50%; transform: translateX(-50%); background: var(--night); color: var(--gold-hi); font-size: 18px; font-weight: 800; padding: 3px 12px; border-radius: 999px; letter-spacing: .1em; white-space: nowrap; }
.grid .box.just { animation: pop .5s; }
.grid .box.fade { opacity: .25; }

.bottom { position: absolute; left: 50px; right: 50px; bottom: 22px; height: 112px; display: flex; align-items: center; gap: 30px; padding: 0 34px;
  background: linear-gradient(90deg, rgba(26, 39, 96, .9), rgba(18, 28, 70, .9)); border: 1px solid var(--line); border-radius: 26px; }
.status { font-family: var(--f-title); font-style: italic; font-weight: 900; font-size: 50px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status em { color: var(--gold); font-style: italic; }
.info { display: flex; gap: 14px; font-size: 22px; font-weight: 800; color: var(--muted); }
.info span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: rgba(255, 255, 255, .06); white-space: nowrap; }
.info b { color: var(--cream); font-family: var(--f-num); font-weight: 600; font-size: 26px; }
.timer { min-width: 120px; text-align: center; font-size: 60px; color: var(--gold-hi); }
.timer.low { color: var(--bad); animation: glow .6s infinite; }

/* ---------- sovrimpressioni ---------- */
.overlay, .flash { position: absolute; inset: 0; display: grid; place-items: center; z-index: 20; }
.overlay { background: radial-gradient(ellipse at center, rgba(6, 10, 28, .78), rgba(6, 10, 28, .95)); backdrop-filter: blur(4px); }
.flash { z-index: 30; pointer-events: none; background: radial-gradient(ellipse at center, rgba(6, 10, 28, .94) 30%, rgba(6, 10, 28, .6) 75%); }
.ovb { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; max-width: 1500px; }
.kicker { font-size: 30px; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.big-title { font-size: 120px; line-height: 1.02; }
.sub { font-size: 40px; color: var(--muted); font-weight: 700; }
.sub b { color: var(--cream); }
.amount { font-family: var(--f-num); font-weight: 700; font-size: 230px; line-height: .95; }
.quip { font-family: var(--f-title); font-style: italic; font-size: 54px; color: var(--cream); max-width: 1300px; }
.quip::before { content: '« '; color: var(--gold); } .quip::after { content: ' »'; color: var(--gold); }
.ovtimer { font-family: var(--f-num); font-size: 44px; color: var(--gold-hi); }
.phone-ic { font-size: 190px; color: var(--gold); animation: ring 1.4s ease-in-out infinite; filter: drop-shadow(0 0 40px rgba(245, 196, 81, .6)); }
.swap-ic { font-size: 200px; color: var(--gold); animation: pop .5s; }
.vs { display: flex; gap: 90px; align-items: center; margin-top: 10px; }
.vs .who { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.vs .avbox { width: 190px; height: 190px; }
.vs b { font-size: 50px; }
.vs .role { font-size: 24px; }
.vs .x { font-family: var(--f-title); font-style: italic; font-size: 80px; color: var(--muted); }

/* apertura pacco */
.open-box { width: 420px; height: 375px; font-size: 1px; }
.open-box.box { animation: pop .35s; }
.reveal-val { font-family: var(--f-num); font-weight: 700; font-size: 200px; line-height: 1; animation: pop .45s both; }
.reveal-val.lo { color: var(--lo); text-shadow: 0 0 60px rgba(61, 155, 255, .55); }
.reveal-val.hi { color: var(--hi); text-shadow: 0 0 60px rgba(255, 77, 94, .55); }
.flash .ovb { gap: 10px; }
.flash .kicker { font-size: 34px; }

/* timbro esito */
.stamp { font-family: var(--f-num); font-weight: 700; font-size: 170px; letter-spacing: .04em; padding: 10px 60px; border: 14px solid currentColor; border-radius: 30px; animation: stamp .5s ease-out both; text-transform: uppercase; background: rgba(6, 10, 28, .6); }
.stamp.ok { color: var(--ok); } .stamp.no { color: var(--bad); } .stamp.gold { color: var(--gold); }

/* riepilogo manche */
.summary-card { padding: 46px 70px; display: flex; flex-direction: column; gap: 22px; align-items: center; min-width: 1200px; }
.sum-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; width: 100%; }
.sum-rows > div { padding: 24px; border-radius: 20px; background: rgba(255, 255, 255, .05); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.sum-rows .lbl { font-size: 24px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sum-rows .v { font-family: var(--f-num); font-size: 80px; font-weight: 600; }
.pos { color: var(--ok); } .neg { color: var(--bad); }
.verdict { font-family: var(--f-title); font-style: italic; font-size: 60px; font-weight: 900; }
.lie { font-size: 34px; font-weight: 800; color: var(--bad); display: flex; align-items: center; gap: 12px; }
.truth { font-size: 34px; font-weight: 800; color: var(--ok); }
.next-note { font-size: 26px; color: var(--muted); font-weight: 700; }

/* fine partita */
#final { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 40px 60px; }
#final .big-title { font-size: 104px; }
.podium { display: flex; gap: 60px; }
.podium .who { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 60px; min-width: 480px; }
.podium .who.win { box-shadow: 0 0 0 4px var(--gold), 0 0 60px rgba(245, 196, 81, .35); }
.podium .avbox { width: 120px; height: 120px; }
.podium b { font-size: 50px; }
.podium .tot { font-family: var(--f-num); font-size: 80px; color: var(--gold-hi); line-height: 1; }
.crown { font-size: 60px; color: var(--gold); margin: -6px 0 -10px; }
.hist { width: 1300px; border-collapse: collapse; font-size: 28px; }
.hist th { text-align: left; color: var(--muted); font-size: 20px; letter-spacing: .14em; text-transform: uppercase; padding: 8px 14px; }
.hist td { padding: 12px 14px; border-top: 1px solid var(--line); font-weight: 700; }
.hist td.n { font-family: var(--f-num); font-weight: 500; }
.final-note { font-size: 28px; color: var(--muted); font-weight: 700; }

/* strumenti */
.tools { position: absolute; right: 22px; bottom: 150px; display: flex; flex-direction: column; gap: 10px; opacity: .25; transition: opacity .2s; z-index: 50; }
.tools:hover { opacity: 1; }
.tbtn { width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--cream); font-size: 24px; cursor: pointer; display: grid; place-items: center; }
#lobby ~ .tools { bottom: 30px; }
.net, .err { position: absolute; left: 50%; top: 24px; transform: translateX(-50%); padding: 14px 30px; border-radius: 999px; font-size: 26px; font-weight: 800; z-index: 60; }
.net { background: var(--gold); color: #2a1a00; }
.err { background: var(--bad); color: #fff; }

/* pausa */
.pause-ic { font-size: 160px; color: var(--gold); }
.open-box .box { width: 100%; height: 100%; aspect-ratio: auto; animation: float 1.2s ease-in-out infinite, glow 1s infinite; }

/* tasto Sala: solo nella sala d'attesa (dentro #lobby), mai durante la partita */
.sala-tv { position: absolute; top: 30px; left: 40px; z-index: 5; }
.sala-tv .sala { font-size: 20px; padding: 12px 24px 12px 16px; }
