:root {
  --fondo: #0b0907;
  --vetro: rgba(10, 13, 19, 0.86);
  --testo: #ececec;
  --tenue: #a2a7ae;
  --accento: #e8b85a;
  --accento-t: #140c02;
  --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; }

/* ARS GOETIA */
body.inferno { --accento: #ff6a2a; --accento-t: #1a0602; }
h1 { font: 900 clamp(42px, 9vw, 66px)/0.95 "Cinzel", serif; letter-spacing: .04em; }
h1 span { color: var(--accento); text-shadow: 0 0 26px rgba(232,184,90,.45); }
body.inferno h1 span { text-shadow: 0 0 26px rgba(255,90,30,.5); }
h2 { font-family: "Cinzel", serif; font-weight: 900; font-size: 28px; }
.sottotitolo { margin: -6px 0 10px; font: 800 20px "Barlow Condensed", sans-serif; letter-spacing: .28em; text-transform: uppercase;
  background: linear-gradient(90deg, #ffe3a0, #fff 45%, #ff7a3a 55%, #ff3b1a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.schermata { background: radial-gradient(ellipse at 30% 20%, rgba(255,214,140,.10), transparent 55%), radial-gradient(ellipse at 75% 85%, rgba(255,70,20,.12), transparent 55%), radial-gradient(ellipse at center, rgba(0,0,0,.35), rgba(0,0,0,.78)); }
.etichetta { font: 600 11px/1 "Barlow", sans-serif; color: var(--tenue); text-transform: uppercase; letter-spacing: .12em; margin: 8px 0 4px; }
.forma { font: 900 28px/1 "Cinzel", serif; letter-spacing: .06em; color: var(--accento); }
.titolo-eroe { font-size: 12px; color: var(--tenue); max-width: 220px; }
.barra.ali i { background: linear-gradient(90deg, #7fb4e8, #e8f4ff); }
.barra.gloria i { background: linear-gradient(90deg, #a87a22, #ffe08a); transition: width .15s; }
body.inferno .barra.gloria i { background: linear-gradient(90deg, #8a1a08, #ff7a2a); }
.barra.gloria i.piena { animation: pulsa .7s ease-in-out infinite alternate; }
.barra i.bassa { background: var(--errore) !important; }
@keyframes pulsa { to { filter: brightness(1.6); box-shadow: 0 0 16px var(--accento); } }
.pronto { margin-top: 8px; padding: 4px 8px; background: var(--accento); color: var(--accento-t); font: 800 15px "Barlow Condensed", sans-serif; letter-spacing: .06em; text-align: center; animation: pulsa .7s ease-in-out infinite alternate; }
.speciale { margin-top: 8px; font: 600 13px "Barlow", sans-serif; color: var(--tenue); }
.speciale.pronta { color: var(--accento); font-weight: 800; }
.hud-dx { text-align: right; min-width: 120px; }
.punti { font: 900 30px/1 "Barlow Condensed", sans-serif; color: #fff; }
.tempo { font: 600 16px "Barlow", sans-serif; color: var(--tenue); }
.combo { font: 900 22px "Barlow Condensed", sans-serif; color: var(--accento); min-height: 0; }
.combo:empty { display: none; }
.hud-centro small { color: var(--tenue); font-size: 13px; }
.mirino { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%); transition: width .15s, height .15s; font-size: 0; }
.mirino i { position: absolute; background: rgba(255,255,255,.9); box-shadow: 0 0 3px rgba(0,0,0,.9); }
.mirino i:nth-child(1), .mirino i:nth-child(2) { width: 2px; height: 8px; left: calc(50% - 1px); }
.mirino i:nth-child(1) { top: 0; } .mirino i:nth-child(2) { bottom: 0; }
.mirino i:nth-child(3), .mirino i:nth-child(4) { height: 2px; width: 8px; top: calc(50% - 1px); }
.mirino i:nth-child(3) { left: 0; } .mirino i:nth-child(4) { right: 0; }
.mirino.mira { width: 16px; height: 16px; }
.mirino.mira i:nth-child(1), .mirino.mira i:nth-child(2) { height: 5px; }
.mirino.mira i:nth-child(3), .mirino.mira i:nth-child(4) { width: 5px; }
.boss { position: absolute; bottom: 74px; left: 50%; transform: translateX(-50%); width: min(560px, 82vw); text-align: center; font: 900 18px "Cinzel", serif; letter-spacing: .1em; color: #ffb08a; }
.boss .barra { width: 100%; height: 12px; margin-top: 4px; }
.barra.rossa i { background: linear-gradient(90deg, #a11d0e, #ff5a2e); }
.messaggio { font-size: 22px; text-align: center; max-width: 90vw; }
.schiera { position: absolute; left: 16px; bottom: 40px; list-style: none; margin: 0; padding: 8px 12px; background: rgba(0,0,0,.45); min-width: 190px; font-size: 13px; }
.schiera li { display: grid; grid-template-columns: 1fr; padding: 2px 0; }
.schiera li i { display: block; height: 3px; background: var(--accento); margin-top: 2px; }
.schiera .tit { color: var(--tenue); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.avversari { position: absolute; right: 16px; top: 140px; list-style: none; margin: 0; padding: 8px 12px; background: rgba(0,0,0,.5); min-width: 210px; font-size: 14px; }
.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.par b { color: #ffe08a; } .avversari li.inf b { color: #ff8a5a; }
.avversari .tit { display: block; color: var(--tenue); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.grado { margin: 4px 0 12px; padding: 8px 12px; border-left: 3px solid var(--accento); background: rgba(232,184,90,.08); font-size: 15px; }
.grado:empty { display: none; }
.guerra { margin: 10px 0 12px; padding: 10px 12px; background: rgba(255,255,255,.04); border: 1px solid var(--bordo); }
.gtit { margin: 0 0 6px; font: 800 15px "Barlow Condensed", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.gbarra { height: 12px; background: linear-gradient(90deg, #8a1a08, #ff5a1e); }
.gbarra .gp { display: block; height: 100%; width: 50%; background: linear-gradient(90deg, #fff4d0, #e8b85a); box-shadow: 0 0 12px rgba(232,184,90,.6); transition: width .8s; }
.gtesto { display: flex; justify-content: space-between; margin: 4px 0 0; font-size: 14px; }
.gtesto span:first-child b { color: #ffe08a; } .gtesto span:last-child b { color: #ff7a3a; }
.gsotto { margin: 4px 0 0; font-size: 13px; color: var(--tenue); }
.gsotto:empty { display: none; }
.parti { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.parte { display: flex; flex-direction: column; gap: 6px; min-height: 170px; padding: 16px; text-align: left; font-weight: 400; font-size: 15px; }
.parte b { font: 900 26px "Cinzel", serif; letter-spacing: .06em; }
.parte.par { background: linear-gradient(160deg, rgba(255,235,180,.22), rgba(40,30,10,.6)); border-color: rgba(232,184,90,.5); }
.parte.par b { color: #ffe9a8; }
.parte.inf { background: linear-gradient(160deg, rgba(255,80,30,.25), rgba(30,6,2,.7)); border-color: rgba(255,90,40,.5); }
.parte.inf b { color: #ff8a5a; }
.parte:hover { filter: brightness(1.15); }
.scelta-eroe { place-items: center end; background: linear-gradient(90deg, transparent 30%, rgba(0,0,0,.7)); }
.scelta-eroe .finestra { width: min(520px, 100%); }
.eroi { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 6px; }
.eroe { display: grid; gap: 2px; text-align: left; font-weight: 400; min-height: 0; padding: 10px 12px; margin: 0; }
.eroe b { font: 900 20px "Cinzel", serif; color: var(--accento); }
.eroe small { color: var(--tenue); font-size: 12px; }
.eroe span { font-size: 14px; }
.eroe em { font-style: normal; font-size: 12px; color: var(--tenue); }
.eroe.scelto { border-color: var(--accento); background: #2a2418; box-shadow: inset 3px 0 0 var(--accento); }
body.inferno .eroe.scelto { background: #2a140c; }
.griglia72 { list-style: none; padding: 0; margin: 10px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.griglia72 li { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; background: rgba(255,255,255,.04); border: 1px solid var(--bordo); cursor: pointer; text-align: center; }
.griglia72 li img { width: 64px; height: 64px; }
.griglia72 li b { font-size: 13px; } .griglia72 li small { font-size: 11px; color: var(--tenue); }
.griglia72 li.chiuso img { opacity: .18; filter: grayscale(1); }
.griglia72 li.chiuso b { color: var(--tenue); }
.griglia72 li:focus-visible { outline: 2px solid var(--accento); }
.scheda { padding: 12px; background: rgba(0,0,0,.35); border-left: 3px solid #c0281a; font-size: 15px; }
.scheda .testa { display: flex; gap: 14px; align-items: center; }
.scheda h3 { color: var(--testo); font-size: 18px; text-transform: none; letter-spacing: 0; margin: 0 0 4px; font-family: "Cinzel", serif; }
.scheda p { margin: 6px 0; }
.classifica li.par b { color: #ffe08a; } .classifica li.inf b { color: #ff8a5a; }
.classifica li small { color: var(--tenue); }
.tbtn { right: 22px; bottom: 30px; width: 88px; height: 88px; font-size: 34px; }
.tbtn2 { right: 124px; bottom: 26px; width: 70px; height: 70px; font-size: 26px; }
.tbtn3 { right: 22px; bottom: 132px; width: 66px; height: 66px; font: 900 26px "Cinzel", serif; }
.tbtn4 { right: 104px; bottom: 116px; width: 60px; height: 60px; font: 900 24px "Cinzel", serif; }
.tbtn.pronto { background: var(--accento); color: var(--accento-t); }
#tSpara { background: rgba(232,184,90,.28); }
@media (max-width: 640px) {
  .hud-centro { top: 160px; font-size: 13px; max-width: 80vw; }
  .avversari { top: auto; bottom: 200px; right: 8px; min-width: 150px; font-size: 13px; }
  .schiera { display: none; }
  .barra { width: 130px; }
  .forma { font-size: 22px; } .titolo-eroe { display: none; }
  .parti { grid-template-columns: 1fr; }
  .scelta-eroe { place-items: end center; }
}
@media (prefers-reduced-motion: reduce) { .barra.gloria i.piena, .pronto { animation: none; } }
.segni { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.segno { position: absolute; left: 0; top: 0; margin: -10px 0 0 -40px; width: 80px; text-align: center; font: 800 12px "Barlow Condensed", sans-serif; letter-spacing: .06em; color: #fff; text-shadow: 0 1px 3px #000; white-space: nowrap; }
.segno::before { content: ""; display: block; width: 10px; height: 10px; margin: 0 auto 2px; transform: rotate(45deg); border: 2px solid currentColor; }
.segno.str { color: #ff8a4a; } body.inferno .segno.str { color: #ffe08a; }
.segno.capo { color: #ff5a3a; font-size: 13px; } body.inferno .segno.capo { color: #fff0b0; }
.segno.nem { color: #ffb0a0; opacity: .85; }
.segno.bordo { opacity: .75; }
