/* =====================================================================
   Variables
   ===================================================================== */
:root {
  /* Color palette - dark elegant fantasy */
  --color-bg: #05070b;
  --color-bg-elevated: #0b1019;
  --color-bg-soft: #101725;
  --color-surface: #151b29;

  --color-text: #e4edf7;
  --color-text-soft: #b3c1d5;
  --color-text-muted: #8a94aa;

  --color-primary: #3fd0ff; /* arcane teal/cyan glow */
  --color-primary-soft: rgba(63, 208, 255, 0.12);
  --color-primary-strong: #68e0ff;

  --color-accent-emerald: #35d0a1;
  --color-accent-emerald-soft: rgba(53, 208, 161, 0.16);
  --color-accent-gold: #f6c667;
  --color-accent-gold-soft: rgba(246, 198, 103, 0.14);
  --color-accent-royal: #4462ff;

  --color-success: #4ade80;
  --color-warning: #facc15;
  --color-danger: #fb7185;

  --color-border-subtle: rgba(148, 163, 184, 0.22);
  --color-border-strong: rgba(148, 163, 184, 0.45);

  --color-overlay: rgba(4, 6, 18, 0.8);

  /* Neutral grays for UI */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2933;
  --gray-900: #111827;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-display: "Poppins", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */
  --font-size-5xl: 3rem;     /* 48px */

  --line-height-tight: 1.15;
  --line-height-snug: 1.3;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.8;

  /* Spacing scale (px) */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Shadows - soft, mystical glow */
  --shadow-soft: 0 16px 40px rgba(15, 23, 42, 0.55);
  --shadow-soft-inset: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
  --shadow-glow-primary: 0 0 24px rgba(63, 208, 255, 0.45);
  --shadow-glow-emerald: 0 0 24px rgba(53, 208, 161, 0.42);

  /* Transitions */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-emphasized: cubic-bezier(0.22, 1, 0.36, 1);

  --transition-fast: 120ms var(--ease-standard);
  --transition-base: 200ms var(--ease-standard);
  --transition-slow: 320ms var(--ease-emphasized);

  /* Layout */
  --layout-max-width: 1200px;
  --layout-max-width-wide: 1320px;
  --layout-gutter: 16px;

  /* Z-index */
  --z-header: 40;
  --z-overlay: 50;
  --z-modal: 60;
  --z-popover: 70;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================================================
   Reset / Normalize
   ===================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  margin: 0;
  padding: 0;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: none;
  padding: 0;
  background: none;
}

textarea {
  resize: vertical;
}

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

table {
  border-collapse: collapse;
  border-spacing: 0;
}

body,
html {
  min-height: 100%;
}

/* =====================================================================
   Base Styles
   ===================================================================== */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  background: radial-gradient(circle at top, #0b1324 0, #05070b 55%, #020308 100%);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  min-height: 60vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-2);
}

h4 {
  font-size: 1.15rem;
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-3);
  color: var(--color-text-soft);
}

strong,
b {
  font-weight: 600;
}

small {
  font-size: var(--font-size-sm);
}

code,
pre,
kbd,
samp {
  font-family: var(--font-mono);
}

a {
  color: var(--color-primary-strong);
  text-decoration: none;
  transition: color var(--transition-base),
    text-shadow var(--transition-base),
    opacity var(--transition-fast);
}

a:hover {
  color: var(--color-accent-gold);
  text-shadow: 0 0 12px rgba(246, 198, 103, 0.45);
}

a:active {
  opacity: 0.85;
}

/* Selection */
::selection {
  background: rgba(63, 208, 255, 0.25);
  color: #f9fafb;
}

/* =====================================================================
   Accessibility & Focus
   ===================================================================== */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

button:focus,
[role="button"]:focus,
input:focus,
select:focus,
textarea:focus,
summary:focus {
  outline: none;
}

button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-accent-gold);
  outline-offset: 2px;
}

/* Screen reader only */
.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;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* =====================================================================
   Layout Utilities
   ===================================================================== */
.container {
  width: 100%;
  max-width: var(--layout-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--layout-gutter);
  padding-right: var(--layout-gutter);
}

.container-wide {
  width: 100%;
  max-width: var(--layout-max-width-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--layout-gutter);
  padding-right: var(--layout-gutter);
}

.section {
  padding-top: clamp(48px, 7vh, 80px);
  padding-bottom: clamp(48px, 7vh, 80px);
}

.section--alt {
  background: radial-gradient(circle at top left, rgba(40, 85, 164, 0.28), transparent 55%),
    radial-gradient(circle at bottom right, rgba(25, 148, 120, 0.22), transparent 60%),
    var(--color-bg-elevated);
}

.section-header {
  margin-bottom: var(--space-6);
}

.section-kicker {
  font-size: var(--font-size-sm);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent-gold);
  margin-bottom: var(--space-2);
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: var(--space-2);
}

.section-subtitle {
  max-width: 640px;
  color: var(--color-text-muted);
}

/* Spacing utilities (vertical margins) */
.u-mb-0 { margin-bottom: 0 !important; }
.u-mb-2 { margin-bottom: var(--space-2) !important; }
.u-mb-3 { margin-bottom: var(--space-3) !important; }
.u-mb-4 { margin-bottom: var(--space-4) !important; }
.u-mb-6 { margin-bottom: var(--space-6) !important; }

/* Flex helpers */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* Grid helpers */
.grid { display: grid; }
.grid-2 {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: var(--space-4);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Alignment */
.text-center { text-align: center; }
.text-right { text-align: right; }

/* =====================================================================
   Components - Buttons
   ===================================================================== */
.btn {
  --btn-bg: var(--color-primary);
  --btn-bg-hover: var(--color-primary-strong);
  --btn-color: #020617;
  --btn-border: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--btn-border);
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 55%),
    var(--btn-bg);
  color: var(--btn-color);
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.7);
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast),
    color var(--transition-fast),
    opacity var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px) scale(1.01);
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.2), transparent 60%),
    var(--btn-bg-hover);
  box-shadow: var(--shadow-glow-primary);
}

