/**
 * TipzPop - design system tokens
 * Standard: premium-ui (Vercel / Linear / Stripe Dark Aesthetic)
 */
:root {
  /* Surface & Canvas Hierarchy */
  --spz-bg: #0A0A0B;
  --spz-surface-1: #121215;
  --spz-surface-2: #1A1A1E;
  --spz-surface-hover: #222227;

  /* Hairline Borders */
  --spz-border-subtle: rgba(255, 255, 255, 0.08);
  --spz-border-strong: rgba(255, 255, 255, 0.16);
  --spz-border-focus: rgba(255, 255, 255, 0.35);

  /* High-Contrast Typography */
  --spz-text-primary: #FAFAFA;
  --spz-text-secondary: #A1A1AA;
  --spz-text-tertiary: #71717A;

  /* Financial Liquidity Accent (Emerald Volt - No purple gradients) */
  --spz-accent: #10B981;
  --spz-accent-hover: #059669;
  --spz-accent-subtle: rgba(16, 185, 129, 0.12);
  --spz-accent-border: rgba(16, 185, 129, 0.25);

  /* Primary High-Contrast Button (Solid White) */
  --spz-btn-primary-bg: #FFFFFF;
  --spz-btn-primary-text: #0A0A0B;
  --spz-btn-primary-hover: #E4E4E7;

  /* Semantic Feedback */
  --spz-success: #10B981;
  --spz-warning: #F59E0B;
  --spz-error: #EF4444;
  --spz-error-subtle: rgba(239, 68, 68, 0.12);
  --spz-error-border: rgba(239, 68, 68, 0.25);
  --spz-info: #3B82F6;

  /* Radius Scale */
  --spz-radius-sm: 6px;
  --spz-radius-md: 10px;
  --spz-radius-lg: 16px;
  --spz-radius-xl: 24px;
  --spz-radius-full: 9999px;

  /* Shadows */
  --spz-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --spz-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);
  --spz-shadow-lg: 0 16px 48px -8px rgba(0, 0, 0, 0.8);

  /* Fonts */
  --spz-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --spz-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Transitions */
  --spz-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spz-duration: 180ms;
}

/* Global Reset & Foundation */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--spz-bg);
  color: var(--spz-text-primary);
  font-family: var(--spz-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-color: var(--spz-bg);
  color: var(--spz-text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Hardware-Accelerated Ambient Studio Background (Zero Scroll Jank) */
.spz-ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.spz-ambient-glow {
  position: absolute;
  top: -140px;
  left: 50%;
  transform: translateX(-50%);
  width: 960px;
  height: 480px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
  border-radius: 9999px;
  filter: blur(60px);
  pointer-events: none;
}

.spz-ambient-glow-secondary {
  position: absolute;
  top: 40%;
  right: -200px;
  width: 500px;
  height: 400px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.03) 0%, transparent 70%);
  border-radius: 9999px;
  filter: blur(80px);
  pointer-events: none;
}

.spz-ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 15%, #000 65%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 15%, #000 65%, transparent 100%);
  pointer-events: none;
}

/* Tabular Numerals for Currency & Timers */
.tabular-nums {
  font-family: var(--spz-font-mono);
  font-variant-numeric: tabular-nums;
}

/* Accessible Focus States */
:focus-visible {
  outline: 2px solid var(--spz-border-focus);
  outline-offset: 2px;
}

/* Scrollbar refinement */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}


/* Studio Card & Depth Utilities */
.spz-card {
  background: var(--spz-surface-1);
  border: 1px solid var(--spz-border-subtle);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.04);
  transition: border-color var(--spz-duration) var(--spz-ease), transform var(--spz-duration) var(--spz-ease);
}
.spz-card:hover {
  border-color: var(--spz-border-strong);
}
.spz-card-glow {
  position: relative;
}
.spz-card-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), transparent 50%, rgba(255, 255, 255, 0.05));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.spz-glass {
  background: rgba(18, 18, 21, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--spz-border-subtle);
}


/* Equalizer Visualizer Animations */
@keyframes bounceBar {
  0%, 100% { height: 4px; }
  50% { height: 18px; }
}
.animate-eq-1 { animation: bounceBar 0.45s ease-in-out infinite; }
.animate-eq-2 { animation: bounceBar 0.35s ease-in-out infinite 0.1s; }
.animate-eq-3 { animation: bounceBar 0.55s ease-in-out infinite 0.2s; }
.animate-eq-4 { animation: bounceBar 0.4s ease-in-out infinite 0.15s; }
.animate-eq-5 { animation: bounceBar 0.5s ease-in-out infinite 0.05s; }

/* ==========================================================================
   ANIME & CREATOR CARD THEMES (Premium Dark Geist Aesthetic)
   ========================================================================== */
.theme-obsidian-glow {
  --theme-card-bg: #121215;
  --theme-border: rgba(255, 255, 255, 0.08);
  --theme-glow: rgba(16, 185, 129, 0.2);
  --theme-accent: #10b981;
}

.theme-sakura-bloom {
  --theme-card-bg: #1d1222;
  --theme-border: rgba(244, 114, 182, 0.28);
  --theme-glow: rgba(244, 114, 182, 0.35);
  --theme-accent: #f472b6;
}

.theme-cyber-scan {
  --theme-card-bg: #0a1628;
  --theme-border: rgba(6, 182, 212, 0.32);
  --theme-glow: rgba(6, 182, 212, 0.38);
  --theme-accent: #06b6d4;
}

