/* Il Sensale — stili comuni. Stile «Studio»: notte blu, riflettori, oro, pacchi sigillati con ceralacca. */
:root {
  --night: #060a1c;
  --night-2: #0c1433;
  --panel: #121c46;
  --panel-2: #1a2760;
  --line: rgba(255, 220, 140, .18);
  --cream: #fff4dc;
  --muted: #a5b0dc;
  --gold: #f5c451;
  --gold-hi: #ffe39a;
  --gold-lo: #b9811a;
  --wax: #b3122e;
  --lo: #3d9bff;
  --lo-2: #1b4fb8;
  --hi: #ff4d5e;
  --hi-2: #b10f2a;
  --ok: #2fd27c;
  --bad: #ff4d5e;
  --radius: 18px;
  --f-title: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --f-num: 'Oswald', 'Arial Narrow', Impact, sans-serif;
  --f-text: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-text); color: var(--cream); background: var(--night);
  background-image:
    radial-gradient(ellipse 60% 45% at 50% -8%, rgba(255, 214, 120, .22), transparent 70%),
    radial-gradient(ellipse 40% 60% at 0% 100%, rgba(61, 155, 255, .14), transparent 70%),
    radial-gradient(ellipse 40% 60% at 100% 100%, rgba(255, 77, 94, .13), transparent 70%),
    linear-gradient(180deg, var(--night-2), var(--night));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, .title { font-family: var(--f-title); font-weight: 900; font-style: italic; margin: 0; letter-spacing: .005em; }
.num { font-family: var(--f-num); font-weight: 600; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.gold { color: var(--gold); }
button { font: inherit; color: inherit; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -.14em; flex: none; }

/* testo dorato «inciso» */
.goldtext {
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 45%, var(--gold-lo) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .45));
}

