/* =============================================
   Variables
   ============================================= */
:root {
  /* Color Palette - Dark Fantasy Theme */
  --color-bg: #05060a;
  --color-bg-elevated: #0b0d14;
  --color-bg-muted: #11131c;

  --color-text: #f5f5f7;
  --color-text-muted: #a1a4b5;

  --color-primary: #d08b2f; /* warm amber accent */
  --color-primary-soft: rgba(208, 139, 47, 0.12);
  --color-primary-strong: #ffb347;

  --color-success: #4fbf7a;
  --color-warning: #e9b44c;
  --color-danger: #e04848;

  /* Neutral grays for borders, subtle text, separators */
  --gray-50: #f8fafc;
  --gray-100: #e2e8f0;
  --gray-200: #cbd5f5;
  --gray-300: #94a3b8;
  --gray-400: #64748b;
  --gray-500: #475569;
  --gray-600: #323848;
  --gray-700: #1f2430;
  --gray-800: #12151f;
  --gray-900: #05060a;

  /* Semantic surface/border colors */
  --color-border-subtle: rgba(148, 163, 184, 0.25);
  --color-border-strong: rgba(148, 163, 184, 0.6);
  --color-shadow-soft: rgba(0, 0, 0, 0.45);

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Font sizes (clamp for responsiveness) */
  --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: clamp(2.25rem, 4vw, 2.75rem); /* hero headings */
  --font-size-5xl: clamp(3rem, 5vw, 3.5rem);

  /* Line heights */
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (px values) */
  --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-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 6px 16px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.8);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 200ms ease-out;
  --transition-slow: 320ms ease-out;

  /* Layout */
  --container-max-width: 1120px;
  --container-padding-x: 16px;
}

/* Respect prefers-reduced-motion: reduce non-essential animations */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-normal: 0ms;
    --transition-slow: 0ms;
  }

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

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

html,
body {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
}

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

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

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

ul,
ol {
  margin: 0;
  padding: 0;
}

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

/* =============================================
   Base Styles
   ============================================= */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  display: block;
}

h1,
 h2,
 h3,
 h4,
 h5,
 h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: var(--gray-50);
}

h1 {
  font-size: var(--font-size-4xl);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h2 {
  font-size: var(--font-size-3xl);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-base);
}

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

strong {
  font-weight: 600;
}

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

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

a:hover {
  color: var(--color-primary-strong);
  text-shadow: 0 0 12px rgba(208, 139, 47, 0.55);
}

a:focus-visible {
  outline: 2px solid var(--color-primary-strong);
  outline-offset: 3px;
}

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

hr {
  border: 0;
  border-top: 1px solid var(--color-border-subtle);
  margin: var(--space-8) 0;
}

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

.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;
}

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

.section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.section--tight {
  padding-top: var(--space-10);
  padding-bottom: var(--space-10);
}

/* Layout helpers */
.flex {
  display: flex;
}

.flex-row {
  flex-direction: row;
}

.flex-column {
  flex-direction: column;
}

.flex-center {
  align-items: center;
  justify-content: center;
}

