/* ===========================================================================
   Variables
   ======================================================================== */
:root {
  /* Color Palette - Dark Fantasy Analytical */
  --color-bg: #05070b;
  --color-bg-elevated: #0b1018;
  --color-bg-soft: #101724;
  --color-surface: #151b2a;

  --color-text: #e4ecff;
  --color-text-muted: #9fa9c3;
  --color-text-soft: #7b859d;
  --color-heading: #f5f7ff;

  --color-primary: #4fd1c5; /* emerald-cyan glow */
  --color-primary-soft: rgba(79, 209, 197, 0.15);
  --color-primary-strong: #34b5aa;

  --color-success: #48bb78;
  --color-warning: #ecc94b;
  --color-danger: #f56565;

  --color-info: #63b3ed;
  --color-accent-blue: #4c6fff;
  --color-accent-emerald: #2dd4bf;

  /* Neutral Grays for UI & Stat Panels */
  --gray-50: #f9fafb;
  --gray-100: #edf2f7;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e0;
  --gray-400: #a0aec0;
  --gray-500: #718096;
  --gray-600: #4a5568;
  --gray-700: #2d3748;
  --gray-800: #1a202c;
  --gray-900: #0f1722;

  /* Semantic Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-glow-primary: rgba(79, 209, 197, 0.5);

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  --font-display: "Cinzel", "Trajan Pro", "Cormorant Garamond", serif;
  --font-mono: "JetBrains Mono", "Fira Code", 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-md: 1.0625rem; /* 17px */
  --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.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.8;

  /* Spacing Scale (0–96px) */
  --space-0: 0;
  --space-1: 0.125rem;  /* 2px */
  --space-2: 0.25rem;   /* 4px */
  --space-3: 0.375rem;  /* 6px */
  --space-4: 0.5rem;    /* 8px */
  --space-5: 0.625rem;  /* 10px */
  --space-6: 0.75rem;   /* 12px */
  --space-8: 1rem;      /* 16px */
  --space-10: 1.25rem;  /* 20px */
  --space-12: 1.5rem;   /* 24px */
  --space-16: 2rem;     /* 32px */
  --space-20: 2.5rem;   /* 40px */
  --space-24: 3rem;     /* 48px */
  --space-32: 4rem;     /* 64px */
  --space-40: 5rem;     /* 80px */
  --space-48: 6rem;     /* 96px */

  /* Radii */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-full: 999px;

  /* Shadows (subtle sci-fi fantasy glow) */
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 18px 45px rgba(0, 0, 0, 0.6);
  --shadow-strong: 0 24px 70px rgba(0, 0, 0, 0.85);
  --shadow-glow-primary: 0 0 25px rgba(79, 209, 197, 0.55);
  --shadow-glow-blue: 0 0 25px rgba(76, 111, 255, 0.5);

  /* Transitions & Motion */
  --transition-fast: 150ms ease-out;
  --transition-base: 220ms ease-out;
  --transition-slow: 360ms ease-out;

  --transition-all: all var(--transition-base);
  --transition-color: color var(--transition-base), background-color var(--transition-base), border-color var(--transition-base);
  --transition-transform: transform var(--transition-base), box-shadow var(--transition-base);
}

/* Reduced Motion Handling */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 0ms;
    --transition-slow: 0ms;
    --transition-all: none;
    --transition-color: none;
    --transition-transform: none;
  }
  *, *::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,
figure, blockquote, dl, dd,
ul, ol, p {
  margin: 0;
}

ul, ol {
  padding-left: 1.25rem;
}

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

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

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

textarea {
  resize: vertical;
}

/* Remove default link styles but keep accessibility */
a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

/* ===========================================================================
   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, #101527 0, #05070b 52%, #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;
  color: var(--color-heading);
  line-height: var(--line-height-tight);
  letter-spacing: 0.03em;
}

h1 { font-size: clamp(2.5rem, 4vw, 3.25rem); margin-bottom: var(--space-8); }

h2 { font-size: clamp(2rem, 3vw, 2.5rem); margin-bottom: var(--space-6); }

h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin-bottom: var(--space-5); }

h4 { font-size: 1.25rem; margin-bottom: var(--space-4); }

h5 { font-size: 1.125rem; margin-bottom: var(--space-3); }

h6 { font-size: 1rem; margin-bottom: var(--space-2); }

p {
  margin-bottom: var(--space-6);
  color: var(--color-text-muted);
}

strong, b {
  font-weight: 600;
  color: var(--color-heading);
}

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

pre {
  background: rgba(4, 7, 16, 0.95);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
}

/* Analytical stat label style */
small {
  font-size: var(--font-size-xs);
  color: var(--gray-400);
}

/* Links - glowing UI accent */
a,
.link {
  color: var(--color-primary);
  text-decoration: none;
  position: relative;
  transition: var(--transition-color);
}

a::after,
.link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent-blue));
  box-shadow: 0 0 12px rgba(79, 209, 197, 0.7);
  transition: width var(--transition-base);
}

a:hover::after,
.link:hover::after {
  width: 100%;
}

/* Focus-visible styles for accessibility and keyboard users */
:focus {
  outline: none;
}

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

/* ===========================================================================
   Utilities
   ======================================================================== */

/* Layout Containers */
.container {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}

@media (min-width: 1280px) {
  .container {
    max-width: 1240px;
  }
}

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

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

