:root {
  --fondo: #0b0d0c;
  --vetro: rgba(10, 13, 19, 0.86);
  --testo: #ececec;
  --tenue: #a2a7ae;
  --accento: #e3b341;
  --accento-t: #15110a;
  --bordo: rgba(255, 255, 255, 0.09);
  --errore: #ff7a6b;
  --ok: #74e083;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --vetro: rgba(10, 13, 19, 0.86); } }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fondo); color: var(--testo); overflow: hidden;
  font: 16px/1.45 "Barlow", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
canvas#scena { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
[hidden] { display: none !important; }

.demo-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 50; text-align: center; padding: 6px 12px;
  background: var(--accento); color: var(--accento-t); font: 800 14px/1.2 "Barlow Condensed", sans-serif; letter-spacing: .08em; }

.schermata { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 48px 16px 16px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.35), rgba(0,0,0,.7)); }
.finestra { width: min(460px, 100%); max-height: calc(100dvh - 80px); overflow: auto; background: var(--vetro);
  border: 1px solid var(--bordo); padding: 26px 28px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.finestra.larga { width: min(680px, 100%); }
.accento { display: block; width: 48px; height: 3px; background: var(--accento); margin-bottom: 10px; }
h1, h2 { font: 800 clamp(30px, 6vw, 44px)/1 "Barlow Condensed", sans-serif; text-transform: uppercase; margin: 0 0 12px; letter-spacing: .02em; }
h2 { font-size: 32px; }
h3 { font: 600 13px/1 "Barlow", sans-serif; color: var(--tenue); text-transform: uppercase; letter-spacing: .1em; margin: 18px 0 6px; }
.tenue { color: var(--tenue); }
.piccolo { font-size: 13px; color: var(--tenue); margin-top: 14px; }
a { color: var(--accento); }
button, .bottone { display: block; width: 100%; min-height: 46px; margin: 6px 0; padding: 10px 14px; border: 1px solid var(--bordo);
  background: #1d2028; color: var(--testo); font: 600 17px "Barlow", sans-serif; cursor: pointer; text-align: center; text-decoration: none;
  transition: background .15s, transform .1s; }
button:hover, .bottone:hover { background: #272b35; }
button:active { transform: scale(.985); }
button.pri { background: var(--accento); color: var(--accento-t); border-color: transparent; font-weight: 800; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
label { display: block; margin: 10px 0 4px; color: var(--tenue); font-size: 14px; }
input { display: block; width: 100%; margin-top: 4px; min-height: 44px; padding: 8px 12px; background: #11141a; color: var(--testo);
  border: 1px solid var(--bordo); font: 16px "Barlow", sans-serif; }
.comandi, .funzioni, .classifica { padding-left: 0; list-style: none; margin: 0; }
.comandi li { display: flex; gap: 12px; padding: 4px 0; align-items: baseline; }
.comandi kbd { min-width: 120px; padding: 2px 8px; background: rgba(255,255,255,.08); font: 600 14px "Barlow", sans-serif; }
.funzioni li { padding: 3px 0; color: var(--tenue); }
.classifica li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--bordo); }
.classifica li b { color: var(--accento); }
.testo-lungo p { color: var(--tenue); font-size: 15px; }

#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.hud-sx { position: absolute; top: 44px; left: 16px; padding: 10px 14px; background: rgba(0,0,0,.45); }
.barra { width: 200px; height: 10px; background: rgba(255,255,255,.15); }
.barra i { display: block; height: 100%; width: 100%; background: var(--ok); transition: width .2s; }
.punti { margin-top: 6px; font: 800 20px "Barlow Condensed", sans-serif; }
.hud-centro { position: absolute; top: 44px; left: 50%; transform: translateX(-50%); padding: 8px 14px; background: rgba(0,0,0,.45);
  max-width: min(560px, 60vw); text-align: center; font-size: 15px; }
.hud-dx { position: absolute; top: 44px; right: 16px; padding: 8px 14px; background: rgba(0,0,0,.45); font: 800 20px "Barlow Condensed", sans-serif; }
.mirino { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 26px; color: rgba(255,255,255,.85); }
.messaggio { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); padding: 8px 18px; background: rgba(0,0,0,.55);
  font: 800 20px "Barlow Condensed", sans-serif; }
