/* ═══════════════════════════════════════════════════════════
   ARROW BLITZ — Styles
   Palette: Volcanic Glass × Neon Arcade
   Font: Outfit (Google Fonts)
═══════════════════════════════════════════════════════════ */

:root {
  --bg:         #0D0D1A;
  --bg2:        #12122A;
  --bg3:        #1A1A35;
  --orange:     #FF6B2B;
  --cyan:       #00F5FF;
  --yellow:     #FFE600;
  --purple:     #B44FFF;
  --green:      #39FF14;
  --red:        #FF2D55;
  --white:      #F0F0FF;
  --muted:      #5A5A8A;
  --card-bg:    rgba(18, 18, 42, 0.95);
  --glow-o:     0 0 20px rgba(255,107,43,0.6);
  --glow-c:     0 0 20px rgba(0,245,255,0.6);
  --glow-y:     0 0 20px rgba(255,230,0,0.6);
  --font:       'Outfit', sans-serif;
  --radius:     16px;
  --radius-sm:  8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--font);
  color: var(--white);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: none;
}

/* ─── SCREENS ─────────────────────────────────────────── */
.screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 10;
}
.screen.active {
  opacity: 1; pointer-events: all;
}
.overlay-screen { z-index: 50; background: rgba(13,13,26,0.85); backdrop-filter: blur(8px); }
.transparent-overlay { background: transparent; z-index: 60; }

/* ─── SPLASH SCREEN ───────────────────────────────────── */
#screen-splash { overflow: hidden; }

.splash-bg {
  position: absolute; inset: 0; overflow: hidden;
}
.grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,245,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,245,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridScroll 20s linear infinite;
}
@keyframes gridScroll {
  from { transform: translateY(0); }
  to   { transform: translateY(40px); }
}

.orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.25;
  animation: orbFloat 8s ease-in-out infinite;
}
.orb-1 { width: 300px; height: 300px; background: var(--orange); top: -80px; right: -60px; animation-delay: 0s; }
.orb-2 { width: 250px; height: 250px; background: var(--cyan);   bottom: -60px; left: -40px; animation-delay: -3s; }
.orb-3 { width: 200px; height: 200px; background: var(--purple); top: 40%; left: 30%; animation-delay: -6s; }
@keyframes orbFloat {
  0%,100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-30px) scale(1.1); }
}

.splash-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; gap: 28px;
  padding: 40px 24px;
  width: 100%; max-width: 400px;
}

