@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

:root {
  --bg: #0d0221;
  --cyan: #22d3ee;
  --purple: #8b5cf6;
  --pink: #ec4899;
  --green: #10b981;
  --yellow: #f59e0b;
}

body {
  background: var(--bg);
  color: #e0e0ff;
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  height: 100vh;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.game-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

canvas {
  display: block;
  background: var(--bg);
}

/* HUD */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 14px 20px;
  pointer-events: none;
  z-index: 10;
  gap: 40px;
}

.hud-left, .hud-center, .hud-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hud-center { align-items: center; }
.hud-right { align-items: center; }

.hud-label {
  font-size: 0.6rem;
  color: #8888aa;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}

.hud-value {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.lives {
  font-size: 1.3rem;
  letter-spacing: 4px;
}

.streak-display {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--yellow);
  opacity: 0;
  transition: opacity 0.3s;
}

.streak-display.active { opacity: 1; }

.fever-bar {
  position: absolute;
  top: 60px;
  left: 16px;
  right: 16px;
  height: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  overflow: hidden;
  pointer-events: none;
  z-index: 10;
}

.fever-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--purple), var(--pink), var(--yellow));
  border-radius: 2px;
  transition: width 0.3s;
}

.fever-active {
  position: absolute;
  top: 68px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  color: var(--yellow);
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s;
  animation: feverPulse 0.4s ease-in-out infinite alternate;
}

.fever-active.show { opacity: 1; }

@keyframes feverPulse {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

/* Screens */
.screen-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 26, 0.92);
  z-index: 50;
  padding: 24px;
  text-align: center;
  gap: 16px;
}

.screen-overlay.hidden { display: none; }

.screen-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1.2rem, 4vw, 2rem);
  color: var(--cyan);
}

.screen-emoji { font-size: 4rem; line-height: 1; }

.screen-text {
  color: #888;
  font-size: 0.9rem;
  max-width: 300px;
}

.screen-score {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.5rem;
  color: var(--green);
}

.new-best {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  color: var(--pink);
  animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.6; transform: scale(1); }
  to { opacity: 1; transform: scale(1.1); }
}

.btn {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(180, 77, 255, 0.4);
}

.btn:hover { transform: scale(1.05); }
.btn:active { transform: scale(0.97); }

.btn-secondary {
  background: transparent;
  border: 1px solid #444;
  box-shadow: none;
  font-size: 0.75rem;
  padding: 10px 24px;
}

.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.back-btn {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 60;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #666;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s;
}

.back-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* Flash effect */
.flash {
  animation: flashAnim 0.15s ease-out;
}

@keyframes flashAnim {
  0% { filter: brightness(2); }
  100% { filter: brightness(1); }
}
