:root {
  --bg: #1a1040;
  --panel: rgba(24, 14, 60, 0.92);
  --ink: #fff7e8;
  --muted: #b8aee0;
  --red: #ff4b4b;
  --blue: #3d7bff;
  --yellow: #ffd23d;
  --green: #3ddc6a;
  --pink: #ff5ab4;
  --pixel: 'Press Start 2P', monospace;
  --round: 'Baloo 2', 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--round); user-select: none; -webkit-user-select: none; touch-action: none; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }

button { font-family: var(--round); cursor: pointer; border: 0; color: var(--ink); }
.big {
  display: block; width: 100%; padding: 14px 22px; margin: 8px 0; font-size: 22px; font-weight: 800; letter-spacing: 1px;
  border-radius: 16px; background: #5a3ac0; box-shadow: 0 6px 0 #2a1a70, 0 10px 20px rgba(0,0,0,.35);
  transition: transform .08s, box-shadow .08s; text-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.big:hover { transform: translateY(-2px); filter: brightness(1.1); }
.big:active { transform: translateY(4px); box-shadow: 0 2px 0 #2a1a70; }
.c1 { background: var(--red); box-shadow: 0 6px 0 #9a1a2a, 0 10px 20px rgba(0,0,0,.35); }
.c2 { background: var(--blue); box-shadow: 0 6px 0 #1a3a9a, 0 10px 20px rgba(0,0,0,.35); }
.c3 { background: #e0a020; box-shadow: 0 6px 0 #8a5a10, 0 10px 20px rgba(0,0,0,.35); }
.c5 { background: var(--pink); box-shadow: 0 6px 0 #9a1a6a, 0 10px 20px rgba(0,0,0,.35); }
.c4 { background: var(--green); box-shadow: 0 6px 0 #1a7a3a, 0 10px 20px rgba(0,0,0,.35); }
.small { padding: 8px 14px; border-radius: 12px; background: rgba(255,255,255,.14); font-size: 18px; font-weight: 700; }
.small:hover { background: rgba(255,255,255,.25); }

/* ---------- schermate ---------- */
#ui { position: fixed; inset: 0; pointer-events: none; }
.screen { position: absolute; inset: 0; pointer-events: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
#scr-title { justify-content: center; gap: 10px; }
.logo { margin: 0 0 10px; text-align: center; font-family: var(--pixel); line-height: 1.1; filter: drop-shadow(0 6px 0 rgba(0,0,0,.45)); }
.logo span { display: block; }
/* BimBam BOOM!: "BimBam" storto che rimbalza, "BOOM!" che esplode su una stella di fuoco */
.logo .bb { font-size: clamp(24px, 5.5vw, 48px); color: #7ae0ff; transform: rotate(-4deg); animation: bimbam 0.9s ease-in-out infinite; text-shadow: 3px 3px 0 #2a1a6a; }
.logo .boom { position: relative; margin-top: 6px; font-size: clamp(40px, 9.5vw, 86px); }
.logo .boom b { position: relative; color: #ffe03a; text-shadow: -2px -2px 0 #c81e1e, 2px -2px 0 #c81e1e, -2px 2px 0 #c81e1e, 4px 4px 0 #c81e1e, 7px 7px 0 #5a0a2a; display: inline-block; animation: boom 2.4s ease-in-out infinite; }
.logo .burst { position: absolute; left: 50%; top: 50%; width: 4.6em; height: 2.5em; transform: translate(-50%, -50%); background: radial-gradient(circle, #fff6a0 0, #ffb020 45%, #ff4b1a 75%); clip-path: polygon(50% 0, 58% 30%, 80% 6%, 70% 36%, 100% 26%, 77% 50%, 100% 74%, 70% 64%, 80% 94%, 58% 70%, 50% 100%, 42% 70%, 20% 94%, 30% 64%, 0 74%, 23% 50%, 0 26%, 30% 36%, 20% 6%, 42% 30%); animation: burst 2.4s ease-in-out infinite; }
@keyframes bimbam { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-4px); } }
@keyframes boom { 0%, 70%, 100% { transform: scale(1) rotate(-2deg); } 76% { transform: scale(1.25) rotate(3deg); } 82% { transform: scale(0.95) rotate(-3deg); } 88% { transform: scale(1.08) rotate(1deg); } }
@keyframes burst { 0%, 70%, 100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); } 76% { transform: translate(-50%, -50%) scale(1.35) rotate(12deg); } 90% { transform: translate(-50%, -50%) scale(1.05) rotate(-4deg); } }
@keyframes wob { 0%,100% { transform: rotate(-2deg) scale(1); } 50% { transform: rotate(2deg) scale(1.05); } }
.menu { width: min(360px, 90vw); }
.corner { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 8px; }

.panel-screen { background: rgba(10, 6, 30, .35); padding-top: 58px; }
.panel { background: var(--panel); border: 3px solid rgba(255,255,255,.12); border-radius: 24px; padding: 18px 22px 22px; width: min(480px, 100%); max-height: 100%; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.panel.wide { width: min(980px, 100%); }
.panel header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.panel h2 { margin: 0; font-family: var(--pixel); font-size: 20px; color: var(--yellow); }
.back { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.12); font-size: 18px; }
.intro, .hint { color: var(--muted); font-size: 16px; line-height: 1.35; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0; flex-wrap: wrap; }
.row label { font-weight: 700; font-size: 17px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { padding: 8px 14px; border-radius: 12px; background: rgba(255,255,255,.1); font-size: 16px; font-weight: 700; }
.seg button.on { background: var(--yellow); color: #2a1a00; }
input { font: inherit; font-size: 17px; padding: 10px 12px; border-radius: 12px; border: 2px solid rgba(255,255,255,.2); background: rgba(0,0,0,.3); color: var(--ink); min-width: 200px; user-select: text; -webkit-user-select: text; }
.go { margin-top: 14px; }

.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 6px 0 10px; }
.gcard { background: rgba(255,255,255,.08); border-radius: 16px; padding: 12px 8px; text-align: center; border: 3px solid transparent; }
.gcard .ic { font-size: 38px; display: block; }
.gcard .nm { font-weight: 800; font-size: 15px; line-height: 1.1; display: block; margin-top: 4px; }
.gcard.on { border-color: var(--yellow); background: rgba(255,210,61,.18); }

.chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 10px; }
.chapters .world { grid-column: 1 / -1; margin: 10px 0 0; font-size: 18px; color: var(--yellow); }
.chap { text-align: left; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.08); }
.chap .n { font-family: var(--pixel); font-size: 11px; color: var(--muted); }
.chap .t { display: block; font-size: 18px; font-weight: 800; margin: 4px 0; }
.chap .b { font-size: 14px; color: var(--muted); }
.chap.done { background: rgba(61,220,106,.18); }
.chap.locked { opacity: .4; cursor: not-allowed; }
.chap.next { background: rgba(255,210,61,.2); outline: 3px solid var(--yellow); }

.help { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.help > div, .help-games > div { background: rgba(255,255,255,.07); padding: 10px 14px; border-radius: 14px; }
.help h3 { margin: 4px 0; }
.help p { margin: 4px 0; color: var(--muted); line-height: 1.4; }
.help-games { display: grid; gap: 8px; margin-top: 12px; }
.help-games b { color: var(--yellow); }

.spinner { width: 54px; height: 54px; margin: 10px auto; border: 6px solid rgba(255,255,255,.2); border-top-color: var(--yellow); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#online-wait { text-align: center; }
.on-actions { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.on-help { margin-top: 10px; background: rgba(0,0,0,.25); border-radius: 14px; padding: 10px 14px; }
.on-help summary { font-weight: 800; cursor: pointer; }
.on-help p { color: var(--muted); font-size: 15px; line-height: 1.35; margin: 8px 0; }
#on-lobbies { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; max-height: 50vh; overflow-y: auto; }
.lrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.12); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.lrow b { flex: 1; }
.lrow small, .lmem small { color: var(--muted); }
.badge { font-size: 13px; font-weight: 800; padding: 3px 8px; border-radius: 10px; white-space: nowrap; }
.badge.good { background: #2fae5a; } .badge.ok { background: #3a6aff; } .badge.bad { background: #d8402a; } .badge.new { background: #8a6aff; }
.ping { font-size: 13px; font-weight: 800; white-space: nowrap; } .ping.g { color: #6aff8a; } .ping.m { color: #ffd23d; } .ping.b { color: #ff6a5a; }
#lb-members { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.lmem { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.07); }
.lmem b { flex: 1; }
.lmem.empty { opacity: .45; }
select { font: inherit; font-size: 16px; padding: 8px 10px; border-radius: 12px; border: 2px solid rgba(255,255,255,.2); background: #1a1440; color: var(--ink); max-width: 60vw; }
#on-status { font-size: 18px; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
/* schede sui bordi: 1-2 sul lato sinistro, 3-4 sul destro, piccole e su due righe, fuori dal campo */
#cards { position: absolute; inset: 0; pointer-events: none; }
#cards .card { position: absolute; width: 96px; flex-direction: column; align-items: flex-start; gap: 0; padding: 2px 6px 3px; border-radius: 8px; background: rgba(14, 8, 40, .42); }
#cards .card:nth-child(1) { left: max(4px, env(safe-area-inset-left)); top: 22%; }
#cards .card:nth-child(2) { left: max(4px, env(safe-area-inset-left)); top: calc(22% + 52px); }
#cards .card:nth-child(3) { right: max(4px, env(safe-area-inset-right)); top: 22%; }
#cards .card:nth-child(4) { right: max(4px, env(safe-area-inset-right)); top: calc(22% + 52px); }
#cards .card:nth-child(n+3) { align-items: flex-end; border-left: 0; border-right: 4px solid; }
.card { display: flex; align-items: center; gap: 5px; background: rgba(14, 8, 40, .5); border-radius: 9px; padding: 1px 7px; min-width: 0; flex: 0 1 auto; border-left: 4px solid; line-height: 1.25; }
.card .nm { font-weight: 800; font-size: 11px; white-space: nowrap; max-width: 84px; overflow: hidden; text-overflow: ellipsis; }
.card .nm .me { background: var(--yellow); color: #2a1a00; border-radius: 4px; padding: 0 3px; font-size: 9px; margin-right: 3px; }
.card .tr { font-size: 9px; letter-spacing: 0; white-space: nowrap; }
.card .tr:empty { display: none; }
.card .tr .off { filter: grayscale(1); opacity: .35; }
.card .st { font-size: 11px; color: #e8e0ff; white-space: nowrap; font-weight: 700; }
.card.dead { opacity: .4; }
#timer { position: absolute; top: max(6px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); font-family: var(--pixel); font-size: 12px; text-shadow: 0 2px 0 #000; }
#timer.hurry { color: var(--red); }
#banner { position: absolute; top: 52px; left: 0; right: 0; text-align: center; font-family: var(--pixel); font-size: clamp(14px, 3vw, 24px); text-shadow: 0 3px 0 #000, 0 0 18px rgba(0,0,0,.6); animation: pop .3s ease-out; }
@media (max-height: 500px) { #banner { top: 44px; } }
#btn-pause { position: absolute; top: max(4px, env(safe-area-inset-top)); right: 8px; pointer-events: auto; width: 40px; height: 40px; padding: 0; font-size: 16px; }
#center { position: absolute; top: 38%; left: 0; right: 0; text-align: center; font-family: var(--pixel); font-size: clamp(28px, 7vw, 64px); color: var(--yellow); text-shadow: 0 5px 0 #000, 0 0 30px rgba(0,0,0,.5); line-height: 1.3; }
#center small { display: block; font-size: .4em; color: var(--ink); }
#center.pop { animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(1.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

#intro, #end, #pause { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; pointer-events: auto; background: rgba(10,6,30,.45); }
#intro .panel, #end .panel { text-align: center; width: min(560px, 100%); }
#intro .ic { font-size: 64px; }
#intro h2 { font-size: 22px; margin: 6px 0 10px; }
#intro p { font-size: 17px; line-height: 1.4; margin: 8px 0; }
#intro .ctrl { color: var(--yellow); }
#intro .bar { height: 8px; background: rgba(255,255,255,.15); border-radius: 4px; overflow: hidden; margin-top: 12px; }
#intro .bar div { height: 100%; background: var(--yellow); }
#pause { background: rgba(10,6,30,.6); }
#pause .panel { width: min(360px, 100%); text-align: center; }
.podium { text-align: left; margin: 12px 0; }
.podium .pl { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; margin: 4px 0; background: rgba(255,255,255,.07); font-size: 18px; font-weight: 700; }
.podium .pl.win { background: rgba(255,210,61,.25); }
.podium .dot { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.podium .pl span:last-child { margin-left: auto; }
.story-text { color: var(--muted); font-size: 16px; line-height: 1.4; }

/* ---------- comandi touch ---------- */
#touch { position: absolute; inset: 0; pointer-events: none; }
.stick-zone { position: absolute; left: 0; bottom: 0; width: 50%; height: 65%; pointer-events: auto; touch-action: none; }
.stick { position: absolute; left: 120px; top: calc(100% - 110px); width: 130px; height: 130px; margin: -65px 0 0 -65px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.06) 0, rgba(255,255,255,.14) 70%); border: 2px solid rgba(255,255,255,.35); box-shadow: 0 0 18px rgba(120,180,255,.25), inset 0 0 20px rgba(255,255,255,.08); opacity: 0; transition: opacity .12s; pointer-events: none; }
.stick.on { opacity: 1; } /* il cerchio si vede solo mentre tieni il dito */
.knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(255,255,255,.75); box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.tbtn { position: absolute; pointer-events: auto; touch-action: none; width: 86px; height: 86px; border-radius: 50%; font-family: var(--pixel); font-size: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; --c: #ff4b6b; --c2: #ff9a3d;
  background: rgba(40, 20, 70, .75); border: 2px solid rgba(255,255,255,.6); /* per i telefoni vecchi senza color-mix */
  background: radial-gradient(circle at 35% 28%, rgba(255,255,255,.35) 0, rgba(255,255,255,0) 38%), linear-gradient(145deg, color-mix(in srgb, var(--c) 55%, #1a1030) 0%, color-mix(in srgb, var(--c2) 35%, #0c0820) 100%);
  border: 2px solid color-mix(in srgb, var(--c) 80%, #fff); box-shadow: 0 0 22px color-mix(in srgb, var(--c) 55%, transparent), inset 0 -6px 14px rgba(0,0,0,.45), inset 0 2px 6px rgba(255,255,255,.25); backdrop-filter: blur(6px); text-shadow: 0 0 10px var(--c); opacity: .92; transition: transform .06s, box-shadow .06s; }
/* pulsantiera a 4 colori (Segui la Sequenza): rosso su, blu destra, giallo giù, verde sinistra */
#touch [hidden] { display: none !important; }
.cpad { position: absolute; right: max(20px, env(safe-area-inset-right)); bottom: 20px; width: 240px; height: 240px; pointer-events: none; }
.cbtn { position: absolute; width: 92px; height: 92px; border-radius: 50%; pointer-events: auto; touch-action: none; font-size: 40px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 60%, #fff), var(--c) 60%, color-mix(in srgb, var(--c) 70%, #000));
  border: 4px solid rgba(255,255,255,.75); box-shadow: 0 6px 0 rgba(0,0,0,.35), 0 0 18px color-mix(in srgb, var(--c) 70%, transparent); cursor: pointer; }
.cbtn[data-c="0"] { left: 74px; top: 0; }
.cbtn[data-c="1"] { right: 0; top: 74px; }
.cbtn[data-c="2"] { left: 74px; bottom: 0; }
.cbtn[data-c="3"] { left: 0; top: 74px; }
.cbtn.down { transform: translateY(4px) scale(.92); box-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 34px var(--c); }
@media (max-height: 460px) { .cpad { width: 200px; height: 200px; } .cbtn { width: 76px; height: 76px; font-size: 32px; } .cbtn[data-c="0"], .cbtn[data-c="2"] { left: 62px; } .cbtn[data-c="1"], .cbtn[data-c="3"] { top: 62px; } }
.tbtn small { font-family: var(--round); font-size: 10px; font-weight: 800; margin-top: 3px; letter-spacing: .5px; opacity: .9; text-shadow: none; }
.tbtn.down { transform: scale(.9); box-shadow: 0 0 34px color-mix(in srgb, var(--c) 90%, transparent), inset 0 4px 14px rgba(0,0,0,.55); opacity: 1; }
.btn-a { right: max(24px, env(safe-area-inset-right)); bottom: 40px; width: 100px; height: 100px; --c: #ff3d71; --c2: #ff9a3d; }
.btn-b { right: max(140px, calc(env(safe-area-inset-right) + 116px)); bottom: 24px; --c: #3d8bff; --c2: #3ad8ff; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: rgba(14,8,40,.92); padding: 10px 18px; border-radius: 14px; font-weight: 700; z-index: 10; max-width: 90vw; text-align: center; }

/* ---------- portafoglio, scheda gioco, negozio ---------- */
#wallet { position: absolute; top: max(10px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); pointer-events: auto; z-index: 5; display: flex; gap: 12px; align-items: center; padding: 8px 14px; border-radius: 14px; background: rgba(10,6,30,.75); border: 2px solid rgba(255,255,255,.15); font-size: 18px; font-weight: 800; }
#wallet small { font-size: 12px; color: var(--muted); }
.big small { font-size: .7em; opacity: .85; }
.gm-body { display: grid; grid-template-columns: 1fr 1.2fr; gap: 18px; align-items: start; }
.gm-ic { font-size: 64px; text-align: center; }
#gm-desc { font-size: 17px; line-height: 1.4; }
.gm-ctrl { color: var(--yellow); font-size: 15px; line-height: 1.35; }
.tabs { margin: 4px 0 10px; }
.chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ch { position: relative; background: rgba(255,255,255,.08); border-radius: 16px; padding: 8px; text-align: center; border: 3px solid transparent; display: flex; flex-direction: column; align-items: center; }
.ch img { width: 110px; height: 110px; }
.ch .nm { font-weight: 800; font-size: 15px; line-height: 1.1; }
.ch .ds { font-size: 12px; color: var(--muted); line-height: 1.2; margin: 4px 0 6px; min-height: 30px; }
.ch .act { width: 100%; padding: 6px; border-radius: 10px; font-weight: 800; font-size: 15px; background: var(--blue); }
.ch .act.buy { background: #e0a020; }
.ch .act.no { background: rgba(255,255,255,.12); color: var(--muted); }
.ch.sel { border-color: var(--yellow); background: rgba(255,210,61,.16); }
.ch.lock img { filter: brightness(.55) saturate(.6); }
.energy { display: grid; gap: 12px; }
.energy .now { font-size: 20px; font-weight: 800; text-align: center; }
.energy .pack { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.08); font-size: 18px; font-weight: 800; }
.energy .pack button { padding: 8px 16px; border-radius: 12px; background: #e0a020; font-size: 17px; font-weight: 800; }
.reward { font-size: 22px; font-weight: 800; color: var(--yellow); margin: 6px 0; }

@media (max-width: 700px) {
  .gm-body { grid-template-columns: 1fr; }
  .card { min-width: 0; padding: 2px 8px 4px; }
  .card .nm { font-size: 12px; max-width: 80px; }
  .card .st, .card .tr { font-size: 11px; }
  #timer { font-size: 14px; }
  .big { font-size: 18px; padding: 12px 16px; }
}
@media (max-height: 500px) {
  .logo .bb { font-size: 20px; } .logo .boom { font-size: 36px; }
  .big { padding: 8px 14px; margin: 5px 0; font-size: 17px; }
  .panel { padding: 10px 14px 12px; border-radius: 18px; }
  #intro .ic { display: none; }
  #intro h2, #end h2 { font-size: 15px; margin: 2px 0 4px; }
  #intro p, .story-text { font-size: 13px; margin: 3px 0; line-height: 1.3; }
  #intro .panel, #end .panel { width: min(640px, 100%); }
  .podium .pl { font-size: 14px; padding: 3px 8px; margin: 2px 0; }
  .tbtn { width: 74px; height: 74px; font-size: 18px; }
  .btn-a { width: 86px; height: 86px; bottom: 22px; }
  .btn-b { right: max(122px, calc(env(safe-area-inset-right) + 100px)); bottom: 14px; }
  #scr-title .menu { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; width: min(560px, 92vw); }
  #scr-title .menu .big { font-size: 15px; }
  .logo { margin-bottom: 2px; }
  .gm-ic { font-size: 40px; }
  #gm-desc { font-size: 14px; }
  .ch img { width: 80px; height: 80px; }
}

/* modalità sviluppatore nel negozio */
.dev { margin-top: 14px; padding: 6px 10px; border: 2px dashed rgba(255,255,255,.15); border-radius: 12px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; font-size: 14px; }
.dev summary { cursor: pointer; opacity: .6; width: 100%; list-style: none; text-align: right; }
.dev input { flex: 1 1 140px; min-width: 0; padding: 8px; border-radius: 8px; border: 0; font: inherit; }
.dev label { display: flex; align-items: center; justify-content: flex-start; gap: 8px; flex: 1 1 200px; margin: 0; text-align: left; }

/* ---------- rarità nel negozio ---------- */
.ch { --rc: #b8b8c8; padding-top: 20px; }
.ch.r-rare { --rc: #3d9bff; border-color: rgba(61,155,255,.45); }
.ch.r-epic { --rc: #b05aff; border-color: rgba(176,90,255,.6); background: linear-gradient(160deg, rgba(176,90,255,.22), rgba(255,255,255,.06)); }
.ch.r-legendary { --rc: #ffb020; border-color: #ffb020; background: linear-gradient(160deg, rgba(255,176,32,.3), rgba(255,90,40,.1)); animation: legend 2.2s ease-in-out infinite; }
.ch.r-mythic { --rc: #ff3a8a; border-color: transparent; background: linear-gradient(rgba(30,14,60,.92), rgba(30,14,60,.92)) padding-box, linear-gradient(90deg, #ff3a3a, #ffd23d, #3ddc6a, #3d7bff, #b05aff, #ff3a3a) border-box; background-size: 100% 100%, 300% 100%; animation: rainbow 3s linear infinite; }
.ch.sel { border-color: var(--yellow) !important; }
@keyframes legend { 0%,100% { box-shadow: 0 0 6px rgba(255,176,32,.4); } 50% { box-shadow: 0 0 22px rgba(255,176,32,.9); } }
@keyframes rainbow { to { background-position: 0 0, 300% 0; } }
.ch .rar { position: absolute; top: 4px; left: 6px; font-size: 10px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--rc); }
.ch.r-legendary img, .ch.r-mythic img { filter: drop-shadow(0 0 8px var(--rc)); }
.ch.r-epic img { filter: drop-shadow(0 0 5px var(--rc)); }
.ch.lock.r-legendary img, .ch.lock.r-mythic img, .ch.lock.r-epic img { filter: brightness(.6) drop-shadow(0 0 8px var(--rc)); }
.ch .btns { display: flex; gap: 6px; width: 100%; margin-top: auto; }
.ch .btns .act { flex: 1; }
.ch .btns .act.eye { flex: 0 0 40px; background: rgba(255,255,255,.18); }
.ch .big-ic { font-size: 64px; line-height: 110px; height: 110px; }
@media (max-height: 500px) { .ch .big-ic { font-size: 46px; line-height: 80px; height: 80px; } }
.coinpacks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.cpack { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px 10px; border-radius: 16px; background: linear-gradient(160deg, rgba(255,210,61,.25), rgba(255,255,255,.06)); border: 3px solid rgba(255,210,61,.5); }
.cpack.best { border-color: var(--yellow); animation: legend 2s ease-in-out infinite; }
.cpack .ic { font-size: 34px; }
.cpack b { font-size: 20px; }
.cpack small { font-size: 12px; color: var(--green); font-weight: 800; }
.cpack .price { margin-top: 6px; background: var(--green); color: #0a2a10; border-radius: 10px; padding: 4px 16px; font-weight: 800; font-size: 17px; }
.cpack .tag { position: absolute; top: -10px; background: var(--red); border-radius: 8px; padding: 1px 8px; font-size: 11px; font-weight: 800; }
/* anteprima: si vede il personaggio sul disco del menu */
body.peek .panel-screen { opacity: 0; pointer-events: none; transition: opacity .2s; }
body.peek #wallet { opacity: 0; }

/* ---------- Storia: gemme ---------- */
.gems { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; }
.gems b { margin-right: 6px; color: var(--yellow); }
.gem { font-size: 22px; color: rgba(255,255,255,.15); }
.gem.on { color: var(--gc); text-shadow: 0 0 10px var(--gc); }
.chapters .world small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; line-height: 1.3; margin-top: 2px; }
.wgem { font-size: 13px; color: rgba(255,255,255,.3); margin-left: 6px; }
.wgem.on { color: var(--gc); text-shadow: 0 0 8px var(--gc); }

/* ---------- vincitore del round ---------- */
.wbox { display: flex; justify-content: center; align-items: center; gap: 4px; margin-bottom: -6px; }
.wface { width: clamp(80px, 18vh, 150px); height: clamp(80px, 18vh, 150px); animation: wwig .5s ease-in-out infinite alternate; filter: drop-shadow(0 6px 0 rgba(0,0,0,.4)); }
.wemo { font-size: clamp(40px, 9vh, 72px); font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif; animation: wemo .45s ease-in-out infinite alternate; }
@keyframes wwig { from { transform: rotate(-8deg) scale(1); } to { transform: rotate(8deg) scale(1.08); } }
@keyframes wemo { from { transform: translateY(0) rotate(-10deg); } to { transform: translateY(-14px) rotate(12deg) scale(1.15); } }

/* ---------- podio finale: pannello a destra, vincitore a sinistra ---------- */
#end.final { justify-content: flex-end; background: linear-gradient(90deg, transparent 40%, rgba(10,6,30,.55)); }
#end.final .panel { width: min(440px, 50%); max-height: 100%; }
#hud.final #cards, #hud.final #timer, #hud.final #banner, #hud.final #center, #hud.final #touch, #hud.final #btn-pause { display: none; }

/* scelta della lingua */
.langs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.langs .big { margin: 0; }
@media (max-width: 500px) { .langs { grid-template-columns: 1fr; } }

/* nome del giocatore (in basso a sinistra nel menu) */
.corner-l { position: absolute; left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); }
.namechip { width: auto !important; padding: 0 14px; font-size: 15px; font-weight: 800; max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#name-input { width: 100%; font-size: 22px; padding: 10px 14px; border-radius: 14px; border: 3px solid rgba(255,255,255,.3); background: rgba(0,0,0,.3); color: #fff; text-align: center; font-weight: 800; margin: 8px 0; box-sizing: border-box; }

/* cursori del volume */
.vol-box { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 12px; text-align: left; }
.vol-row { display: grid; grid-template-columns: 6.4em minmax(0, 1fr) 2.8em; align-items: center; gap: 8px; font-weight: 800; }
.vol-row input[type=range] { width: 100%; min-width: 0; margin: 0; accent-color: #ffd23d; height: 28px; }
.vol-row b { text-align: right; font-variant-numeric: tabular-nums; }

/* zona swipe per i lanci (Barattoli, Pesciolini): tutto lo schermo, la riga mostra direzione e forza */
.swipe-zone { position: absolute; inset: 0; pointer-events: auto; touch-action: none; cursor: crosshair; }
.swipe-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity .1s; }
.swipe-zone.on .swipe-line { opacity: 1; }
.swipe-line line { stroke: #fff; stroke-width: 8; stroke-linecap: round; stroke-dasharray: 2 14; filter: drop-shadow(0 0 6px rgba(255,210,61,.9)); }
.swipe-line circle { fill: rgba(255,210,61,.8); stroke: #fff; stroke-width: 3; }
.swipe-hint { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); font-size: 46px; opacity: .55; animation: swipeHint 1.6s ease-in-out infinite; pointer-events: none; }
.swipe-zone.used .swipe-hint { display: none; }
@keyframes swipeHint { 0% { transform: translate(-50%, 40px); opacity: 0; } 30% { opacity: .7; } 100% { transform: translate(-50%, -90px); opacity: 0; } }
/* Salto in Lungo: A a sinistra, B a destra, SALTA in mezzo */
.runpad { position: absolute; inset: 0; pointer-events: none; }
.rbtn { position: absolute; bottom: max(26px, env(safe-area-inset-bottom)); pointer-events: auto; touch-action: none; width: 118px; height: 118px; border-radius: 50%; font-family: var(--pixel); font-size: 38px; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; --c: #ff3d71;
  background: radial-gradient(circle at 35% 28%, rgba(255,255,255,.35) 0, rgba(255,255,255,0) 38%), rgba(40, 20, 70, .78); border: 3px solid var(--c); box-shadow: 0 0 22px var(--c), inset 0 -6px 14px rgba(0,0,0,.45); text-shadow: 0 0 10px var(--c); transition: transform .05s; }
.rbtn.down { transform: scale(.9); box-shadow: 0 0 40px var(--c), inset 0 4px 14px rgba(0,0,0,.55); }
.rbtn-a { left: max(26px, env(safe-area-inset-left)); --c: #ff3d71; }
.rbtn-b { right: max(26px, env(safe-area-inset-right)); --c: #3dd6ff; }
.rbtn-j { left: 50%; margin-left: -70px; width: 140px; height: 84px; border-radius: 42px; font-size: 18px; --c: #ffd23d; bottom: max(40px, env(safe-area-inset-bottom)); }
@media (max-height: 460px) { .rbtn { width: 96px; height: 96px; font-size: 30px; } .rbtn-j { width: 120px; height: 70px; margin-left: -60px; font-size: 15px; } }
/* il tasto pausa resta cliccabile anche sopra la zona swipe */
#btn-pause { z-index: 4; }
/* SALTA sta sopra B, centrato, così si preme col pollice destro */
.rbtn-j { left: auto; margin-left: 0; right: max(15px, calc(env(safe-area-inset-right) - 11px)); bottom: max(160px, calc(env(safe-area-inset-bottom) + 134px)); }
@media (max-height: 460px) { .rbtn-j { right: max(14px, calc(env(safe-area-inset-right) - 12px)); bottom: 136px; } }
/* pausa, presentazione e fine partita stanno SOPRA ai comandi touch (swipe compreso) */
#intro, #end, #pause { z-index: 6; }
/* titoli delle categorie nella lista Arcade: occupano tutta la riga */
.gcat { grid-column: 1 / -1; margin: 14px 4px 2px; font-size: 17px; color: var(--yellow); text-align: left; border-bottom: 2px solid rgba(255,255,255,.12); padding-bottom: 4px; }
.gcat:first-child { margin-top: 2px; }

/* pannello sviluppatore: sempre aperto, tasto ripristina grande */
.dev .dev-t { width: 100%; opacity: .6; text-align: right; }
.dev button.c2:not(.small) { flex: 1 1 100%; font-size: 18px; padding: 14px; }

/* classifiche */
.top-list { list-style: none; padding: 0; margin: 8px 0; max-height: 52vh; overflow-y: auto; }
.top-list li { display: flex; gap: 10px; align-items: center; padding: 8px 12px; margin: 4px 0; border-radius: 12px; background: rgba(255,255,255,.07); font-weight: 700; }
.top-list li.mine { background: rgba(255,210,61,.28); }
.top-list .pos { width: 34px; text-align: center; font-family: var(--pixel); }
.top-list .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-list .val { color: var(--yellow); }
.top-me { font-weight: 800; margin: 6px 0; }
#scr-top h2 { font-size: 17px; overflow-wrap: anywhere; }

/* lobby online: impostazioni dell'host (per gli altri solo da leggere) */
#lb-cfg .ro, #lb-cfg button.ro { pointer-events: none; opacity: .85; }
.lb-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.lb-list .chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px; background: rgba(255,255,255,.1); font-weight: 700; font-size: 14px; }
.lb-list .chip button { padding: 0 6px; background: rgba(255,80,80,.35); border-radius: 8px; font-size: 13px; }
.lb-tbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
#lb-picker { margin-top: 8px; }
.lb-pick-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; position: sticky; top: 0; z-index: 1; background: rgba(20,12,50,.95); padding: 6px; border-radius: 10px; }

/* ONLINE a tutto schermo: a sinistra i giocatori, a destra PARTITA SINGOLA / TORNEO */
.online-panel { width: min(1180px, 100%); height: 100%; display: flex; flex-direction: column; }
.on-grid { display: grid; grid-template-columns: minmax(230px, 33%) 1fr; gap: 16px; flex: 1; min-height: 0; }
.on-left, .on-right { overflow-y: auto; min-height: 0; }
.on-left { background: rgba(255,255,255,.05); border-radius: 18px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.on-left h3 { margin: 2px 0; }
.on-left .lmem { margin: 0; }
.on-namebox { display: flex; flex-direction: column; gap: 4px; font-size: 14px; opacity: .9; margin-top: 4px; }
.on-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modecard { padding: 16px 14px; border-radius: 18px; background: rgba(255,255,255,.08); border: 3px solid transparent; text-align: left; display: flex; flex-direction: column; gap: 6px; min-height: 92px; }
.modecard b { font-size: 19px; }
.modecard small { font-size: 13px; opacity: .8; font-weight: 600; }
.modecard.on { border-color: var(--yellow); background: rgba(255,210,61,.2); box-shadow: 0 0 18px rgba(255,210,61,.35); }
.modecard.ro { pointer-events: none; }
.modecard.ro:not(.on) { opacity: .45; }
.on-box { background: rgba(255,255,255,.05); border-radius: 14px; padding: 10px 12px; margin: 10px 0; }
.pickbtn { width: 100%; font-size: 18px; font-weight: 800; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.12); margin-bottom: 6px; }
.startbtn { width: 100%; }
@media (max-width: 700px) { .on-grid { grid-template-columns: 1fr; } .on-modes { grid-template-columns: 1fr; } }

/* aggiornamento dell'APK (apk-updater.js) */
#apk-update { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(10, 6, 30, 0.82); }
#apk-update[hidden] { display: none; }
#apk-update .apk-box { max-width: 460px; width: calc(100% - 32px); text-align: center; }
#apk-update .apk-notes { white-space: pre-line; opacity: 0.9; }
#apk-update .apk-size, #apk-update .apk-msg { font-size: 0.9em; opacity: 0.85; min-height: 1.2em; }
#apk-update .apk-bar { height: 14px; border-radius: 7px; background: rgba(255, 255, 255, 0.15); overflow: hidden; margin: 10px 0; }
#apk-update .apk-bar > div { height: 100%; width: 0; background: #ffd23d; transition: width 0.25s; }
#apk-update .apk-btns { display: flex; flex-direction: column; gap: 8px; align-items: center; margin-top: 10px; }

/* =====================================================================
   IDENTITÀ BimBam BOOM! — stile cartoon da fumetto
   Contorno "inchiostro" spesso (lo stesso colore dei contorni dei personaggi 3D), ombre piene
   sfalsate, titoli come adesivi storti, retino a puntini, nuvolette. I font sono dentro il gioco
   (client/fonts, licenza OFL): funzionano anche senza internet.
   ===================================================================== */
@font-face { font-family: 'Lilita One'; src: url('fonts/lilita-one.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Baloo 2'; src: url('fonts/baloo-2-500.woff2') format('woff2'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: 'Baloo 2'; src: url('fonts/baloo-2-700.woff2') format('woff2'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'Baloo 2'; src: url('fonts/baloo-2-800.woff2') format('woff2'); font-weight: 800 900; font-display: swap; }
@font-face { font-family: 'Press Start 2P'; src: url('fonts/press-start-2p.woff2') format('woff2'); font-display: swap; }

:root {
  --line: #1a1026;                 /* inchiostro: bordi e ombre di tutto */
  --display: 'Lilita One', 'Baloo 2', 'Segoe UI', Arial, sans-serif;
  --paper: #2c1a6e;                /* fondo dei pannelli */
  --paper2: #3a2490;
  /* testo bordato d'inchiostro (come le scritte dei cartoni) */
  --outline: 2px 0 0 var(--line), -2px 0 0 var(--line), 0 2px 0 var(--line), 0 -2px 0 var(--line),
    1.5px 1.5px 0 var(--line), -1.5px 1.5px 0 var(--line), 1.5px -1.5px 0 var(--line), -1.5px -1.5px 0 var(--line), 0 4px 0 var(--line);
  --dots: radial-gradient(rgba(255,255,255,.07) 1.5px, transparent 1.6px);
}

/* ---------- pulsanti ---------- */
.big {
  font-family: var(--display); font-weight: 400; letter-spacing: .5px; font-size: 24px;
  border: 3px solid var(--line); border-radius: 18px;
  box-shadow: 0 6px 0 var(--line), 0 12px 18px rgba(0,0,0,.28);
  background-image: linear-gradient(180deg, rgba(255,255,255,.28) 0, rgba(255,255,255,.08) 45%, rgba(0,0,0,0) 46%);
  text-shadow: var(--outline);
  transition: transform .12s cubic-bezier(.3,1.6,.5,1), box-shadow .08s, filter .1s;
}
.big:hover { transform: translateY(-2px) rotate(-1.2deg) scale(1.02); filter: brightness(1.08); }
.big:active { transform: translateY(5px) scale(.99); box-shadow: 0 1px 0 var(--line), 0 4px 8px rgba(0,0,0,.25); }
.c1, .c2, .c3, .c4, .c5 { box-shadow: 0 6px 0 var(--line), 0 12px 18px rgba(0,0,0,.28); }
.c1 { background-color: var(--red); } .c2 { background-color: var(--blue); } .c3 { background-color: #f0a820; }
.c4 { background-color: var(--green); } .c5 { background-color: var(--pink); }
.big:not(.c1):not(.c2):not(.c3):not(.c4):not(.c5) { background-color: #6a44d8; }
/* il menu principale: i pulsanti ballano un po' in sequenza */
.menu .big { animation: menuIn .45s cubic-bezier(.3,1.6,.5,1) backwards; } /* backwards: finita l entrata il pulsante torna libero di abbassarsi quando lo premi */
.menu .big:nth-child(2) { animation-delay: .05s; } .menu .big:nth-child(3) { animation-delay: .1s; }
.menu .big:nth-child(4) { animation-delay: .15s; } .menu .big:nth-child(5) { animation-delay: .2s; } .menu .big:nth-child(6) { animation-delay: .25s; }
@keyframes menuIn { from { transform: translateY(18px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }

.small {
  font-family: var(--round); border: 3px solid var(--line); background: var(--paper2);
  box-shadow: 0 4px 0 var(--line); transition: transform .1s;
}
.small:hover { background: #4a30b0; transform: translateY(-1px); }
.small:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.back {
  border: 3px solid var(--line); background: var(--yellow); color: var(--line); font-weight: 800;
  box-shadow: 0 4px 0 var(--line); border-radius: 14px;
}
.back:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }

/* ---------- pannelli ---------- */
.panel-screen { background: rgba(10, 6, 30, .38) var(--dots); background-size: auto, 14px 14px; }
.panel {
  background: var(--paper) var(--dots); background-size: 14px 14px;
  border: 4px solid var(--line); border-radius: 28px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.07), 0 10px 0 var(--line), 0 26px 50px rgba(0,0,0,.45);
}
/* titolo del pannello: adesivo giallo storto */
.panel h2 {
  font-family: var(--display); font-size: 26px; color: var(--yellow); text-shadow: var(--outline);
  display: inline-block; transform: rotate(-2deg); letter-spacing: .5px;
}
.intro, .hint { color: #d8d0f8; }

/* controlli a scelta e campi */
.seg button { border: 3px solid var(--line); background: var(--paper2); box-shadow: 0 3px 0 var(--line); font-family: var(--round); }
.seg button.on { background: var(--yellow); color: var(--line); transform: translateY(1px) rotate(-1deg); }
input, select { border: 3px solid var(--line); background: #140c34; box-shadow: inset 0 3px 0 rgba(0,0,0,.35); }

/* carte (giochi, capitoli, personaggi, modalità, monete): bordo d'inchiostro col box-shadow,
   così il bordo vero resta libero per i colori di stato (scelto, rarità...) */
.gcard, .chap, .ch, .modecard, .lmem, .podium .pl, .cpack {
  background-color: var(--paper2);
  box-shadow: 0 0 0 3px var(--line), 0 6px 0 3px var(--line);
  transition: transform .12s cubic-bezier(.3,1.6,.5,1);
}
.gcard:hover, .chap:hover, .ch:hover, .modecard:hover, .cpack:hover { transform: translateY(-3px) rotate(-1deg); }
.gcard .nm, .modecard b, .ch .nm { font-family: var(--display); font-weight: 400; letter-spacing: .3px; }
.gcard .ic { filter: drop-shadow(0 3px 0 var(--line)); }

/* ---------- in partita ---------- */
#banner, #center { font-family: var(--display); letter-spacing: 1px; text-shadow: var(--outline), 0 0 24px rgba(0,0,0,.45); }
#banner { font-size: clamp(18px, 3.6vw, 32px); }
#center { font-size: clamp(42px, 9vw, 92px); color: var(--yellow); }
#timer { font-family: var(--display); font-size: 22px; text-shadow: var(--outline); }
.card { border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); }
#cards .card { background: rgba(26, 16, 38, .62); }
.card .nm { font-family: var(--display); font-weight: 400; letter-spacing: .3px; }
.tbtn { border: 4px solid var(--line); box-shadow: 0 6px 0 var(--line), 0 10px 18px rgba(0,0,0,.35); font-family: var(--display); }
.tbtn small { font-family: var(--display); font-weight: 400; }
.tbtn.down { box-shadow: 0 1px 0 var(--line); }

/* messaggi: nuvoletta da fumetto */
#toast {
  background: #fffaf0; color: var(--line); border: 3px solid var(--line); border-radius: 18px;
  box-shadow: 0 5px 0 var(--line); font-weight: 800; padding: 10px 20px;
}
#toast::after {
  content: ''; position: absolute; left: 50%; bottom: -12px; width: 18px; height: 18px; background: #fffaf0;
  border-right: 3px solid var(--line); border-bottom: 3px solid var(--line); transform: translateX(-50%) rotate(45deg);
}

/* portafoglio in alto: pillola con bordo */
#wallet { border: 3px solid var(--line); box-shadow: 0 4px 0 var(--line); background: rgba(26, 16, 38, .85); font-family: var(--display); font-weight: 400; }

/* finestra dell'aggiornamento: stessa grafica */
#apk-update .apk-bar { border: 3px solid var(--line); height: 18px; border-radius: 10px; }
#apk-update .apk-bar > div { background: repeating-linear-gradient(-45deg, #ffd23d 0 10px, #ffb020 10px 20px); }

/* pressione dei pulsanti più evidente, e sui touch screen niente "mouse sopra" (dopo un tocco resterebbe attivo
   e il pulsante rimarrebbe sollevato e storto) */
@media (hover: none) {
  .big:hover, .small:hover, .gcard:hover, .chap:hover, .ch:hover, .modecard:hover, .cpack:hover { transform: none; filter: none; }
}
.big:active { transform: translateY(6px) scale(.97); box-shadow: 0 0 0 var(--line), 0 2px 6px rgba(0,0,0,.25); filter: brightness(.95); transition-duration: .04s; }
.small:active, .back:active { transform: translateY(4px) scale(.96); box-shadow: 0 0 0 var(--line); }

/* tocco veloce: il pulsante fa giù-e-su prima che parta l'azione (vedi TAP_MS in main.js) */
.tap { animation: tapPress .16s ease-out !important; }
@keyframes tapPress {
  0% { transform: none; }
  45% { transform: translateY(6px) scale(.97); box-shadow: 0 0 0 var(--line); filter: brightness(.95); }
  100% { transform: none; }
}

/* sposta l'account: codice grande, da dettare all'altro telefono */
.acct-box { margin-top: 18px; padding-top: 14px; border-top: 3px dashed rgba(255,255,255,.18); }
.acct-box h3 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; color: var(--yellow); text-shadow: var(--outline); font-size: 22px; }
.link-code { margin: 8px 0; padding: 12px; text-align: center; background: #fffaf0; color: var(--line); border: 3px solid var(--line); border-radius: 16px; box-shadow: 0 5px 0 var(--line); }
.link-code b { display: block; font-family: var(--display); font-size: 40px; letter-spacing: 4px; }
.link-code small { font-weight: 700; }
.link-row input { flex: 1; min-width: 140px; text-transform: uppercase; letter-spacing: 2px; font-weight: 800; }
