/* ═══════════════════════════════════════════════════════════════
   YINGNUKE.WIN v2 — BASE DESIGN SYSTEM
   Dark Cyberpunk + Glassmorphism Aesthetic
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Space+Grotesk:wght@300;400;500;600;700&family=Orbitron:wght@400;700;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* Rev COG Colors */
  --bg:           #030307;
  --bg-2:         #080811;
  --bg-3:         #0e0e1e;
  --surface:      rgba(14, 14, 26, 0.75);
  --surface-2:    rgba(255, 255, 255, 0.04);
  --surface-3:    rgba(255, 255, 255, 0.08);

  --purple:       #6366f1;
  --purple-light: #818cf8;
  --purple-dark:  #4338ca;
  --purple-glow:  rgba(99, 102, 241, 0.4);

  --cyan-accent:  #00f2fe;
  --pink-accent:  #ff0055;
  --blue-accent:  #3b82f6;
  --gold:         #f59e0b;

  --text:         #ffffff;
  --text-2:       rgba(255, 255, 255, 0.75);
  --text-3:       rgba(255, 255, 255, 0.45);
  --border:       rgba(99, 102, 241, 0.15);
  --border-2:     rgba(255, 255, 255, 0.16);

  /* Rev COG Dynamic Gradients */
  --grad-purple:  linear-gradient(135deg, #6366f1, #00f2fe);
  --grad-glow:    linear-gradient(135deg, #ff0055, #6366f1, #00f2fe);
  --grad-cyber:   linear-gradient(135deg, #00f2fe, #6366f1, #ff0055);
  --grad-card:    linear-gradient(135deg, rgba(99,102,241,0.12), rgba(0,242,254,0.06));

  /* Blur & Effects */
  --blur-sm:  blur(10px);
  --blur-md:  blur(20px);
  --blur-lg:  blur(40px);

  /* Typography */
  --font-main:    'Space Grotesk', sans-serif;
  --font-display: 'Bebas Neue', sans-serif;
  --font-mono:    'Orbitron', monospace;
  --font-body:    'Inter', sans-serif;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Border Radius */
  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-xl:  32px;
  --radius-full:9999px;

  /* Transitions */
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:   cubic-bezier(0, 0, 0.2, 1);
  --ease-spring:cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:   0.15s;
  --dur-med:    0.3s;
  --dur-slow:   0.6s;

  /* Shadows */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:  0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg:  0 20px 60px rgba(0,0,0,0.6);
  --shadow-glow:0 0 30px var(--purple-glow);
  --shadow-card:0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.06);
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--purple);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--purple-light); }

/* ── Selection ── */
::selection {
  background: var(--purple-glow);
  color: #fff;
}

