/* ============================================================
   DISCO DASH — Complete Stylesheet (Dance Stage Rewrite)
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a1a;
  color: #fff;
  font-family: 'Fredoka', sans-serif;
}

/* --- Screens --- */
.screen {
  display: none;
  position: fixed;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.screen--active {
  display: flex;
}

/* ============================================================
   TITLE SCREEN
   ============================================================ */
#screen-title {
  background: radial-gradient(ellipse at center, #1a0a2e 0%, #0a0a1a 70%);
  gap: 20px;
}

.title-heading {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(28px, 6vw, 64px);
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 0 10px #ff00ff,
    0 0 20px #ff00ff,
    0 0 40px #ff00ff,
    0 0 80px #8800ff;
  animation: titlePulse 2s ease-in-out infinite;
  text-align: center;
  line-height: 1.4;
}

@keyframes titlePulse {
  0%, 100% { text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff, 0 0 40px #ff00ff, 0 0 80px #8800ff; }
  50% { text-shadow: 0 0 20px #ff44ff, 0 0 40px #ff44ff, 0 0 60px #ff44ff, 0 0 100px #aa22ff; }
}

.title-sub {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(14px, 2.5vw, 22px);
  color: #ffcc00;
  font-weight: 600;
}

.title-sub-small {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(11px, 2vw, 16px);
  color: rgba(255,255,255,0.5);
  font-weight: 400;
}

.title-keys {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 10px 0;
}

.key-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  font-family: 'Fredoka', sans-serif;
  font-size: 20px;
  font-weight: 700;
  border: 3px solid;
}
.key-hint--left  { color: #ff69b4; border-color: #ff69b4; background: rgba(255,105,180,0.15); }
.key-hint--down  { color: #00e5ff; border-color: #00e5ff; background: rgba(0,229,255,0.15); }
.key-hint--up    { color: #39ff14; border-color: #39ff14; background: rgba(57,255,20,0.15); }
.key-hint--right { color: #ffea00; border-color: #ffea00; background: rgba(255,234,0,0.15); }
.key-hint--space { color: #d580ff; border-color: #d580ff; background: rgba(213,128,255,0.15); width: 80px; font-size: 12px; }

.btn-start {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(14px, 2.5vw, 20px);
  padding: 16px 48px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff00ff, #8800ff);
  color: #fff;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 0 20px rgba(255,0,255,0.4), 0 4px 15px rgba(0,0,0,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  animation: btnPulse 1.5s ease-in-out infinite;
  margin-top: 8px;
}
.btn-start:hover {
  transform: scale(1.08);
  box-shadow: 0 0 30px rgba(255,0,255,0.6), 0 6px 20px rgba(0,0,0,0.5);
}
.btn-start:active {
  transform: scale(0.96);
}

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255,0,255,0.4), 0 4px 15px rgba(0,0,0,0.4); }
  50% { box-shadow: 0 0 35px rgba(255,0,255,0.7), 0 4px 20px rgba(0,0,0,0.5); }
}

.title-hint {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}

.home-link {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 14px;
  margin-top: 8px;
  transition: color 0.2s;
}
.home-link:hover {
  color: #ffcc00;
}

/* Title disco ball */
.title-disco-ball {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0%, #ccc 30%, #888 60%, #555 100%);
  box-shadow: 0 0 30px rgba(255,255,255,0.3), 0 0 60px rgba(200,200,255,0.2);
  animation: discoBallSpin 4s linear infinite;
  position: relative;
}
.title-disco-ball::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      rgba(255,255,255,0.3) 0deg 10deg,
      transparent 10deg 20deg
    );
  animation: sparkleRotate 3s linear infinite reverse;
}

@keyframes discoBallSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes sparkleRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============================================================
   MODE SELECT SCREEN
   ============================================================ */
#screen-mode-select {
  background: radial-gradient(ellipse at center, #1a0a2e 0%, #0a0a1a 70%);
  gap: 24px;
  padding: 24px;
}

.mode-select-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(16px, 3.5vw, 28px);
  color: #fff;
  text-shadow: 0 0 10px #ff00ff, 0 0 20px #8800ff;
  text-align: center;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  max-width: 720px;
  width: 100%;
  padding: 0 8px;
}

.mode-card {
  background: linear-gradient(180deg, #1a1a3a 0%, #0e0e24 100%);
  border: 3px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.mode-card:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

/* Cabinet top bezel */
.mode-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 13px 13px 0 0;
}

.mode-card--breakdancing { border-color: #ff69b4; }
.mode-card--breakdancing::before { background: #ff69b4; }
.mode-card--breakdancing:hover { box-shadow: 0 0 25px rgba(255,105,180,0.4), 0 8px 30px rgba(0,0,0,0.5); }

.mode-card--noRules { border-color: #39ff14; }
.mode-card--noRules::before { background: #39ff14; }
.mode-card--noRules:hover { box-shadow: 0 0 25px rgba(57,255,20,0.4), 0 8px 30px rgba(0,0,0,0.5); }

.mode-card--powerDancing { border-color: #ffea00; }
.mode-card--powerDancing::before { background: #ffea00; }
.mode-card--powerDancing:hover { box-shadow: 0 0 25px rgba(255,234,0,0.4), 0 8px 30px rgba(0,0,0,0.5); }

.mode-card--watchOut { border-color: #ff4444; }
.mode-card--watchOut::before { background: #ff4444; }
.mode-card--watchOut:hover { box-shadow: 0 0 25px rgba(255,68,68,0.4), 0 8px 30px rgba(0,0,0,0.5); }

.mode-card--battleDancing { border-color: #00e5ff; }
.mode-card--battleDancing::before { background: #00e5ff; }
.mode-card--battleDancing:hover { box-shadow: 0 0 25px rgba(0,229,255,0.4), 0 8px 30px rgba(0,0,0,0.5); }

.mode-card--allCombined { border-color: #d580ff; }
.mode-card--allCombined::before { background: #d580ff; }
.mode-card--allCombined:hover { box-shadow: 0 0 25px rgba(213,128,255,0.4), 0 8px 30px rgba(0,0,0,0.5); }

.mode-card--coming-soon {
  opacity: 0.5;
  cursor: default;
}
.mode-card--coming-soon:hover {
  transform: none;
}

.mode-card__icon {
  font-size: 36px;
  line-height: 1;
}

.mode-card__name {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  text-align: center;
  color: #fff;
  line-height: 1.4;
}

.mode-card__desc {
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  text-align: center;
  line-height: 1.3;
}

.mode-card__badge {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #ffcc00;
  background: rgba(255,204,0,0.15);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,204,0,0.3);
}

.btn-back {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  padding: 10px 28px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-back:hover {
  border-color: #ff00ff;
  color: #fff;
}

/* ============================================================
   GAME SCREEN — Full-Stage Layout
   ============================================================ */
#screen-game {
  flex-direction: column;
  background: #0a0a1a;
}

/* --- HUD --- */
.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  gap: 16px;
}
.hud__score, .hud__combo, .hud__crowd, .hud__power {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hud__label {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.6);
}
.hud__value {
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  color: #ffea00;
}
.hud__meter {
  width: 120px;
  height: 14px;
  border-radius: 7px;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  overflow: hidden;
}
.hud__meter--power {
  width: 80px;
  border-color: rgba(255,234,0,0.3);
}
.hud__meter-fill {
  height: 100%;
  width: 50%;
  border-radius: 5px;
  background: linear-gradient(90deg, #39ff14, #ffea00);
  transition: width 0.3s ease, background 0.3s ease;
}
.hud__meter-fill--power {
  background: linear-gradient(90deg, #ffea00, #ff8800);
  width: 0%;
}

/* Double points indicator */
.hud__double {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #ffea00;
  text-shadow: 0 0 10px #ffea00, 0 0 20px #ff8800;
  animation: doublePointsPulse 0.5s ease-in-out infinite;
  display: none;
}
.hud__double--active {
  display: block;
}
@keyframes doublePointsPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

/* --- Timing Feedback --- */
.timing-feedback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(20px, 4vw, 36px);
  z-index: 110;
  pointer-events: none;
  opacity: 0;
  transition: none;
}
.timing-feedback--show {
  animation: timingPop 0.5s ease-out forwards;
}
@keyframes timingPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  30% { transform: translate(-50%, -50%) scale(1.0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(1.0); }
}

/* --- Game Stage (FULL SCREEN) --- */
.game-stage {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  padding-top: 48px;
}
.game-stage--full {
  flex: 1;
}

/* Screen shake on good hits */
.game-stage--shake {
  animation: stageShake 0.2s ease-out;
}
@keyframes stageShake {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, 1px); }
  80% { transform: translate(2px, -1px); }
  100% { transform: translate(0, 0); }
}

/* Dance floor */
.dance-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35%;
  background:
    repeating-conic-gradient(
      #1a1a3a 0deg 90deg,
      #12122a 90deg 180deg
    ) 0 0 / 60px 60px;
  transform: perspective(400px) rotateX(30deg);
  transform-origin: bottom center;
  opacity: 0.8;
}
.dance-floor--flash {
  animation: floorFlash 0.2s ease-out;
}
@keyframes floorFlash {
  0% { background-color: rgba(255,255,255,0.3); }
  100% { background-color: transparent; }
}

/* Disco ball */
.disco-ball {
  position: absolute;
  top: 55px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0%, #ccc 30%, #999 60%, #666 100%);
  box-shadow: 0 0 20px rgba(255,255,255,0.3), 0 0 40px rgba(200,200,255,0.15);
  z-index: 10;
  transition: width 0.5s, height 0.5s, top 0.5s;
}
.disco-ball::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: #888;
}
.disco-ball::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      rgba(255,255,255,0.25) 0deg 15deg,
      transparent 15deg 30deg
    );
  animation: sparkleRotate 5s linear infinite;
}
.disco-ball--pulse {
  animation: discoPulse 0.3s ease-out;
}
@keyframes discoPulse {
  0% { box-shadow: 0 0 20px rgba(255,255,255,0.3), 0 0 40px rgba(200,200,255,0.15); transform: translateX(-50%) scale(1); }
  50% { box-shadow: 0 0 40px rgba(255,255,255,0.6), 0 0 80px rgba(255,200,255,0.4); transform: translateX(-50%) scale(1.15); }
  100% { box-shadow: 0 0 20px rgba(255,255,255,0.3), 0 0 40px rgba(200,200,255,0.15); transform: translateX(-50%) scale(1); }
}

/* Disco Ball Drop state */
.disco-ball--drop {
  width: 120px;
  height: 120px;
  top: 35%;
  box-shadow:
    0 0 40px rgba(255,255,255,0.6),
    0 0 80px rgba(255,200,255,0.5),
    0 0 120px rgba(200,100,255,0.3);
}
.disco-ball--drop::after {
  animation: sparkleRotate 1s linear infinite;
}

/* Stage lights */
.stage-light {
  position: absolute;
  top: 48px;
  width: 200px;
  height: 70%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.4;
  transition: opacity 0.5s;
}
.stage-light--left {
  left: 0;
  background: linear-gradient(135deg, rgba(255,0,255,0.3) 0%, transparent 60%);
}
.stage-light--right {
  right: 0;
  background: linear-gradient(225deg, rgba(0,200,255,0.3) 0%, transparent 60%);
}
.stage-light--back-left {
  left: 15%;
  top: 48px;
  width: 150px;
  background: linear-gradient(160deg, rgba(57,255,20,0.2) 0%, transparent 50%);
}
.stage-light--back-right {
  right: 15%;
  top: 48px;
  width: 150px;
  background: linear-gradient(200deg, rgba(255,234,0,0.2) 0%, transparent 50%);
}

/* Disco ball drop light cycling */
.stage-light--disco-drop {
  animation: lightCycle 0.3s linear infinite;
}
@keyframes lightCycle {
  0% { filter: hue-rotate(0deg); opacity: 0.9; }
  33% { filter: hue-rotate(120deg); opacity: 1; }
  66% { filter: hue-rotate(240deg); opacity: 0.9; }
  100% { filter: hue-rotate(360deg); opacity: 1; }
}

/* Crowd */
.crowd {
  position: absolute;
  bottom: 28%;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  z-index: 5;
  opacity: 0.6;
}

/* Particles container */
.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}
.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: particleFly 0.7s ease-out forwards;
}
@keyframes particleFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.2);
  }
}

/* Sparkle particles for disco ball drop */
.particle--sparkle {
  width: 4px;
  height: 4px;
  animation: sparkleFly 1.5s ease-out forwards;
}
@keyframes sparkleFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.1);
  }
}

