/* =====================================================================
   AGLUEAT — stile punk street-art: carta avorio, spray, adesivi
   ===================================================================== */
:root {
  --avorio: #f7f3ea; --bianco: #fffdf8; --ink: #15140f; --grafite: #39362d;
  --oro: #c98f05; --oro2: #f0b91f; --giallo: #ffd60a; --verde: #00713a; --rosso: #c8232f;
  --paper: none;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--ink) var(--paper-dark, none) center/420px repeat;
  color: var(--ink); font: 400 15px/1.4 Inter, system-ui, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
#app {
  position: fixed; inset: 0; margin: 0 auto; width: min(100vw, 500px); height: 100%;
  background: var(--avorio) var(--paper) center/420px repeat; overflow: hidden;
  box-shadow: 0 0 0 4px var(--ink), 0 0 60px rgba(0,0,0,.6);
}
.scr { position: absolute; inset: 0; display: none; }
.scr.on { display: block; }
.ic { width: 24px; height: 24px; flex: none; }

/* ---------- Bottoni adesivo ---------- */
.btn {
  font: 400 19px/1 Bungee, Impact, sans-serif; letter-spacing: .5px; text-transform: uppercase;
  background: var(--giallo); color: var(--ink); border: 3px solid var(--ink); border-radius: 14px;
  padding: 13px 18px; box-shadow: 4px 4px 0 var(--ink); transform: rotate(-1deg);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; position: relative;
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translate(3px, 3px) rotate(-1deg); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { filter: grayscale(1) opacity(.55); }
.btn.big { font-size: 26px; padding: 16px 30px; border-width: 4px; box-shadow: 6px 6px 0 var(--ink); }
.btn.verde { background: var(--verde); color: var(--bianco); }
.btn.rosso { background: var(--rosso); color: var(--bianco); }
.btn.bianco { background: var(--bianco); }
.btn.ink { background: var(--ink); color: var(--giallo); box-shadow: 4px 4px 0 var(--oro); }
.btn.sm { font-size: 14px; padding: 9px 12px; box-shadow: 3px 3px 0 var(--ink); }
.btn small { font: 700 12px Inter, sans-serif; text-transform: none; opacity: .85; }
.btn .ic { width: 22px; height: 22px; }
.ib { width: 46px; height: 46px; border-radius: 14px; background: var(--bianco); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); display: grid; place-items: center; }
.ib:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.ib.sm { width: 42px; height: 42px; }

/* ---------- Titolo ---------- */
#title { background: radial-gradient(circle at 50% 42%, rgba(255,214,10,.35), transparent 60%); }
.tt-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: calc(var(--sat) + 16px) 18px calc(var(--sab) + 18px); text-align: center; }
.tt-logo { width: 104px; height: auto; margin-bottom: -6px; }
.tt-name { font: 800 64px/0.9 Archivo, Impact, sans-serif; letter-spacing: -2px; color: var(--ink); text-shadow: 4px 4px 0 var(--giallo); }
.tt-glu { width: min(62vw, 280px); max-height: 34vh; object-fit: contain; filter: drop-shadow(6px 8px 0 rgba(21,20,15,.18)); animation: bob 2.4s ease-in-out infinite; }
.tt-motto { transform: rotate(-4deg); margin: 2px 0 4px; }
.tt-motto span, .motto {
  display: inline-block; font: 400 30px/1 "Bagel Fat One", Impact, sans-serif; color: var(--ink);
  background: var(--giallo); padding: 8px 16px 10px; border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
  clip-path: polygon(0 6%, 4% 0, 30% 4%, 62% 0, 100% 5%, 98% 52%, 100% 100%, 70% 95%, 38% 100%, 3% 96%, 0 60%);
}
.tt-sub { max-width: 330px; font-size: 15px; color: var(--grafite); }
.tt-foot { font: 600 11px Inter, sans-serif; color: var(--grafite); opacity: .7; margin-top: 4px; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(1.5deg); } }

