/* Custom Styles & Modern Enhancements for Isprin.me */

:root {
  --primary-color: #38bdf8;
  --accent-color: #818cf8;
  --primary-glow: rgba(56, 189, 248, 0.3);
  --accent-glow: rgba(129, 140, 248, 0.25);
  --card-bg: rgba(15, 23, 42, 0.75);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-hover: rgba(56, 189, 248, 0.5);
  --bg-gradient-1: rgba(30, 58, 138, 0.35);
  --bg-gradient-2: rgba(88, 28, 135, 0.2);
}

/* Theme: Cyberpunk Neon */
body[data-theme="cyberpunk"] {
  --primary-color: #00f0ff;
  --accent-color: #ffe600;
  --primary-glow: rgba(0, 240, 255, 0.4);
  --accent-glow: rgba(255, 230, 0, 0.3);
  --card-bg: rgba(10, 15, 29, 0.85);
  --card-border: rgba(0, 240, 255, 0.2);
  --card-border-hover: rgba(255, 230, 0, 0.7);
  --bg-gradient-1: rgba(0, 240, 255, 0.15);
  --bg-gradient-2: rgba(255, 0, 85, 0.2);
}

/* Theme: Synthwave Sunset */
body[data-theme="synthwave"] {
  --primary-color: #f43f5e;
  --accent-color: #fb923c;
  --primary-glow: rgba(244, 63, 94, 0.4);
  --accent-glow: rgba(251, 146, 60, 0.3);
  --card-bg: rgba(24, 10, 34, 0.82);
  --card-border: rgba(244, 63, 94, 0.2);
  --card-border-hover: rgba(251, 146, 60, 0.7);
  --bg-gradient-1: rgba(244, 63, 94, 0.2);
  --bg-gradient-2: rgba(147, 51, 234, 0.25);
}

/* Theme: Matrix Terminal */
body[data-theme="matrix"] {
  --primary-color: #10b981;
  --accent-color: #065f46;
  --primary-glow: rgba(16, 185, 129, 0.4);
  --accent-glow: rgba(5, 150, 105, 0.3);
  --card-bg: rgba(6, 20, 12, 0.85);
  --card-border: rgba(16, 185, 129, 0.2);
  --card-border-hover: rgba(52, 211, 153, 0.7);
  --bg-gradient-1: rgba(16, 185, 129, 0.15);
  --bg-gradient-2: rgba(4, 120, 87, 0.2);
}

/* Base Body */
body {
  background-color: #080d1a;
  min-height: 100vh;
  color: #f1f5f9;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
  position: relative;
}

/* Dedicated Parallax Cosmic Background Layer */
#bg-parallax-container {
  position: fixed;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  pointer-events: none;
  z-index: -2;
  overflow: hidden;
  will-change: transform;
}

#bg-parallax-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/bg.jpg');
  background-size: cover;
  background-position: center;
  transform: translate3d(0, 0, 0) scale(1.06);
  transition: transform 0.15s cubic-bezier(0.2, 0, 0.2, 1);
  will-change: transform;
  animation: cosmic-drift 24s ease-in-out infinite alternate;
}

#bg-ambient-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  background-image: 
    radial-gradient(circle at 50% 0%, var(--bg-gradient-1) 0%, transparent 65%),
    radial-gradient(circle at 100% 100%, var(--bg-gradient-2) 0%, transparent 50%);
  transition: background-image 0.5s ease;
}

@keyframes cosmic-drift {
  0% {
    filter: brightness(0.95) saturate(1);
    transform: scale(1.04) rotate(0deg);
  }
  50% {
    filter: brightness(1.08) saturate(1.15);
    transform: scale(1.08) rotate(0.4deg);
  }
  100% {
    filter: brightness(0.98) saturate(1.05);
    transform: scale(1.05) rotate(-0.3deg);
  }
}

/* Cursor Follower Spotlight Glow */
#cursor-spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 1;
  opacity: 0.6;
  mix-blend-mode: screen;
  transition: opacity 0.3s ease;
}

/* Canvas Layer */
#starfield-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.75;
}

/* Bento Card with 3D Holographic Tilt */
.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
}

.bento-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.15s ease-out;
  position: relative;
  overflow: hidden;
}

.bento-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  pointer-events: none;
}

/* Holographic Glare Sheen */
.card-glare {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  mix-blend-mode: overlay;
  z-index: 2;
}

.bento-card:hover .card-glare {
  opacity: 1;
}

.bento-card:hover {
  border-color: var(--card-border-hover);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.6), 0 0 30px -4px var(--primary-glow);
}

/* Audio Widget */
.audio-player-widget {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Spectrum Canvas on Hero */
#audio-spectrum-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 320px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.85;
}

/* Animated Equalizer Bars */
.eq-bar {
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(to top, var(--primary-color), var(--accent-color));
  height: 4px;
  transition: height 0.1s ease;
}

.eq-active .eq-bar:nth-child(1) { animation: eq-pulse 0.8s infinite ease-in-out alternate; }
.eq-active .eq-bar:nth-child(2) { animation: eq-pulse 1.1s infinite ease-in-out alternate 0.2s; }
.eq-active .eq-bar:nth-child(3) { animation: eq-pulse 0.7s infinite ease-in-out alternate 0.4s; }
.eq-active .eq-bar:nth-child(4) { animation: eq-pulse 0.9s infinite ease-in-out alternate 0.1s; }
.eq-active .eq-bar:nth-child(5) { animation: eq-pulse 1.2s infinite ease-in-out alternate 0.3s; }

@keyframes eq-pulse {
  0% { height: 4px; }
  50% { height: 16px; }
  100% { height: 8px; }
}