.btn:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.9);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn--secondary {
  --btn-bg: rgba(15, 23, 42, 0.85);
  --btn-bg-hover: rgba(15, 23, 42, 1);
  --btn-border: rgba(148, 163, 184, 0.4);
  --btn-color: var(--color-text);

  box-shadow: var(--shadow-soft-inset);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-bg-hover: rgba(15, 23, 42, 0.95);
  --btn-border: rgba(148, 163, 184, 0.4);
  --btn-color: var(--color-text-soft);

  background: transparent;
  box-shadow: none;
}

.btn--ghost:hover {
  box-shadow: var(--shadow-soft);
}

.btn--accent-gold {
  --btn-bg: var(--color-accent-gold);
  --btn-bg-hover: #ffd677;
  --btn-color: #111827;
}

.btn--accent-emerald {
  --btn-bg: var(--color-accent-emerald);
  --btn-bg-hover: #4ce2b3;
  --btn-color: #020617;
}

/* =====================================================================
   Components - Forms / Inputs
   ===================================================================== */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-3);
}

.field-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-soft);
}

.field-help {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.input,
select,
textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: radial-gradient(circle at top left, rgba(63, 208, 255, 0.07), transparent 55%),
    rgba(15, 23, 42, 0.88);
  color: var(--color-text);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
  transition: border-color var(--transition-base),
    box-shadow var(--transition-base),
    background var(--transition-base);
}

.input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
}

.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(63, 208, 255, 0.7),
    0 0 24px rgba(63, 208, 255, 0.35);
}

.input--error {
  border-color: var(--color-danger);
}

.input--error:focus-visible {
  box-shadow: 0 0 0 1px rgba(251, 113, 133, 0.7),
    0 0 24px rgba(251, 113, 133, 0.4);
}

/* =====================================================================
   Components - Card
   ===================================================================== */
.card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background:
    radial-gradient(circle at top left, rgba(63, 208, 255, 0.16), transparent 60%),
    radial-gradient(circle at bottom right, rgba(53, 208, 161, 0.2), transparent 60%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgba(148, 163, 184, 0.25);
  opacity: 0.4;
  pointer-events: none;
}

.card-header {
  margin-bottom: var(--space-3);
}

.card-title {
  font-size: var(--font-size-xl);
  margin-bottom: 4px;
}

.card-kicker {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-accent-gold);
  margin-bottom: var(--space-1);
}

.card-body {
  color: var(--color-text-soft);
}

/* Variant for map / lore / gameplay listing cards */
.card--holo {
  background:
    radial-gradient(circle at 0% 0%, rgba(63, 208, 255, 0.26), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(246, 198, 103, 0.2), transparent 50%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.96));
}

/* Subtle hover for interactive cards */
.card--interactive {
  cursor: pointer;
  transition: transform var(--transition-slow),
    box-shadow var(--transition-slow),
    border-color var(--transition-slow);
}

.card--interactive:hover {
  transform: translateY(-4px) translateZ(0);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.96), var(--shadow-glow-primary);
  border-color: rgba(148, 163, 184, 0.6);
}

/* =====================================================================
   Hero & Cinematic Elements (generic base styles)
   ===================================================================== */
.hero {
  position: relative;
  padding-top: clamp(80px, 12vh, 120px);
  padding-bottom: clamp(72px, 14vh, 140px);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(63, 208, 255, 0.24), transparent 60%),
    radial-gradient(circle at 80% 40%, rgba(246, 198, 103, 0.26), transparent 65%),
    radial-gradient(circle at 10% 90%, rgba(53, 208, 161, 0.2), transparent 55%);
  opacity: 0.8;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-accent-gold);
  margin-bottom: var(--space-3);
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  line-height: var(--line-height-tight);
  text-shadow: 0 0 30px rgba(15, 23, 42, 0.9);
}

.hero-title span {
  background: linear-gradient(120deg, #e4edf7, #68e0ff, #f6c667);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin-top: var(--space-3);
  max-width: 560px;
  color: var(--color-text-muted);
}

.hero-actions {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Quick navigation / pill links */
.pill-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.pill-nav__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: radial-gradient(circle at top, rgba(63, 208, 255, 0.12), transparent 60%),
    rgba(15, 23, 42, 0.96);
  color: var(--color-text-soft);
  font-size: var(--font-size-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: border-color var(--transition-base),
    background var(--transition-base),
    color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-base);
}

.pill-nav__item:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-strong);
  box-shadow: 0 0 18px rgba(63, 208, 255, 0.4);
  transform: translateY(-1px);
}

/* =====================================================================
   Misc Utility Classes
   ===================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.badge--primary {
  border-color: rgba(63, 208, 255, 0.75);
  background: rgba(15, 23, 42, 0.96);
  color: var(--color-primary-strong);
}

.badge--success {
  border-color: rgba(74, 222, 128, 0.7);
  color: var(--color-success);
}

.text-muted { color: var(--color-text-muted); }
.text-soft { color: var(--color-text-soft); }

.bg-surface { background: var(--color-surface); }
.bg-soft { background: var(--color-bg-soft); }

.radius-md { border-radius: var(--radius-md); }
.radius-lg { border-radius: var(--radius-lg); }

.shadow-soft { box-shadow: var(--shadow-soft); }
.shadow-glow { box-shadow: var(--shadow-glow-primary); }

/* Status text helpers for guides / tips */
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }

/* =====================================================================
   End base.css
   ===================================================================== */
