/* SNZ Arcade — "Dumpling Rush". Estetica da sala giochi: blu notte, giallo e rosa al neon, font a pixel. */
:root {
  --arc-bg: #120b2b; --arc-panel: #1d1244; --arc-line: #3a2a7a;
  --arc-yellow: #ffd23f; --arc-pink: #ff4d8d; --arc-cyan: #3ee6ff; --arc-green: #5dff8f; --arc-red: #ff5a4d;
  --arc-font: 'Press Start 2P', 'Courier New', monospace;
}

/* ===== Home: striscia "Gioca e vinci" ===== */
#arcade_home_slot:empty { display: none; }
#arcade_home_slot { padding: 0 14px 12px; }
.arc-strip {
  width: 100%; min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  border: 2px solid var(--arc-yellow); border-radius: 14px; background: var(--arc-bg); color: #fff; text-align: left;
  box-shadow: 0 0 0 2px var(--arc-bg), 0 6px 18px rgba(18, 11, 43, .35);
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.arc-strip:active { transform: translateY(1px); }
.arc-strip:focus-visible, #arc_pill:focus-visible, .arc-overlay button:focus-visible, .arc-nick input:focus-visible { outline: 3px solid var(--arc-cyan); outline-offset: 2px; }
.arc-strip-ico { flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; background: var(--arc-pink); color: #fff; display: grid; place-items: center; font-size: 18px; }
.arc-strip-txt { flex: 1; min-width: 0; display: grid; gap: 5px; }
.arc-strip-txt b { font-family: var(--arc-font); font-size: 12px; line-height: 1.35; color: var(--arc-yellow); font-weight: 400; letter-spacing: .2px; white-space: nowrap; }
.arc-strip-txt small { font-size: 11.5px; color: #cfc6f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arc-strip-cta { flex-shrink: 0; padding: 9px 9px 8px; border-radius: 8px; background: var(--arc-yellow); color: var(--arc-bg); font-family: var(--arc-font); font-size: 10px; animation: arcBlink 1.1s steps(2, jump-none) infinite; }
.arc-strip.is-won { border-color: var(--arc-green); }
.arc-strip.is-won .arc-strip-ico { background: var(--arc-green); color: var(--arc-bg); }
.arc-strip.is-won .arc-strip-txt b { color: var(--arc-green); }
.arc-strip [data-arc-countdown] { font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.arc-strip [data-arc-countdown].is-urgent { color: var(--arc-red); }
@keyframes arcBlink { 50% { opacity: .35; } }

/* ===== Conto alla rovescia: pillola piccola in alto a destra, rossa sotto i 90 secondi ===== */
#arc_pill {
  position: fixed; z-index: 9500; top: calc(10px + env(safe-area-inset-top)); right: max(10px, calc((100vw - 720px) / 2 + 10px));
  height: 30px; padding: 0 11px 0 9px; display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-radius: 999px; background: rgba(18, 11, 43, .94); color: var(--arc-yellow);
  font: 800 12.5px/1 inherit; font-variant-numeric: tabular-nums; box-shadow: 0 3px 12px rgba(0, 0, 0, .28);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
#arc_pill[hidden] { display: none; }
#arc_pill i { font-size: 12px; }
#arc_pill b { font-weight: 800; }
#arc_pill span { color: #fff; min-width: 30px; text-align: right; }
#arc_pill.is-urgent { background: #d92d20; color: #fff; animation: arcPulse 1s ease-in-out infinite; }
@keyframes arcPulse { 50% { box-shadow: 0 0 0 5px rgba(217, 45, 32, .25); } }
/* Non deve coprire nulla: la campanella lascia il posto, la barra dei passi si accorcia, nel carrello sta accanto alla X. */
body.arc-has-win #snz-push-btn { display: none; }
body.arc-has-win .step-bar { padding-right: 86px; }
body.arc-has-win .step-bar-item { letter-spacing: 0; padding-right: 4px; }
/* Durante l'ordine la pillola mostra solo il tempo, così i quattro passi restano leggibili. */
body:has(.app-section.active) #arc_pill { top: calc(12px + env(safe-area-inset-top)); }
body:has(.app-section.active) #arc_pill b { display: none; }
body.arc-open #arc_pill, body:has(dialog[open]) #arc_pill, body:has(.cart-drawer.open) #arc_pill { display: none; }
/* Nel carrello il tempo sta nella riga dello sconto, sopra i totali. */
.arc-cart-hint { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 9px 11px; border-radius: 10px; background: #f3efff; color: #3b2a8c; font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.arc-cart-hint.is-on { background: #e9fbef; color: #14532d; }
.arc-cart-hint [data-arc-countdown] { font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
.arc-cart-hint [data-arc-countdown].is-urgent { color: #d92d20; }

/* ===== Schermo del gioco ===== */
body.arc-open { overflow: hidden; }
.arc-overlay {
  position: fixed; inset: 0; z-index: 9800; background: var(--arc-bg); color: #fff; overscroll-behavior: contain;
  font-family: var(--arc-font); display: flex; justify-content: center;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 3px);
}
.arc-overlay[hidden] { display: none; }
/* app.css assegna il font a ogni elemento (*): qui dentro vale quello a pixel, tranne le icone. */
.arc-overlay *:not(i) { font-family: var(--arc-font); }
.arc-overlay .arc-win-rule, .arc-overlay .arc-win-rule * { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }
.arc-frame { width: 100%; max-width: 480px; height: 100%; display: flex; flex-direction: column; padding: calc(8px + env(safe-area-inset-top)) 12px calc(10px + env(safe-area-inset-bottom)); }
.arc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; }
.arc-brand { font-size: 10px; color: var(--arc-cyan); letter-spacing: 1px; }
.arc-icon { width: 44px; height: 44px; border-radius: 10px; border: 2px solid var(--arc-line); background: var(--arc-panel); color: #fff; font-size: 16px; display: grid; place-items: center; touch-action: manipulation; }
.arc-screen { display: none; flex: 1; min-height: 0; flex-direction: column; align-items: center; overflow-y: auto; overscroll-behavior: contain; padding: 8px 2px 4px; }
.arc-screen.is-on { display: flex; }

.arc-logo { margin: 6px 0 10px; text-align: center; font-size: clamp(22px, 8vw, 34px); line-height: 1.25; font-weight: 400; }
.arc-logo span { display: block; color: var(--arc-yellow); text-shadow: 3px 3px 0 var(--arc-pink), 6px 6px 0 rgba(0, 0, 0, .35); }
.arc-logo span + span { color: #fff; text-shadow: 3px 3px 0 var(--arc-cyan), 6px 6px 0 rgba(0, 0, 0, .35); }
.arc-prize { margin: 0 0 12px; text-align: center; font-size: 10px; line-height: 1.9; color: #e9e3ff; }
.arc-prize b { color: var(--arc-green); }
.arc-prize small { display: block; font-size: 8px; color: #a99be0; }
.arc-how { list-style: none; display: flex; gap: 8px; margin: 0 0 8px; padding: 0; }
.arc-how li { width: 62px; padding: 8px 4px 7px; border-radius: 10px; border: 2px solid var(--arc-line); background: var(--arc-panel); display: grid; justify-items: center; gap: 7px; font-size: 9px; color: var(--arc-green); }
.arc-how li.is-bad { color: var(--arc-red); border-color: #6b2330; }
.arc-how canvas { height: 26px; width: auto; image-rendering: pixelated; }
.arc-tip { margin: 0 0 12px; font-size: 8px; line-height: 1.7; color: #a99be0; text-align: center; }
.arc-nick { width: 100%; max-width: 320px; display: grid; gap: 7px; margin-bottom: 10px; font-size: 8px; color: var(--arc-cyan); text-align: center; }
.arc-nick input { width: 100%; height: 46px; border-radius: 10px; border: 2px solid var(--arc-cyan); background: #0b0620; color: #fff; text-align: center; font-family: var(--arc-font); font-size: 16px; text-transform: uppercase; }
.arc-nick input::placeholder { color: #5a4d93; font-size: 12px; }
.arc-play { width: 100%; max-width: 320px; min-height: 54px; flex-shrink: 0; border: 0; border-radius: 12px; background: var(--arc-yellow); color: var(--arc-bg); font-family: var(--arc-font); font-size: 15px; box-shadow: 0 5px 0 #b98a00; touch-action: manipulation; }
.arc-play:active { transform: translateY(3px); box-shadow: 0 2px 0 #b98a00; }
.arc-play:disabled { opacity: .55; }
.arc-play i { font-size: 13px; margin: 0 4px; }
.arc-again { margin-top: 12px; min-height: 44px; padding: 0 14px; border: 2px solid var(--arc-line); border-radius: 10px; background: transparent; color: #cfc6f5; font-family: var(--arc-font); font-size: 9px; touch-action: manipulation; }
/* Modalità prova (il locale apre un gioco dal pannello): avviso e tasti per passare da un gioco all'altro */
.arc-preview { width: 100%; margin: 0 0 12px; padding: 9px 8px 8px; border: 2px dashed var(--arc-cyan); border-radius: 10px; text-align: center; }
.arc-preview p { margin: 0 0 8px; font-size: 7px; line-height: 1.6; color: var(--arc-cyan); }
.arc-preview div { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.arc-preview button { min-height: 32px; padding: 0 8px; border: 2px solid var(--arc-line); border-radius: 8px; background: transparent; color: #cfc6f5; font-size: 7px; touch-action: manipulation; }
.arc-preview button.is-on { border-color: var(--arc-yellow); background: var(--arc-yellow); color: var(--arc-bg); }
.arc-screen[data-screen="result"] .arc-preview { margin-top: 16px; }
.arc-msg { min-height: 16px; margin: 8px 0 0; font-size: 8px; line-height: 1.6; color: var(--arc-red); text-align: center; }

.arc-board { width: 100%; max-width: 320px; margin-top: 12px; padding: 12px 10px 8px; border-radius: 12px; border: 2px solid var(--arc-line); background: var(--arc-panel); }
.arc-board h3 { margin: 0 0 10px; text-align: center; font-size: 10px; font-weight: 400; color: var(--arc-pink); }
.arc-board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 9px; }
.arc-board-list li { display: grid; grid-template-columns: 26px 1fr auto; gap: 6px; align-items: center; color: #e9e3ff; }
.arc-board-list li:nth-child(1) { color: var(--arc-yellow); }
.arc-board-list li.is-me { color: var(--arc-green); }
.arc-board-list .rk { color: #7f71c2; }
.arc-board-list .nk { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arc-board-list .sc { font-variant-numeric: tabular-nums; }
.arc-board-empty, .arc-best { margin: 8px 0 2px; font-size: 8px; line-height: 1.7; color: #a99be0; text-align: center; }
.arc-best b { color: var(--arc-green); }

/* Partita */
.arc-screen[data-screen="game"] { overflow: hidden; padding-top: 6px; }
.arc-hud { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 6px; flex-shrink: 0; }
.arc-hud > div { display: grid; gap: 5px; }
.arc-hud > div:last-child { text-align: right; }
.arc-hud small { font-size: 7px; color: #a99be0; }
.arc-hud b { font-size: 16px; font-weight: 400; font-variant-numeric: tabular-nums; }
.arc-hud .is-low b { color: var(--arc-red); animation: arcBlink .5s steps(2, jump-none) infinite; }
.arc-combo { font-size: 8px; min-width: 96px; text-align: center; padding-bottom: 3px; color: #cfc6f5; }
.arc-combo.m2 { color: var(--arc-cyan); } .arc-combo.m3 { color: var(--arc-green); }
.arc-combo.m4 { color: var(--arc-pink); } .arc-combo.m5 { color: var(--arc-yellow); }
.arc-goal { position: relative; width: 100%; height: 18px; margin: 8px 0; flex-shrink: 0; border-radius: 6px; border: 2px solid var(--arc-line); background: #0b0620; overflow: hidden; }
.arc-goal i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--arc-pink); transition: width .15s linear; }
.arc-goal span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 7px; color: #fff; }
.arc-goal.is-hit i { background: var(--arc-green); }
.arc-goal.is-hit span { color: var(--arc-bg); }
.arc-stage { position: relative; flex: 1; min-height: 0; width: 100%; display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none; }
#arc_canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; border: 3px solid var(--arc-line); border-radius: 8px; background: #160d33; touch-action: none; }
.arc-count { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(34px, 14vw, 60px); color: var(--arc-yellow); text-shadow: 4px 4px 0 var(--arc-pink); pointer-events: none; }
.arc-count[hidden] { display: none; }
.arc-hint { margin: 8px 0 0; font-size: 7px; color: #7f71c2; flex-shrink: 0; }
.arc-overlay.is-playing .arc-brand { visibility: hidden; }

/* Risultato */
.arc-res-title { margin: 10px 0 12px; font-size: clamp(18px, 6.5vw, 26px); color: var(--arc-yellow); text-shadow: 3px 3px 0 var(--arc-pink); text-align: center; }
.arc-res-score { margin: 0 0 8px; display: grid; gap: 8px; justify-items: center; }
.arc-res-score small { font-size: 8px; color: #a99be0; }
.arc-res-score b { font-size: 26px; font-weight: 400; }
.arc-rank { margin: 0 0 12px; font-size: 8px; color: #cfc6f5; }
.arc-rank b { color: var(--arc-green); }
.arc-res-sub { max-width: 320px; margin: 4px 0 14px; font-size: 8.5px; line-height: 1.9; color: #e9e3ff; text-align: center; }
.arc-res-sub b { color: var(--arc-yellow); }
.arc-win { width: 100%; max-width: 320px; margin: 4px 0 2px; padding: 14px 12px 16px; border-radius: 14px; border: 2px solid var(--arc-green); background: #0e2a22; display: grid; justify-items: center; gap: 10px; text-align: center; }
.arc-win p { margin: 0; }
.arc-win-kicker { font-size: 9px; color: var(--arc-green); }
.arc-win-pct { font-size: 38px; color: #fff; text-shadow: 4px 4px 0 var(--arc-green); }
.arc-win-timer { font-size: 9px; color: #cfc6f5; }
.arc-win-timer b { font-size: 16px; font-weight: 400; color: var(--arc-yellow); font-variant-numeric: tabular-nums; }
.arc-win-timer b.is-urgent { color: var(--arc-red); }
.arc-win-rule { font: 600 13px/1.45 'Plus Jakarta Sans', system-ui, sans-serif; color: #d9f5e6; }
.arc-win-rule b { color: #fff; }

@media (max-height: 640px) {
  .arc-logo { font-size: 20px; margin: 2px 0 6px; }
  .arc-how li { padding: 6px 4px 5px; } .arc-how canvas { height: 20px; }
  .arc-tip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .arc-strip-cta, #arc_pill.is-urgent, .arc-hud .is-low b { animation: none; }
}
