/* 
 ACCELERANDO - CRT Synthwave Typing Game Scoped under .accelerando-theme to prevent CSS bleeding */

/* ── Root Theme Variables ── */
.accelerando-theme {
  --crt-bg: #0a0a0f;
  --crt-teal: #00f5d4;
  --crt-cyan: #00bbf9;
  --crt-pink: #f15bb5;
  --crt-yellow: #fee440;
  --crt-red: #ef476f;
  --crt-green: #06ffa5;
  --crt-grid: rgba(0, 245, 212, 0.08);
  --crt-glow: 0 0 10px var(--crt-teal), 0 0 20px var(--crt-teal), 0 0 40px var(--crt-teal);
  --crt-glow-pink: 0 0 10px var(--crt-pink), 0 0 20px var(--crt-pink);
  --crt-glow-red: 0 0 10px var(--crt-red), 0 0 20px var(--crt-red);
  --font-display: 'Orbitron', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
  --font-pixel: 'Press Start 2P', cursive;
}

/* ── CRT Overlay System ── */
.accelerando-theme .crt-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--crt-bg);
  overflow: hidden;
}

.accelerando-theme .crt-scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.15) 2px,
      rgba(0, 0, 0, 0.15) 4px);
  animation: scanline-scroll 8s linear infinite;
}

@keyframes scanline-scroll {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 0 100%;
  }
}

.accelerando-theme .crt-flicker {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: rgba(0, 245, 212, 0.02);
  animation: flicker 0.15s infinite;
}

@keyframes flicker {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.97;
  }
}

.accelerando-theme .crt-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  background: radial-gradient(ellipse at center,
      transparent 0%,
      transparent 60%,
      rgba(0, 0, 0, 0.6) 100%);
}

.accelerando-theme .crt-curved-screen {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9996;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.7);
  border-radius: 20px;
}

/* ── Animated Grid Background ── */
.accelerando-theme .crt-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--crt-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--crt-grid) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: grid-move 20s linear infinite;
  opacity: 0.5;
}

@keyframes grid-move {
  0% {
    transform: perspective(500px) rotateX(60deg) translateY(0);
  }

  100% {
    transform: perspective(500px) rotateX(60deg) translateY(50px);
  }
}

/* ── Floating Music Notes ── */
.accelerando-theme .music-note {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0.06;
  color: var(--crt-teal);
  pointer-events: none;
  animation: note-float 6s ease-in-out infinite;
}

@keyframes note-float {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.06;
  }

  25% {
    transform: translateY(-30px) rotate(10deg);
    opacity: 0.1;
  }

  50% {
    transform: translateY(-15px) rotate(-5deg);
    opacity: 0.08;
  }

  75% {
    transform: translateY(-40px) rotate(15deg);
    opacity: 0.12;
  }
}