/* 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-xs { gap: var(--space-4); }
.gap-sm { gap: var(--space-6); }
.gap-md { gap: var(--space-8); }
.gap-lg { gap: var(--space-12); }
.gap-xl { gap: var(--space-16); }

/* Grid Helpers */
.grid {
  display: grid;
}

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

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

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

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

.text-muted { color: var(--color-text-muted); }
.text-soft { color: var(--color-text-soft); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }

/* Spacing Utilities (margin / padding) */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-xs { margin-top: var(--space-4); }
.mb-xs { margin-bottom: var(--space-4); }
.mt-sm { margin-top: var(--space-6); }
.mb-sm { margin-bottom: var(--space-6); }
.mt-md { margin-top: var(--space-8); }
.mb-md { margin-bottom: var(--space-8); }
.mt-lg { margin-top: var(--space-12); }
.mb-lg { margin-bottom: var(--space-12); }
.mt-xl { margin-top: var(--space-16); }
.mb-xl { margin-bottom: var(--space-16); }

.pt-sm { padding-top: var(--space-6); }
.pb-sm { padding-bottom: var(--space-6); }
.pt-md { padding-top: var(--space-8); }
.pb-md { padding-bottom: var(--space-8); }
.pt-lg { padding-top: var(--space-12); }
.pb-lg { padding-bottom: var(--space-12); }

/* Width Helpers */
.w-full { width: 100%; }
/* Elevation / Surfaces */
.surface-soft {
  background: radial-gradient(circle at top left, rgba(79, 209, 197, 0.06), rgba(0, 0, 0, 0.5));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.surface-strong {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.98));
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
}

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

/* ===========================================================================
   Components
   ======================================================================== */

/* Buttons - primary CTA for hero, builds, guides */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: var(--font-size-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition-color), var(--transition-transform), box-shadow var(--transition-base), border-color var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 55%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent-blue));
  color: #02040a;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-soft), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.btn-primary:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: var(--shadow-glow-primary);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.9);
  color: var(--color-text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: rgba(30, 64, 175, 0.6);
  border-color: rgba(129, 140, 248, 0.7);
  box-shadow: var(--shadow-glow-blue);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-soft);
  border-color: rgba(148, 163, 184, 0.4);
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.85);
  color: var(--color-text);
}

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

.btn-lg {
  padding: 0.9rem 1.9rem;
  font-size: var(--font-size-md);
}

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

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

/* Inputs - shared across FAQ, Contact, Community */
.input,
.textarea,
.select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(2, 6, 23, 0.92);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  transition: var(--transition-color), var(--transition-transform), border-color var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
}

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

.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary-soft), var(--shadow-glow-primary);
  background: rgba(4, 7, 30, 0.98);
}

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

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

.form-field {
  margin-bottom: var(--space-8);
}

.form-helper {
  font-size: var(--font-size-xs);
  color: var(--color-text-soft);
  margin-top: var(--space-2);
}

.form-error {
  font-size: var(--font-size-xs);
  color: var(--color-danger);
  margin-top: var(--space-2);
}

/* Card - stat panels, build tiles, guide previews */
.card {
  position: relative;
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  background: radial-gradient(circle at top left, rgba(79, 209, 197, 0.09), rgba(15, 23, 42, 0.98));
  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 transparent;
  background: linear-gradient(135deg, rgba(79, 209, 197, 0.4), rgba(76, 111, 255, 0.0));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

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

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

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-soft);
}

.card-body {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card-footer {
  margin-top: var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

/* Focus style for clickable cards */
.card[tabindex] {
  transition: var(--transition-transform), box-shadow var(--transition-base), border-color var(--transition-base);
}

.card[tabindex]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--shadow-glow-primary);
  border-color: var(--border-glow-primary);
}

.card[tabindex]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* Hero-specific utility (for immersive home hero) */
.hero {
  position: relative;
  padding-top: var(--space-32);
  padding-bottom: var(--space-32);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top center, rgba(79, 209, 197, 0.18), transparent 60%);
  opacity: 0.9;
  pointer-events: none;
}

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

/* Simple tag / pill for stats, roles, Hungary targeting labels */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.85);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
}

.pill--primary {
  border-color: rgba(79, 209, 197, 0.7);
  background: rgba(15, 118, 110, 0.2);
  color: var(--color-primary);
}

/* Stat grid for analytical UI */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-6);
}

.stat {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

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

.stat-value {
  font-family: var(--font-mono);
  font-size: var(--font-size-lg);
  color: var(--color-heading);
}

/* Tags / chips for class, build, role labels */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.tag {
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: var(--font-size-xs);
  color: var(--color-text-soft);
}

.tag--role-dps { border-color: rgba(239, 68, 68, 0.7); }
.tag--role-tank { border-color: rgba(59, 130, 246, 0.7); }
.tag--role-support { border-color: rgba(52, 211, 153, 0.7); }

/* Toast / inline info (for Hungary targeting notices, game info) */
.notice {
  padding: var(--space-6) var(--space-8);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: rgba(8, 47, 73, 0.85);
  color: var(--color-text);
  font-size: var(--font-size-sm);
}

.notice--warning {
  border-color: rgba(245, 158, 11, 0.75);
  background: rgba(120, 53, 15, 0.9);
}

.notice--danger {
  border-color: rgba(248, 113, 113, 0.8);
  background: rgba(127, 29, 29, 0.9);
}
