:root {
  --deep-purple: #0d0221;
  --mid-purple: #1a0533;
  --neon-teal: #00f0ff;
  --hot-pink: #ff6ec7;
  --gold: #ffd700;
  --pale-lavender: #c4b5fd;
  --glass-bg: rgba(26, 5, 51, 0.65);
  --glass-border: rgba(0, 240, 255, 0.2);
}

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

body {
  font-family: 'IBM Plex Mono', monospace;
  background: var(--deep-purple);
  color: #e2e0f0;
  min-height: 100vh;
  overflow-x: hidden;
}

#scanlines {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.08) 0px,
    rgba(0, 0, 0, 0.08) 1px,
    transparent 1px,
    transparent 3px
  );
}

@keyframes bgShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 15px rgba(0, 240, 255, 0.3), 0 0 30px rgba(0, 240, 255, 0.1); }
  50% { box-shadow: 0 0 25px rgba(0, 240, 255, 0.5), 0 0 50px rgba(0, 240, 255, 0.2); }
}

@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin-coin {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes star-float {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) translateX(20px); opacity: 0; }
}

.bg-animated {
  background: linear-gradient(135deg, #0d0221 0%, #1a0533 25%, #150428 50%, #0f0320 75%, #0d0221 100%);
  background-size: 400% 400%;
  animation: bgShift 15s ease infinite;
}

.font-pixel {
  font-family: 'Press Start 2P', cursive;
}

.font-mono {
  font-family: 'IBM Plex Mono', monospace;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

.neon-input {
  background: rgba(13, 2, 33, 0.8);
  border: 2px solid rgba(0, 240, 255, 0.3);
  border-radius: 12px;
  color: #e2e0f0;
  font-family: 'IBM Plex Mono', monospace;
  transition: all 0.3s ease;
}

.neon-input:focus {
  outline: none;
  border-color: var(--neon-teal);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3), 0 0 40px rgba(0, 240, 255, 0.1), inset 0 0 10px rgba(0, 240, 255, 0.05);
}

.neon-input::placeholder {
  color: rgba(196, 181, 253, 0.4);
  font-size: 0.85em;
}

.btn-pain {
  background: linear-gradient(135deg, var(--hot-pink), #d946ef, var(--neon-teal));
  background-size: 200% 200%;
  border: none;
  border-radius: 12px;
  color: white;
  font-family: 'Press Start 2P', cursive;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.btn-pain:hover {
  background-position: 100% 0;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 110, 199, 0.4);
}

.btn-pain:active {
  transform: translateY(0);
}

.btn-pain:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.gold-shimmer {
  background: linear-gradient(90deg, #ffd700, #fff8b8, #ffd700, #ffed4a, #ffd700);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

.teal-glow {
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6), 0 0 20px rgba(0, 240, 255, 0.3);
}

.pink-glow {
  text-shadow: 0 0 10px rgba(255, 110, 199, 0.6), 0 0 20px rgba(255, 110, 199, 0.3);
}

.card-glow {
  animation: pulse-glow 4s ease-in-out infinite;
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

.spin-coin {
  display: inline-block;
  animation: spin-coin 1s linear infinite;
  font-size: 1.5rem;
}

.blink-text {
  animation: blink 1.2s ease-in-out infinite;
}

.pain-meter-bg {
  background: rgba(13, 2, 33, 0.6);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 110, 199, 0.3);
}

.pain-meter-fill {
  background: linear-gradient(90deg, var(--neon-teal), var(--hot-pink), #ef4444);
  border-radius: 999px;
  transition: width 1s ease;
}

.recent-pill {
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'IBM Plex Mono', monospace;
}

.recent-pill:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: rgba(0, 240, 255, 0.5);
  transform: translateY(-1px);
}

.star {
  position: fixed;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: star-float linear infinite;
  pointer-events: none;
  z-index: 0;
}

.sparkle-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
  animation: sparkle 2s ease-in-out infinite;
  pointer-events: none;
}

.section-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.3), rgba(255, 110, 199, 0.3), transparent);
  margin: 1.5rem 0;
}

@media (max-width: 640px) {
  .font-pixel { font-size: 0.7em; }
}