/* ── Screen Shake ── */
.accelerando-theme .screen-shake {
  animation: crt-shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes crt-shake {
  0% {
    transform: translate(2px, 2px) rotate(0deg);
    filter: hue-rotate(0deg);
  }

  10% {
    transform: translate(-2px, -3px) rotate(-1deg);
    filter: hue-rotate(90deg);
  }

  20% {
    transform: translate(-4px, 1px) rotate(1deg);
    filter: hue-rotate(180deg);
  }

  30% {
    transform: translate(4px, 3px) rotate(0deg);
    filter: hue-rotate(270deg);
  }

  40% {
    transform: translate(2px, -2px) rotate(1deg);
    filter: hue-rotate(360deg);
  }

  50% {
    transform: translate(-2px, 3px) rotate(-1deg);
  }

  60% {
    transform: translate(-4px, 2px) rotate(0deg);
  }

  70% {
    transform: translate(4px, 2px) rotate(-1deg);
  }

  80% {
    transform: translate(-2px, -2px) rotate(1deg);
  }

  90% {
    transform: translate(2px, 3px) rotate(0deg);
  }

  100% {
    transform: translate(1px, -3px) rotate(-1deg);
  }
}

/* ── Glitch Text Effect ── */
.accelerando-theme .glitch-text {
  position: relative;
  color: white;
}

.accelerando-theme .glitch-text::before,
.accelerando-theme .glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.accelerando-theme .glitch-text::before {
  left: 3px;
  text-shadow: -2px 0 var(--crt-pink);
  clip: rect(24px, 550px, 90px, 0);
  animation: glitch-anim-1 3s infinite linear alternate-reverse;
}

.accelerando-theme .glitch-text::after {
  left: -3px;
  text-shadow: -2px 0 var(--crt-cyan);
  clip: rect(85px, 550px, 140px, 0);
  animation: glitch-anim-2 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0% {
    clip: rect(20px, 9999px, 10px, 0);
  }

  20% {
    clip: rect(60px, 9999px, 70px, 0);
  }

  40% {
    clip: rect(10px, 9999px, 50px, 0);
  }

  60% {
    clip: rect(80px, 9999px, 100px, 0);
  }

  80% {
    clip: rect(30px, 9999px, 40px, 0);
  }

  100% {
    clip: rect(90px, 9999px, 110px, 0);
  }
}

@keyframes glitch-anim-2 {
  0% {
    clip: rect(60px, 9999px, 70px, 0);
  }

  20% {
    clip: rect(10px, 9999px, 50px, 0);
  }

  40% {
    clip: rect(80px, 9999px, 100px, 0);
  }

  60% {
    clip: rect(30px, 9999px, 40px, 0);
  }

  80% {
    clip: rect(90px, 9999px, 110px, 0);
  }

  100% {
    clip: rect(20px, 9999px, 10px, 0);
  }
}

/* ── HUD Panel Styles ── */
.accelerando-theme .hud-panel {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 245, 212, 0.2);
  box-shadow:
    0 0 20px rgba(0, 245, 212, 0.05),
    inset 0 0 20px rgba(0, 245, 212, 0.02);
  clip-path: polygon(0 8px, 8px 0,
      calc(100% - 8px) 0, 100% 8px,
      100% calc(100% - 8px), calc(100% - 8px) 100%,
      8px 100%, 0 calc(100% - 8px));
}

.accelerando-theme .hud-panel-danger {
  border-color: rgba(239, 71, 111, 0.4);
  box-shadow:
    0 0 20px rgba(239, 71, 111, 0.1),
    inset 0 0 20px rgba(239, 71, 111, 0.03);
  animation: danger-pulse 1s ease-in-out infinite;
}

@keyframes danger-pulse {

  0%,
  100% {
    border-color: rgba(239, 71, 111, 0.4);
  }

  50% {
    border-color: rgba(239, 71, 111, 0.8);
  }
}

/* ── Neon Button Styles ── */
.accelerando-theme .neon-btn {
  position: relative;
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  background: transparent;
  border: 2px solid var(--crt-teal);
  color: var(--crt-teal);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0% 100%);
}

.accelerando-theme .neon-btn:hover {
  background: rgba(0, 245, 212, 0.15);
  box-shadow: var(--crt-glow);
  transform: translateY(-2px);
}

.accelerando-theme .neon-btn:active {
  transform: translateY(0);
}

.accelerando-theme .neon-btn-primary {
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.2), rgba(0, 187, 249, 0.2));
  border-color: var(--crt-teal);
  color: white;
}

.accelerando-theme .neon-btn-primary:hover {
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.4), rgba(0, 187, 249, 0.4));
}

.accelerando-theme .neon-btn-danger {
  border-color: var(--crt-red);
  color: var(--crt-red);
}

.accelerando-theme .neon-btn-danger:hover {
  background: rgba(239, 71, 111, 0.15);
  box-shadow: var(--crt-glow-red);
}

/* ── Progress Bar ── */
.accelerando-theme .progress-container {
  position: relative;
  height: 12px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 245, 212, 0.2);
  border-radius: 0;
  overflow: hidden;
}

.accelerando-theme .progress-fill {
  height: 100%;
  transition: width 0.1s linear, background 0.3s ease;
  position: relative;
  overflow: hidden;
}

.accelerando-theme .progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.3) 50%,
      transparent 100%);
  animation: progress-shine 2s ease-in-out infinite;
}

@keyframes progress-shine {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(200%);
  }
}

