/* Stile comune: colori, font, pulsanti risposta */
:root {
  --bg: #1f1a55;
  --bg-top: #3d2f95;
  --bg2: #29226a;
  --panel: #332b80;
  --panel2: #2a2370;
  --line: #5a50bd;
  --ink: #fbfaff;
  --muted: #c3bcf0;
  --a: #ff6b9d; --a2: #c63c6c;
  --b: #4fd8f6; --b2: #1f9cbc;
  --c: #ffc54d; --c2: #c28a17;
  --d: #82ea72; --d2: #44a838;
  --ok: #5cffa3; --ko: #ff6b7f; --gold: #ffd95a; --gold2: #b8921a;
  --px: 'Press Start 2P', ui-monospace, Consolas, monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

.px { font-family: var(--px); font-weight: 400; }
.gold { color: var(--gold); }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.ko { color: var(--ko); }
.up { color: var(--ok); }
.down { color: var(--ko); }
.eq { color: var(--muted); }

.title-logo {
  font-family: var(--px);
  line-height: 1.55;
  text-align: center;
  color: #fff;
  text-shadow: 0 3px 0 var(--a2), 0 0 16px rgba(255, 107, 157, .65);
}
.title-logo .sub { display: block; color: var(--gold); text-shadow: 0 3px 0 var(--gold2); }

.ans {
  position: relative;
  border-radius: 16px;
  color: #fff;
  font-weight: 800;
  text-align: left;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  transition: transform .08s, opacity .2s, filter .2s;
}
.ans .L {
  font-family: var(--px);
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(0, 0, 0, .2);
}
.ans.A { background: var(--a); box-shadow: 0 7px 0 var(--a2); }
.ans.B { background: var(--b); box-shadow: 0 7px 0 var(--b2); }
.ans.C { background: var(--c); box-shadow: 0 7px 0 var(--c2); }
.ans.D { background: var(--d); box-shadow: 0 7px 0 var(--d2); }
.ans:active:not(:disabled) { transform: translateY(5px); }
.ans.dim, .ans:disabled { opacity: .3; filter: grayscale(.5); }
.ans.sel { opacity: 1; filter: none; outline: 4px solid #fff; }
.ans.win { opacity: 1; filter: none; outline: 4px solid #fff; box-shadow: 0 0 28px rgba(92, 255, 163, .7); }
.ans.wrong { opacity: .35; filter: grayscale(.8); }
.ans.wrong::after { content: '✖'; position: absolute; right: 12px; top: 8px; font-size: 22px; }

.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); flex: none; display: inline-block; }
.dot.off { background: #6f6a92; box-shadow: none; }

@keyframes pop { from { transform: scale(.2); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes fall { to { transform: translateY(110vh) rotate(600deg); } }
@keyframes shine { to { background-position: -200% 0; } }
@keyframes fadeUp { from { transform: translateY(14px); opacity: 0; } }
.shake { animation: shake .4s; }
.dots::after { content: ''; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i { position: absolute; top: -14px; width: 9px; height: 13px; animation: fall linear forwards; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: #120e3a; border: 2px solid var(--line); color: var(--ink);
  padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14px;
  z-index: 60; max-width: 90vw; text-align: center; animation: fadeUp .25s;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.toast.err { border-color: var(--ko); }