.theme-dragon-flame {
  --theme-card-bg: #240d0d;
  --theme-border: rgba(249, 115, 22, 0.32);
  --theme-glow: rgba(239, 68, 68, 0.38);
  --theme-accent: #f97316;
}

.theme-galaxy-starlight {
  --theme-card-bg: #150c33;
  --theme-border: rgba(139, 92, 246, 0.32);
  --theme-glow: rgba(139, 92, 246, 0.4);
  --theme-accent: #8b5cf6;
}

.theme-rgb-perimeter {
  --theme-card-bg: #101018;
  --theme-border: rgba(255, 255, 255, 0.14);
  --theme-glow: rgba(16, 185, 129, 0.35);
  --theme-accent: #10b981;
}

/* Card Ambient Animations */
@keyframes neonPulseGlow {
  0%, 100% {
    box-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.7), 0 0 16px -2px var(--theme-glow, rgba(16, 185, 129, 0.2));
  }
  50% {
    box-shadow: 0 8px 36px 0 rgba(0, 0, 0, 0.8), 0 0 28px 2px var(--theme-glow, rgba(16, 185, 129, 0.45));
  }
}

@keyframes cyberScanline {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 100px;
  }
}

@keyframes sakuraFloatAura {
  0%, 100% {
    box-shadow: 0 6px 28px -4px rgba(244, 114, 182, 0.25), 0 0 12px rgba(244, 114, 182, 0.15);
  }
  50% {
    box-shadow: 0 10px 42px -2px rgba(244, 114, 182, 0.42), 0 0 24px rgba(244, 114, 182, 0.3);
  }
}

@keyframes dragonFlamePulse {
  0%, 100% {
    box-shadow: 0 6px 28px -4px rgba(249, 115, 22, 0.25), 0 0 14px rgba(239, 68, 68, 0.2);
  }
  50% {
    box-shadow: 0 10px 44px -2px rgba(249, 115, 22, 0.48), 0 0 30px rgba(239, 68, 68, 0.38);
  }
}

@keyframes galaxyStarlightTwinkle {
  0%, 100% {
    box-shadow: 0 6px 30px -4px rgba(139, 92, 246, 0.25), 0 0 16px rgba(139, 92, 246, 0.2);
  }
  50% {
    box-shadow: 0 12px 46px -2px rgba(139, 92, 246, 0.45), 0 0 32px rgba(139, 92, 246, 0.35);
  }
}

@keyframes rgbBorderFlow {
  0% {
    border-color: #f43f5e;
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.3);
  }
  25% {
    border-color: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  }
  50% {
    border-color: #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
  }
  75% {
    border-color: #eab308;
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.3);
  }
  100% {
    border-color: #f43f5e;
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.3);
  }
}

.anim-neon_pulse {
  animation: neonPulseGlow 3.5s ease-in-out infinite;
}

.anim-cyber_scan {
  position: relative;
  animation: neonPulseGlow 4s ease-in-out infinite;
}
.anim-cyber_scan::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(6, 182, 212, 0.03) 0px,
    rgba(6, 182, 212, 0.03) 1px,
    transparent 1px,
    transparent 4px
  );
  animation: cyberScanline 12s linear infinite;
  border-radius: inherit;
}

.anim-sakura_bloom {
  animation: sakuraFloatAura 4s ease-in-out infinite;
}

.anim-dragon_flame {
  animation: dragonFlamePulse 3s ease-in-out infinite;
}

.anim-galaxy_starlight {
  animation: galaxyStarlightTwinkle 4.5s ease-in-out infinite;
}

.anim-rgb_flow {
  animation: rgbBorderFlow 6s linear infinite;
}

/* ==========================================================================
   THREE.JS & MOTION ANIMATION PRIMITIVES (Stripe x Linear x Apple Standards)
   ========================================================================== */
@keyframes floatSlow {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

@keyframes beamSweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes holoGlowPulse {
  0%, 100% {
    opacity: 0.4;
    filter: drop-shadow(0 0 15px rgba(16, 185, 129, 0.3));
  }
  50% {
    opacity: 0.85;
    filter: drop-shadow(0 0 30px rgba(16, 185, 129, 0.65));
  }
}

.animate-float-slow {
  animation: floatSlow 6s ease-in-out infinite;
}

.animate-holo-glow {
  animation: holoGlowPulse 4s ease-in-out infinite;
}

.perspective-1000 {
  perspective: 1000px;
}

.preserve-3d {
  transform-style: preserve-3d;
}

.holo-stage-container {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.08) 0%, rgba(17, 17, 20, 0.95) 75%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}



/* Accessibility: Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Button & Badge Utility Standard */
.btn-primary-white {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #FFFFFF;
  color: #0A0A0B;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.25rem;
  padding: 0.625rem 1.25rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 16px -2px rgba(255, 255, 255, 0.15);
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 44px;
  cursor: pointer;
}
.btn-primary-white:hover {
  background-color: #E4E4E7;
  transform: translateY(-1px);
}
.btn-primary-white:active {
  transform: translateY(0);
}

.btn-secondary-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #121215;
  color: #FAFAFA;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  padding: 0.625rem 1.25rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 44px;
  cursor: pointer;
}
.btn-secondary-dark:hover {
  background-color: #1A1A1E;
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10B981;
}

/* Drop-down lists on every page: the open list is dark with light text. Left to the browser, the list could
   open white while the page sets white text, so the choices could not be read. */
select { color-scheme: dark; }
select option,
select optgroup { background-color: #16161a; color: #f4f4f5; }
select option:disabled { color: #71717a; }
select option:checked { background-color: #2a2340; color: #ffffff; }
