/* =========================================================
   GAME WORLD — Design Tokens & Base Styles
   ========================================================= */

:root {
  /* Brand */
  --brand-accent: #2dd4bf;
  --brand-accent-2: #f97316;
  --brand-accent-soft: rgba(45, 212, 191, 0.16);
  --brand-accent-2-soft: rgba(249, 115, 22, 0.16);

  /* Surfaces (dark default) */
  --bg: #0b1220;
  --bg-elevated: #111a2e;
  --surface: #151f36;
  --surface-2: #1c2740;
  --surface-3: #243154;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);

  /* Text */
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --text-inverse: #0b1220;

  /* Semantic */
  --primary: var(--brand-accent);
  --primary-hover: #5eead4;
  --secondary: var(--brand-accent-2);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #38bdf8;

  /* Badges */
  --badge-new: #22d3ee;
  --badge-hot: #f97316;
  --badge-featured: #a78bfa;
  --badge-trending: #fb7185;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.42);
  --shadow-glow: 0 0 0 1px rgba(45, 212, 191, 0.2), 0 12px 32px rgba(45, 212, 191, 0.12);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.75rem;
  --radius-full: 9999px;

  /* Typography */
  --font-display: "Segoe UI", "Trebuchet MS", "Verdana", sans-serif;
  --font-body: "Segoe UI", "Helvetica Neue", "Arial", sans-serif;
  --font-mono: "Cascadia Code", "Consolas", monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 1.875rem;
  --fs-3xl: 2.25rem;
  --fs-4xl: 3rem;
  --fs-5xl: 3.75rem;

  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-normal: 1.55;

  /* Layout */
  --header-h: 4rem;
  --container: 1480px;
  --container-pad: clamp(1rem, 3vw, 2rem);
  --section-gap: clamp(2.5rem, 5vw, 4.5rem);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 150ms;
  --duration: 220ms;
  --duration-slow: 380ms;

  /* Focus */
  --focus-ring: 0 0 0 3px rgba(45, 212, 191, 0.45);

  /* Overlay */
  --overlay: rgba(5, 10, 20, 0.72);
  --hero-overlay: linear-gradient(
    105deg,
    rgba(11, 18, 32, 0.92) 0%,
    rgba(11, 18, 32, 0.72) 42%,
    rgba(11, 18, 32, 0.35) 100%
  );
}

[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef3f9;
  --surface-3: #e2eaf4;
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --text-inverse: #f8fafc;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 0 1px rgba(13, 148, 136, 0.18), 0 12px 32px rgba(13, 148, 136, 0.1);
  --primary: #0d9488;
  --primary-hover: #0f766e;
  --brand-accent: #0d9488;
  --brand-accent-soft: rgba(13, 148, 136, 0.12);
  --overlay: rgba(15, 23, 42, 0.45);
  --hero-overlay: linear-gradient(
    105deg,
    rgba(244, 247, 251, 0.95) 0%,
    rgba(244, 247, 251, 0.78) 42%,
    rgba(244, 247, 251, 0.28) 100%
  );
  --focus-ring: 0 0 0 3px rgba(13, 148, 136, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(45, 212, 191, 0.08), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(249, 115, 22, 0.07), transparent 50%),
    var(--bg);
  background-attachment: fixed;
}

[data-theme="light"] body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(13, 148, 136, 0.08), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(249, 115, 22, 0.06), transparent 50%),
    var(--bg);
}

img,
svg,
video {
  max-width: 100%;
  display: block;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(100% - (var(--container-pad) * 2), var(--container));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-gap);
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: var(--lh-tight);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin-top: var(--space-2);
}

.section-link {
  color: var(--primary);
  font-weight: 600;
  font-size: var(--fs-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  transition: color var(--duration) var(--ease);
}

.section-link:hover {
  color: var(--primary-hover);
}

/* Atmosphere pattern */
.bg-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

[data-theme="light"] .bg-pattern {
  opacity: 0.5;
}
