/* Furia del Vesuvio — interfaccia. Realizzato da CGFA. */
:root {
  --nero: #0c0605; --brace: #1c0d09; --lava: #ff5a1f; --lava2: #ffb02e; --oro: #ffd77a; --sangue: #b3200f;
  --testo: #f6ece4; --tenue: #c9b3a6; --linea: rgba(255, 176, 46, 0.28); --vetro: rgba(18, 8, 6, 0.82);
  --disp: "Teko", "Arial Narrow", Impact, sans-serif; --corpo: "Barlow", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--nero); color: var(--testo); font-family: var(--corpo); -webkit-tap-highlight-color: transparent; user-select: none; }
#scena { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.lampo { position: fixed; inset: 0; pointer-events: none; background: #fff; opacity: 0; z-index: 5; mix-blend-mode: screen; }

/* ---------- schermate ---------- */
.schermata { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top)) 16px 16px; z-index: 20; overflow-y: auto; }
.schermata.menu, .schermata.torre, .schermata.fine, .schermata.pausa, .schermata:not(.titolo):not(.scelta) { background: radial-gradient(ellipse at 50% 120%, rgba(255, 90, 31, 0.18), transparent 60%), linear-gradient(180deg, rgba(12, 6, 5, 0.55), rgba(12, 6, 5, 0.86)); }
.finestra { width: min(560px, 100%); background: var(--vetro); border: 1px solid var(--linea); border-radius: 14px; padding: 26px 26px 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 215, 122, 0.12); backdrop-filter: blur(6px); margin: auto; }
.finestra.larga { width: min(860px, 100%); }
h2 { font-family: var(--disp); font-weight: 600; font-size: 44px; line-height: 0.9; letter-spacing: 0.02em; margin: 0 0 12px; text-transform: uppercase; color: var(--oro); }
h3 { font-family: var(--disp); font-weight: 500; font-size: 24px; letter-spacing: 0.03em; margin: 18px 0 6px; text-transform: uppercase; color: var(--lava2); }
.sotto { color: var(--tenue); line-height: 1.5; margin: 0 0 14px; }
.marchio { font-size: 58px; text-align: center; margin-bottom: 18px; }
.marchio span { display: block; font-size: 30px; color: var(--lava); letter-spacing: 0.16em; }

.pri, .sec { border-radius: 10px; padding: 12px 22px; font-weight: 700; letter-spacing: 0.02em; border: 0; min-height: 46px; }
.pri { background: linear-gradient(180deg, #ff8a3d, #e0430e); color: #fff; box-shadow: 0 6px 18px rgba(224, 67, 14, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.pri:hover, .pri:focus-visible { filter: brightness(1.12); }
.sec { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--linea); color: var(--testo); }
.sec:hover, .sec:focus-visible { background: rgba(255, 176, 46, 0.14); }
.pri.grande { font-family: var(--disp); font-size: 30px; padding: 10px 40px 6px; text-transform: uppercase; }
:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; }
.azioni { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }

.voci { display: grid; gap: 10px; }
.voce { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 14px 18px; border-radius: 12px; background: linear-gradient(90deg, rgba(255, 90, 31, 0.14), rgba(255, 255, 255, 0.03)); border: 1px solid var(--linea); transition: transform 0.12s, background 0.12s; }
.voce b { font-family: var(--disp); font-size: 30px; font-weight: 600; line-height: 0.95; text-transform: uppercase; letter-spacing: 0.02em; }
.voce small { color: var(--tenue); font-size: 14px; }
.voce:hover, .voce:focus-visible { transform: translateX(4px); background: linear-gradient(90deg, rgba(255, 90, 31, 0.32), rgba(255, 255, 255, 0.05)); }
.voci.piccole { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-top: 14px; }
.sbloccati { margin: 14px 0 0; color: var(--oro); font-size: 14px; text-align: center; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--linea); font-weight: 600; min-height: 38px; }
.chip.on { background: var(--lava); border-color: var(--lava); color: #fff; }
.imp { margin-bottom: 6px; } .imp small { color: var(--tenue); }
input[type=range] { width: 100%; accent-color: var(--lava); }
.campo { display: grid; gap: 6px; color: var(--tenue); margin-bottom: 14px; }
input:not([type=range]) { font: inherit; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--linea); background: rgba(0, 0, 0, 0.35); color: var(--testo); }
.entra { display: flex; gap: 8px; margin: 14px 0; } .entra input { flex: 1; text-transform: uppercase; letter-spacing: 0.2em; font-weight: 700; }
.attesa { text-align: center; margin: 10px 0 16px; padding: 14px; border-radius: 12px; background: rgba(255, 90, 31, 0.1); border: 1px dashed var(--linea); }
.codice { font-family: var(--disp); font-size: 64px; letter-spacing: 0.18em; color: var(--oro); line-height: 1; }

