:root {
  --cyan: #00f0ff;
  --magenta: #ff00aa;
  --amber: #ffaa00;
  --green: #00ff88;
  --bg-dark: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a28;
  --text-primary: #e8e8f0;
  --text-secondary: #8888aa;
  --scanline-opacity: 0.03;
}

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

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'IBM Plex Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* CRT Scanline overlay */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* Rainbow color bar */
.color-bar {
  height: 6px;
  background: linear-gradient(
    90deg,
    #ff0000 0%, #ff0000 14.28%,
    #ff8800 14.28%, #ff8800 28.57%,
    #ffff00 28.57%, #ffff00 42.85%,
    #00ff00 42.85%, #00ff00 57.14%,
    #0088ff 57.14%, #0088ff 71.42%,
    #0000ff 71.42%, #0000ff 85.71%,
    #8800ff 85.71%, #8800ff 100%
  );
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Static noise animation */
@keyframes staticNoise {
  0% { background-position: 0 0; }
  10% { background-position: -5% -10%; }
  20% { background-position: -15% 5%; }
  30% { background-position: 7% -25%; }
  40% { background-position: 20% 15%; }
  50% { background-position: -25% 10%; }
  60% { background-position: 15% 5%; }
  70% { background-position: 0% -15%; }
  80% { background-position: 25% 25%; }
  90% { background-position: -10% 10%; }
  100% { background-position: 5% 0; }
}

.static-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.05s;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='6' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  animation: staticNoise 0.2s steps(10) infinite;
}

.static-overlay.active {
  opacity: 0.7;
}

/* Pulse animation for buttons */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 15px rgba(0, 240, 255, 0.3); }
  50% { box-shadow: 0 0 30px rgba(0, 240, 255, 0.6), 0 0 60px rgba(0, 240, 255, 0.2); }
}

.btn-generate {
  animation: pulse-glow 2s ease-in-out infinite;
  transition: all 0.3s ease;
}

.btn-generate:hover {
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.7);
}

.btn-generate:active {
  transform: scale(0.97);
}

/* Card entrance */
@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-enter {
  animation: cardSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* CRT glow effect on cards */
.crt-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.crt-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(0,240,255,0.02) 0%, transparent 70%);
  pointer-events: none;
}

/* Featured card glow */
.featured-card {
  border: 1px solid rgba(0, 240, 255, 0.15);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.05), inset 0 0 30px rgba(0, 240, 255, 0.02);
}

/* Genre color tags */
.genre-news { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.genre-sports { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.genre-kids { background: rgba(251, 191, 36, 0.2); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.genre-drama { background: rgba(167, 139, 250, 0.2); color: #a78bfa; border: 1px solid rgba(167, 139, 250, 0.3); }
.genre-reality { background: rgba(244, 114, 182, 0.2); color: #f472b6; border: 1px solid rgba(244, 114, 182, 0.3); }
.genre-documentary { background: rgba(45, 212, 191, 0.2); color: #2dd4bf; border: 1px solid rgba(45, 212, 191, 0.3); }
.genre-music { background: rgba(232, 121, 249, 0.2); color: #e879f9; border: 1px solid rgba(232, 121, 249, 0.3); }
.genre-comedy { background: rgba(253, 186, 116, 0.2); color: #fdba74; border: 1px solid rgba(253, 186, 116, 0.3); }
.genre-sci-fi { background: rgba(0, 240, 255, 0.2); color: #00f0ff; border: 1px solid rgba(0, 240, 255, 0.3); }
.genre-horror { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.genre-cooking { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.genre-nature { background: rgba(34, 197, 94, 0.2); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.3); }
.genre-lifestyle { background: rgba(217, 70, 239, 0.2); color: #d946ef; border: 1px solid rgba(217, 70, 239, 0.3); }
.genre-religious { background: rgba(234, 179, 8, 0.2); color: #eab308; border: 1px solid rgba(234, 179, 8, 0.3); }
.genre-shopping { background: rgba(168, 85, 247, 0.2); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.3); }
.genre-educational { background: rgba(14, 165, 233, 0.2); color: #0ea5e9; border: 1px solid rgba(14, 165, 233, 0.3); }
.genre-animation { background: rgba(236, 72, 153, 0.2); color: #ec4899; border: 1px solid rgba(236, 72, 153, 0.3); }
.genre-default { background: rgba(148, 163, 184, 0.2); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Surprise Me button when active */
@keyframes surprisePulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 170, 0, 0.4); }
  50% { box-shadow: 0 0 25px rgba(255, 170, 0, 0.8); }
}

.surprise-active {
  animation: surprisePulse 1s ease-in-out infinite;
}

/* Favorite star animation */
@keyframes starPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.star-pop {
  animation: starPop 0.3s ease-out;
}

/* Toast notification */
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

.toast-enter { animation: toastIn 0.3s ease-out forwards; }
.toast-exit { animation: toastOut 0.3s ease-in forwards; }

/* Header glow text */
.glow-text {
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.5), 0 0 40px rgba(0, 240, 255, 0.2);
}

.mono { font-family: 'IBM Plex Mono', monospace; }
.retro { font-family: 'Press Start 2P', cursive; }

/* Tab styles */
.tab-active {
  border-bottom: 2px solid var(--cyan);
  color: var(--cyan);
}

.tab-inactive {
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
}

.tab-inactive:hover {
  color: var(--text-primary);
  border-bottom-color: rgba(255,255,255,0.1);
}