/* ============================================
   NEON WHACK-A-MOLE — Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #12122a;
  --accent-cyan: #00f0ff;
  --accent-magenta: #ff00ff;
  --accent-green: #39ff14;
  --accent-orange: #ff6b35;
  --accent-red: #ff2244;
  --accent-yellow: #ffe600;
  --text-primary: #e0e0ff;
  --text-secondary: #8888aa;
  --text-dim: #444466;
  --glow-cyan: 0 0 20px rgba(0, 240, 255, 0.5);
  --glow-magenta: 0 0 20px rgba(255, 0, 255, 0.5);
  --glow-yellow: 0 0 20px rgba(255, 230, 0, 0.6);
  --glow-red: 0 0 20px rgba(255, 34, 68, 0.6);
  --font-arcade: 'Press Start 2P', monospace;
  --font-body: 'Inter', sans-serif;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  touch-action: none;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(160deg, #0a0a1a 0%, #1a0a2e 40%, #0a0a1a 100%);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* --- Scanline --- */
.scanline-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,0.06) 2px, rgba(0,0,0,0.06) 4px
  );
}

/* --- Top Bar --- */
.top-bar {
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
  flex-shrink: 0;
}

.back-link {
  font-family: var(--font-arcade);
  font-size: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.1em;
  transition: color 0.2s, text-shadow 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.back-link:hover {
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
}

.mute-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.2s;
  line-height: 1;
}

.mute-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

/* --- Score Bar --- */
.score-bar {
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: space-between;
  padding: 0 20px 16px;
  flex-shrink: 0;
}

.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-label {
  font-family: var(--font-arcade);
  font-size: 0.45rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.score-value {
  font-family: var(--font-arcade);
  font-size: 1.1rem;
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
}

.score-value--time {
  color: var(--accent-orange);
  text-shadow: 0 0 15px rgba(255, 107, 53, 0.4);
}

.score-value--hi {
  color: var(--accent-green);
  text-shadow: 0 0 15px rgba(57, 255, 20, 0.4);
}

/* --- Game Container --- */
.game-container {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1;
  background: rgba(18, 18, 42, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  margin-bottom: 20px;
}

/* --- Mole Grid --- */
.mole-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 85%;
  height: 85%;
}

.mole-hole {
  position: relative;
  aspect-ratio: 1;
  background: rgba(10, 10, 26, 0.7);
  border: 2px dashed var(--text-dim);
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mole-hole:hover {
  border-color: var(--accent-cyan);
  box-shadow: inset 0 0 12px rgba(0, 240, 255, 0.1);
}

.mole {
  width: 75%;
  height: 75%;
  background: radial-gradient(circle, #ff55ff 0%, var(--accent-magenta) 50%, rgba(255,0,255,0) 80%);
  border-radius: 50%;
  box-shadow: var(--glow-magenta);
  transform: translateY(110%);
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.mole-hole.active .mole {
  transform: translateY(0);
}

/* Golden Mole (Bonus) */
.mole-hole.bonus .mole {
  background: radial-gradient(circle, #ffff99 0%, var(--accent-yellow) 50%, rgba(255,230,0,0) 80%);
  box-shadow: var(--glow-yellow);
}

/* Red Mole (Penalty) */
.mole-hole.penalty .mole {
  background: radial-gradient(circle, #ff8888 0%, var(--accent-red) 50%, rgba(255,34,68,0) 80%);
  box-shadow: var(--glow-red);
}

/* Hit visual feedback */
@keyframes moleHit {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; filter: brightness(1.5); }
  100% { transform: scale(0); opacity: 0; }
}

.mole-hole.hit .mole {
  animation: moleHit 0.2s ease-out forwards;
}

/* --- Overlays --- */
.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 26, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  transition: opacity 0.3s ease;
}

.game-overlay--hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-title {
  font-family: var(--font-arcade);
  font-size: clamp(1rem, 4vw, 1.4rem);
  color: #fff;
  text-shadow: 0 0 10px var(--accent-cyan), 0 0 20px var(--accent-magenta);
  margin-bottom: 24px;
  text-align: center;
  letter-spacing: 0.1em;
}

.overlay-title--gameover {
  color: var(--accent-red);
  text-shadow: var(--glow-red);
}

.overlay-hint {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 30px;
}

.overlay-score {
  font-family: var(--font-arcade);
  font-size: 0.85rem;
  color: #fff;
  margin-bottom: 12px;
}

.overlay-score span {
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
}

.overlay-score--hi {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.overlay-score--hi span {
  color: var(--accent-green);
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
}

.new-highscore {
  font-family: var(--font-arcade);
  font-size: 0.6rem;
  color: var(--accent-yellow);
  text-shadow: var(--glow-yellow);
  margin-bottom: 24px;
  animation: flash 0.6s infinite alternate;
}

@keyframes flash {
  from { opacity: 0.2; }
  to { opacity: 1; }
}

.overlay-btn {
  font-family: var(--font-arcade);
  font-size: 0.65rem;
  padding: 12px 28px;
  border: 2px solid var(--accent-magenta);
  background: transparent;
  color: var(--accent-magenta);
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: all 0.2s;
}

.overlay-btn:hover {
  background: rgba(255, 0, 255, 0.12);
  box-shadow: var(--glow-magenta);
  color: #fff;
  transform: scale(1.05);
}

.overlay-btn:active {
  transform: scale(0.98);
}
