:root {
  --fondo: #0c120a;
  --vetro: rgba(10, 13, 19, 0.86);
  --testo: #ececec;
  --tenue: #a2a7ae;
  --accento: #7ddc3a;
  --accento-t: #071204;
  --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; }

/* KIKKI HUKK */
h1 span { color: var(--accento); text-shadow: 0 0 24px rgba(125,220,58,.45); }
h1 { font-weight: 900; font-size: clamp(40px, 9vw, 64px); }
.etichetta { font: 600 11px/1 "Barlow", sans-serif; color: var(--tenue); text-transform: uppercase; letter-spacing: .12em; margin: 8px 0 4px; }
.forma { font: 900 30px/1 "Barlow Condensed", sans-serif; letter-spacing: .06em; color: #ffd76a; transition: color .3s, transform .3s; }
.forma.hukk { color: var(--accento); text-shadow: 0 0 14px rgba(125,220,58,.7); transform: scale(1.12); transform-origin: left center; }
.barra.verde i { background: linear-gradient(90deg, #3c9a1e, #9dff5a); box-shadow: 0 0 10px rgba(125,220,58,.6); transition: width .15s; }
.barra.verde i.piena { animation: pulsa .7s ease-in-out infinite alternate; }
@keyframes pulsa { to { filter: brightness(1.6); box-shadow: 0 0 18px #9dff5a; } }
.pronto { margin-top: 8px; padding: 4px 8px; background: var(--accento); color: var(--accento-t); font: 800 16px "Barlow Condensed", sans-serif; letter-spacing: .06em; text-align: center; animation: pulsa .7s ease-in-out infinite alternate; }
.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: #ffd23f; text-shadow: 0 0 10px rgba(255,190,40,.6); min-height: 0; }
.combo:empty { display: none; }
.boss { position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%); width: min(520px, 80vw); text-align: center; font: 900 18px "Barlow Condensed", sans-serif; letter-spacing: .14em; color: #ff8a5c; }
.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; }
#hud.lampo::after { content: ""; position: fixed; inset: 0; background: radial-gradient(circle, rgba(140,255,90,.45), rgba(40,120,10,.2)); animation: svanisci .6s ease-out forwards; pointer-events: none; }
@keyframes svanisci { to { opacity: 0; } }
.avversari { position: absolute; right: 16px; top: 140px; list-style: none; margin: 0; padding: 8px 12px; background: rgba(0,0,0,.5); min-width: 190px; 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 b { color: #7fe6ff; }
.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(125,220,58,.08); font-size: 15px; }
.grado:empty { display: none; }
.tbtn { right: 22px; bottom: 30px; width: 84px; height: 84px; font-size: 32px; }
.tbtn2 { right: 120px; bottom: 26px; width: 70px; height: 70px; font-size: 26px; }
.tbtn3 { right: 22px; bottom: 128px; width: 70px; height: 70px; font: 900 30px "Barlow Condensed", sans-serif; }
.tbtn4 { right: 104px; bottom: 112px; width: 62px; height: 62px; font-size: 24px; }
.tbtn5 { right: 186px; bottom: 60px; width: 62px; height: 62px; font-size: 24px; }
.tbtn3.pronto { background: var(--accento); color: var(--accento-t); animation: pulsa .7s ease-in-out infinite alternate; }
.schermata { background: radial-gradient(ellipse at center, rgba(8,20,4,.3), rgba(4,8,2,.78)); }
@media (max-width: 640px) {
  .hud-centro { top: 150px; font-size: 13px; max-width: 80vw; }
  .avversari { top: auto; bottom: 200px; right: 8px; min-width: 150px; font-size: 13px; }
  .barra { width: 140px; }
  .forma { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { .barra.verde i.piena, .pronto, .tbtn3.pronto { animation: none; } #hud.lampo::after { animation-duration: .01s; } }
