:root { --blue: #2F5BEA; --ink: #0A0A0A; --paper: #F2F2F2; --font: Arial, Helvetica, sans-serif; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--paper); font-family: var(--font); overflow: hidden; touch-action: none; }
.hand { font-weight: 900; text-transform: uppercase; }
[hidden] { display: none !important; }
input, textarea { user-select: text; -webkit-user-select: text; }

/* --- wall */
#wall { position: absolute; left: 50%; top: 50%; width: 1080px; height: 1920px; transform-origin: 50% 50%; background: #000; }
#wall > canvas { position: absolute; inset: 0; }
.badge { position: absolute; top: 60px; left: 80px; width: 260px; }
.audio-hint { position: absolute; right: 40px; top: 60px; font-size: 30px; font-weight: 700; background: rgba(0,0,0,.6); padding: 12px 22px; border: 3px solid var(--paper); }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.overlay h1 { font-size: 140px; margin: 0; line-height: .9; transform: rotate(-4deg); text-shadow: 10px 10px 0 var(--blue), 0 0 40px rgba(0,0,0,.5); }
.overlay p { font-size: 46px; padding: 0 60px; margin: 30px 0 0; text-shadow: 0 4px 20px #000; }
#stamp { justify-content: flex-start; padding-top: 330px; }
.count { font-size: 340px; font-weight: 900; color: var(--paper); text-shadow: 14px 14px 0 var(--blue); }
.score { font-size: 120px; font-weight: 900; transform: rotate(-5deg); text-shadow: 10px 10px 0 var(--blue); }
.score.big { font-size: 100px; white-space: nowrap; background: var(--blue); color: #fff; padding: 6px 44px; text-shadow: 8px 8px 0 var(--ink); box-shadow: 16px 16px 0 var(--ink); }
.pop { animation: pop .45s cubic-bezier(.2, 1.8, .4, 1) both; }
.count.pop { animation-duration: .35s; }
@keyframes pop { from { transform: scale(2.6) rotate(-14deg); opacity: 0; } to { transform: scale(1) rotate(-5deg); opacity: 1; } }
.spots { position: absolute; left: 0; right: 0; bottom: 70px; display: flex; justify-content: center; gap: 22px; }
.spots .th { position: relative; width: 130px; height: 230px; background-size: cover; background-position: center; border: 5px solid rgba(255,255,255,.35); opacity: .6; transition: all .2s; }
.spots .th .name { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 24px; font-weight: 900; text-shadow: 0 2px 6px #000; }
.th.on { border-color: var(--paper); opacity: 1; transform: translateY(-14px) scale(1.08); box-shadow: 10px 10px 0 var(--blue); }
.hud { position: absolute; top: 250px; left: 0; right: 0; display: flex; justify-content: center; align-items: center; gap: 22px; }
.hud .chip { font-size: 44px; font-weight: 900; background: var(--blue); color: #fff; padding: 6px 22px; transform: rotate(-3deg); }
.hud .ttl { font-size: 60px; font-weight: 900; letter-spacing: 1px; text-shadow: 6px 6px 0 #000; }
.arr { position: absolute; top: 46%; font-size: 120px; color: var(--paper); text-shadow: 8px 8px 0 var(--blue); animation: nudge 1s ease-in-out infinite; }
.arr.l { left: 30px; } .arr.r { right: 30px; animation-delay: .5s; }
@keyframes nudge { 50% { transform: scale(1.18); } }
.pick { position: absolute; bottom: 380px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; }
.pick.low { bottom: 160px; }
.pick small, .card-r small { font-size: 34px; letter-spacing: 6px; color: #9fb4ff; }
.pick b { font-size: 100px; font-weight: 900; line-height: 1; text-shadow: 8px 8px 0 var(--blue); }
.pick b.hand { font-size: 64px; }
.pick b.hint { font-size: 52px; padding: 0 70px; line-height: 1.1; }
.card-r { position: absolute; top: 360px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; }
.card-r b { font-size: 120px; font-weight: 900; line-height: 1; text-shadow: 10px 10px 0 var(--blue); }

/* --- pad e schermate dati/foto */
#pad { position: absolute; inset: 0; display: flex; flex-direction: column; }
.screen { display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center; padding: 3vh 4vw; gap: 2.5vh; }
.screen.on { display: flex; }
.screen h1 { font-size: min(13vw, 12vh); margin: 0; line-height: .9; text-align: center; transform: rotate(-4deg); text-shadow: .08em .08em 0 var(--blue); }
.screen h2 { font-size: min(6vw, 6vh); font-weight: 900; margin: 0; letter-spacing: 2px; }
.screen p { font-size: min(3vw, 2.8vh); margin: 0; opacity: .85; text-align: center; max-width: 80vw; }
.btn { font-family: var(--font); font-size: min(4.5vw, 4.5vh); font-weight: 900; letter-spacing: 2px; background: var(--paper); color: var(--ink); border: 0; padding: .45em 1.6em; box-shadow: .18em .18em 0 var(--blue); transform: rotate(-1.5deg); }
.btn:active { transform: rotate(-1.5deg) scale(.95); }
.btn.ghost { background: transparent; color: var(--paper); border: 3px solid var(--paper); box-shadow: none; }
.btn:disabled { opacity: .3; }
.row { display: flex; gap: 3vw; align-items: center; }
.prev { height: min(56vh, 100vw); aspect-ratio: 9/16; background-size: cover; background-position: center; border: 5px solid var(--paper); box-shadow: .4em .4em 0 var(--blue); touch-action: pan-y; }
#trickPrev { position: relative; }
#trickPrev img { position: absolute; left: 10%; bottom: 8%; width: 80%; }
.pname { font-size: min(6vw, 5vh); font-weight: 900; letter-spacing: 3px; text-align: center; }
.pname small { display: block; font-size: .45em; opacity: .7; letter-spacing: 2px; }
.pad-ctl { display: flex; gap: 4vw; align-items: center; }
.dir { width: min(16vw, 11vh); height: min(16vw, 11vh); border-radius: 50%; border: 4px solid var(--paper); background: transparent; color: var(--paper); font-size: min(6vw, 5vh); }
.dir:active { background: var(--blue); }
#draw { height: min(72vh, 150vw); aspect-ratio: 9/16; background-size: cover; background-position: center; border: 4px solid var(--paper); touch-action: none; }
#mini { height: min(62vh, 120vw); aspect-ratio: 9/16; background: #111; border: 3px solid #333; }
#shutter { width: min(30vw, 30vh); height: min(30vw, 30vh); border-radius: 50%; background: var(--paper); border: min(2vw, 2vh) solid var(--blue); font-family: var(--font); font-size: min(4vw, 4vh); color: var(--ink); }
#shutter:active { transform: scale(.93); }
#shutter:disabled { opacity: .3; }
.form { display: flex; flex-direction: column; gap: 1.5vh; width: min(80vw, 600px); font-size: min(2.6vw, 2.4vh); }
.form input[type=email] { font-size: 1.2em; padding: .5em; border: 0; }
.form label { display: flex; gap: .6em; align-items: flex-start; }
.form input[type=checkbox] { width: 1.4em; height: 1.4em; flex: none; }
.err { color: #ff6b6b; min-height: 1.2em; }
.cam { position: relative; width: min(70vw, 46vh); aspect-ratio: 1; overflow: hidden; border: 4px solid var(--paper); background: #111; }
.cam video, .cam canvas { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
#guide { position: absolute; inset: 0; pointer-events: none; }
.cam-hint { min-height: 1.4em; font: 700 min(4.5vw, 2.6vh) Arial, sans-serif; text-align: center; }
