/* ========================================================================
   Variables
   ======================================================================== */
:root {
  /* Color Palette - Epic Fantasy Kingdom Rush Theme */
  --color-bg: #050813; /* deep night blue */
  --color-bg-alt: #0b1020;
  --color-surface: #151a2b; /* panels/cards */
  --color-surface-alt: #1e2639;

  --color-text: #f5efe2; /* parchment-like text */
  --color-text-muted: #c2b9a4;

  --color-primary: #1e5bd8; /* royal blue */
  --color-primary-soft: rgba(30, 91, 216, 0.12);

  --color-accent-gold: #d1a543; /* medieval gold */
  --color-accent-gold-soft: rgba(209, 165, 67, 0.16);

  --color-success: #2e8b57; /* forest green */
  --color-warning: #f2b544; /* warm gold */
  --color-danger: #b6232a; /* deep crimson */

  --color-stone: #3f4656; /* stone gray */
  --color-stone-light: #5a6274;

  /* Neutral Grays */
  --gray-50: #f8fafc;
  --gray-100: #e2e8f0;
  --gray-200: #cbd5f5;
  --gray-300: #a0aec0;
  --gray-400: #718096;
  --gray-500: #4a5568;
  --gray-600: #2d3748;
  --gray-700: #1a202c;
  --gray-800: #111827;
  --gray-900: #05060a;

  /* Gradients - for cinematic hero areas */
  --gradient-hero: linear-gradient(135deg, #050813 0%, #13316b 45%, #4b1c3a 100%);
  --gradient-button: linear-gradient(135deg, #d1a543 0%, #f2b544 40%, #f9e3aa 100%);

  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --font-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-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 (0–96px) */
  --space-0: 0px;
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-6: 12px;
  --space-8: 16px;
  --space-10: 20px;
  --space-12: 24px;
  --space-16: 32px;
  --space-20: 40px;
  --space-24: 48px;
  --space-28: 56px;
  --space-32: 64px;
  --space-40: 80px;
  --space-48: 96px;

  /* Radius */
  --radius-none: 0;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* Shadows (slightly mystical / glowy) */
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 18px 45px rgba(0, 0, 0, 0.7);
  --shadow-glow-primary: 0 0 15px rgba(30, 91, 216, 0.7);
  --shadow-glow-gold: 0 0 18px rgba(209, 165, 67, 0.7);

  /* Transition Durations */
  --transition-fast: 120ms;
  --transition-base: 200ms;
  --transition-slow: 320ms;

  /* Layout */
  --container-max-width: 1200px;
  --container-padding-x: 1.25rem;
}

/* Reduced motion adjustments */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 0ms;
    --transition-slow: 0ms;
  }
}


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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

