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

:root {
  --bg-primary: #0a0b10;
  --panel-bg: rgba(18, 20, 32, 0.7);
  --border-glow: rgba(0, 242, 254, 0.3);
  --neon-blue: #00f2fe;
  --neon-pink: #ff007f;
  --neon-green: #39ff14;
  --neon-yellow: #fffb00;
  --text-main: #f0f3f8;
  --text-muted: #8a8f98;
  --font-sans: 'Outfit', sans-serif;
  --font-pixel: 'Press Start 2P', monospace;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(26, 20, 76, 0.4) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(79, 15, 60, 0.4) 0%, transparent 40%);
}

#game-container {
  position: relative;
  width: 1024px;
  height: 600px;
  border-radius: 20px;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 24px 80px rgba(0, 0, 0, 0.6),
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    0 0 40px var(--border-glow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Screen Wrapper */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
  z-index: 10;
}

.screen.hidden, .overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
}

/* Typography & Neon Text */
h1 {
  font-family: var(--font-pixel);
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 10px;
  color: #fff;
  text-shadow: 
    0 0 10px var(--neon-blue),
    0 0 20px var(--neon-blue),
    0 0 40px rgba(0, 242, 254, 0.5);
  animation: titleGlow 2s infinite alternate;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Buttons */
.btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 14px 36px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-blue), #0072ff);
  border: none;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 
    0 0 30px rgba(0, 242, 254, 0.6),
    0 8px 25px rgba(0, 114, 255, 0.4);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

/* Character Selection Screen */
.character-select-grid {
  display: flex;
  gap: 25px;
  margin-bottom: 40px;
  max-width: 90%;
  justify-content: center;
}

.char-card {
  width: 190px;
  height: 250px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.char-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 60%, rgba(0, 242, 254, 0.05));
  opacity: 0;
  transition: opacity 0.3s;
}

.char-card:hover {
  transform: translateY(-8px);
  border-color: rgba(0, 242, 254, 0.4);
  box-shadow: 0 12px 30px rgba(0, 242, 254, 0.15);
}

.char-card:hover::before {
  opacity: 1;
}

.char-card.selected {
  border-color: var(--neon-blue);
  background: rgba(0, 242, 254, 0.04);
  box-shadow: 
    0 0 25px rgba(0, 242, 254, 0.25),
    inset 0 0 12px rgba(0, 242, 254, 0.1);
  transform: scale(1.03) translateY(-4px);
}

.char-avatar {
  width: 90px;
  height: 90px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 3rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.3s;
}

.char-card.selected .char-avatar {
  border-color: var(--neon-blue);
}

.char-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 10px;
  letter-spacing: 0.5px;
}

.char-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

.char-stats {
  width: 100%;
  margin-top: 10px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.stat-bar {
  width: 70px;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  align-self: center;
}

.stat-fill {
  height: 100%;
  background: var(--neon-blue);
}

.char-card.selected .stat-fill {
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-pink));
}

/* Play Screen */
#canvas-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

canvas {
  background: #06070a;
  display: block;
}

/* HUD Overlay */
.hud {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  z-index: 20;
}

.hud-score {
  font-size: 1.5rem;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.hud-catnip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.catnip-bar-bg {
  width: 120px;
  height: 14px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.catnip-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #39ff14, #00f2fe);
  box-shadow: 0 0 10px var(--neon-green);
  transition: width 0.3s ease;
}

.catnip-ready {
  animation: pulseGreen 1s infinite alternate;
}

.catnip-label {
  color: var(--neon-green);
  text-shadow: 0 0 5px var(--neon-green);
}

/* Pause Overlay */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 11, 16, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 30;
  backdrop-filter: blur(8px);
}

/* Animations */
@keyframes titleGlow {
  from {
    text-shadow: 
      0 0 10px var(--neon-blue),
      0 0 20px var(--neon-blue),
      0 0 30px rgba(0, 242, 254, 0.4);
  }
  to {
    text-shadow: 
      0 0 12px var(--neon-pink),
      0 0 24px var(--neon-pink),
      0 0 40px rgba(255, 0, 127, 0.4);
  }
}

@keyframes pulseGreen {
  from {
    opacity: 0.6;
    box-shadow: 0 0 5px var(--neon-green);
  }
  to {
    opacity: 1;
    box-shadow: 0 0 15px var(--neon-green);
  }
}

/* Game Info Rules */
.controls-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  pointer-events: none;
  z-index: 20;
}

/* Responsive Scaling */
@media (max-width: 1050px) {
  #game-container {
    width: 100%;
    height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}