.logo-wrap { text-align: center; }
.logo-icon {
  width: 90px; height: 90px; margin: 0 auto 12px;
  animation: logoSpin 6s linear infinite;
  filter: drop-shadow(0 0 16px rgba(0,245,255,0.5));
}
@keyframes logoSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.logo-text {
  font-size: 48px; font-weight: 900; letter-spacing: 4px;
  line-height: 1;
  background: linear-gradient(135deg, var(--orange), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}
.logo-text span {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-sub {
  font-size: 13px; font-weight: 600; letter-spacing: 6px;
  color: var(--muted); margin-top: 6px;
}

.best-score-display {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(0,245,255,0.06);
  border: 1px solid rgba(0,245,255,0.2);
  border-radius: var(--radius);
  padding: 10px 32px;
}
.best-label { font-size: 11px; font-weight: 700; letter-spacing: 4px; color: var(--cyan); }
#splash-best-score { font-size: 36px; font-weight: 900; color: var(--white); line-height: 1.1; }

.splash-buttons { display: flex; flex-direction: column; gap: 12px; width: 100%; }

.splash-modes {
  display: flex; gap: 8px;
}
.mode-btn {
  flex: 1; padding: 8px 0; border-radius: 20px;
  border: 1px solid var(--muted);
  background: transparent; color: var(--muted);
  font-family: var(--font); font-size: 11px; font-weight: 700; letter-spacing: 2px;
  cursor: pointer; transition: all 0.2s;
}
.mode-btn.active {
  border-color: var(--cyan); color: var(--cyan);
  background: rgba(0,245,255,0.1);
  box-shadow: var(--glow-c);
}

/* ─── BUTTONS ─────────────────────────────────────────── */
.btn-primary {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, var(--orange), #FF3CAC);
  border: none; border-radius: var(--radius);
  color: var(--white); font-family: var(--font);
  font-size: 18px; font-weight: 800; letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(255,107,43,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:active { transform: scale(0.96); box-shadow: 0 2px 12px rgba(255,107,43,0.3); }

.btn-secondary {
  width: 100%; padding: 14px;
  background: transparent;
  border: 2px solid rgba(0,245,255,0.4);
  border-radius: var(--radius);
  color: var(--cyan); font-family: var(--font);
  font-size: 16px; font-weight: 700; letter-spacing: 2px;
  cursor: pointer; transition: all 0.2s;
}
.btn-secondary:active { background: rgba(0,245,255,0.1); }

.btn-ghost {
  width: 100%; padding: 12px;
  background: transparent; border: none;
  color: var(--muted); font-family: var(--font);
  font-size: 14px; font-weight: 600; letter-spacing: 2px;
  cursor: pointer; transition: color 0.2s;
}
.btn-ghost:active { color: var(--white); }

.btn-back {
  position: absolute; top: 20px; right: 20px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: none;
  color: var(--white); font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* ─── HOW TO PLAY ─────────────────────────────────────── */
.howto-content {
  position: relative; width: 100%; max-width: 400px;
  padding: 60px 24px 32px;
  display: flex; flex-direction: column; gap: 24px;
  overflow-y: auto; max-height: 100vh;
}
.howto-title {
  font-size: 28px; font-weight: 900; letter-spacing: 4px;
  text-align: center;
  background: linear-gradient(135deg, var(--orange), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.howto-steps { display: flex; flex-direction: column; gap: 16px; }
.howto-step {
  display: flex; align-items: center; gap: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius); padding: 16px;
}
.step-arrow-demo {
  width: 52px; height: 52px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(0,245,255,0.1);
  border: 2px solid rgba(0,245,255,0.3);
}
.demo-arrow { font-size: 24px; }
.step-text strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 4px; color: var(--white); }
.step-text p { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* ─── GAME SCREEN ─────────────────────────────────────── */
#screen-game {
  flex-direction: column; justify-content: flex-start;
  background: var(--bg);
}

/* HUD */
.hud {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px 8px;
  background: rgba(13,13,26,0.8);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 10; flex-shrink: 0;
}
.hud-left, .hud-right { min-width: 80px; }
.hud-right { text-align: right; }
.hud-score-label, .hud-combo-label {
  font-size: 10px; font-weight: 700; letter-spacing: 3px; color: var(--muted);
}
.hud-score {
  font-size: 28px; font-weight: 900; color: var(--white);
  transition: transform 0.1s;
}
.hud-score.pop { transform: scale(1.3); color: var(--yellow); }
.hud-combo {
  font-size: 24px; font-weight: 900; color: var(--cyan);
  transition: all 0.15s;
}
.hud-combo.hot { color: var(--orange); text-shadow: var(--glow-o); }

.hud-center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lives-display { display: flex; gap: 6px; }
.life { font-size: 18px; color: var(--muted); transition: all 0.3s; }
.life.active { color: var(--red); filter: drop-shadow(0 0 6px rgba(255,45,85,0.8)); }
.level-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 3px;
  color: var(--yellow); background: rgba(255,230,0,0.1);
  border: 1px solid rgba(255,230,0,0.3);
  padding: 2px 8px; border-radius: 10px;
}

/* Arena */
.arena {
  flex: 1; position: relative; width: 100%;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #12122A 0%, #0D0D1A 70%);
}

#particle-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}

/* Center Zone */
.center-zone {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100px; height: 100px;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
}
.zone-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(0,245,255,0.15);
  animation: ringPulse 2s ease-in-out infinite;
}
.ring-outer { width: 100px; height: 100px; animation-delay: 0s; }
.ring-inner { width: 70px; height: 70px; animation-delay: -1s; }
@keyframes ringPulse {
  0%,100% { opacity: 0.15; transform: scale(1); }
  50%      { opacity: 0.4;  transform: scale(1.05); }
}
.zone-core {
  width: 56px; height: 56px;
  background: rgba(0,245,255,0.05);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.zone-core.hit  { background: rgba(57,255,20,0.2);  box-shadow: 0 0 30px rgba(57,255,20,0.5); }
.zone-core.miss { background: rgba(255,45,85,0.2);  box-shadow: 0 0 30px rgba(255,45,85,0.5); }

/* Arrows */
#arrows-container { position: absolute; inset: 0; z-index: 3; pointer-events: none; }

.arrow-obj {
  position: absolute;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 26px;
  font-weight: 900;
  transition: none;
  z-index: 3;
  pointer-events: none;
}
.arrow-obj.dir-up    { color: var(--cyan);   background: rgba(0,245,255,0.12);   border: 2px solid rgba(0,245,255,0.5);   box-shadow: 0 0 16px rgba(0,245,255,0.3); }
.arrow-obj.dir-down  { color: var(--orange); background: rgba(255,107,43,0.12);  border: 2px solid rgba(255,107,43,0.5);  box-shadow: 0 0 16px rgba(255,107,43,0.3); }
.arrow-obj.dir-left  { color: var(--purple); background: rgba(180,79,255,0.12);  border: 2px solid rgba(180,79,255,0.5);  box-shadow: 0 0 16px rgba(180,79,255,0.3); }
.arrow-obj.dir-right { color: var(--yellow); background: rgba(255,230,0,0.12);   border: 2px solid rgba(255,230,0,0.5);   box-shadow: 0 0 16px rgba(255,230,0,0.3); }

/* Special arrow types */
.arrow-obj.type-shield  { border-color: var(--green) !important; color: var(--green) !important; background: rgba(57,255,20,0.15) !important; }
.arrow-obj.type-slow    { border-color: #FF88FF !important; color: #FF88FF !important; background: rgba(255,136,255,0.15) !important; }
.arrow-obj.type-double  { border-color: var(--yellow) !important; color: var(--yellow) !important; background: rgba(255,230,0,0.2) !important; animation: doublePulse 0.5s ease-in-out infinite alternate; }
.arrow-obj.type-bomb    { border-color: var(--red) !important; color: var(--red) !important; background: rgba(255,45,85,0.15) !important; animation: bombShake 0.3s ease-in-out infinite; }
@keyframes doublePulse { from { transform: scale(1); } to { transform: scale(1.12); } }
@keyframes bombShake   { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }

.arrow-obj.trail::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: inherit;
  opacity: 0.3;
  animation: trailFade 0.4s ease-out forwards;
}
@keyframes trailFade { to { transform: scale(2); opacity: 0; } }

/* Feedback text */
.feedback-text {
  position: absolute; top: 30%; left: 50%;
  transform: translateX(-50%);
  font-size: 28px; font-weight: 900; letter-spacing: 3px;
  pointer-events: none; z-index: 20;
  opacity: 0; transition: none;
  text-shadow: 0 0 20px currentColor;
}
.feedback-text.show {
  animation: feedbackPop 0.7s ease-out forwards;
}
@keyframes feedbackPop {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0) scale(0.6); }
  30%  { opacity: 1; transform: translateX(-50%) translateY(-10px) scale(1.2); }
  70%  { opacity: 1; transform: translateX(-50%) translateY(-20px) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-40px) scale(0.9); }
}
.feedback-text.perfect { color: var(--cyan); }
.feedback-text.great   { color: var(--green); }
.feedback-text.good    { color: var(--yellow); }
.feedback-text.miss    { color: var(--red); }

/* Power-up indicator */
.powerup-indicator {
  position: absolute; top: 12px; left: 50%;
  transform: translateX(-50%);
  font-size: 13px; font-weight: 700; letter-spacing: 2px;
  padding: 6px 16px; border-radius: 20px;
  background: rgba(57,255,20,0.15);
  border: 1px solid rgba(57,255,20,0.4);
  color: var(--green);
  opacity: 0; transition: opacity 0.3s;
  z-index: 10;
}
.powerup-indicator.visible { opacity: 1; }

/* Controls */
.controls {
  flex-shrink: 0;
  padding: 12px 0 20px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: rgba(13,13,26,0.9);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.controls-row { display: flex; align-items: center; justify-content: center; gap: 6px; }
.ctrl-center-gap { width: 72px; height: 72px; }

.ctrl-btn {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.12);
  color: var(--white);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.ctrl-btn svg { width: 32px; height: 32px; }
.ctrl-btn:active,
.ctrl-btn.pressed {
  background: rgba(0,245,255,0.2);
  border-color: var(--cyan);
  box-shadow: var(--glow-c);
  transform: scale(0.92);
}
#btn-up    { color: var(--cyan); }
#btn-down  { color: var(--orange); }
#btn-left  { color: var(--purple); }
#btn-right { color: var(--yellow); }

.btn-pause {
  position: absolute; top: 12px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: none;
  color: var(--white); font-size: 16px;
  cursor: pointer; z-index: 20;
  display: flex; align-items: center; justify-content: center;
}

/* ─── OVERLAY CARDS ───────────────────────────────────── */
.overlay-card {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 32px 28px;
  width: calc(100% - 48px); max-width: 360px;
  display: flex; flex-direction: column; gap: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.overlay-title {
  font-size: 32px; font-weight: 900; letter-spacing: 4px;
  text-align: center;
  background: linear-gradient(135deg, var(--orange), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.overlay-buttons { display: flex; flex-direction: column; gap: 10px; }

/* Pause */
.pause-score {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 14px; font-weight: 600; color: var(--muted);
}
.pause-score span:last-child { font-size: 24px; font-weight: 900; color: var(--white); }

/* Game Over */
.gameover-card { gap: 16px; }
.gameover-header { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.gameover-icon { font-size: 40px; animation: iconBounce 0.6s ease-out; }
@keyframes iconBounce {
  0%   { transform: scale(0) rotate(-20deg); }
  60%  { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.gameover-stats { display: flex; flex-direction: column; gap: 8px; }
.stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
}
.stat-label { font-size: 11px; font-weight: 700; letter-spacing: 3px; color: var(--muted); }
.stat-val { font-size: 22px; font-weight: 900; color: var(--white); }
.stat-val.highlight { color: var(--yellow); text-shadow: var(--glow-y); }

.new-best-banner {
  text-align: center; font-size: 18px; font-weight: 800; letter-spacing: 2px;
  color: var(--yellow); padding: 10px;
  background: rgba(255,230,0,0.1);
  border: 1px solid rgba(255,230,0,0.3);
  border-radius: var(--radius-sm);
  animation: bestPulse 0.8s ease-in-out infinite alternate;
}
.new-best-banner.hidden { display: none; }
@keyframes bestPulse {
  from { box-shadow: 0 0 10px rgba(255,230,0,0.3); }
  to   { box-shadow: 0 0 24px rgba(255,230,0,0.7); }
}

/* ─── COUNTDOWN ───────────────────────────────────────── */
.countdown-number {
  font-size: 120px; font-weight: 900;
  background: linear-gradient(135deg, var(--orange), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: countPop 0.8s ease-out;
  filter: drop-shadow(0 0 30px rgba(0,245,255,0.5));
}
@keyframes countPop {
  0%   { transform: scale(2); opacity: 0; }
  50%  { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ─── SCREEN SHAKE ────────────────────────────────────── */
@keyframes screenShake {
  0%,100% { transform: translate(0,0) rotate(0deg); }
  10%     { transform: translate(-6px, -4px) rotate(-1deg); }
  20%     { transform: translate(6px, 4px) rotate(1deg); }
  30%     { transform: translate(-4px, 6px) rotate(0deg); }
  40%     { transform: translate(4px, -6px) rotate(1deg); }
  50%     { transform: translate(-6px, 2px) rotate(-1deg); }
  60%     { transform: translate(6px, -2px) rotate(0deg); }
  70%     { transform: translate(-2px, 6px) rotate(-1deg); }
  80%     { transform: translate(2px, -4px) rotate(1deg); }
  90%     { transform: translate(-4px, 2px) rotate(0deg); }
}
.shake { animation: screenShake 0.4s ease-out; }

/* ─── CHROMATIC ABERRATION FLASH ──────────────────────── */
@keyframes chromaFlash {
  0%   { filter: none; }
  20%  { filter: hue-rotate(90deg) saturate(3) brightness(1.5); }
  40%  { filter: hue-rotate(-90deg) saturate(3) brightness(1.3); }
  60%  { filter: hue-rotate(45deg) saturate(2) brightness(1.2); }
  100% { filter: none; }
}
.chroma { animation: chromaFlash 0.3s ease-out; }

/* ─── PROGRESS BAR (arrow timer) ──────────────────────── */
.arrow-timer-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; border-radius: 0 0 50% 50%;
  background: currentColor;
  transform-origin: left;
  transition: transform linear;
}

/* ─── SLOW-MO OVERLAY ─────────────────────────────────── */
.slowmo-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background: rgba(180,79,255,0.06);
  border: 3px solid rgba(180,79,255,0.3);
  opacity: 0; transition: opacity 0.3s;
}
.slowmo-overlay.active { opacity: 1; }

/* ─── RESPONSIVE ──────────────────────────────────────── */
@media (max-height: 700px) {
  .ctrl-btn { width: 60px; height: 60px; }
  .ctrl-center-gap { width: 60px; height: 60px; }
  .ctrl-btn svg { width: 26px; height: 26px; }
  .controls { padding: 8px 0 12px; gap: 4px; }
  .hud-score { font-size: 22px; }
  .hud-combo { font-size: 18px; }
}
@media (min-width: 480px) {
  .ctrl-btn { width: 80px; height: 80px; }
  .ctrl-center-gap { width: 80px; height: 80px; }
}