body {
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

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

img,
video {
  height: auto;
}

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

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

textarea {
  resize: vertical;
}

:where(table) {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Remove default outline; we'll restore focus-visible styles below */
:focus {
  outline: none;
}


/* ========================================================================
   Base Styles
   ======================================================================== */
body {
  background: radial-gradient(circle at top, #162447 0, #050813 55%, #020309 100%);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
}

main {
  min-height: 60vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: #fff8e6;
}

h1 {
  font-size: clamp(2.5rem, 3.6vw, 3.25rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(1.9rem, 2.6vw, 2.3rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h3 {
  font-size: clamp(1.5rem, 2.1vw, 1.8rem);
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.1rem;
}

h6 {
  font-size: 0.95rem;
}

p {
  margin-block: var(--space-8);
  color: var(--color-text);
}

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

strong {
  font-weight: 600;
}

a {
  color: var(--color-accent-gold);
  text-decoration: none;
  transition: color var(--transition-base) ease, text-shadow var(--transition-base) ease;
}

a:hover {
  color: #ffe8a6;
  text-shadow: 0 0 8px rgba(250, 225, 160, 0.6);
}

a:active {
  color: #f2b544;
}

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

hr {
  border: none;
  border-top: 1px solid rgba(255, 248, 230, 0.12);
  margin-block: var(--space-16);
}


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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Screen-reader-only utility */
.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 */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-inline: auto;
  padding-inline: var(--container-padding-x);
}

/* Simple layout helpers */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

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

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

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

.grid {
  display: grid;
}

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

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

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

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

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

.mt-0 { margin-top: 0 !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-8 { margin-top: var(--space-8) !important; }
.mt-16 { margin-top: var(--space-16) !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-8 { margin-bottom: var(--space-8) !important; }
.mb-16 { margin-bottom: var(--space-16) !important; }

.py-16 {
  padding-block: var(--space-16) !important;
}

.py-24 {
  padding-block: var(--space-24) !important;
}

.p-16 {
  padding: var(--space-16) !important;
}

.p-24 {
  padding: var(--space-24) !important;
}

.max-w-wide {
  max-width: 72rem;
}

/* Background helpers */
.bg-surface {
  background-color: var(--color-surface);
}

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

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

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

/* Epic section background hint for hero / key areas */
.bg-hero-epic {
  background-image: var(--gradient-hero);
  background-size: cover;
  background-position: center;
}


/* ========================================================================
   Components
   ======================================================================== */
/* Buttons */
.button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding-inline: 1.4rem;
  padding-block: 0.7rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: var(--font-size-sm);
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.9);
  position: relative;
  transition: transform var(--transition-fast) ease,
              box-shadow var(--transition-base) ease,
              filter var(--transition-base) ease,
              background var(--transition-base) ease,
              color var(--transition-base) ease;
  user-select: none;
}

.button-primary,
.btn-primary {
  background-image: var(--gradient-button);
  color: #2d1b07 !important;
  box-shadow: var(--shadow-md), var(--shadow-glow-gold);
}

.button-primary:hover,
.btn-primary:hover {
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.05);
  box-shadow: var(--shadow-lg), var(--shadow-glow-gold);
}

.button-primary:active,
.btn-primary:active {
  transform: translateY(0) scale(0.99);
  filter: brightness(0.97);
  box-shadow: var(--shadow-sm);
}

.button-secondary,
.btn-secondary {
  background: rgba(10, 19, 40, 0.9);
  color: var(--color-text);
  border-color: rgba(209, 165, 67, 0.35);
  box-shadow: var(--shadow-sm);
}

.button-secondary:hover,
.btn-secondary:hover {
  background: rgba(18, 32, 66, 0.95);
  box-shadow: var(--shadow-md);
}

.button-ghost,
.btn-ghost {
  background: transparent;
  color: var(--color-accent-gold);
  border-color: rgba(209, 165, 67, 0.6);
}

.button-ghost:hover,
.btn-ghost:hover {
  background: rgba(209, 165, 67, 0.08);
}

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

.button:focus-visible,
.btn:focus-visible {
  outline: 2px solid #ffe3a4;
  outline-offset: 3px;
}

/* Inputs & Form Controls */
.input,
select,
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"] {
  width: 100%;
  padding-inline: 0.85rem;
  padding-block: 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: rgba(6, 10, 27, 0.9);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: 1.4;
  transition: border-color var(--transition-base) ease,
              box-shadow var(--transition-base) ease,
              background-color var(--transition-base) ease;
}

.input::placeholder,
textarea::placeholder,
input::placeholder {
  color: rgba(218, 206, 180, 0.7);
}

.input:focus-visible,
select:focus-visible,
textarea:focus-visible,
input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="password"]:focus-visible,
input[type="search"]:focus-visible,
input[type="number"]:focus-visible {
  border-color: var(--color-accent-gold);
  box-shadow: 0 0 0 1px rgba(209, 165, 67, 0.9), 0 0 0 6px rgba(209, 165, 67, 0.25);
  background-color: rgba(10, 15, 40, 0.98);
}

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

label {
  display: inline-block;
  margin-bottom: var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Cards - for hero profiles, tower analysis, enemy entries, etc. */
.card {
  position: relative;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.04) 0, rgba(10, 12, 23, 0.96) 55%, rgba(4, 5, 10, 0.98) 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-16);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(209, 165, 67, 0.25), transparent 40%, transparent 60%, rgba(30, 91, 216, 0.25));
  opacity: 0;
  transition: opacity var(--transition-slow) ease;
}

.card:hover::before {
  opacity: 1;
}

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

.card-title {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
}

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

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

/* Tables - for tower comparison charts, enemy databases */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.table thead {
  background: rgba(14, 20, 40, 0.95);
}

