/* Tema "platform pixel + neon geometrico": cielo, nuvole pixel, terreno a mattoncini,
   forme al neon che ruotano, contorni neri spessi stile arcade. Caricato dopo gli altri CSS. */
:root {
  --outline: #0d0f33;
  --sky-hi: #3d63e0;
  --sky-lo: #8fd3ff;
  --bg: #3d63e0;
  --bg-top: #3d63e0;
  --bg2: #24307e;
  --panel: #232c86;
  --panel2: rgba(22, 27, 96, .86);
  --line: var(--outline);
  --muted: #e6eeff;
  --a: #ff4f8b; --a2: #a8235a;
  --b: #22c7ff; --b2: #0b78b0;
  --c: #ffc21a; --c2: #b37800;
  --d: #4fe34f; --d2: #1c8c1c;
  --gold: #ffd21f; --gold2: #b38600;
  --ok: #6dff7a; --ko: #ff5b6e;
  --neon1: #39f3ff; --neon2: #ff3df0; --neon3: #b6ff3d;
  --ol: 2px 0 0 var(--outline), -2px 0 0 var(--outline), 0 2px 0 var(--outline), 0 -2px 0 var(--outline), 2px 2px 0 var(--outline), -2px 2px 0 var(--outline), 2px -2px 0 var(--outline), -2px -2px 0 var(--outline), 0 5px 0 var(--outline);
}

body { background: linear-gradient(180deg, var(--sky-hi) 0%, #5b8ff0 45%, var(--sky-lo) 100%) fixed, var(--sky-hi); }
body::before {
  /* griglia geometrica leggera */
  background:
    linear-gradient(rgba(255, 255, 255, .06) 2px, transparent 2px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(255, 255, 255, .06) 2px, transparent 2px) 0 0 / 48px 48px;
}

/* ---------------- mondo decorativo ---------------- */
.world { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; --g: 64px; --u: 1px; }
.stage .world { position: absolute; z-index: 1; --g: 7.5cqw; --u: .12cqw; }
.cloud { position: absolute; image-rendering: pixelated; animation: drift linear infinite; opacity: .95; }
@keyframes drift { from { transform: translateX(110vw); } to { transform: translateX(-30vw); } }
.stage .cloud { animation-name: drift2; }
@keyframes drift2 { from { transform: translateX(110cqw); } to { transform: translateX(-30cqw); } }

.neon { position: absolute; width: calc(var(--u) * 46); height: calc(var(--u) * 46); border: calc(var(--u) * 4) solid var(--c1); border-radius: calc(var(--u) * 4);
  box-shadow: 0 0 calc(var(--u) * 14) var(--c1), inset 0 0 calc(var(--u) * 10) var(--c1); animation: spin 9s linear infinite, float 4s ease-in-out infinite; opacity: .75; }
.neon::after { content: ''; position: absolute; inset: 28%; border: calc(var(--u) * 3) solid var(--c1); border-radius: calc(var(--u) * 2); }
.neon.tri { border: 0; box-shadow: none; width: calc(var(--u) * 50); height: calc(var(--u) * 44); background: var(--c1); clip-path: polygon(50% 0, 100% 100%, 0 100%); filter: drop-shadow(0 0 6px var(--c1)); opacity: .55; }
.neon.tri::after { display: none; }
@keyframes spin { to { rotate: 360deg; } }
@keyframes float { 50% { translate: 0 calc(var(--u) * -18); } }

.ground { position: absolute; left: 0; right: 0; bottom: 0; height: var(--g); border-top: calc(var(--u) * 4) solid var(--outline);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' shape-rendering='crispEdges'%3E%3Crect width='32' height='32' fill='%23d9692b'/%3E%3Crect y='0' width='32' height='3' fill='%230d0f33'/%3E%3Crect y='16' width='32' height='3' fill='%230d0f33'/%3E%3Crect x='0' y='0' width='3' height='16' fill='%230d0f33'/%3E%3Crect x='16' y='16' width='3' height='16' fill='%230d0f33'/%3E%3Crect x='4' y='4' width='10' height='2' fill='%23f39a5c'/%3E%3Crect x='20' y='20' width='10' height='2' fill='%23f39a5c'/%3E%3C/svg%3E") 0 0 / calc(var(--g) / 2) calc(var(--g) / 2);
  animation: scroll 2.4s linear infinite; }
.ground::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--g) * .18); background: #4fe34f; border-bottom: calc(var(--u) * 3) solid var(--outline);
  box-shadow: 0 calc(var(--u) * -3) 0 #b6ff9a inset; }