.flex-between {
  justify-content: space-between;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-2 {
  gap: var(--space-2);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-6 {
  gap: var(--space-6);
}

.grid {
  display: grid;
}

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

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

.text-center {
  text-align: center;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(148, 163, 184, 0.12);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

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

.border-subtle {
  border: 1px solid var(--color-border-subtle);
}

.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* =============================================
   Components - Buttons
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: linear-gradient(135deg, #3a2410, #7a4b15);
  color: #fff;
  font-weight: 600;
  font-size: var(--font-size-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--transition-normal),
    border-color var(--transition-fast),
    box-shadow var(--transition-normal),
    transform var(--transition-fast),
    color var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  background: linear-gradient(135deg, #4b2e12, #b8711e);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary-strong);
  outline-offset: 3px;
}

.btn--ghost {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.6);
  box-shadow: none;
}

.btn--ghost:hover {
  background: rgba(30, 41, 59, 0.9);
}

.btn--secondary {
  background: linear-gradient(135deg, #193948, #1e5568);
}

.btn--success {
  background: linear-gradient(135deg, #145237, #2f9b61);
}

.btn--danger {
  background: linear-gradient(135deg, #5a1117, #b21b29);
}

.btn--sm {
  padding: 0.45rem 0.9rem;
  font-size: var(--font-size-xs);
}

.btn--lg {
  padding: 0.8rem 1.6rem;
  font-size: var(--font-size-base);
}

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

/* Platform-specific CTA styles (Google Play / App Store) */
.btn--store {
  border-radius: var(--radius-md);
  padding: 0.5rem;
  background: #111827;
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.02em;
  width: 48px;
  height: 48px;
}

.btn--store:hover {
  background: #020617;
}

.store-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* =============================================
   Components - Form Elements
   ============================================= */
.input,
textarea,
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: rgba(15, 23, 42, 0.85);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

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

.input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--color-primary-strong);
  box-shadow: 0 0 0 1px rgba(255, 179, 71, 0.6), 0 0 0 6px rgba(255, 179, 71, 0.16);
}

.input[disabled],
textarea[disabled],
select[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

label {
  display: inline-block;
  margin-bottom: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* =============================================
   Components - Card (Guide Sections, Tips, etc.)
   ============================================= */
.card {
  position: relative;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.16), transparent 55%),
              linear-gradient(to bottom right, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-sm);
}

.card--muted {
  background: linear-gradient(to bottom right, #050816, #020617);
}

.card__title {
  margin-bottom: var(--space-2);
}

.card__meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
}

.card__content {
  color: var(--color-text);
}

/* Hero-specific helper for dark fantasy atmosphere */
.hero {
  position: relative;
  padding-top: var(--space-20);
  padding-bottom: var(--space-20);
  color: var(--color-text);
  background: radial-gradient(circle at 10% 0%, rgba(248, 250, 252, 0.08), transparent 50%),
              radial-gradient(circle at 90% 10%, rgba(248, 250, 252, 0.05), transparent 45%),
              linear-gradient(to bottom, #020617 0%, #020617 40%, #020617 60%, #020617 100%);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(148, 163, 184, 0.16), transparent 55%),
              radial-gradient(circle at 80% 0%, rgba(37, 99, 235, 0.28), transparent 55%);
  mix-blend-mode: screen;
  opacity: 0.45;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
}

.hero__eyebrow {
  font-size: var(--font-size-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.hero__title {
  max-width: 22ch;
}

.hero__subtitle {
  max-width: 50ch;
  color: var(--color-text-muted);
  margin-top: var(--space-4);
}

.hero__actions {
  margin-top: var(--space-6);
}

/* =============================================
   Media - Dark fantasy imagery helpers
   ============================================= */
.image-frame {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: var(--shadow-md);
}

.image-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(15, 23, 42, 0.2), transparent 60%);
  pointer-events: none;
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =============================================
   Tables (for structured stats/guide lists)
   ============================================= */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-4);
  font-size: var(--font-size-sm);
}

th,
 td {
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

th {
  text-align: left;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tr:nth-child(even) td {
  background-color: rgba(15, 23, 42, 0.5);
}

/* =============================================
   Lists for tips & strategies
   ============================================= */
ul,
 ol {
  padding-left: var(--space-4);
  margin-top: var(--space-3);
  margin-bottom: var(--space-3);
}

.list--unstyled {
  list-style: none;
  padding-left: 0;
}

.list--check {
  list-style: none;
  padding-left: 0;
}

.list--check li {
  position: relative;
  padding-left: 1.25rem;
}

.list--check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-primary-strong);
  box-shadow: 0 0 10px rgba(255, 179, 71, 0.7);
}

/* =============================================
   Misc
   ============================================= */
::selection {
  background-color: rgba(208, 139, 47, 0.32);
  color: var(--gray-50);
}