/* ---------- Casa: barra in alto ---------- */
.top { position: absolute; left: 0; right: 0; top: 0; z-index: 5; display: flex; gap: 8px; align-items: center; padding: calc(var(--sat) + 10px) 12px 10px;
  background: linear-gradient(var(--avorio) 70%, rgba(247,243,234,0)); }
.pill { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px 0 8px; border-radius: 14px; background: var(--bianco); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.pill b { font: 400 18px Bungee, sans-serif; }
.pill small { font: 700 11px Inter, sans-serif; color: var(--grafite); }
.top .ib { margin-left: auto; }
.regcard { position: absolute; z-index: 5; left: 12px; right: 12px; top: calc(var(--sat) + 64px); text-align: left; padding: 9px 14px 9px 54px; border: 3px solid var(--ink); border-radius: 14px;
  background: var(--ink) no-repeat 8px 50%/38px; color: var(--bianco); box-shadow: 4px 4px 0 var(--oro); transform: rotate(-.6deg); animation: wob 3s ease-in-out infinite; }
.regcard b { display: block; font: 400 15px Bungee, sans-serif; color: var(--giallo); }
.regcard small { font: 600 12px Inter, sans-serif; opacity: .85; }
@keyframes wob { 50% { transform: rotate(.6deg) scale(1.015); } }

/* ---------- Mappa ---------- */
#mapWrap { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
#mapWrap::-webkit-scrollbar { display: none; }
#mapIn { position: relative; width: 100%; }
.band { position: absolute; left: 0; right: 0; border-top: 4px solid var(--ink); }
.band::after { content: ''; position: absolute; inset: 0; background: var(--paper) center/420px; opacity: .6; pointer-events: none; }
.wtitle { position: absolute; left: 50%; transform: translateX(-50%) rotate(-2deg); z-index: 2; text-align: center; white-space: nowrap; }
.wtitle b { display: block; font: 400 12px Bungee, sans-serif; color: var(--bianco); background: var(--ink); padding: 4px 10px; border-radius: 6px; width: max-content; margin: 0 auto 4px; }
.wtitle span { font: 400 30px/1 "Bagel Fat One", Impact, sans-serif; color: var(--bianco); -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--ink); }
.wtitle small { display: block; font: 700 12px Inter, sans-serif; color: var(--grafite); margin-top: 2px; }
#mapIn svg.path { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1; }
.node { position: absolute; z-index: 3; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; border: 4px solid var(--ink); background: var(--bianco);
  box-shadow: 4px 4px 0 var(--ink); display: grid; place-items: center; font: 400 21px Bungee, sans-serif; }