.danno { position: fixed; inset: 0; z-index: 9; pointer-events: none; background: rgba(150,0,0,.35); opacity: 0; transition: opacity .35s; }

.touch { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
.stick { position: absolute; left: 24px; bottom: 28px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.08);
  border: 1px solid var(--bordo); pointer-events: auto; touch-action: none; }
.stick i { position: absolute; left: 40px; top: 40px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,.3); }
.tbtn { position: absolute; right: 24px; bottom: 36px; width: 74px; height: 74px; min-height: 0; border-radius: 50%; pointer-events: auto;
  background: rgba(255,255,255,.12); font-size: 28px; padding: 0; }
.tbtn2 { right: 112px; bottom: 60px; }

.caricamento { position: fixed; inset: 0; z-index: 40; display: grid; place-content: center; justify-items: center; background: var(--fondo); gap: 10px; }
.giro { width: 42px; height: 42px; border: 3px solid var(--bordo); border-top-color: var(--accento); border-radius: 50%; animation: gira 1s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .giro { animation-duration: 3s; } }

.credit { position: fixed; right: 12px; bottom: 10px; z-index: 20; font-size: 12px; opacity: .75; }
.credit a { color: var(--tenue); text-decoration: none; }


/* FRONTE VESUVIO — HUD tattico */
h1 { font-weight: 900; font-size: clamp(40px, 9vw, 66px); letter-spacing: .03em; }
h1 span { display: block; color: var(--accento); font-size: .5em; letter-spacing: .3em; margin-top: 6px; }
.schermata { background: linear-gradient(90deg, rgba(5,7,6,.9) 0%, rgba(5,7,6,.55) 55%, rgba(5,7,6,.15) 100%); place-items: center start; padding-left: max(16px, 6vw); }
.finestra { border-left: 3px solid var(--accento); }
.grado { margin: 4px 0 12px; padding: 8px 12px; border-left: 3px solid var(--accento); background: rgba(227,179,65,.08); font-size: 15px; }
.grado:empty { display: none; }
select, input[type=range] { display: block; width: 100%; margin-top: 4px; min-height: 44px; padding: 8px 12px; background: #11141a; color: var(--testo); border: 1px solid var(--bordo); font: 16px "Barlow", sans-serif; }
input[type=range] { padding: 0; accent-color: var(--accento); }
.armi { display: grid; gap: 8px; }
button.arma { display: grid; grid-template-columns: 90px 1fr; gap: 3px 10px; text-align: left; align-items: center; font-weight: 400; }
button.arma b { grid-column: 1 / -1; font: 800 22px/1 "Barlow Condensed", sans-serif; letter-spacing: .04em; }
button.arma small { grid-column: 1 / -1; color: var(--tenue); margin-bottom: 4px; }
button.arma span { font-size: 13px; color: var(--tenue); }
button.arma em { display: block; height: 6px; background: rgba(255,255,255,.1); }
button.arma em i { display: block; height: 100%; background: var(--testo); }
button.arma.scelta { border-color: var(--accento); background: rgba(227,179,65,.12); }
button.arma.scelta b { color: var(--accento); }

#hud { font-family: "Barlow Condensed", sans-serif; }
.hud-centro { top: 16px; left: 16px; transform: none; text-align: left; border-left: 3px solid var(--accento); font: 600 17px "Barlow Condensed", sans-serif; letter-spacing: .03em; max-width: min(520px, 55vw); }
#mappa { position: absolute; top: 16px; right: 16px; width: 176px; height: 176px; }
.hud-dx { position: absolute; top: 200px; right: 16px; background: none; padding: 0; text-align: right; }
.punti { font: 800 24px/1 "Barlow Condensed", sans-serif; text-shadow: 0 1px 3px #000; }
.tempo { font: 600 15px "Barlow", sans-serif; color: var(--tenue); text-shadow: 0 1px 3px #000; }
.cronaca { position: absolute; top: 260px; right: 16px; list-style: none; margin: 0; padding: 0; text-align: right; font: 600 15px "Barlow Condensed", sans-serif; }
.cronaca li { padding: 2px 8px; margin-bottom: 3px; background: rgba(0,0,0,.45); transition: opacity .6s; }
.cronaca li b { color: #8dd7ff; } .cronaca li span { color: #ff8a7a; } .cronaca li i { font-style: normal; color: var(--tenue); margin: 0 6px; }
.cronaca li.via { opacity: 0; }
.armi-hud { position: absolute; right: 20px; bottom: 22px; text-align: right; text-shadow: 0 1px 4px #000; }
#munizioni b { font: 800 46px/1 "Barlow Condensed", sans-serif; } #munizioni b.poche { color: #ff6a50; }
#munizioni span { font: 600 22px "Barlow Condensed", sans-serif; color: var(--tenue); margin-left: 6px; }
#nomeArma { font: 600 15px "Barlow Condensed", sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--tenue); }
#granate { font-size: 18px; color: var(--accento); letter-spacing: .1em; }
.serie { position: absolute; left: 16px; bottom: 22px; list-style: none; margin: 0; padding: 0; font: 600 14px "Barlow Condensed", sans-serif; }
.serie li { padding: 3px 10px 3px 4px; margin-top: 3px; background: rgba(0,0,0,.4); color: var(--tenue); display: flex; gap: 8px; align-items: center; }
.serie li kbd { min-width: 22px; text-align: center; background: rgba(255,255,255,.1); font: 700 13px "Barlow", sans-serif; }
.serie li small { margin-left: auto; opacity: .7; }
.serie li.pronta { color: var(--accento-t); background: var(--accento); animation: pulsa .8s ease-in-out infinite alternate; }
.serie li.usata { opacity: .4; text-decoration: line-through; }
.serie li.conta { background: none; color: var(--testo); }
@keyframes pulsa { to { filter: brightness(1.3); } }
/* mirino a quattro tacche: si allarga con la dispersione */
.mirino { position: absolute; left: 50%; top: 50%; width: 0; height: 0; --d: 10px; transition: opacity .12s; }
.mirino i { position: absolute; background: rgba(255,255,255,.92); box-shadow: 0 0 2px #000; }
.mirino i:nth-child(1) { width: 2px; height: 9px; left: -1px; top: calc(-1 * var(--d) - 9px); }
.mirino i:nth-child(2) { width: 2px; height: 9px; left: -1px; top: var(--d); }
.mirino i:nth-child(3) { width: 9px; height: 2px; top: -1px; left: calc(-1 * var(--d) - 9px); }
.mirino i:nth-child(4) { width: 9px; height: 2px; top: -1px; left: var(--d); }
.mirino b { position: absolute; width: 2px; height: 2px; left: -1px; top: -1px; background: rgba(255,255,255,.9); }
.hitmarker { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%) rotate(45deg); opacity: 1; }
.hitmarker::before, .hitmarker::after { content: ""; position: absolute; background: #fff; left: 50%; top: 50%; transform: translate(-50%,-50%); }
.hitmarker::before { width: 26px; height: 2px; } .hitmarker::after { width: 2px; height: 26px; }
.hitmarker.spento { opacity: 0; transition: opacity .1s; }
.hitmarker.testa::before, .hitmarker.testa::after { background: #ffd23f; }
.hitmarker.morto::before { background: #ff3b30; width: 34px; } .hitmarker.morto::after { background: #ff3b30; height: 34px; }
#piu { position: absolute; left: 50%; top: 56%; }
.piu { position: absolute; left: 0; top: 0; transform: translateX(-50%); font: 800 26px/1 "Barlow Condensed", sans-serif; color: var(--accento); text-shadow: 0 1px 4px #000; animation: sale 1.3s ease-out forwards; text-align: center; white-space: nowrap; }
.piu small { display: block; font-size: 15px; color: #fff; letter-spacing: .06em; text-transform: uppercase; }
@keyframes sale { from { transform: translate(-50%, 12px); opacity: 0; } 15% { opacity: 1; transform: translate(-50%, 0); } to { transform: translate(-50%, -30px); opacity: 0; } }
.ferito { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(120,0,0,0) 45%, rgba(140,8,4,.55) 80%, rgba(90,0,0,.85) 100%); transition: opacity .25s; }
#indicatori { position: absolute; left: 50%; top: 50%; }
.freccia-danno { position: absolute; left: 0; top: 0; width: 120px; height: 30px; border-top: 6px solid rgba(255,40,20,.85); border-radius: 50% 50% 0 0; animation: svanisci 1.4s ease-in forwards; }
@keyframes svanisci { to { opacity: 0; } }
.granata-vicina { position: absolute; left: 50%; top: 50%; font-size: 28px; color: #ffb23f; text-shadow: 0 0 8px #f00; }
.azione { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); padding: 8px 16px; background: rgba(0,0,0,.55); font: 700 18px "Barlow Condensed", sans-serif; letter-spacing: .04em; min-width: 260px; text-align: center; }
.azione i { display: block; height: 4px; background: var(--accento); margin-top: 6px; }
.messaggio { bottom: 150px; font: 700 21px "Barlow Condensed", sans-serif; text-align: center; max-width: 80vw; border-left: 3px solid var(--accento); }
.boss { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); width: min(480px, 70vw); text-align: center; font: 900 17px "Barlow Condensed", sans-serif; letter-spacing: .16em; color: #ff8a5c; }
.boss .barra { width: 100%; height: 10px; margin-top: 4px; }
.barra.rossa i { background: linear-gradient(90deg, #a11d0e, #ff5a2e); }
.avversari { position: absolute; right: 16px; top: 200px; list-style: none; margin: 0; padding: 8px 12px; background: rgba(0,0,0,.55); min-width: 210px; font: 600 15px "Barlow Condensed", sans-serif; }
.avversari li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 2px 0; }
.avversari li small { grid-column: 1 / -1; color: var(--tenue); font-size: 12px; }
.avversari li b { color: var(--accento); } .avversari li.io span { color: var(--accento); }
.avversari .tit { display: block; color: var(--tenue); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.avversari.aperto { transform: scale(1.25); transform-origin: top right; }
.ottica { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at center, transparent 0 32vmin, #000 32.3vmin); }
.ottica::before { content: ""; position: absolute; left: 50%; top: 50%; width: 64vmin; height: 1px; background: rgba(0,0,0,.85); transform: translate(-50%, -50%); }
.ottica::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1px; height: 64vmin; background: rgba(0,0,0,.85); transform: translate(-50%, -50%); }
.ottica i { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #ff2a1a; box-shadow: 0 0 6px #ff2a1a; }
.morto { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; background: rgba(60,0,0,.35); font: 800 34px "Barlow Condensed", sans-serif; text-shadow: 0 2px 8px #000; }
.morto small { display: block; font-size: 18px; color: var(--tenue); }
.tbtn { position: absolute; right: 22px; bottom: 30px; width: 86px; height: 86px; min-height: 0; border-radius: 50%; padding: 0; pointer-events: auto; background: rgba(255,255,255,.12); font-size: 30px; }
.tb2 { right: 124px; bottom: 22px; width: 64px; height: 64px; font-size: 22px; }
.tb3 { right: 22px; bottom: 132px; width: 64px; height: 64px; font-size: 22px; }
.tb4 { right: 100px; bottom: 104px; width: 58px; height: 58px; font-size: 20px; }
.tb5 { right: 196px; bottom: 30px; width: 58px; height: 58px; font-size: 20px; }
.tb6 { right: 22px; bottom: 212px; width: 58px; height: 58px; font-size: 20px; }
.tb7 { right: 92px; bottom: 182px; width: 54px; height: 54px; font-size: 18px; }
.tb8 { right: 160px; bottom: 150px; width: 54px; height: 54px; font-size: 18px; }
.tb9 { left: 180px; right: auto; bottom: 40px; width: 58px; height: 58px; font-size: 20px; }
.tbtn.attivo { background: var(--accento); color: var(--accento-t); }
@media (max-width: 700px) {
  #mappa { width: 120px; height: 120px; }
  .hud-dx { top: 142px; } .cronaca { top: 190px; font-size: 13px; } .avversari { top: auto; bottom: 230px; min-width: 150px; font-size: 13px; }
  .serie { display: none; } .armi-hud { bottom: auto; top: 16px; right: 148px; } #munizioni b { font-size: 30px; }
  .hud-centro { font-size: 14px; max-width: 46vw; }
}
@media (prefers-reduced-motion: reduce) { .serie li.pronta, .piu, .freccia-danno { animation: none; } }
