@font-face {
  font-family: 'Rezzzistor';
  src: url('Rezzzistor.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(circle at 50% 40%, #171b30 70%, #090d17 100%);
  overflow: hidden;
  font-family: 'Rezzzistor', Arial, sans-serif;
  position: relative;
}

/* SFONDO ANIMATO OTTICO CENTRALE */
#animated-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(55,80,90,0.20) 0 20%, rgba(20,30,40,0.38) 45%, #121c20 100%);
}
#animated-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    conic-gradient(
      rgba(60, 110, 90, 0.22) 0deg 33deg,
      rgba(130, 220, 185, 0.11) 33deg 80deg,
      rgba(60, 120, 90, 0.13) 81deg 117deg,
      rgba(30, 60, 40, 0.14) 118deg 166deg,
      rgba(80,155,184,0.15) 167deg 221deg,
      rgba(110,200,200,0.12) 222deg 360deg
    );
  filter: blur(1.7px);
  mix-blend-mode: lighten;
  opacity: 0.53;
  border-radius: 50%;
  animation: rotate-rays 10s linear infinite;
  z-index: 0;
}
@keyframes rotate-rays {
  0% { transform: rotate(0deg);}
  100% {transform: rotate(360deg);}
}

/* VHS Overlay */
#vhs-overlay {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.035) 0,
      rgba(255,255,255,0.035) 1.5px,
      transparent 1.5px,
      transparent 4px
    ),
    repeating-linear-gradient(
      to right,
      rgba(0,255,255,0.06) 0,
      rgba(0,255,255,0.06) 1px,
      transparent 1px,
      transparent 10px
    )
  ;
  mix-blend-mode: lighten;
  opacity: 0.38;
  animation:
    vhs-flip 0.13s infinite steps(2, end),
    vhs-pixelglitch 3.5s infinite steps(1, end);
}

@keyframes vhs-flip {
  0%   { opacity: 0.18; filter: blur(0.2px) brightness(1.01);}
  25%  { opacity: 0.32; }
  35%  { opacity: 0.29; filter: blur(0.5px) brightness(1.11);}
  60%  { opacity: 0.43; filter: blur(1.1px) brightness(0.98);}
  75%  { opacity: 0.22; }
  100% { opacity: 0.38; filter: blur(0.1px) brightness(1); }
}

@keyframes vhs-pixelglitch {
  0%, 91%, 100% { 
    background-position: 0 0, 0 0;
    filter: none;
  }
  92%, 94% {
    background-position: 0 0, 22px 5px;
    filter: hue-rotate(7deg) contrast(2) brightness(1.7);
  }
  95% {
    background-position: 10px 0, 30px 16px;
    filter: hue-rotate(-25deg) contrast(2.8) brightness(1.3);
  }
}

#quiz-container {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

#progress-row {
  width: 60vw;
  max-width: 700px;
  display: flex;
  align-items: center;
  margin-bottom: 2.2rem;
}
.step-index {
  color: #46eaff;
  font-size: 1.11rem;
  letter-spacing: 0.08em;
  text-shadow: 0 0 7px #00f9ff, 0 0 10px #219ca6;
}

#progress-bar-container {
  flex: 1;
  height: 8px;
  background: #14203a;
  border-radius: 6px;
  margin: 0 .75rem;
  overflow: hidden;
  box-shadow: 0 0 8px #2486b7;
}
#progress-bar {
  width: 8%;
  height: 100%;
  background: linear-gradient(90deg, #00f9ff 10%, #209c58 85%);
  box-shadow: 0 0 16px #22c2ff;
  transition: width 0.5s;
}

#subtitle {
  letter-spacing: .10em;
  color: #6ff2e4af;
  font-size: 1.02rem;
  text-align: center;
  margin-bottom: 24px;
  text-shadow: 0 0 4px #33fff7;
}
#question {
  color: #46eaff;
  font-size: 2.55rem;
  font-weight: 600;
  margin-bottom: 2.2rem;
  text-align: center;
  text-shadow: 0 0 2px #00f9ff, 0 0 30px #219ca6;
  letter-spacing: .08em;
  animation: question-flicker 1.4s infinite alternate;
}