.node.done { background: var(--giallo); }
.node.lock { background: #cfc9bb; color: #7b7568; box-shadow: 3px 3px 0 rgba(21,20,15,.5); border-color: #5d584d; }
.node.lock .ic { width: 22px; height: 22px; opacity: .8; }
.node.boss { width: 76px; height: 76px; margin: -38px 0 0 -38px; background: var(--rosso); color: var(--bianco); }
.node.boss.done { background: var(--oro2); color: var(--ink); }
.node.boss.lock { background: #a59c8e; }
.node.boss .crown { position: absolute; top: -22px; width: 34px; height: 34px; }
.node.cur { animation: pulse 1.1s ease-in-out infinite; background: var(--verde); color: var(--bianco); }
.node.boss.cur { background: var(--rosso); }
@keyframes pulse { 50% { transform: scale(1.1); } }
.node .st { position: absolute; bottom: -14px; display: flex; gap: 0; }
.node .st svg { width: 17px; height: 17px; }
.node .st svg.off { filter: grayscale(1) brightness(1.4) opacity(.55); }
.mehead { position: absolute; z-index: 4; width: 58px; height: 58px; margin: -96px 0 0 -29px; pointer-events: none; animation: bob 1.6s ease-in-out infinite; filter: drop-shadow(3px 3px 0 rgba(21,20,15,.3)); }
.side { position: absolute; z-index: 5; bottom: calc(var(--sab) + 104px); display: flex; flex-direction: column; gap: 10px; }
.side.l { left: 10px; } .side.r { right: 10px; }
.sbtn { position: relative; width: 66px; padding: 6px 2px 5px; border-radius: 16px; background: var(--bianco); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; }
.sbtn .ic { width: 30px; height: 30px; }
.sbtn span { font: 400 9.5px/1.05 Bungee, sans-serif; text-align: center; }
.sbtn .dot { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--rosso); border: 3px solid var(--ink); animation: pulse 1s infinite; }
.sbtn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.dock { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 12px 12px calc(var(--sab) + 18px); background: linear-gradient(rgba(247,243,234,0), var(--avorio) 40%); }
.dock .btn { min-width: 230px; }

/* ---------- Partita ---------- */
#game { background: var(--ink); touch-action: none; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.ghud { position: absolute; z-index: 5; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: calc(var(--sat) + 8px) 10px 0; pointer-events: none; }
.ghud > * { pointer-events: auto; }
.hearts { display: flex; gap: 1px; background: var(--bianco); border: 3px solid var(--ink); border-radius: 12px; padding: 4px 6px; box-shadow: 3px 3px 0 var(--ink); }
.hearts svg { width: 24px; height: 24px; }
.hearts svg.off { filter: grayscale(1) opacity(.35); }
.hearts svg.pop { animation: hpop .4s; }
@keyframes hpop { 40% { transform: scale(1.6) rotate(-12deg); } }
.goal { flex: 1; min-width: 0; text-align: center; background: var(--ink); color: var(--bianco); border-radius: 12px; padding: 5px 8px 6px; box-shadow: 3px 3px 0 var(--oro); transform: rotate(-.8deg); }
.goal b { display: block; font: 400 16px/1.1 Bungee, sans-serif; color: var(--giallo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal small { display: block; font: 700 11px/1.15 Inter, sans-serif; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal.ok b { color: #6ff0a2; }
.ally-chip { position: absolute; z-index: 5; left: 10px; top: calc(var(--sat) + 62px); display: flex; align-items: center; gap: 4px; background: var(--bianco); border: 3px solid var(--ink); border-radius: 12px; padding: 3px 9px 3px 5px; box-shadow: 3px 3px 0 var(--ink); font: 700 13px Inter, sans-serif; }
.ally-chip b { font: 400 15px Bungee, sans-serif; margin-right: -2px; }
.ally-chip .ic { width: 20px; height: 20px; }
.ally-chip.bump { animation: hpop .35s; }
.bossbar { position: absolute; z-index: 5; left: 104px; right: 14px; top: calc(var(--sat) + 62px); text-align: center; }
.bossbar span { font: 400 11px Bungee, sans-serif; color: var(--bianco); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.bossbar i { display: block; height: 16px; border: 3px solid var(--ink); border-radius: 9px; background: var(--bianco); overflow: hidden; box-shadow: 3px 3px 0 var(--ink); }
.bossbar b { display: block; height: 100%; width: 100%; background: repeating-linear-gradient(-45deg, var(--oro2) 0 8px, var(--oro) 8px 16px); transition: width .15s; }
#joy { position: absolute; z-index: 4; width: 128px; height: 128px; margin: -64px 0 0 -64px; border-radius: 50%; border: 4px solid rgba(21,20,15,.75); background: rgba(255,253,248,.22); pointer-events: none; }
#joy i { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: var(--giallo); border: 4px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
#gBlast { position: absolute; z-index: 5; right: 14px; bottom: calc(var(--sab) + 22px); width: 112px; height: 112px; border-radius: 50%; background: var(--giallo); border: 4px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink); display: grid; place-items: center; overflow: hidden; transform: rotate(-4deg); touch-action: none; }
#gBlast span { position: relative; z-index: 2; font: 400 13.5px/1.05 Bungee, sans-serif; text-align: center; }
#gBlast .cd { position: absolute; inset: 0; z-index: 1; background: conic-gradient(rgba(21,20,15,.55) var(--cd, 0%), transparent 0); }
#gBlast.ready { animation: ready 1s ease-in-out infinite; }
#gBlast:active { transform: translate(3px, 3px) rotate(-4deg); box-shadow: 2px 2px 0 var(--ink); }
@keyframes ready { 50% { transform: rotate(4deg) scale(1.06); } }
#gHint { position: absolute; z-index: 6; left: 16px; right: 140px; bottom: calc(var(--sab) + 30px); background: var(--bianco); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink); padding: 9px 12px; font: 700 14px/1.3 Inter, sans-serif; pointer-events: none; animation: vin .3s; }
#hurt { position: absolute; inset: 0; z-index: 3; pointer-events: none; box-shadow: inset 0 0 90px 30px rgba(200,35,47,.75); opacity: 0; transition: opacity .35s; }
#hurt.on { opacity: 1; transition: none; }
#banner { position: absolute; z-index: 7; left: 0; right: 0; top: calc(var(--sat) + 118px); display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; text-align: center; padding: 0 12px; }
#banner .bb { font: 400 46px/1 "Bagel Fat One", Impact, sans-serif; color: var(--giallo); -webkit-text-stroke: 9px var(--ink); paint-order: stroke fill; text-shadow: 6px 6px 0 var(--ink); transform: rotate(-4deg); animation: bpop 2.2s forwards; }
#banner .bs { font: 400 15px Bungee, sans-serif; background: var(--ink); color: var(--bianco); padding: 6px 12px; border-radius: 8px; animation: bpop 2.2s .08s both; max-width: 92%; }
#banner .motto { font-size: 26px; transform: rotate(3deg); animation: bpop 2.2s .14s both; }
#banner.long .bb, #banner.long .bs, #banner.long .motto { animation-duration: 3.2s; }
@keyframes bpop { 0% { transform: scale(.2) rotate(-14deg); opacity: 0; } 12% { transform: scale(1.18) rotate(-4deg); opacity: 1; } 20% { transform: scale(1) rotate(-3deg); } 82% { opacity: 1; transform: scale(1) rotate(-3deg); } 100% { opacity: 0; transform: scale(.9) translateY(-30px) rotate(-3deg); } }

/* ---------- Finestre ---------- */
#ovs { position: absolute; inset: 0; z-index: 50; pointer-events: none; }
.ov { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: calc(var(--sat) + 14px) 14px calc(var(--sab) + 14px); background: rgba(21,20,15,.62); pointer-events: auto; animation: vfade .2s; overflow-y: auto; }
.card { position: relative; width: 100%; max-width: 400px; margin: auto; flex: none; background: var(--avorio) var(--paper) center/420px; border: 4px solid var(--ink); border-radius: 22px; box-shadow: 8px 8px 0 var(--ink);
  padding: 22px 16px 16px; text-align: center; display: flex; flex-direction: column; gap: 12px; animation: vin .32s cubic-bezier(.2,1.5,.4,1); }
.card h2 { font: 400 34px/1 "Bagel Fat One", Impact, sans-serif; color: var(--giallo); -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--ink); transform: rotate(-2deg); margin-top: 2px; }
.card h2.verde { color: #6ff0a2; } .card h2.bianco { color: var(--bianco); } .card h2.rosso { color: #ff7480; }
.card h3 { font: 800 18px/1.15 Archivo, sans-serif; text-transform: uppercase; }
.card p { font-size: 14.5px; color: var(--grafite); }
.card .x { position: absolute; top: -14px; right: -12px; width: 42px; height: 42px; border-radius: 50%; background: var(--rosso); color: var(--bianco); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font: 400 18px Bungee, sans-serif; }
.card .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.card .col { display: grid; gap: 10px; }
.tag { display: inline-block; font: 400 12px Bungee, sans-serif; background: var(--ink); color: var(--bianco); padding: 4px 10px; border-radius: 6px; transform: rotate(-1.5deg); align-self: center; }
.goalbox { display: flex; gap: 10px; align-items: center; text-align: left; background: var(--bianco); border: 3px solid var(--ink); border-radius: 14px; padding: 10px 12px; }
.goalbox .ic { width: 38px; height: 38px; }
.goalbox b { display: block; font: 800 17px/1.15 Archivo, sans-serif; }
.goalbox small { font-size: 12.5px; color: var(--grafite); }
.newz { display: flex; gap: 10px; align-items: center; background: #fff3c4; border: 3px dashed var(--ink); border-radius: 14px; padding: 6px 10px; text-align: left; font-size: 13px; }
.newz img { width: 52px; height: 52px; object-fit: contain; }
.newz b { font: 400 13px Bungee, sans-serif; display: block; }
.boosts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.boost { position: relative; background: var(--bianco); border: 3px solid var(--ink); border-radius: 14px; padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 3px 3px 0 var(--ink); }
.boost .ic { width: 34px; height: 34px; }
.boost b { font: 400 10.5px/1.1 Bungee, sans-serif; min-height: 24px; display: grid; place-items: center; }
.boost small { font: 700 11px Inter, sans-serif; color: var(--grafite); }
.boost .n { position: absolute; top: -10px; right: -8px; min-width: 26px; height: 26px; border-radius: 13px; background: var(--ink); color: var(--giallo); font: 400 13px/20px Bungee, sans-serif; border: 3px solid var(--giallo); padding: 0 4px; }
.boost.on { background: var(--giallo); transform: rotate(-2deg) translateY(-3px); }
.boost.on::after { content: '✓'; position: absolute; top: -10px; left: -8px; width: 26px; height: 26px; border-radius: 50%; background: var(--verde); color: var(--bianco); font: 700 15px/20px Inter, sans-serif; border: 3px solid var(--ink); }
.stars { display: flex; justify-content: center; gap: 4px; margin: 4px 0 -2px; }
.stars svg { width: 58px; height: 58px; transform: scale(0); }
.stars svg:nth-child(2) { width: 72px; height: 72px; margin-top: -12px; }
.stars svg.in { animation: sin .45s cubic-bezier(.2,1.8,.4,1) forwards; }
.stars svg.off { filter: grayscale(1) brightness(1.35) opacity(.5); }
@keyframes sin { from { transform: scale(0) rotate(-90deg); } to { transform: scale(1) rotate(0); } }
.stats { display: flex; justify-content: center; gap: 10px; }
.stat { background: var(--bianco); border: 3px solid var(--ink); border-radius: 12px; padding: 5px 12px; display: flex; align-items: center; gap: 6px; font: 400 17px Bungee, sans-serif; }
.stat .ic { width: 22px; height: 22px; }
.fact { position: relative; text-align: left; background: var(--ink); color: var(--bianco); border-radius: 14px; padding: 12px 14px 12px; font-size: 13.5px; line-height: 1.38; transform: rotate(.4deg); }
.fact b { display: block; font: 400 12px Bungee, sans-serif; color: var(--giallo); margin-bottom: 3px; }
.fact a { display: inline-block; margin-top: 7px; font: 400 12px Bungee, sans-serif; color: var(--ink); background: var(--giallo); padding: 5px 10px; border-radius: 8px; text-decoration: none; border: 2px solid var(--bianco); }
.fact small { display: block; margin-top: 6px; font-size: 10.5px; opacity: .6; }
.promo { display: flex; gap: 10px; align-items: center; text-align: left; text-decoration: none; background: var(--bianco); border: 3px solid var(--ink); border-radius: 14px; padding: 8px; box-shadow: 3px 3px 0 var(--verde); }
.promo img { width: 54px; height: 54px; border-radius: 12px; border: 2px solid var(--ink); object-fit: cover; flex: none; }
.promo b { display: block; font: 400 14px Bungee, sans-serif; }
.promo small { display: block; font-size: 12px; color: var(--grafite); line-height: 1.25; }
.promo i { font: 400 11px Bungee, sans-serif; font-style: normal; background: var(--verde); color: var(--bianco); padding: 4px 8px; border-radius: 8px; white-space: nowrap; }
.days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.day { background: var(--bianco); border: 3px solid var(--ink); border-radius: 12px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; font: 700 11px/1.15 Inter, sans-serif; }
.day b { font: 400 11px Bungee, sans-serif; }
.day .ic { width: 26px; height: 26px; }
.day.done { background: #cfe9d8; opacity: .75; }
.day.today { background: var(--giallo); transform: scale(1.06) rotate(-2deg); box-shadow: 3px 3px 0 var(--ink); }
.day.d7 { grid-column: span 2; }
.toggles { display: grid; gap: 8px; }
.tog { display: flex; align-items: center; justify-content: space-between; background: var(--bianco); border: 3px solid var(--ink); border-radius: 14px; padding: 10px 12px; font: 400 15px Bungee, sans-serif; }
.tog i { width: 56px; height: 30px; border-radius: 15px; background: #cfc9bb; border: 3px solid var(--ink); position: relative; transition: background .15s; }
.tog i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--bianco); border: 2px solid var(--ink); transition: left .15s; }
.tog.on i { background: var(--verde); } .tog.on i::after { left: 28px; }
.link { font: 700 13px Inter, sans-serif; color: var(--grafite); text-decoration: underline; }
.mini { font-size: 11.5px !important; color: var(--grafite); opacity: .8; }
.onb img { width: 150px; height: 130px; object-fit: contain; margin: 0 auto; }
.onb .dots { display: flex; justify-content: center; gap: 6px; }
.onb .dots i { width: 10px; height: 10px; border-radius: 50%; background: #cfc9bb; border: 2px solid var(--ink); }
.onb .dots i.on { background: var(--giallo); }
.toast { position: absolute; z-index: 60; left: 50%; top: calc(var(--sat) + 70px); transform: translateX(-50%) rotate(-1deg); background: var(--ink); color: var(--giallo); font: 400 14px Bungee, sans-serif; padding: 9px 14px; border-radius: 12px; box-shadow: 4px 4px 0 var(--oro); white-space: nowrap; pointer-events: none; animation: toast 2.6s forwards; }
@keyframes toast { 0% { opacity: 0; margin-top: -14px; } 10%, 85% { opacity: 1; margin-top: 0; } 100% { opacity: 0; } }
@keyframes vfade { from { opacity: 0; } }
@keyframes vin { from { transform: scale(.85) rotate(-2deg); opacity: 0; } }

@media (min-width: 520px) {
  body { background-color: #23211b; }
}
@media (max-height: 640px) {
  .tt-name { font-size: 50px; } .tt-glu { max-height: 26vh; } .tt-logo { width: 80px; }
  #gBlast { width: 96px; height: 96px; }
}

/* ---------- Potere «Spiga spezzata» ---------- */
#gSpiga { position: absolute; z-index: 5; right: 24px; bottom: calc(var(--sab) + 146px); width: 80px; height: 80px; border-radius: 50%; background: var(--ink); border: 4px solid var(--ink);
  box-shadow: 4px 4px 0 var(--oro); display: grid; place-items: center; transform: rotate(5deg); touch-action: none; padding: 0; }
#gSpiga .spi { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%; overflow: hidden; }
#gSpiga .spi img { width: 112%; height: 112%; object-fit: contain; }
#gSpiga .spi .ic { width: 48px; height: 48px; }
#gSpiga .n { position: absolute; top: -9px; left: -8px; min-width: 28px; height: 28px; border-radius: 14px; background: var(--giallo); color: var(--ink); border: 3px solid var(--ink); font: 400 14px/22px Bungee, sans-serif; text-align: center; padding: 0 4px; }
#gSpiga small { position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%); font: 400 9.5px Bungee, sans-serif; background: var(--ink); color: var(--giallo); padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
#gSpiga.buy .n { background: var(--verde); color: var(--bianco); }
#gSpiga.off { filter: grayscale(1) brightness(.75); opacity: .6; }
#gSpiga.cool .spi { filter: brightness(.55); }
#gSpiga:active { transform: translate(2px, 2px) rotate(5deg); box-shadow: 1px 1px 0 var(--oro); }
.sprow { display: flex; gap: 10px; align-items: center; text-align: left; background: var(--ink); color: var(--bianco); border-radius: 14px; padding: 8px 10px; }
.sprow .spimg { width: 44px; height: 44px; flex: none; }
.sprow span { flex: 1; min-width: 0; }
.sprow b { font: 400 13px Bungee, sans-serif; color: var(--giallo); display: block; }
.sprow small { font-size: 12px; opacity: .85; } .sprow small b { display: inline; color: var(--bianco); font: 700 12px Inter, sans-serif; }
.card > .spimg { width: 96px; height: 96px; margin: 0 auto; }

/* ---------- Livelli quiz ---------- */
.qz { display: grid; gap: 11px; }
.chef { width: 120px; height: 130px; object-fit: contain; margin: 0 auto; filter: drop-shadow(3px 4px 0 rgba(21,20,15,.18)); }
.qprog { display: flex; gap: 4px; justify-content: center; }
.qprog i { width: 14px; height: 8px; border-radius: 4px; background: #d8d1c2; border: 2px solid var(--ink); }
.qprog i.s-card { background: #f0e2b4; border-radius: 2px; } .qprog i.done { background: var(--verde); } .qprog i.on { background: var(--giallo); transform: scale(1.25); }
.qq { font: 800 19px/1.2 Archivo, sans-serif !important; text-transform: none !important; }
.opts { display: grid; gap: 8px; }
.opt { text-align: left; font: 700 15px/1.25 Inter, sans-serif; background: var(--bianco); border: 3px solid var(--ink); border-radius: 14px; padding: 11px 13px; box-shadow: 3px 3px 0 var(--ink); }
.opt:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.opt.ok { background: #bff0cf; border-color: var(--verde); box-shadow: 3px 3px 0 var(--verde); }
.opt.ko { background: #ffd0d4; border-color: var(--rosso); box-shadow: 3px 3px 0 var(--rosso); text-decoration: line-through; }
.opt:disabled { color: var(--ink); opacity: 1; }
.spieg { text-align: left; background: var(--ink); color: var(--bianco); border-radius: 14px; padding: 10px 12px; font-size: 14px; line-height: 1.35; animation: vin .25s; }
.spieg b { color: var(--giallo); font: 400 13px Bungee, sans-serif; margin-right: 4px; }
.scheda { position: relative; text-align: left; background: var(--bianco); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 5px 5px 0 var(--ink); padding: 14px 14px 14px 96px; min-height: 120px; transform: rotate(-.6deg); }
.scheda { touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; transition: transform .18s ease-out; }
.scheda.drag { transition: none; cursor: grabbing; }
.scheda.da-r { animation: schedaR .26s ease-out; } .scheda.da-l { animation: schedaL .26s ease-out; }
@keyframes schedaR { from { transform: translateX(70px) rotate(3deg); opacity: 0; } }
@keyframes schedaL { from { transform: translateX(-70px) rotate(-3deg); opacity: 0; } }
.qz .row.nav { flex-wrap: nowrap; } .qz .row.nav .btn.verde { flex: 1; } .qz .row.nav [data-p] { width: 56px; padding: 0; font-size: 24px; }
.scheda img { position: absolute; left: 8px; bottom: 6px; width: 80px; height: 96px; object-fit: contain; }
.scheda h3 { font: 400 17px/1.15 Bungee, sans-serif !important; color: var(--rosso); margin-bottom: 6px; text-transform: none !important; }
.scheda p { font-size: 14.5px !important; color: var(--ink) !important; line-height: 1.38; }
.aglink { display: inline-block; margin-top: 8px; font: 400 12px Bungee, sans-serif; color: var(--ink); background: var(--giallo); padding: 5px 10px; border-radius: 8px; border: 2px solid var(--ink); text-decoration: none; }
.nota { margin-top: -2px; }
.node.quiz { background: #fff3c4; }
.node.corsa { background: #ffd9b3; }
.node.quiz.done, .node.corsa.done { background: var(--giallo); }
.node.quiz.cur, .node.corsa.cur { background: var(--verde); }
.node.quiz .crown, .node.corsa .crown { top: -28px; width: 30px; height: 30px; }

/* ---------- Livello corsa (modulo esterno) ---------- */
#corsa { background: var(--ink); }
#corsaStage { position: absolute; inset: 0; overflow: hidden; }
.node.quiz.lock, .node.corsa.lock { background: #cfc9bb; }