/* ── Word Display ── */
.accelerando-theme .word-display {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.accelerando-theme .word-display .typed {
  color: var(--crt-teal);
  text-shadow: var(--crt-glow);
}

.accelerando-theme .word-display .untyped {
  color: rgba(255, 255, 255, 0.4);
}

.accelerando-theme .word-display .cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--crt-teal);
  margin-left: 2px;
  animation: cursor-blink 0.8s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes cursor-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* ── Input Field ── */
.accelerando-theme .crt-input {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(0, 245, 212, 0.3);
  color: white;
  caret-color: var(--crt-teal);
  transition: all 0.3s ease;
}

.accelerando-theme .crt-input:focus {
  border-color: var(--crt-teal);
  box-shadow: var(--crt-glow);
  outline: none;
}

.accelerando-theme .crt-input::placeholder {
  color: rgba(255, 255, 255, 0.2);
  font-family: var(--font-mono);
}

/* ── Score Board ── */
.accelerando-theme .score-stat {
  font-family: var(--font-mono);
  text-align: center;
}

.accelerando-theme .score-stat .label {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 4px;
}

.accelerando-theme .score-stat .value {
  font-size: 1.8rem;
  font-weight: 900;
  color: white;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* ── Combo Display ── */
.accelerando-theme .combo-display {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 900;
  font-style: italic;
  color: var(--crt-yellow);
  text-shadow: 0 0 20px var(--crt-yellow), 0 0 40px var(--crt-yellow);
  animation: combo-pop 0.3s ease-out;
}

@keyframes combo-pop {
  0% {
    transform: scale(1.5);
  }

  100% {
    transform: scale(1);
  }
}

/* ── Particle Notes ── */
.accelerando-theme .particle-note {
  position: fixed;
  pointer-events: none;
  z-index: 100;
  font-size: 2rem;
  font-family: var(--font-pixel);
}

/* ── Tutorial Modal ── */
.accelerando-theme .tutorial-modal {
  background: rgba(10, 10, 15, 0.95);
  border: 1px solid rgba(0, 245, 212, 0.3);
  box-shadow: 0 0 60px rgba(0, 245, 212, 0.1);
}

/* ── Pause Menu ── */
.accelerando-theme .pause-overlay {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

/* ── Game Over / Victory Screen ── */
.accelerando-theme .end-screen {
  background: rgba(10, 10, 15, 0.9);
  border-top: 2px solid var(--crt-teal);
  border-bottom: 2px solid var(--crt-teal);
}

.accelerando-theme .end-screen.victory {
  border-color: var(--crt-green);
}

.accelerando-theme .end-screen.gameover {
  border-color: var(--crt-red);
}

/* ── Countdown ── */
.accelerando-theme .countdown-number {
  font-family: var(--font-display);
  font-size: 8rem;
  font-weight: 900;
  color: var(--crt-teal);
  text-shadow: var(--crt-glow);
  animation: countdown-pulse 1s ease-in-out;
}

@keyframes countdown-pulse {
  0% {
    transform: scale(2);
    opacity: 0;
  }

  50% {
    transform: scale(1);
    opacity: 1;
  }

  100% {
    transform: scale(0.5);
    opacity: 0;
  }
}

/* ── Tempo Indicator ── */
.accelerando-theme .tempo-bar {
  display: flex;
  gap: 4px;
  align-items: flex-end;
}

.accelerando-theme .tempo-segment {
  width: 6px;
  background: rgba(0, 245, 212, 0.2);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.accelerando-theme .tempo-segment.active {
  background: var(--crt-teal);
  box-shadow: 0 0 10px var(--crt-teal);
}

/* ── Scrollbar ── */
.accelerando-theme ::-webkit-scrollbar {
  width: 6px;
}

.accelerando-theme ::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.accelerando-theme ::-webkit-scrollbar-thumb {
  background: rgba(0, 245, 212, 0.3);
  border-radius: 3px;
}

.accelerando-theme ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 245, 212, 0.5);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .accelerando-theme .word-display {
    font-size: 2.5rem;
  }

  .accelerando-theme .combo-display {
    font-size: 2.5rem;
  }

  .accelerando-theme .countdown-number {
    font-size: 5rem;
  }
}