/* Discord Status Badges */
.discord-status-online { background-color: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.7); }
.discord-status-idle { background-color: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.7); }
.discord-status-dnd { background-color: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.7); }
.discord-status-offline { background-color: #64748b; }

.discord-badge-online { background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.35); color: #4ade80; }
.discord-badge-idle { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.35); color: #fbbf24; }
.discord-badge-dnd { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.35); color: #f87171; }
.discord-badge-offline { background: rgba(100, 116, 139, 0.15); border: 1px solid rgba(100, 116, 139, 0.3); color: #94a3b8; }

/* Status Indicator Pulse */
.status-indicator {
  position: relative;
}
.status-indicator::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border-radius: 9999px;
  background: inherit;
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.8); opacity: 0; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Extra Life Glow Card */
.extra-life-glow {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18) 0%, rgba(37, 99, 235, 0.1) 50%, rgba(99, 102, 241, 0.18) 100%);
  border-color: rgba(56, 189, 248, 0.35);
}

.extra-life-glow:hover {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 20px 40px -10px rgba(14, 165, 233, 0.35);
}

/* Game Card Badges */
.game-pill-solo {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.game-pill-coop {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* CRT Scanlines / Hyperdrive Easter Egg */
.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.04), rgba(0, 255, 0, 0.02), rgba(0, 255, 0, 0.04));
  background-size: 100% 3px, 6px 100%;
}

.hyperdrive-active {
  animation: screen-jitter 0.15s ease infinite alternate;
}

@keyframes screen-jitter {
  0% { transform: translate(0, 0); }
  100% { transform: translate(0.5px, 0.5px); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #080d1a;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Retro-Futuristic Digital Visitor Hit Counter */
.hit-counter-container {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 15, 30, 0.85);
  border: 1px solid var(--card-border);
  padding: 6px 14px;
  border-radius: 9999px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hit-counter-container:hover {
  border-color: var(--card-border-hover);
  box-shadow: 0 4px 25px -4px var(--primary-glow);
}

.hit-counter-digits {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #030712;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.counter-digit-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 24px;
  background: linear-gradient(to bottom, #111827 0%, #030712 100%);
  color: var(--primary-color);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 13px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 6px var(--primary-glow);
  text-shadow: 0 0 6px var(--primary-color);
  transition: all 0.3s ease;
}

/* CRT Arcade Scanline Overlay */
.crt-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.4) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  background-size: 100% 3px, 6px 100%;
  pointer-events: none;
  z-index: 10;
  opacity: 0.85;
}

.crt-overlay-off {
  display: none !important;
}

/* Modal Open Animations */
.modal-active {
  display: flex !important;
  opacity: 1 !important;
}

/* ==========================================================================
   Custom Sci-Fi Cyber Reticle Cursor
   ========================================================================== */
@media (hover: hover) and (pointer: fine) {
  *, *::before, *::after {
    cursor: none !important;
  }

  #cyber-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background-color: var(--primary-color, #38bdf8);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: width 0.15s ease, height 0.15s ease, background-color 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 0 10px var(--primary-color, #38bdf8), 0 0 20px var(--primary-color, #38bdf8);
  }

  #cyber-cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--primary-color, #38bdf8);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.2s cubic-bezier(0.1, 0.9, 0.2, 1), 
                height 0.2s cubic-bezier(0.1, 0.9, 0.2, 1), 
                border-color 0.2s ease, 
                background-color 0.2s ease;
    opacity: 0.75;
  }

  /* Reticle Crosshair Ticks */
  #cyber-cursor-ring::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    width: 1px;
    height: 4px;
    background-color: var(--primary-color, #38bdf8);
    transform: translateX(-50%);
    box-shadow: 0 34px 0 0 var(--primary-color, #38bdf8);
  }

  #cyber-cursor-ring::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -4px;
    width: 4px;
    height: 1px;
    background-color: var(--primary-color, #38bdf8);
    transform: translateY(-50%);
    box-shadow: 34px 0 0 0 var(--primary-color, #38bdf8);
  }

  /* Target Lock State on Hover */
  body.cursor-hover #cyber-cursor-ring {
    width: 46px;
    height: 46px;
    border-color: var(--accent-color, #fbbf24);
    background-color: rgba(56, 189, 248, 0.08);
    opacity: 1;
    transform: translate(-50%, -50%) rotate(45deg);
  }

  body.cursor-hover #cyber-cursor-ring::before {
    background-color: var(--accent-color, #fbbf24);
    box-shadow: 0 48px 0 0 var(--accent-color, #fbbf24);
  }
  body.cursor-hover #cyber-cursor-ring::after {
    background-color: var(--accent-color, #fbbf24);
    box-shadow: 48px 0 0 0 var(--accent-color, #fbbf24);
  }

  body.cursor-hover #cyber-cursor-dot {
    background-color: var(--accent-color, #fbbf24);
    transform: translate(-50%, -50%) scale(1.4);
  }

  body.cursor-clicking #cyber-cursor-ring {
    transform: translate(-50%, -50%) scale(0.85);
    background-color: rgba(56, 189, 248, 0.25);
  }
}

/* ==========================================================================
   Warp Speed HUD Controls
   ========================================================================== */
#warp-speed-badge {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 40;
  backdrop-filter: blur(12px);
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.2s ease;
}

#warp-speed-badge:hover {
  transform: translateY(-2px) scale(1.03);
}

#warp-speed-badge:active {
  transform: translateY(1px) scale(0.97);
}

.warp-active #bg-parallax-image {
  filter: brightness(1.3) contrast(1.2) saturate(1.4);
}