/* ============================================================
   PROMPT LAYER — Circular prompts on stage
   ============================================================ */
.prompt-layer {
  position: absolute;
  inset: 48px 0 0 0;
  pointer-events: none;
  z-index: 30;
}

.prompt {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka', sans-serif;
  font-size: 46px;
  font-weight: 700;
  color: #fff;
  z-index: 10;
  pointer-events: none;
  box-shadow:
    0 0 30px var(--glow-color),
    0 0 60px var(--glow-color),
    inset 0 0 20px rgba(255,255,255,0.2);
  border: 4px solid rgba(255,255,255,0.6);
  text-shadow: 0 2px 6px rgba(0,0,0,0.7), 0 0 15px rgba(255,255,255,0.4);
}

.prompt--left {
  background: radial-gradient(circle, #ff8ecb, #ff3399);
  --glow-color: rgba(255,105,180,0.6);
}
.prompt--down {
  background: radial-gradient(circle, #66f0ff, #0099cc);
  --glow-color: rgba(0,229,255,0.6);
}
.prompt--up {
  background: radial-gradient(circle, #88ff66, #22aa00);
  --glow-color: rgba(57,255,20,0.6);
}
.prompt--right {
  background: radial-gradient(circle, #ffee66, #ccaa00);
  --glow-color: rgba(255,234,0,0.6);
}
.prompt--space {
  background: radial-gradient(circle, #e0a0ff, #9933ff);
  --glow-color: rgba(213,128,255,0.6);
  font-size: 28px;
  font-family: 'Press Start 2P', monospace;
}

/* "NOW!" glow — pulses bright when it's time to press */
.prompt--now {
  animation: promptNowPulse 0.4s ease-in-out infinite !important;
  border-color: #fff !important;
}
@keyframes promptNowPulse {
  0%, 100% {
    box-shadow:
      0 0 30px var(--glow-color),
      0 0 60px var(--glow-color),
      0 0 90px rgba(255,255,255,0.4),
      inset 0 0 20px rgba(255,255,255,0.3);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 40px var(--glow-color),
      0 0 80px var(--glow-color),
      0 0 120px rgba(255,255,255,0.6),
      inset 0 0 30px rgba(255,255,255,0.4);
    transform: scale(1.1);
  }
}

/* Trap prompt (Watch Out mode) */
.prompt--trap {
  border: 5px solid #ff0000;
  box-shadow: 0 0 30px rgba(255,0,0,0.7), 0 0 60px rgba(255,0,0,0.4);
  animation: trapPulse 0.3s ease-in-out infinite;
  background: radial-gradient(circle, #660000, #330000) !important;
}
@keyframes trapPulse {
  0%, 100% { border-color: #ff0000; transform: scale(1); }
  50% { border-color: #ff6666; transform: scale(1.08); }
}

.prompt__trap-x {
  position: absolute;
  font-family: 'Fredoka', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #ff0000;
  top: -8px;
  right: -8px;
  background: rgba(0,0,0,0.9);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #ff0000;
  text-shadow: 0 0 8px #ff0000;
}

/* Fun bounce when prompts appear */
.prompt {
  animation: promptBounceIn 0.3s ease-out;
}
@keyframes promptBounceIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Ring timer around prompt */
.prompt-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 5px solid currentColor;
  pointer-events: none;
  opacity: 0.3;
}

.prompt--left .prompt-ring { color: #ff69b4; }
.prompt--down .prompt-ring { color: #00e5ff; }
.prompt--up .prompt-ring { color: #39ff14; }
.prompt--right .prompt-ring { color: #ffea00; }
.prompt--space .prompt-ring { color: #d580ff; }
.prompt--trap .prompt-ring { color: #ff0000; }

/* Hit animation */
.prompt--hit {
  animation: promptExplode 0.35s ease-out forwards;
}
@keyframes promptExplode {
  0% { transform: scale(1); opacity: 1; }
  30% { transform: scale(1.4); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}

/* Miss animation */
.prompt--miss {
  animation: promptWobbleFade 0.4s ease-out forwards;
}
@keyframes promptWobbleFade {
  0% { opacity: 0.6; transform: rotate(0deg); }
  25% { transform: rotate(8deg); }
  50% { transform: rotate(-8deg); }
  75% { transform: rotate(4deg); opacity: 0.3; }
  100% { opacity: 0; transform: rotate(0deg) scale(0.5); }
}

/* Trap hit (pressed a trap — bad!) */
.prompt--trap-hit {
  animation: trapHitFlash 0.3s ease-out forwards;
}
@keyframes trapHitFlash {
  0% { transform: scale(1); opacity: 1; background: radial-gradient(circle, #ff0000, #880000); }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Trap ignored (good — bonus!) */
.prompt--trap-dodged {
  animation: trapDodge 0.3s ease-out forwards;
}
@keyframes trapDodge {
  0% { opacity: 0.5; }
  50% { opacity: 0.3; border-color: #39ff14; }
  100% { opacity: 0; transform: scale(0.3); }
}

/* ============================================================
   CHARACTER (CSS Pixel Art)
   ============================================================ */
.character-container {
  position: absolute;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
}

.char-body {
  position: relative;
  width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.1s;
}

/* Head */
.char-head {
  position: relative;
  width: 36px;
  height: 36px;
  background: #ffcc88;
  border-radius: 8px;
  z-index: 2;
}
.char-hair {
  position: absolute;
  top: -6px;
  left: -2px;
  right: -2px;
  height: 18px;
  background: #6a3bcc;
  border-radius: 10px 10px 0 0;
}
.char-face {
  position: absolute;
  bottom: 4px;
  left: 6px;
  right: 6px;
  height: 16px;
}
.char-eye {
  position: absolute;
  top: 2px;
  width: 6px;
  height: 6px;
  background: #222;
  border-radius: 50%;
}
.char-eye--left { left: 2px; }
.char-eye--right { right: 2px; }
.char-mouth {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 5px;
  background: #ff6688;
  border-radius: 0 0 5px 5px;
}

/* Torso */
.char-torso {
  width: 32px;
  height: 28px;
  background: linear-gradient(135deg, #ff00ff, #8800ff);
  border-radius: 4px;
  margin-top: -2px;
  z-index: 1;
}

/* Arms */
.char-arm {
  position: absolute;
  width: 10px;
  height: 28px;
  background: #ffcc88;
  border-radius: 5px;
  top: 40px;
  z-index: 0;
  transition: transform 0.15s ease;
  transform-origin: top center;
}
.char-arm--left {
  left: 0px;
}
.char-arm--right {
  right: 0px;
}

/* Legs */
.char-legs {
  display: flex;
  gap: 4px;
  margin-top: -2px;
}
.char-leg {
  width: 12px;
  height: 30px;
  background: #2244cc;
  border-radius: 3px 3px 4px 4px;
  transition: transform 0.15s ease;
  transform-origin: top center;
}
.char-foot {
  width: 14px;
  height: 6px;
  background: #fff;
  border-radius: 2px 6px 2px 2px;
  margin-top: -1px;
}
.char-foot--left { border-radius: 6px 2px 2px 2px; }

/* --- Character Poses --- */

/* Idle bounce */
.character--idle .char-body {
  animation: idleBounce 0.6s ease-in-out infinite;
}
@keyframes idleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Left lean */
.character--left .char-body {
  transform: rotate(-10deg) translateX(-8px);
}
.character--left .char-arm--left {
  transform: rotate(-60deg);
}
.character--left .char-arm--right {
  transform: rotate(10deg);
}

/* Right lean */
.character--right .char-body {
  transform: rotate(10deg) translateX(8px);
}
.character--right .char-arm--right {
  transform: rotate(60deg);
}
.character--right .char-arm--left {
  transform: rotate(-10deg);
}

/* Up / jump */
.character--up .char-body {
  transform: translateY(-16px);
}
.character--up .char-arm--left {
  transform: rotate(-45deg);
}
.character--up .char-arm--right {
  transform: rotate(45deg);
}
.character--up .char-leg--left {
  transform: rotate(-10deg);
}
.character--up .char-leg--right {
  transform: rotate(10deg);
}

/* Down / crouch */
.character--down .char-body {
  transform: translateY(8px) scaleY(0.85);
}
.character--down .char-arm--left {
  transform: rotate(20deg);
}
.character--down .char-arm--right {
  transform: rotate(-20deg);
}

/* Special (spacebar) — point */
.character--special .char-body {
  transform: translateY(-8px);
}
.character--special .char-arm--left {
  transform: rotate(-120deg);
}
.character--special .char-arm--right {
  transform: rotate(120deg);
}
.character--special .char-leg--left {
  transform: rotate(-15deg);
}
.character--special .char-leg--right {
  transform: rotate(15deg);
}

/* Stumble (miss) */
.character--stumble .char-body {
  transform: rotate(-15deg) translateY(4px);
}
.character--stumble .char-arm--left {
  transform: rotate(40deg);
}
.character--stumble .char-arm--right {
  transform: rotate(-60deg);
}

/* ============================================================
   RESULTS SCREEN
   ============================================================ */
#screen-results {
  background: radial-gradient(ellipse at center, #1a0a2e 0%, #0a0a1a 70%);
}

.results-card {
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 32px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 420px;
  width: 90%;
  backdrop-filter: blur(10px);
}

.results-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(14px, 3vw, 20px);
  color: #ffcc00;
}

.results-grade {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(48px, 10vw, 80px);
  line-height: 1;
  text-shadow: 0 0 20px currentColor;
}
.results-grade--S { color: #ff00ff; }
.results-grade--A { color: #39ff14; }
.results-grade--B { color: #00e5ff; }
.results-grade--C { color: #ffea00; }
.results-grade--D { color: #ff4444; }

.results-grade-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}

.results-stats {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0;
}
.results-stat {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
}
.results-stat__label {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
}
.results-stat__value {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  color: #fff;
}

/* ============================================================
   TIMING FEEDBACK COLORS
   ============================================================ */
.timing--perfect { color: #ff00ff; text-shadow: 0 0 20px #ff00ff; }
.timing--great   { color: #39ff14; text-shadow: 0 0 20px #39ff14; }
.timing--good    { color: #ffea00; text-shadow: 0 0 20px #ffea00; }
.timing--miss    { color: #ff4444; text-shadow: 0 0 20px #ff4444; }
.timing--trap    { color: #ff0000; text-shadow: 0 0 20px #ff0000; }
.timing--dodge   { color: #39ff14; text-shadow: 0 0 20px #39ff14; }

/* ============================================================
   COUNTDOWN OVERLAY
   ============================================================ */
.countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(48px, 12vw, 120px);
  color: #fff;
  text-shadow:
    0 0 30px #ff00ff,
    0 0 60px #ff00ff,
    0 0 90px #00e5ff;
  background: rgba(10, 10, 26, 0.7);
  pointer-events: none;
}
.countdown-overlay--pop {
  animation: countdownPop 0.5s ease-out;
}
.countdown-overlay--fade {
  opacity: 0;
  transition: opacity 0.3s;
}
@keyframes countdownPop {
  0% { transform: scale(2); opacity: 0; }
  50% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   RESULTS EXTRAS
   ============================================================ */
.results-stat__value--gold {
  color: #ffea00;
  text-shadow: 0 0 10px rgba(255, 234, 0, 0.5);
}

.results-new-high {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(14px, 3vw, 22px);
  color: #ffea00;
  text-shadow:
    0 0 10px #ffea00,
    0 0 20px #ff8800;
  animation: newHighPulse 0.6s ease-in-out infinite alternate;
  margin: 8px 0;
}
@keyframes newHighPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); text-shadow: 0 0 20px #ffea00, 0 0 40px #ff8800; }
}

.results-buttons {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.btn-start--replay {
  background: linear-gradient(180deg, #39ff14, #00cc00);
  color: #0a0a1a;
}

/* ============================================================
   BATTLE MODE
   ============================================================ */
.hud__value--rival {
  color: #00e5ff;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}
.results-stat__value--rival {
  color: #00e5ff;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}
.results-battle-outcome {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(16px, 4vw, 28px);
  margin: 8px 0;
  animation: battleOutcomePop 0.5s ease-out;
}
.results-battle-outcome--win {
  color: #39ff14;
  text-shadow: 0 0 15px #39ff14, 0 0 30px #39ff14;
}
.results-battle-outcome--lose {
  color: #ff4444;
  text-shadow: 0 0 15px #ff4444, 0 0 30px #ff4444;
}
.results-battle-outcome--tie {
  color: #ffea00;
  text-shadow: 0 0 15px #ffea00, 0 0 30px #ffea00;
}
@keyframes battleOutcomePop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   COMBO MILESTONE
   ============================================================ */
.combo-milestone {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(20px, 5vw, 42px);
  color: #fff;
  text-shadow:
    0 0 15px #ff00ff,
    0 0 30px #ff00ff,
    0 0 60px #00e5ff;
  z-index: 90;
  pointer-events: none;
  animation: comboMilestone 1.2s ease-out forwards;
}
/* ============================================================
   PAUSE OVERLAY
   ============================================================ */
.pause-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 110;
  background: rgba(10, 10, 26, 0.85);
  gap: 16px;
}
.pause-text {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(36px, 8vw, 72px);
  color: #fff;
  text-shadow: 0 0 20px #ff00ff, 0 0 40px #00e5ff;
  animation: pausePulse 1.5s ease-in-out infinite alternate;
}
.pause-hint {
  font-family: 'Fredoka', sans-serif;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
}
@keyframes pausePulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; text-shadow: 0 0 30px #ff00ff, 0 0 60px #00e5ff; }
}

@keyframes comboMilestone {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  40% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -80%) scale(1); opacity: 0; }
}