/* ---------- titolo ---------- */
.titolo { flex-direction: column; gap: 26px; background: radial-gradient(ellipse at 50% 100%, rgba(255, 70, 20, 0.28), transparent 55%), linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.55)); text-align: center; }
.logo-titolo small { font-family: var(--disp); font-size: 22px; letter-spacing: 0.4em; color: var(--tenue); }
.logo-titolo h1 { font-family: var(--disp); font-weight: 700; font-size: clamp(72px, 15vw, 190px); line-height: 0.78; margin: 8px 0 10px; color: #fff3e0; text-shadow: 0 0 30px rgba(255, 90, 31, 0.65), 0 6px 0 #6b1a07, 0 10px 40px rgba(0, 0, 0, 0.8); letter-spacing: 0.02em; }
.logo-titolo h1 span { display: block; font-size: 0.38em; letter-spacing: 0.34em; color: var(--lava2); text-shadow: 0 0 22px rgba(255, 140, 30, 0.7), 0 4px 0 #5a1505; }
.logo-titolo p { color: var(--tenue); font-size: 18px; margin: 0; }
.premi { color: var(--tenue); font-size: 14px; animation: pulsa 1.6s ease-in-out infinite; }
@keyframes pulsa { 50% { opacity: 0.35; } }

/* ---------- scelta ---------- */
.scelta { flex-direction: column; justify-content: space-between; padding: 14px; background: linear-gradient(180deg, rgba(12, 6, 5, 0.75), transparent 28%, transparent 55%, rgba(12, 6, 5, 0.92)); }
.scelta-alto { display: flex; justify-content: space-between; width: 100%; gap: 14px; }
.scheda { max-width: 330px; padding: 12px 16px; border-radius: 12px; background: var(--vetro); border: 1px solid var(--linea); }
.scheda.s1 { text-align: right; }
.scheda small { font-family: var(--disp); font-size: 18px; letter-spacing: 0.2em; color: var(--lava); }
.scheda h3 { font-size: 40px; margin: 0; color: #fff; line-height: 0.9; }
.scheda p { margin: 2px 0 8px; color: var(--oro); font-size: 14px; }
.spec { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--tenue); display: grid; gap: 2px; }
.spec b { color: var(--testo); }
.scelta-basso { width: 100%; max-width: 1200px; margin: 0 auto; text-align: center; }
.istr { font-family: var(--disp); font-size: 28px; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 8px; color: var(--oro); }
.griglia { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1000px) { .griglia { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.pg { position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; border: 2px solid rgba(255, 255, 255, 0.12); background: linear-gradient(180deg, #3a1a10, #120806); padding: 0; }
.pg img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block; }
.pg span { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 14px 4px 4px; font-family: var(--disp); font-size: 17px; line-height: 1; text-transform: uppercase; background: linear-gradient(transparent, rgba(0, 0, 0, 0.9)); }
.pg .iniziali { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--disp); font-size: 40px; color: var(--lava2); }
.pg.p0 { border-color: #36a3ff; box-shadow: 0 0 0 2px #36a3ff, 0 0 18px rgba(54, 163, 255, 0.6); }
.pg.p1 { border-color: var(--lava); box-shadow: 0 0 0 2px var(--lava), 0 0 18px rgba(255, 90, 31, 0.6); }
.pg.p0.p1 { box-shadow: 0 0 0 2px #36a3ff, 0 0 0 5px var(--lava); }
.pg.chiuso { filter: grayscale(1) brightness(0.45); cursor: not-allowed; }
.pg.chiuso::after { content: "🔒"; position: absolute; top: 6px; right: 6px; font-size: 16px; }
.arene { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 10px; color: var(--tenue); flex-wrap: wrap; }

/* ---------- torre ---------- */
.scala { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; counter-reset: s; }
.scala li { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid transparent; counter-increment: s; }
.scala li::before { content: counter(s); font-family: var(--disp); font-size: 26px; width: 26px; color: var(--tenue); }
.scala li b { font-family: var(--disp); font-size: 26px; font-weight: 500; text-transform: uppercase; flex: 1; }
.scala li small { color: var(--tenue); }
.scala li.fatto { opacity: 0.5; } .scala li.fatto b { text-decoration: line-through; }
.scala li.ora { border-color: var(--lava); background: rgba(255, 90, 31, 0.15); }
.scala li.boss b { color: var(--lava2); }

/* ---------- VS ---------- */
.vs { position: fixed; inset: 0; z-index: 25; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; pointer-events: none; background: linear-gradient(90deg, rgba(20, 60, 140, 0.35), transparent 40%, transparent 60%, rgba(160, 40, 10, 0.4)); animation: vsEntra 0.35s ease-out; }
.vs b { display: block; font-family: var(--disp); font-size: clamp(48px, 8vw, 110px); line-height: 0.85; text-transform: uppercase; text-shadow: 0 4px 0 #000, 0 0 30px rgba(0, 0, 0, 0.8); }
.vs small { font-size: 18px; color: var(--oro); }
.vs-l { text-align: left; padding-left: 5vw; } .vs-r { text-align: right; padding-right: 5vw; }
.vs-c { font-family: var(--disp); font-size: clamp(70px, 12vw, 160px); color: var(--lava); text-shadow: 0 0 40px rgba(255, 90, 31, 0.9), 0 6px 0 #4a1004; }
.vs-arena { position: absolute; bottom: 12vh; left: 0; right: 0; text-align: center; font-family: var(--disp); font-size: 28px; letter-spacing: 0.2em; color: var(--tenue); }
@keyframes vsEntra { from { opacity: 0; transform: scale(1.08); } }

/* ---------- fine incontro ---------- */
.punti { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; margin: 10px 0; font-size: 16px; }
.punti dt { color: var(--tenue); } .punti dd { margin: 0; text-align: right; font-weight: 700; }
.punti .tot { font-family: var(--disp); font-size: 30px; color: var(--oro); border-top: 1px solid var(--linea); padding-top: 6px; }
.nome-classifica { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .nome-classifica label { width: 100%; color: var(--tenue); font-size: 14px; } .nome-classifica input { flex: 1; }
.classifica { padding-left: 26px; margin: 0 0 14px; display: grid; gap: 4px; max-height: 50vh; overflow: auto; } .classifica li span { float: right; color: var(--oro); font-weight: 700; }

/* ---------- mosse e testi ---------- */
.mosse { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 18px; margin: 12px 0; }
.mosse div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 15px; }
.mosse kbd, .tab-comandi kbd { font-family: var(--corpo); font-weight: 700; color: var(--oro); background: rgba(255, 176, 46, 0.1); border: 1px solid var(--linea); border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.mosse .sp { color: var(--lava2); font-weight: 700; }
.tab-comandi { width: 100%; border-collapse: collapse; font-size: 15px; } .tab-comandi td { padding: 6px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); vertical-align: top; } .tab-comandi td:first-child { color: var(--tenue); width: 40%; }
.funzioni { padding-left: 18px; line-height: 1.55; color: var(--tenue); } .funzioni b { color: var(--testo); }
.testo-lungo { color: var(--tenue); line-height: 1.55; font-size: 15px; max-height: 60vh; overflow: auto; } .testo-lungo a { color: var(--oro); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.barre { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 16px; right: 16px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 12px; }
.lato { display: flex; gap: 10px; align-items: flex-start; }
.lato.l1 { flex-direction: row-reverse; text-align: right; }
.ritratto { width: 62px; height: 62px; border-radius: 10px; overflow: hidden; border: 2px solid var(--oro); background: #2a120a center / cover; flex: none; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6); }
.info { flex: 1; min-width: 0; }
.nome { font-family: var(--disp); font-size: 26px; line-height: 0.9; text-transform: uppercase; letter-spacing: 0.03em; text-shadow: 0 2px 0 #000; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vita { position: relative; height: 20px; border-radius: 4px; background: rgba(0, 0, 0, 0.65); border: 2px solid rgba(255, 215, 122, 0.85); overflow: hidden; transform: skewX(-14deg); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); }
.l1 .vita { transform: skewX(14deg); }
.vita i { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; }
.l1 .vita i { left: auto; right: 0; }
.vita .danno { background: #e21b0c; transition: width 0.6s ease-in 0.35s; }
.vita .piena { background: linear-gradient(180deg, #fff3a0, #ffc934 45%, #e88a0c); }
.vita.bassa .piena { background: linear-gradient(180deg, #ffb0a0, #ff5a33 45%, #c7260b); animation: pulsa 0.6s infinite; }
.vinti { display: flex; gap: 6px; margin-top: 6px; } .l1 .vinti { justify-content: flex-end; }
.vinti i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--oro); background: rgba(0, 0, 0, 0.5); }
.vinti i.si { background: radial-gradient(circle at 35% 35%, #fff2b0, #ff9c1a 60%, #a33a06); box-shadow: 0 0 10px rgba(255, 156, 26, 0.9); }
.tempo { font-family: var(--disp); font-size: 64px; line-height: 0.8; min-width: 84px; text-align: center; padding: 6px 8px 0; color: #fff; text-shadow: 0 3px 0 #000, 0 0 20px rgba(255, 90, 31, 0.6); background: rgba(0, 0, 0, 0.45); border: 2px solid rgba(255, 215, 122, 0.6); border-radius: 10px; }
.tempo.poco { color: #ff6a4a; }
.furie { position: absolute; bottom: max(52px, calc(env(safe-area-inset-bottom) + 40px)); left: 16px; right: 16px; display: flex; justify-content: space-between; }
.furia { display: flex; align-items: center; gap: 8px; width: min(34vw, 300px); }
.furia.f1 { flex-direction: row-reverse; }
.furia span { font-family: var(--disp); font-size: 22px; letter-spacing: 0.12em; color: var(--lava2); text-shadow: 0 2px 0 #000; }
.furia b { flex: 1; height: 12px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(255, 176, 46, 0.6); overflow: hidden; display: flex; }
.furia.f1 b { justify-content: flex-end; }
.furia i { width: 0; background: linear-gradient(90deg, #a5260a, #ff5a1f, #ffd34d); transition: width 0.2s; }
.furia.piena span { color: #fff; animation: pulsa 0.5s infinite; } .furia.piena b { box-shadow: 0 0 16px #ff7a1a; }
.combo { position: absolute; top: 24%; font-family: var(--disp); font-size: 54px; line-height: 0.85; color: var(--oro); text-shadow: 0 3px 0 #5a1505, 0 0 18px rgba(255, 140, 30, 0.8); opacity: 0; transition: opacity 0.25s; text-transform: uppercase; }
.combo small { display: block; font-size: 24px; color: #fff; letter-spacing: 0.1em; }
.combo.c0 { left: 4vw; } .combo.c1 { right: 4vw; text-align: right; }
.combo.si { opacity: 1; animation: comboPop 0.18s ease-out; }
@keyframes comboPop { from { transform: scale(1.35); } }
.annuncio { position: absolute; left: 0; right: 0; top: 34%; text-align: center; font-family: var(--disp); font-weight: 700; font-size: clamp(64px, 12vw, 160px); line-height: 0.85; color: #fff6dc; text-shadow: 0 6px 0 #6b1a07, 0 0 40px rgba(255, 90, 31, 0.9), 0 12px 40px rgba(0, 0, 0, 0.8); text-transform: uppercase; opacity: 0; }
.annuncio small { display: block; font-size: 0.32em; letter-spacing: 0.25em; color: var(--oro); text-shadow: 0 3px 0 #000; }
.annuncio.si { animation: annuncio 1.6s ease-out forwards; }
.annuncio.fisso { opacity: 1; animation: annuncioFisso 0.4s ease-out; }
.annuncio.rosso { color: #ffd2c4; text-shadow: 0 6px 0 #5a0a02, 0 0 50px rgba(255, 30, 10, 1); }
@keyframes annuncio { 0% { opacity: 0; transform: scale(1.6); } 12% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(0.96); } }
@keyframes annuncioFisso { from { opacity: 0; transform: scale(1.5); } }
.aiuto { position: absolute; left: 50%; transform: translateX(-50%); bottom: 64px; background: var(--vetro); border: 1px solid var(--linea); border-radius: 10px; padding: 8px 14px; font-size: 15px; text-align: center; max-width: 90vw; }
.aiuto kbd { color: var(--oro); font-weight: 700; font-family: var(--corpo); }
.mosse-live { position: absolute; right: 16px; top: 120px; width: 270px; background: var(--vetro); border: 1px solid var(--linea); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.45; }
.mosse-live b { color: var(--oro); }
.pausa-btn { pointer-events: auto; position: absolute; top: max(86px, calc(env(safe-area-inset-top) + 76px)); left: 50%; transform: translateX(-50%); width: 38px; height: 34px; border-radius: 8px; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--linea); font-weight: 800; }

/* ---------- comandi a sfioramento ---------- */
.touch { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
.stick { pointer-events: auto; position: absolute; left: max(20px, env(safe-area-inset-left)); bottom: 46px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, 0.07); border: 2px solid rgba(255, 215, 122, 0.35); touch-action: none; }
.stick i { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, rgba(255, 215, 122, 0.8), rgba(255, 90, 31, 0.55)); }
.tasti { pointer-events: auto; position: absolute; right: max(16px, env(safe-area-inset-right)); bottom: 40px; display: grid; grid-template-columns: repeat(2, 70px); gap: 10px; }
.tb { width: 70px; height: 62px; border-radius: 16px; border: 2px solid rgba(255, 215, 122, 0.5); background: rgba(30, 12, 8, 0.6); font-family: var(--disp); font-size: 26px; touch-action: none; }
.tb.lungo { font-size: 18px; } .tb.furia { font-size: 20px; color: var(--lava2); }
.tb.giu { background: rgba(255, 90, 31, 0.6); }

/* ---------- varie ---------- */
.ruota { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: #0c0605; text-align: center; padding: 20px; font-family: var(--disp); font-size: 34px; }
.caricamento { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: radial-gradient(ellipse at 50% 100%, #4a1206, #0c0605 70%); transition: opacity 0.5s; }
.caricamento.via { opacity: 0; pointer-events: none; }
.caricamento p { color: var(--tenue); font-size: 15px; }
.giro { width: 54px; height: 54px; border-radius: 50%; border: 4px solid rgba(255, 176, 46, 0.2); border-top-color: var(--lava); animation: gira 0.9s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.credit { position: fixed; right: 10px; bottom: 6px; z-index: 30; font-size: 11px; opacity: 0.7; }
.credit a { color: var(--tenue); text-decoration: none; }
body.in-lotta .credit { opacity: 0.35; }

@media (max-width: 760px) {
  .finestra { padding: 20px 16px; }
  h2 { font-size: 36px; } .marchio { font-size: 46px; }
  .voce b { font-size: 26px; }
  .ritratto { width: 44px; height: 44px; }
  .nome { font-size: 20px; } .vita { height: 14px; }
  .tempo { font-size: 44px; min-width: 60px; }
  .scheda { max-width: 46vw; padding: 8px 10px; } .scheda h3 { font-size: 28px; } .spec { display: none; }
  .griglia { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .pg span { font-size: 13px; }
  .mosse-live { display: none; }
}
@media (max-height: 500px) {
  .scheda .spec { display: none; } .scheda { padding: 6px 10px; } .scheda h3 { font-size: 26px; }
  .griglia { grid-template-columns: repeat(10, 1fr); } .pg { aspect-ratio: 1; }
  .istr { font-size: 20px; margin-bottom: 4px; }
  .stick { width: 120px; height: 120px; bottom: 20px; } .tasti { bottom: 16px; grid-template-columns: repeat(3, 60px); } .tb { width: 60px; height: 50px; font-size: 22px; }
  .combo { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) { .annuncio.si, .combo.si, .vs { animation-duration: 0.01s; } }