.table th,
.table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.table th {
  text-align: left;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.table tbody tr:nth-child(even) {
  background: rgba(8, 10, 22, 0.8);
}

.table tbody tr:hover {
  background: rgba(30, 91, 216, 0.16);
}

/* Hero section base (for dramatic Hungarian headline areas) */
.section-hero {
  position: relative;
  padding-block: clamp(3rem, 8vw, 5rem);
  color: var(--color-text);
  overflow: hidden;
}

.section-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at bottom, rgba(182, 35, 42, 0.35), transparent 55%);
  mix-blend-mode: screen;
  opacity: 0.7;
  pointer-events: none;
}

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

/* Badges (for difficulty, hero roles, damage types) */
.badge {
  display: inline-flex;
  align-items: center;
  padding-inline: 0.55rem;
  padding-block: 0.18rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-primary {
  background: rgba(30, 91, 216, 0.23);
  border-color: rgba(138, 192, 255, 0.7);
  color: #e3f0ff;
}

.badge-danger {
  background: rgba(182, 35, 42, 0.35);
  border-color: rgba(250, 140, 149, 0.8);
  color: #ffe6ea;
}

.badge-success {
  background: rgba(46, 139, 87, 0.35);
  border-color: rgba(132, 215, 169, 0.8);
  color: #e0ffef;
}

/* Timeline base (for campaign progression pages) */
.timeline {
  position: relative;
  padding-left: 1.75rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.6rem;
  top: 0.25rem;
  bottom: 0.25rem;
  width: 2px;
  background: linear-gradient(to bottom, rgba(209, 165, 67, 0.9), rgba(30, 91, 216, 0.2));
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-16);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.15rem;
  top: 0.2rem;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(circle, #ffe7a4 0, #d1a543 60%, #7d5412 100%);
  box-shadow: 0 0 0 3px rgba(209, 165, 67, 0.4);
}

/* Gallery base (for battle / map screenshots) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-12);
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform var(--transition-slow) ease, filter var(--transition-slow) ease;
}

.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent 55%);
}

.gallery-item:hover img {
  transform: scale(1.06);
  filter: saturate(1.15);
}

/* World map / interactive map container baseline */
.map-shell {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: radial-gradient(circle at center, #233659 0, #050813 65%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-lg);
}

.map-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 10% 10%, rgba(209, 165, 67, 0.18), transparent 60%),
    radial-gradient(circle at 90% 80%, rgba(30, 91, 216, 0.24), transparent 55%);
  mix-blend-mode: screen;
  opacity: 0.85;
  pointer-events: none;
}

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

/* Status text helpers (for Hungarian labels like "Könnyű", "Nehéz", etc.) */
.text-success {
  color: var(--color-success) !important;
}

.text-warning {
  color: var(--color-warning) !important;
}

.text-danger {
  color: var(--color-danger) !important;
}

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

/* Chips / tags for damage types, armor, path, etc. */
.tag {
  display: inline-flex;
  align-items: center;
  padding-inline: 0.5rem;
  padding-block: 0.2rem;
  border-radius: var(--radius-pill);
  background: rgba(12, 17, 34, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.7rem;
}

.tag + .tag {
  margin-left: 0.35rem;
}

/* Utility panel / info callout (for tips, warnings, Hungarian info boxes) */
.callout {
  border-radius: var(--radius-lg);
  padding: var(--space-12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, rgba(6, 14, 30, 0.95), rgba(19, 30, 56, 0.98));
}

.callout--warning {
  border-color: rgba(242, 181, 68, 0.9);
  background: radial-gradient(circle at top left, rgba(242, 181, 68, 0.28), transparent 55%),
    linear-gradient(135deg, rgba(17, 13, 3, 0.98), rgba(22, 18, 6, 0.95));
}

.callout--danger {
  border-color: rgba(182, 35, 42, 0.9);
  background: radial-gradient(circle at top left, rgba(182, 35, 42, 0.35), transparent 55%),
    linear-gradient(135deg, rgba(16, 3, 4, 0.98), rgba(22, 7, 8, 0.95));
}

.callout-title {
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-4);
}

.callout-body {
  font-size: var(--font-size-sm);
}

/* Footer base */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle at top, rgba(30, 91, 216, 0.16), transparent 60%);
  padding-block: var(--space-16);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.site-footer a {
  color: var(--color-accent-gold);
}

.site-footer a:hover {
  color: #ffe8b4;
}

/* End of base.css */