@keyframes scroll { to { background-position: calc(var(--g) / -2) 0; } }
.spike { position: absolute; bottom: 100%; width: calc(var(--g) * .42); height: calc(var(--g) * .42); background: var(--outline); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.spike::after { content: ''; position: absolute; inset: 22% 22% 0; background: linear-gradient(var(--neon2), #8a1fd6); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.runner { position: absolute; bottom: 100%; left: 0; animation: run-x 14s linear infinite; }
.runner i { display: block; width: calc(var(--g) * .5); height: calc(var(--g) * .5); background: var(--gold); border: calc(var(--u) * 4) solid var(--outline); border-radius: calc(var(--u) * 3);
  box-shadow: inset calc(var(--u) * -5) calc(var(--u) * -5) 0 rgba(0, 0, 0, .18); animation: jump 1.75s cubic-bezier(.3, .7, .4, 1) infinite; position: relative; }
.runner i::before { content: ''; position: absolute; left: 22%; right: 22%; top: 30%; height: 22%; background: linear-gradient(90deg, var(--outline) 30%, transparent 30% 70%, var(--outline) 70%); }
.runner i::after { content: '👑'; position: absolute; left: 50%; top: calc(var(--g) * -.36); transform: translateX(-50%); font-size: calc(var(--g) * .3); }
@keyframes run-x { from { transform: translateX(-10vw); } to { transform: translateX(110vw); } }
.stage .runner { animation-name: run-x2; }
@keyframes run-x2 { from { transform: translateX(-10cqw); } to { transform: translateX(110cqw); } }
@keyframes jump { 0%, 55%, 100% { transform: translateY(0) rotate(0); } 75% { transform: translateY(calc(var(--g) * -1.1)) rotate(90deg); } 90% { transform: translateY(0) rotate(180deg); } }

/* ---------------- elementi comuni ---------------- */
.title-logo { color: #fff; text-shadow: var(--ol); }
.title-logo .sub { color: var(--gold); text-shadow: var(--ol); }
.ans { border: 4px solid var(--outline); border-radius: 12px;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .18), inset 0 6px 0 rgba(255, 255, 255, .35), 0 6px 0 var(--outline) !important; text-shadow: var(--ol); }
.ans .L { background: #fff; color: var(--outline); border: 3px solid var(--outline); border-radius: 6px; text-shadow: none;
  background-image: radial-gradient(circle at 4px 4px, var(--outline) 1.6px, transparent 2px), radial-gradient(circle at calc(100% - 4px) 4px, var(--outline) 1.6px, transparent 2px),
    radial-gradient(circle at 4px calc(100% - 4px), var(--outline) 1.6px, transparent 2px), radial-gradient(circle at calc(100% - 4px) calc(100% - 4px), var(--outline) 1.6px, transparent 2px); }
.ans:active:not(:disabled) { transform: translateY(5px); box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .18), 0 1px 0 var(--outline) !important; }
.ans.sel, .ans.win { outline: 4px solid #fff; outline-offset: 3px; }
.ans.win { box-shadow: 0 0 0 4px var(--outline), 0 0 30px var(--ok) !important; }
.dot { border: 2px solid var(--outline); }
.toast { background: var(--panel); border: 4px solid var(--outline); box-shadow: 0 6px 0 var(--outline); }
.coin { display: inline-block; width: 1em; height: 1em; border-radius: 50%; vertical-align: -0.12em; margin-right: .35em;
  background: radial-gradient(circle at 50% 50%, transparent 24%, var(--gold) 25%), linear-gradient(90deg, transparent 42%, #b38600 42% 58%, transparent 58%), var(--gold);
  border: 2px solid var(--outline); box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .2); animation: coin 1.6s steps(8) infinite; }
@keyframes coin { 50% { transform: scaleX(.25); } }

/* ---------------- giocatore ---------------- */
#app { z-index: 1; }
#view { padding-bottom: 84px; }
#app.with-tabs #view { padding-bottom: 104px; }
.hero img.logo { width: 110px; padding: 6px 10px; background: rgba(13, 15, 51, .6); border: 3px solid var(--outline); border-radius: 12px; bottom: 10px; }
.hud { color: #fff; text-shadow: var(--ol); font-size: 10px; }
.hud b { color: var(--gold); }
.hint, .tagline { color: #fff; text-shadow: 0 2px 0 rgba(13, 15, 51, .55); }
.tagline { color: var(--gold); text-shadow: var(--ol); }
.big, .msg, .pts, .rank-big, .countdown b, .status { text-shadow: var(--ol); }
.big { color: #fff; }
.qtext { color: #fff; text-shadow: var(--ol); line-height: 1.45; }
.msg.ok { color: var(--ok); text-shadow: var(--ol); }
.msg.ko { color: var(--ko); text-shadow: var(--ol); }
.pts { color: var(--gold); text-shadow: var(--ol); }
.rank-big { color: var(--gold); }
.countdown b { color: var(--gold); text-shadow: var(--ol); }
.status { color: #fff; }
.status.ko { color: var(--ko); }
.chip, .pill, .field, .correct-box, .hcard, .mini-lb div, .church-card, .qimg {
  background: var(--panel2); border: 4px solid var(--outline); box-shadow: 0 5px 0 rgba(13, 15, 51, .55);
}
.chip { color: var(--gold); }
.field { background: #fff; color: var(--outline); }
.field::placeholder { color: #8a90c0; }
.field:focus { border-color: var(--outline); box-shadow: 0 0 0 4px var(--neon1), 0 5px 0 rgba(13, 15, 51, .55); }
.btn { border: 4px solid var(--outline); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .18), inset 0 5px 0 rgba(255, 255, 255, .45), 0 6px 0 var(--outline); color: var(--outline); }
.btn:active { box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .18), 0 2px 0 var(--outline); }
.btn.alt { background: var(--b); color: #fff; text-shadow: var(--ol); border: 4px solid var(--outline); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .18), inset 0 5px 0 rgba(255, 255, 255, .35), 0 6px 0 var(--outline); }
.hero { border-bottom: 4px solid var(--outline); }
.hero::after { background: linear-gradient(180deg, rgba(61, 99, 224, 0) 30%, rgba(61, 99, 224, .65) 100%); }
.avatar { background: var(--gold); color: var(--outline); border: 5px solid var(--outline); border-radius: 12px;
  box-shadow: inset -8px -8px 0 rgba(0, 0, 0, .15), 0 6px 0 var(--outline); position: relative; }
.avatar::after { content: '👑'; position: absolute; top: -30px; left: 50%; transform: translateX(-50%); font-size: 28px; }
.timer { border: 4px solid var(--outline); background: #fff; height: 18px; }
.timer i { background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .3) 0 6px, transparent 6px 12px), linear-gradient(90deg, var(--d), var(--gold), var(--a)); }
.secs { color: #fff; text-shadow: var(--ol); }
.answers { flex: 1; max-height: 460px; grid-auto-rows: 1fr; }
.answers .ans { font-size: 17px; }
.answers .ans .L { width: 40px; height: 40px; font-size: 16px; }
.bonus-banner { border: 4px solid var(--outline); box-shadow: 0 5px 0 var(--outline); }
.clue { border: 4px solid var(--outline); box-shadow: 0 6px 0 var(--outline), 0 0 30px rgba(255, 210, 31, .45); }
.mini-lb div.me { box-shadow: 0 0 0 3px var(--gold), 0 5px 0 rgba(13, 15, 51, .55); }
.hcard .top { color: #c9d6ff; }
.empty { color: #fff; text-shadow: 0 2px 0 rgba(13, 15, 51, .55); }
.tabs { background: transparent; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.tabs button { background: var(--panel2); border: 4px solid var(--outline); color: #c9d6ff; box-shadow: 0 4px 0 var(--outline); }
.tabs button.on { background: var(--gold); color: var(--outline); border-color: var(--outline); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18), 0 4px 0 var(--outline); }

/* scanner QR */
.scanner { position: fixed; inset: 0; z-index: 70; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 16px; padding: 24px 24px max(24px, env(safe-area-inset-bottom)); }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; left: 50%; top: 42%; width: min(70vw, 300px); aspect-ratio: 1; transform: translate(-50%, -50%);
  border: 5px solid var(--neon1); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45), 0 0 24px var(--neon1); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45), 0 0 40px var(--neon1); } }
.scanner .hint, .scanner .btn { position: relative; z-index: 1; }
.scanner .hint { font-size: 15px; font-weight: 700; }

/* ---------------- maxischermo ---------------- */
.stage { background: linear-gradient(180deg, var(--sky-hi) 0%, #5b8ff0 50%, var(--sky-lo) 100%); }
.stage::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, .06) .2cqw, transparent .2cqw) 0 0 / 4cqw 4cqw, linear-gradient(90deg, rgba(255, 255, 255, .06) .2cqw, transparent .2cqw) 0 0 / 4cqw 4cqw; }
.stage::after { display: none; }
.bgphoto::after { background: linear-gradient(90deg, rgba(36, 56, 160, .9) 0%, rgba(61, 99, 224, .7) 45%, rgba(61, 99, 224, .35) 100%); }
.S { z-index: 3; padding-bottom: 9cqw; }
.ctrl { background: rgba(13, 15, 51, .9); border-top: .3cqw solid var(--outline); }
.ctrl .k { border: .25cqw solid #000; }
.tag { background: var(--panel2); border: .3cqw solid var(--outline); box-shadow: 0 .4cqw 0 var(--outline); }
.brand .title-logo { font-size: 1.5cqw; }
.qt { color: #fff; text-shadow: .2cqw .2cqw 0 var(--outline), -.2cqw .2cqw 0 var(--outline), .2cqw -.2cqw 0 var(--outline), -.2cqw -.2cqw 0 var(--outline), 0 .5cqw 0 var(--outline); }
.qrcard { border: .45cqw solid var(--outline); box-shadow: 0 .6cqw 0 var(--outline), 0 0 4cqw rgba(57, 243, 255, .5); }
.pin { color: #fff; text-shadow: var(--ol); }
.pin b { color: var(--gold); text-shadow: .3cqw .3cqw 0 var(--outline), -.3cqw .3cqw 0 var(--outline), .3cqw -.3cqw 0 var(--outline), -.3cqw -.3cqw 0 var(--outline), 0 .7cqw 0 var(--outline); }
.players h3 { color: #fff; text-shadow: var(--ol); }
.pchip, .lrow, .rest span, .setup, .warnbox { border: .3cqw solid var(--outline) !important; box-shadow: 0 .4cqw 0 rgba(13, 15, 51, .6); background: var(--panel2); }
.hans .ans { border-width: .35cqw; }
.hans .ans .L { border-width: .25cqw; }
.ring { border: .4cqw solid var(--outline); }
.ring b { border: .4cqw solid var(--outline); background: #fff; color: var(--outline); }
.ring.hurry b { color: var(--ko); }
.counter b { color: #fff; text-shadow: var(--ol); }
.counter span, .stats, .lbfoot, .waiting { color: #fff; text-shadow: 0 .15cqw 0 rgba(13, 15, 51, .7); }
.media { border: .4cqw solid var(--outline); box-shadow: 0 .5cqw 0 var(--outline); }
.bars .col i { border: .35cqw solid var(--outline); }
.bars .col span { color: #fff; text-shadow: var(--ol); }
.cd p { color: #fff; text-shadow: var(--ol); }
.cd b { text-shadow: .5cqw .5cqw 0 var(--outline), -.5cqw .5cqw 0 var(--outline), .5cqw -.5cqw 0 var(--outline), -.5cqw -.5cqw 0 var(--outline), 0 1.2cqw 0 var(--outline); }
.lrow .track { border: .2cqw solid var(--outline); background: #fff; }
.lrow .track i { background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .3) 0 .6cqw, transparent .6cqw 1.2cqw), linear-gradient(90deg, var(--d), var(--gold)); }
.lrow.p1 { box-shadow: 0 0 0 .3cqw var(--gold), 0 .4cqw 0 rgba(13, 15, 51, .6); }
.podium .pl .blk { border: .4cqw solid var(--outline); }
.podium .pl .nm { color: #fff; text-shadow: var(--ol); }
.setup input, .setup textarea { background: #fff; color: var(--outline); border: .25cqw solid var(--outline); }
.setup .btn { border: .3cqw solid var(--outline); }