/* pulsanti */
.btn {
  appearance: none; border: 0; border-radius: 999px; cursor: pointer; touch-action: manipulation; user-select: none;
  font-family: var(--f-text); font-weight: 800; font-size: 1.05rem; letter-spacing: .02em; line-height: 1.1;
  padding: .9em 1.4em; min-height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  color: var(--cream); background: var(--panel-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 6px 16px rgba(0, 0, 0, .35);
  transition: transform .08s, filter .15s, opacity .15s;
}
.btn:active:not(:disabled) { transform: scale(.97); filter: brightness(1.1); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.gold { color: #2a1a00; background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 6px 18px rgba(245, 196, 81, .3); }
.btn.ok { background: linear-gradient(180deg, #4be394, #1aa75e); color: #04210f; }
.btn.no { background: linear-gradient(180deg, #ff6b78, #c41530); color: #fff; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.btn.big { font-size: 1.25rem; min-height: 64px; }
.btn.wide { width: 100%; }
.btn:focus-visible, input:focus-visible, .chip:focus-visible, .box:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.card { background: linear-gradient(180deg, rgba(26, 39, 96, .92), rgba(18, 28, 70, .92)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }

/* logo */
.logo { position: relative; display: inline-flex; align-items: baseline; gap: .12em; font-family: var(--f-title); font-style: italic; font-weight: 900; line-height: 1; white-space: nowrap; }
.logo-il { font-size: .45em; color: var(--muted); font-weight: 700; }
.logo-word {
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 45%, var(--gold-lo) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .5)); padding-right: .08em;
}
.logo-seal { width: .62em; height: .62em; align-self: center; margin-left: .06em; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); transform: rotate(-12deg); }

/* gettoni */
.av { display: block; width: 100%; height: 100%; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45)); }
.avbox { width: 48px; height: 48px; flex: none; position: relative; }
.avbox.off { opacity: .4; filter: grayscale(.8); }

/* ---------- pacco ---------- */
.box {
  position: relative; display: grid; place-items: center; aspect-ratio: 1.12; border: 0; padding: 0; overflow: hidden; container-type: inline-size;
  border-radius: 12%; color: var(--cream);
  background: linear-gradient(155deg, #ffe08c 0%, #eab445 38%, #c78a1f 75%, #9c6510 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), inset 0 -7px 0 rgba(0, 0, 0, .2), 0 8px 16px rgba(0, 0, 0, .45);
  transition: transform .15s, box-shadow .2s, opacity .3s;
}
.box::before, .box::after { content: ''; position: absolute; background: linear-gradient(90deg, #8c0c22, #d42645 50%, #8c0c22); box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.box::before { left: 43%; width: 14%; top: 0; bottom: 0; }
.box::after { top: 41%; height: 16%; left: 0; right: 0; background: linear-gradient(180deg, #8c0c22, #d42645 50%, #8c0c22); }
.box-seal {
  position: relative; z-index: 2; width: 50%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #e23a57, var(--wax) 55%, #6e0418);
  box-shadow: 0 0 0 2px #ffd36b, 0 3px 6px rgba(0, 0, 0, .5);
  font-family: var(--f-num); font-weight: 700; font-size: 22cqw; color: var(--gold-hi); text-shadow: 0 2px 0 rgba(0, 0, 0, .4);
}
.box-peek {
  position: absolute; z-index: 3; left: 6%; right: 6%; bottom: 6%; border-radius: 999px; padding: .1em 0; text-align: center;
  font-family: var(--f-num); font-weight: 600; font-size: 15cqw; line-height: 1.15; color: #fff; background: rgba(6, 10, 28, .82);
}
.box-peek.hi { color: #ffb3ba; } .box-peek.lo { color: #a9d2ff; }
button.box { cursor: pointer; }
button.box:active:not(:disabled) { transform: scale(.94); }
.box.own { box-shadow: 0 0 0 3px var(--gold-hi), 0 0 26px rgba(255, 214, 120, .75), inset 0 -7px 0 rgba(0, 0, 0, .2); animation: float 2.6s ease-in-out infinite; }
.box.open {
  background: rgba(10, 16, 44, .7); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .08); animation: none;
}
.box.open::before, .box.open::after { display: none; }
.box-val { font-family: var(--f-num); font-weight: 600; font-size: 21cqw; line-height: 1; }
.box.open.lo .box-val { color: var(--lo); } .box.open.hi .box-val { color: var(--hi); }
.box-n { position: absolute; top: 6%; left: 9%; font-family: var(--f-num); font-size: 13cqw; color: var(--muted); opacity: .8; }
.box.target { box-shadow: 0 0 0 3px var(--cream), 0 0 22px rgba(255, 255, 255, .55); }

/* ---------- tabellone dei valori ---------- */
.val {
  display: flex; align-items: center; justify-content: flex-end; padding: 0 .7em; border-radius: 8px; height: 100%;
  font-family: var(--f-num); font-weight: 600; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 3px 8px rgba(0, 0, 0, .3); transition: opacity .5s, filter .5s, transform .5s;
}
.val span::after { content: ' €'; font-size: .7em; opacity: .8; }
.val.lo { background: linear-gradient(90deg, var(--lo-2), var(--lo)); }
.val.hi { background: linear-gradient(90deg, var(--hi), var(--hi-2)); justify-content: flex-start; }
.val.gone { opacity: .16; filter: grayscale(1); transform: scale(.96); box-shadow: none; }

/* chip */
.chip {
  appearance: none; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--cream); border-radius: 999px; cursor: pointer;
  padding: .55em 1em; font-weight: 700; font-size: .95rem; display: inline-flex; align-items: center; gap: .4em; min-height: 42px; touch-action: manipulation;
}
.chip[aria-pressed="true"], .chip.on { background: var(--gold); color: #2a1a00; border-color: var(--gold); }

/* confetti dorati */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 99; }
.confetti i { position: absolute; top: -20px; width: 14px; height: 14px; border-radius: 50%; animation: fall linear forwards; box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .2); }
.confetti i:nth-child(3n) { border-radius: 2px; width: 10px; height: 16px; }
@keyframes fall { to { transform: translate(var(--x), 110vh) rotate(var(--rot)); } }

@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 10%, 30%, 50% { transform: rotate(-14deg); } 20%, 40%, 60% { transform: rotate(14deg); } 70% { transform: rotate(0); } }
@keyframes glow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes stamp { 0% { transform: scale(2.6) rotate(-14deg); opacity: 0; } 60% { transform: scale(.94) rotate(-8deg); opacity: 1; } 100% { transform: scale(1) rotate(-8deg); opacity: 1; } }
.pop { animation: pop .4s ease-out both; }
.shake { animation: shake .3s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* tasto «Sala»: discreto, in un angolo */
.sala {
  display: inline-flex; align-items: center; gap: .3em; text-decoration: none; color: var(--gold-hi);
  font-family: var(--f-text); font-weight: 800; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase;
  padding: .55em 1em .55em .75em; border-radius: 999px; border: 1px solid var(--line); background: rgba(6, 10, 28, .55);
  backdrop-filter: blur(6px); transition: background .15s, color .15s; min-height: 40px;
}
.sala:hover, .sala:focus-visible { background: var(--gold); color: #2a1a00; outline: none; }
.sala .ic { width: 1.1em; height: 1.1em; }