/* ── Typography ── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-main);
  font-weight: 700;
  line-height: 1.2;
}

a { color: inherit; text-decoration: none; }

/* ── Glass Card ── */
.glass {
  background: var(--surface);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.glass-sm {
  background: var(--surface-2);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.glass-hover {
  transition: border-color var(--dur-med) var(--ease),
              box-shadow var(--dur-med) var(--ease),
              transform var(--dur-med) var(--ease-spring);
}
.glass-hover:hover {
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: var(--shadow-card), 0 0 20px var(--purple-glow);
  transform: translateY(-2px);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all var(--dur-med) var(--ease);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
.btn:hover::after { transform: translateX(100%); }

.btn-primary {
  background: var(--grad-purple);
  color: #fff;
  box-shadow: 0 4px 20px var(--purple-glow);
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 30px var(--purple-glow);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover {
  background: var(--surface-3);
  border-color: rgba(124,58,237,0.4);
  transform: translateY(-2px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 40px; height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* ── Inputs ── */
.input {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 0.95rem;
  padding: 12px 16px;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.input:focus {
  border-color: rgba(124, 58, 237, 0.6);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
.input::placeholder { color: var(--text-3); }

textarea.input { resize: vertical; min-height: 100px; }

/* ── Toggle Switch ── */
.toggle {
  position: relative;
  display: inline-block;
  width: 52px; height: 28px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--dur-med) var(--ease);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: all var(--dur-med) var(--ease-spring);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.toggle input:checked + .toggle-slider {
  background: var(--purple);
  border-color: transparent;
  box-shadow: 0 0 15px var(--purple-glow);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(24px);
  filter: drop-shadow(0 0 4px var(--purple));
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-purple {
  background: rgba(124,58,237,0.2);
  color: #c4b5fd;
  border: 1px solid rgba(124,58,237,0.3);
}
.badge-green {
  background: rgba(34,197,94,0.15);
  color: #86efac;
  border: 1px solid rgba(34,197,94,0.25);
}
.badge-gold {
  background: rgba(251,191,36,0.15);
  color: #fde68a;
  border: 1px solid rgba(251,191,36,0.25);
}
.badge-red {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.25);
}
.badge-blue {
  background: rgba(94,106,210,0.15);
  color: #a5b4fc;
  border: 1px solid rgba(94,106,210,0.25);
}

/* ── Section Label ── */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--purple-light);
  text-transform: uppercase;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.section-label::before {
  content: '';
  width: 20px; height: 1px;
  background: var(--purple);
}

/* ── Section Title ── */
.section-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: var(--space-6);
  background: linear-gradient(135deg, #fff 60%, rgba(124,58,237,0.8));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Particle Canvas ── */
#star-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ── Animated Background ── */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 15% 30%, rgba(124,58,237,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 70%, rgba(94,106,210,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(236,72,153,0.04) 0%, transparent 60%);
  animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0%   { opacity: 0.7; }
  100% { opacity: 1; }
}

/* ── Scroll Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-2), transparent);
  margin: var(--space-6) 0;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  color: var(--text-3);
  padding: var(--space-8) var(--space-5);
  font-size: 0.95rem;
}
.empty-state i {
  display: block;
  font-size: 2.5rem;
  margin-bottom: var(--space-3);
  opacity: 0.5;
}

/* ── Toast Notification ── */
#toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  animation: toastIn 0.3s var(--ease-spring) forwards;
  min-width: 260px;
  box-shadow: var(--shadow-lg);
}
.toast.fade-out { animation: toastOut 0.3s var(--ease) forwards; }
.toast-success { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.3); color: #86efac; }
.toast-error   { background: rgba(239,68,68,0.15);  border-color: rgba(239,68,68,0.3);  color: #fca5a5; }
.toast-info    { background: var(--surface);         border-color: var(--border-2);       color: var(--text); }

@keyframes toastIn  { from { opacity:0; transform:translateX(40px) scale(0.9); } to { opacity:1; transform:none; } }
@keyframes toastOut { from { opacity:1; transform:none; } to { opacity:0; transform:translateX(40px); } }

/* ── Side Navigation ── */
#sidenav {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: rgba(10, 10, 18, 0.8);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-3);
}

.nav-rune {
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-3);
  font-size: 1.2rem;
  position: relative;
  transition: all var(--dur-med) var(--ease);
  cursor: pointer;
}
.nav-rune:hover, .nav-rune.active {
  color: #fff;
  background: var(--surface-3);
}
.nav-rune.active { color: var(--purple-light); }

.nav-rune::before {
  content: attr(data-label);
  position: absolute;
  left: 54px;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  pointer-events: none;
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--dur-fast) var(--ease);
}
.nav-rune:hover::before {
  opacity: 1;
  transform: none;
}

/* ── BGM Player ── */
#bgm-player {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: rgba(12, 10, 18, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 42, 95, 0.3);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  transition: all var(--dur-med) var(--ease);
  box-shadow: 0 10px 30px rgba(0,0,0,0.7), 0 0 20px rgba(255, 42, 95, 0.15);
}
#bgm-player.bgm-playing {
  border-color: rgba(255, 42, 95, 0.8);
  box-shadow: 0 10px 35px rgba(0,0,0,0.8), 0 0 25px rgba(255, 42, 95, 0.4);
}
.bgm-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 150px;
  overflow: hidden;
}
.bgm-title {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ffffff;
}
.bgm-status {
  font-size: 0.68rem;
  color: #ff2a5f;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.bgm-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  transition: all var(--dur-fast) var(--ease);
}
.bgm-btn:hover {
  background: #ff2a5f;
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 0 15px rgba(255, 42, 95, 0.6);
  transform: scale(1.1);
}
.bgm-mini-vis {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
  opacity: 0.4;
  transition: opacity var(--dur-med) var(--ease);
}
#bgm-player.bgm-playing .bgm-mini-vis { opacity: 1; }
.bgm-mini-vis .b {
  width: 3px;
  background: #ff2a5f;
  border-radius: 2px;
  animation: none;
  height: 4px;
  box-shadow: 0 0 8px rgba(255, 42, 95, 0.8);
}
#bgm-player.bgm-playing .bgm-mini-vis .b:nth-child(1) { animation: bar 0.8s ease-in-out infinite; }
#bgm-player.bgm-playing .bgm-mini-vis .b:nth-child(2) { animation: bar 0.8s ease-in-out 0.15s infinite; }
#bgm-player.bgm-playing .bgm-mini-vis .b:nth-child(3) { animation: bar 0.8s ease-in-out 0.3s infinite; }
#bgm-player.bgm-playing .bgm-mini-vis .b:nth-child(4) { animation: bar 0.8s ease-in-out 0.45s infinite; }
@keyframes bar {
  0%, 100% { height: 4px; }
  50%       { height: 18px; }
}

/* ── Splash Screen ── */
#splash-screen {
  position: fixed; inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  cursor: pointer;
  text-align: center;
  transition: opacity 1s var(--ease), visibility 1s;
}
#splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 6rem);
  letter-spacing: 0.2em;
  color: #fff;
  text-shadow: 0 0 40px rgba(124, 58, 237, 0.8), 0 0 80px rgba(124, 58, 237, 0.4);
  animation: splashPulse 3s ease-in-out infinite;
}
.splash-sub {
  font-size: 0.8rem;
  letter-spacing: 0.6em;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  margin-top: var(--space-4);
  animation: splashBlink 2s ease-in-out infinite;
}
@keyframes splashPulse {
  0%, 100% { text-shadow: 0 0 40px rgba(124,58,237,0.8), 0 0 80px rgba(124,58,237,0.4); }
  50%       { text-shadow: 0 0 60px rgba(124,58,237,1), 0 0 120px rgba(124,58,237,0.6); }
}
@keyframes splashBlink {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1; }
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: var(--space-7) var(--space-5);
  color: var(--text-3);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  border-top: 1px solid var(--border);
  margin-top: var(--space-8);
}

