/* ==========================================================================
   SLevelStudio Core Design System & Global Styles
   Aesthetic: Indie Game Title Screen + Game Launcher UI
   ========================================================================== */

:root {
  /* Color Palette: Deep Obsidian, Slate, Warm Amber/Gold Game Accent */
  --bg-primary: #0a0c10;
  --bg-surface: #11151e;
  --bg-surface-elevated: #181e2b;
  --bg-surface-hover: #1f2738;
  
  --border-subtle: #242c3d;
  --border-strong: #3b4760;
  --border-highlight: #e2b714;

  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.25);
  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.2);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Typography */
  --font-game: 'Chakra Petch', -apple-system, sans-serif;
  --font-body: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono: 'Space Mono', monospace;

  /* Dimensions & Spacing */
  --max-width: 1140px;
  --hud-radius: 4px;
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
}

/* Atmospheric Background Canvas & CRT Scanlines */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.crt-scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.18) 50%
  ), linear-gradient(
    90deg,
    rgba(255, 0, 0, 0.015),
    rgba(0, 255, 0, 0.005),
    rgba(0, 0, 255, 0.015)
  );
  background-size: 100% 4px, 6px 100%;
  opacity: 0.7;
}

.vignette-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.85);
}

/* Transitions */
.hidden {
  display: none !important;
}

.fade-out {
  opacity: 0 !important;
  transform: scale(0.98) !important;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.fade-in {
  animation: fadeInEffect 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

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

/* Global Buttons & Game UI Elements */
button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, #242c3d 0%, #151b27 100%);
  color: #fff;
  border: 1px solid var(--border-strong);
  padding: 12px 24px;
  font-family: var(--font-game);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--hud-radius);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.primary-btn:hover {
  background: linear-gradient(180deg, #2e384c 0%, #1a2232 100%);
  border-color: var(--accent-gold);
  color: #fff;
  box-shadow: 0 0 16px var(--accent-gold-glow), 0 4px 16px rgba(0, 0, 0, 0.6);
  transform: translateY(-2px);
}

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

.btn-corner-deco {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 8px 8px 0;
  border-color: transparent var(--border-strong) transparent transparent;
  transition: border-color var(--transition-fast);
}

.primary-btn:hover .btn-corner-deco {
  border-color: transparent var(--accent-gold) transparent transparent;
}

/* Status dots */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald-glow);
  margin-right: 4px;
}

/* Accessibility */
@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;
  }
}
