body[data-theme]{--ink:#f6f1ff;--muted:#cfc6df;--surface:#1b122df2;--edge:#72598b;--accent:#b7f35b;--accent-ink:#142009;--heading:system-ui,sans-serif;color:var(--ink);background-color:#0d0919;background-attachment:fixed}
#nightBanner{margin:0 0 28px;padding:28px 30px;border:1px solid var(--edge,#72598b);border-radius:18px;background:var(--surface,#1b122d);position:relative;overflow:hidden}
#nightBanner span{font:700 12px system-ui;letter-spacing:.24em;color:var(--accent,#b7f35b)}
#nightBanner h2{font-family:var(--heading,system-ui);font-size:clamp(28px,4.5vw,58px);margin:12px 0 0;line-height:1.1;overflow-wrap:anywhere}
body[data-theme] h1,body[data-theme] h2,body[data-theme] .question{font-family:var(--heading)}
body[data-theme] p,body[data-theme] label,body[data-theme] .muted{color:var(--muted)}
body[data-theme] .card,body[data-theme] .option{background:var(--surface);border-color:var(--edge);color:var(--ink)}
body[data-theme] .primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
body[data-theme] .big,body[data-theme] .meta{color:var(--accent)}
body[data-theme] .correct{background:#173c2c;border:3px solid #b7f35b;color:#fff}
body[data-theme] .correct::after{content:' ✓';color:#b7f35b}
body[data-theme] header{background:#080c18d9;border-bottom-color:var(--edge)}
body[data-theme] a{color:var(--accent)}body[data-theme] header a{color:white}
body[data-theme] button:focus-visible,body[data-theme] a:focus-visible,body[data-theme] select:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
body[data-theme='wizard']{--ink:#f7e9ca;--muted:#e1d1b4;--surface:#142232f5;--edge:#9c8050;--accent:#f1ce80;--accent-ink:#251b0d;--heading:Georgia,'Times New Roman',serif;background-image:radial-gradient(circle at 12% 16%,#f1ce8070 1px,transparent 2px),radial-gradient(circle at 70% 32%,#fff5cb70 1px,transparent 2px),radial-gradient(ellipse at 50% 0,#294760,transparent 65%);background-size:137px 157px,219px 239px,100% 100%;background-color:#091322}
body[data-theme='wizard'] #nightBanner{border:3px double #bd9a59;border-radius:5px;box-shadow:inset 0 0 50px #0008;padding:38px}
body[data-theme='wizard'] #nightBanner::after{content:'✦';position:absolute;right:22px;top:12px;color:#e7c27b;font-size:38px}
body[data-theme='wizard'] .option{background:linear-gradient(115deg,#ead9b2,#cfb988);color:#241c14;border:2px solid #9e8050;border-radius:4px;font-family:Georgia,serif;font-size:20px}
body[data-theme='wizard'] .question{text-shadow:0 2px 8px #000}
body[data-theme='eighties']{--surface:#190d32f5;--edge:#c768e9;--accent:#63f7f4;--accent-ink:#042a2a;background-color:#110621;background-image:linear-gradient(0deg,#110621 0%,transparent 70%),repeating-linear-gradient(90deg,transparent 0 79px,#e84b9e22 80px 81px),repeating-linear-gradient(0deg,transparent 0 79px,#5af8fb1f 80px 81px),radial-gradient(ellipse at 80% 0,#841f79,transparent 60%)}
body[data-theme='eighties'] #nightBanner{border:2px solid #ff5cc9;border-radius:0;box-shadow:7px 7px 0 #37d9ee;transform:skewY(-1deg);background:linear-gradient(120deg,#251046,#401442)}
body[data-theme='eighties'] #nightBanner h2{text-transform:uppercase;font-style:italic;text-shadow:3px 3px #c81d9f;font-weight:950}
body[data-theme='eighties'] .option{border-radius:0;box-shadow:3px 3px 0 #a335a0}
body[data-theme='y2k']{--surface:#111c3af5;--edge:#90a8df;--accent:#daff64;--accent-ink:#192600;background-color:#070e27;background-image:radial-gradient(ellipse at 90% 10%,#235dcc99,transparent 50%),radial-gradient(ellipse at 0% 85%,#6728a166,transparent 45%)}
body[data-theme='y2k'] #nightBanner{background:linear-gradient(135deg,#f3f8ff,#99accd 32%,#f8fbff 47%,#a5bbdc 70%,#e0ebff);color:#101b3e;border:2px solid #f0f6ff;border-radius:36px 8px 36px 8px;box-shadow:0 12px 0 #03092066}
body[data-theme='y2k'] #nightBanner span{color:#23387b;font-family:monospace}
body[data-theme='y2k'] #nightBanner h2{font-style:italic;font-weight:950;letter-spacing:-.04em}
body[data-theme='y2k'] .option{border-radius:22px 5px 22px 5px;border-top:3px solid #b5ccff}
body[data-theme='cinema']{--surface:#20181af5;--edge:#937c6f;--accent:#f5d39b;--accent-ink:#25180a;--heading:Georgia,serif;background-image:radial-gradient(ellipse at 50% -20%,#7b243d,transparent 65%);background-color:#100c10}
body[data-theme='cinema'] #nightBanner{border-radius:0;border-top:9px dashed #9a8067;border-bottom:9px dashed #9a8067;background:#241419}
body[data-theme='series']{--surface:#231b3bf5;--edge:#9c81cb;--accent:#ffb4a4;--accent-ink:#39130e;background-image:radial-gradient(ellipse at 10% 0,#493078,transparent 70%);background-color:#130f22}
body[data-theme='series'] #nightBanner{border-left:9px solid #ffb4a4;border-radius:0 20px 20px 0}
body[data-theme] .option.correct{background:#173c2c;color:white;border-color:#b7f35b}
.theme-preview{margin:14px 0;padding:16px;border-left:3px solid var(--accent,#b7f35b);line-height:1.5}
@media(max-width:650px){#nightBanner,body[data-theme='wizard'] #nightBanner{padding:24px 18px}#nightBanner span{letter-spacing:.12em}body[data-theme='eighties'] #nightBanner{box-shadow:4px 4px 0 #37d9ee}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
body[data-theme='tremaghi']{--ink:#fff0d5;--muted:#dfccb6;--surface:#1c1e23f2;--edge:#ae6b42;--accent:#ffc47a;--accent-ink:#201208;--heading:Georgia,'Times New Roman',serif;background-color:#10131a;background-image:radial-gradient(ellipse at 0 100%,#bc48145c,transparent 43%),radial-gradient(ellipse at 100% 100%,#ff80283d,transparent 39%),linear-gradient(#29313c,#11141b 54%,#16171a)}
body[data-theme='tremaghi'] #nightBanner{border:2px solid var(--edge);border-radius:4px;background:linear-gradient(110deg,#30241e,#1a1d23 45%,#30241e)}
body[data-theme='tremaghi'] .option{border:2px solid var(--edge);border-radius:6px;background:linear-gradient(130deg,#303039,#18191e);box-shadow:inset 0 0 0 2px #0f1116}
body[data-theme='tremaghi'] .option.correct{border-color:#cdf39a;background:#19382a}
body.tv[data-theme='tremaghi'] #nightBanner{border:0;border-bottom:1px solid var(--edge);background:transparent}
body[data-theme='tremaghi'] .podium-place:first-child{background:linear-gradient(#8d512c,#422818);border-color:#ffc47a}
body[data-theme='tremaghi']{background-image:url('./assets/tremaghi-arena.webp');background-size:cover;background-position:center;background-repeat:no-repeat}
/* Tournament projection: framed title, compact timer and copper answer plates. */
body.tv[data-theme='tremaghi'] #nightBanner:not([hidden]){
 display:block;visibility:visible;width:min(680px,82vw);margin:24px auto 0;padding:15px 38px;text-align:center;
 border:0;background:linear-gradient(135deg,#f5cb8d,#824724 45%,#e6a35c);
 clip-path:polygon(5% 0,95% 0,100% 28%,97% 100%,3% 100%,0 28%);
}
body.tv[data-theme='tremaghi'] #nightBanner::before{
 content:'';position:absolute;inset:3px;background:linear-gradient(#303642,#10141c);
 clip-path:polygon(5% 0,95% 0,100% 28%,97% 100%,3% 100%,0 28%);
}
body.tv[data-theme='tremaghi'] #nightBanner h2{display:none}
body.tv[data-theme='tremaghi'] #nightBanner::after{
 content:'🏆  TROFEO DRUNKARAMA';display:block;position:relative;inset:auto;color:#ffdcaa;
 font:700 clamp(16px,3vw,37px)/1.15 Georgia,serif;letter-spacing:.04em;text-shadow:0 2px 4px #000;
}
body.tv[data-theme='tremaghi'] #screen{width:min(1080px,80vw);padding-block:10px}
body.tv[data-theme='tremaghi'] #screen .question{text-shadow:0 4px 10px #000}
body.tv[data-theme='tremaghi'] #timer{font-size:clamp(23px,3.8vh,42px);margin:0 0 12px}
body.tv[data-theme='tremaghi'] #screen .option{
 --plate:#c4804b;position:relative;isolation:isolate;border:0;border-radius:0;text-align:center;
 font-family:Georgia,serif;background:var(--plate);color:#fff0d5;box-shadow:none;
 clip-path:polygon(13px 0,calc(100% - 13px) 0,100% 13px,100% calc(100% - 13px),calc(100% - 13px) 100%,13px 100%,0 calc(100% - 13px),0 13px);
}
body.tv[data-theme='tremaghi'] #screen .option::before{
 content:'';position:absolute;inset:2px;z-index:-1;background:linear-gradient(145deg,#353842,#13171f);
 clip-path:inherit;
}
body.tv[data-theme='tremaghi'] #screen .option.correct{--plate:#c4f591}
body.tv[data-theme='tremaghi'] #screen .option.correct::before{background:#19382a}
body.tv[data-theme='tremaghi'] #nightBanner:not([hidden]){
 width:min(66vw,1040px);height:clamp(65px,14vw,190px);margin:0 auto;padding:0;
 background:transparent url('./assets/trofeo-drunkarama.png') center top / contain no-repeat;
 clip-path:none;border:0;overflow:visible;
}
body.tv[data-theme='tremaghi'] #nightBanner::before,body.tv[data-theme='tremaghi'] #nightBanner::after{display:none}
body.tv[data-theme='tremaghi'] #screen{width:min(74vw,1400px)}
body.tv[data-theme='tremaghi'] #screen .question{font-family:Georgia,'Times New Roman',serif;font-size:clamp(25px,min(5.4vw,8vh),98px);line-height:1.04;margin:0 0 .28em;color:#fff3dc}
body.tv[data-theme='tremaghi'] #screen .options{gap:clamp(6px,1vw,20px)}
body.tv[data-theme='tremaghi'] #screen .option{font-size:clamp(17px,min(3.5vw,5.8vh),60px);font-weight:700;line-height:1.08;padding:.38em .45em;background:linear-gradient(155deg,#ffda96,#8d4d2d 45%,#e2a568 80%,#67351f)}
body.tv[data-theme='tremaghi'] #screen .option::before{inset:3px;background:linear-gradient(145deg,#292a2b,#121519 55%,#202123)}
body.tv[data-theme='tremaghi'] #screen .option.correct{background:#c4f591}
body.tv[data-theme='tremaghi'] #screen .option.correct::before{background:#19382a}
body.tv[data-theme='tremaghi'] #timer{font-size:clamp(15px,2vw,30px);margin:0 0 8px}
body.tv[data-theme='tremaghi'] #nightBanner:not([hidden]){
 width:min(57vw,820px);height:clamp(42px,16dvh,130px);
}
body.tv[data-theme='tremaghi'] main{gap:6px;padding-block:10px}
body.tv[data-theme='tremaghi'] #screen{width:min(76vw,1240px);padding-block:4px}
body.tv[data-theme='tremaghi'] #screen .question{
 font-size:clamp(20px,min(3.9vw,5.6dvh),64px);line-height:1.08;margin-bottom:.22em;
}
body.tv[data-theme='tremaghi'] #screen .option{
 font-size:clamp(15px,min(2.5vw,3.8dvh),42px);line-height:1.12;padding:.32em .42em;overflow-wrap:anywhere;
}
body.tv[data-theme='tremaghi'] #screen .options{gap:clamp(5px,1.15dvh,12px)}
body.tv[data-theme='tremaghi'] #screen #timer{font-size:clamp(16px,3dvh,30px);margin:2px 0 7px}
/* Keep projection elements inside the available browser viewport. */
body.tv[data-theme='tremaghi'] main{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
body.tv[data-theme='tremaghi'] #screen{max-width:100%;min-width:0;box-sizing:border-box}
body.tv[data-theme='tremaghi'] #screen .question{overflow-wrap:anywhere}
body.tv[data-theme='tremaghi'] #screen .options{grid-template-columns:repeat(2,minmax(0,1fr));min-width:0}
body.tv[data-theme='tremaghi'] #screen .option{min-width:0}
@media(max-height:650px){
 body.tv[data-theme='tremaghi'] #nightBanner:not([hidden]){height:clamp(32px,12dvh,80px);margin:0 auto}
 body.tv[data-theme='tremaghi'] #screen .question{font-size:clamp(16px,4.8dvh,31px);margin:4px 0}
 body.tv[data-theme='tremaghi'] #screen .option{font-size:clamp(13px,3.6dvh,23px);padding:.3em .45em}
}
@media(max-width:650px){
 body.tv[data-theme='tremaghi'] #screen{width:100%;max-width:100%}
 body.tv[data-theme='tremaghi'] #screen .question{font-size:clamp(17px,5vw,28px)}
 body.tv[data-theme='tremaghi'] #screen .option{font-size:clamp(13px,3.6vw,19px)}
}