@keyframes question-flicker {
  0% { opacity: 1; }
  18% { opacity: 0.84; }
  27% { opacity: 1; }
  34% { opacity: 0.9; }
  89% { opacity: 1; }
  91% { opacity: 0.6; }
  100% { opacity: 1; }
}

#answers {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.answer-row {
  display: flex;
  gap: 3.2rem;
  justify-content: center;
}
.answer-btn {
  min-width: 275px;
  min-height: 68px;
  background: rgba(20, 32, 55, 0.12);
  border: 2px solid #49ffe5;
  border-radius: 18px;
  color: #e2ffff;
  font-size: 1.19rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-align: left;
  text-shadow: 0 0 6px #7bfff6b6;
  box-shadow: 0 0 20px 0 #1ceee4a6, 0 0 0px 2px #249da5 inset;
  transition: border 0.14s, box-shadow 0.2s, background 0.18s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  outline: none;
}
.answer-btn .num {
  font-size: 0.97rem;
  color: #49ffe5a9;
  font-weight: 400;
  margin-left: 20px;
}
.answer-btn:hover, .answer-btn:focus {
  border: 2.5px solid #a7ff38;
  color: #a7ff38;
  background: rgba(71,255,38, 0.08);
  box-shadow: 0 0 38px #a7ff38a1, 0 0 0px 2.5px #92ff4a inset;
  z-index: 4;
  animation: btn-glow 0.14s linear alternate infinite;
}

@keyframes btn-glow {
  from { box-shadow: 0 0 15px #a7ff38a1, 0 0 0px 2.5px #92ff4a inset;}
  to { box-shadow: 0 0 30px #a7ff38f8, 0 0 0px 2.7px #92ff4a inset;}
}.answer-btn:active

.answer-btn:active,
.answer-btn.pressed {
    background: rgba(0,255,94,0.15);  /* Meno opaco */
    color: #1fff80;
    transform: scale(0.96) translateY(2px);
    border-color: #00f9ff;  /* ← CAMBIA QUI IL COLORE */
    box-shadow: 
        0 0 20px #00f9ff80,     /* ← BAGLIORI RIDOTTI */
        0 8px 20px rgba(0,0,0,0.3),
        inset 0 0 0 2px #00f9ff;
    animation: btn-press 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes btn-press {
    0% { /* stato iniziale invariato */ }
    50% {
        transform: scale(0.94) translateY(3px);
        box-shadow: 
            0 0 25px #00f9ffdd,    /* ← BAGLIORI RIDOTTI + NUOVO COLORE */
            0 4px 15px rgba(0,249,255,0.2);
        filter: brightness(1.15) drop-shadow(0 0 6px #00f9ff);  /* ← MENO INTENSO */
    }
    100% { /* fine invariato */ }
}

.answer-btn:active {
  background: rgba(0,255,94,0.13);
  color: #1fff80;
}

@media (max-width: 600px) {
  #question { font-size: 1.12rem; }
  .answer-btn { min-width: 120px; min-height: 50px; font-size: 1rem;}
  #progress-row { width: 97vw; }
}

/* VHS Glitch Effect (animazione transizione) */
.vhs-glitch {
  animation: vhs-glitch 0.68s steps(4) alternate both;
}
@keyframes vhs-glitch {
  0% { filter: hue-rotate(25deg) blur(1.1px) brightness(1.7);}
  20% { filter:hue-rotate(-14deg) blur(1.2px) brightness(2.1); }
  48% { filter: hue-rotate(33deg) brightness(2.3);}
  75% { transform: translateX(-16px) scaleY(0.993);}
  100% {filter:none; transform:none;}
}

#image-temp-wrap {
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

#image-temp-wrap.fade-in {
  opacity: 1;
}