/* ── Utilities ── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-2); }
.gap-2 { gap: var(--space-3); }
.gap-3 { gap: var(--space-5); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-muted { color: var(--text-3); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.font-mono { font-family: var(--font-mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pointer { cursor: pointer; }

/* ── Lightbox ── */
.lightbox {
  position: fixed; inset: 0;
  z-index: 99000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease);
  backdrop-filter: var(--blur-sm);
}
.lightbox.active {
  opacity: 1;
  pointer-events: all;
}
.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}
.lightbox-close {
  position: absolute;
  top: -44px; right: 0;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-2);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--dur-fast) var(--ease);
}
.lightbox-close:hover { background: var(--surface-3); color: #fff; }
.lightbox-inner iframe, .lightbox-inner video, .lightbox-inner img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: var(--radius-md);
}
.lightbox-inner iframe { width: 800px; height: 450px; border: none; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease);
  backdrop-filter: var(--blur-sm);
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.modal {
  width: 100%;
  max-width: 560px;
  padding: var(--space-6);
  position: relative;
  animation: modalIn var(--dur-med) var(--ease-spring);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: none; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}
.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
}

/* ── Color Picker ── */
.color-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease);
  flex-shrink: 0;
}
.color-dot:hover { transform: scale(1.15); }

/* ── Range Input ── */
input[type=range] {
  -webkit-appearance: none;
  background: transparent;
  height: 36px;
  width: 100%;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  border: 1px solid var(--border);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  margin-top: -8px;
  cursor: pointer;
  border: 2px solid var(--purple);
  box-shadow: 0 0 8px var(--purple-glow);
  transition: transform var(--dur-fast) var(--ease);
}
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.2); }

/* ── Responsive ── */
@media (max-width: 768px) {
  #sidenav {
    left: 50%;
    top: auto;
    bottom: 16px;
    transform: translateX(-50%);
    flex-direction: row;
  }
  .nav-rune::before { display: none; }
  #bgm-player { bottom: 80px; right: 12px; }
}
