/* =========================================
   Variables
   ========================================= */
:root {
  /* Color Palette - Neon Fantasy */
  --color-bg: #050712;
  --color-bg-elevated: #0b0f1f;
  --color-bg-alt: #070914;

  --color-text: #f5f7ff;
  --color-text-muted: #a3b0d9;

  --color-primary: #47f3ff; /* neon cyan */
  --color-primary-soft: rgba(71, 243, 255, 0.12);

  --color-success: #3df78b;
  --color-warning: #ffdb5a;
  --color-danger: #ff4f7b;

  --color-info: #7b5cff;

  --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,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --font-display: "Orbitron", "Rajdhani", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;

  --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.1;
  --line-height-snug: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

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

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Shadows - neon flavored */
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.75);
  --shadow-neon-primary: 0 0 16px rgba(71, 243, 255, 0.55);
  --shadow-neon-danger: 0 0 18px rgba(255, 79, 123, 0.5);

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

  /* Layout */
  --container-width: 1120px;
}

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

* {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border-radius: 0;
}

button {
  border: none;
}

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

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

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

/* Remove animations & transitions for people who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================
   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, #181b3a 0, #050712 52%, #020309 100%);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  display: block;
}

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

h1 {
  font-size: clamp(var(--font-size-3xl), 3vw + 1rem, var(--font-size-5xl));
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(var(--font-size-2xl), 2.4vw + 0.6rem, var(--font-size-4xl));
  margin-bottom: var(--space-3);
}

h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

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

strong {
  font-weight: 600;
}

code,
pre {
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular,
    Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}

pre {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: rgba(7, 9, 20, 0.95);
  overflow: auto;
}

a {
  position: relative;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-primary);
}

/* Underline-on-hover for textual links (not buttons) */
a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.1em;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-info));
  transition: width var(--transition-base);
}

a:not(.btn):hover::after {
  width: 100%;
}

hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin: var(--space-6) 0;
}

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

::-moz-selection {
  background: var(--color-primary-soft);
  color: var(--color-text);
}

::selection {
  background: var(--color-primary-soft);
  color: var(--color-text);
}

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

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

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

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

/* Flex */
.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-col {
  display: flex;
  flex-direction: column;
}

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

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

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

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

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

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

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

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

/* Spacing utilities (subset for common usage) */
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.pt-4 { padding-top: var(--space-4); }
.pt-8 { padding-top: var(--space-8); }
.pb-4 { padding-bottom: var(--space-4); }
.pb-8 { padding-bottom: var(--space-8); }

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

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

.hidden { display: none !important; }

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

/* Hero / Background helpers for neon arenas & spell art */
.hero-neon {
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 10% 0, rgba(123, 92, 255, 0.3) 0,
        transparent 45%),
      radial-gradient(circle at 80% 20%, rgba(71, 243, 255, 0.3) 0,
        transparent 50%),
      radial-gradient(circle at 50% 100%, rgba(255, 79, 123, 0.28) 0,
        transparent 55%),
      #050712;
}

.hero-neon::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.04),
      transparent 55%);
  opacity: 0.6;
  pointer-events: none;
}

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

/* Visual placeholders for magical battles & tutorials */
.media-placeholder {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(71, 243, 255, 0.18),
      rgba(123, 92, 255, 0.2)),
    radial-gradient(circle at 20% 0, rgba(255, 79, 123, 0.35), transparent 45%),
    #050712;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.media-placeholder::after {
  content: "Neon Battle Visual Placeholder";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(245, 247, 255, 0.7);
  background: radial-gradient(circle at 50% 50%, rgba(5, 7, 18, 0.2),
      rgba(5, 7, 18, 0.9));
}

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

/* Buttons */
.btn {
  --btn-bg: var(--color-primary);
  --btn-bg-hover: #82f9ff;
  --btn-color: #020308;
  --btn-shadow: var(--shadow-neon-primary);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: radial-gradient(circle at 20% 0, #ffffff 0, transparent 50%),
    linear-gradient(135deg, var(--btn-bg), var(--color-info));
  color: var(--btn-color);
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  position: relative;
  overflow: hidden;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-base),
    filter var(--transition-fast);
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 0, rgba(255, 255, 255, 0.55),
      transparent 40%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 0 0 1px rgba(71, 243, 255, 0.5), var(--shadow-neon-primary);
  filter: saturate(1.1);
}

.btn:hover::after {
  opacity: 1;
}

.btn:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 0 0 1px rgba(71, 243, 255, 0.4);
}

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

/* Primary CTA - e.g., Google Play */
.btn-primary {
  --btn-bg: var(--color-primary);
  --btn-bg-hover: #82f9ff;
  --btn-color: #020308;
}

/* Secondary button - for less prominent actions */
.btn-secondary {
  --btn-bg: rgba(7, 9, 20, 0.9);
  --btn-bg-hover: rgba(11, 15, 31, 1);
  --btn-color: var(--color-text);
  --btn-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);

  background: linear-gradient(135deg, rgba(123, 92, 255, 0.35),
      rgba(7, 9, 20, 0.95));
}

/* Tag-style button - e.g., for filters (News, Guides, Builds) */
.btn-ghost {
  --btn-bg: rgba(255, 255, 255, 0.02);
  --btn-bg-hover: rgba(255, 255, 255, 0.06);
  --btn-color: var(--color-text-muted);
  --btn-shadow: none;

  border-radius: var(--radius-md);
  padding: 0.5rem 0.9rem;
  text-transform: none;
  letter-spacing: 0.04em;
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
}

.btn-ghost:hover {
  box-shadow: 0 0 0 1px rgba(71, 243, 255, 0.6);
}

/* Inputs */
.input,
.textarea,
.select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 9, 20, 0.92);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  outline: none;
  box-shadow: 0 0 0 0 rgba(71, 243, 255, 0.8);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background var(--transition-base);
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(163, 176, 217, 0.7);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(71, 243, 255, 0.9), var(--shadow-neon-primary);
  background: #050712;
}

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

textarea.textarea {
  min-height: 140px;
  resize: vertical;
}

/* Cards - for guides, builds, news, etc. */
.card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: linear-gradient(145deg, rgba(7, 9, 20, 0.98), #050712);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: conic-gradient(from 140deg,
      rgba(71, 243, 255, 0.6),
      rgba(123, 92, 255, 0.6),
      rgba(255, 79, 123, 0.6),
      rgba(71, 243, 255, 0.6));
  opacity: 0;
  transition: opacity var(--transition-slow);
  pointer-events: none;
}

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

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

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

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

.card-meta {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(163, 176, 217, 0.75);
}

/* Pill label for content types (Guide, Arena, Spell, Build, News) */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(7, 9, 20, 0.9);
  color: var(--color-text-muted);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.badge-primary {
  border-color: rgba(71, 243, 255, 0.7);
  color: var(--color-primary);
}

.badge-danger {
  border-color: rgba(255, 79, 123, 0.7);
  color: var(--color-danger);
}

/* Tag chips for spell elements, roles, etc. */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgba(7, 9, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

/* Callout boxes for tips / warnings */
.callout {
  position: relative;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  border-left: 3px solid var(--color-primary);
  background: radial-gradient(circle at 0 0, rgba(71, 243, 255, 0.12),
      transparent 55%),
    rgba(7, 9, 20, 0.96);
}

.callout--warning {
  border-left-color: var(--color-warning);
}

.callout--danger {
  border-left-color: var(--color-danger);
}

/* Simple main nav baseline (gaming portal style) */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(5, 7, 18, 0.96),
      rgba(5, 7, 18, 0.88));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.nav-logo span {
  color: var(--color-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.nav-link {
  position: relative;
  color: rgba(245, 247, 255, 0.78);
  padding-bottom: 0.2rem;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.1rem;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-info));
  transition: width var(--transition-base);
}

.nav-link:hover::after,
.nav-link--active::after {
  width: 100%;
}

.nav-cta {
  margin-left: 1.5rem;
}

@media (max-width: 960px) {
  .nav-links {
    display: none;
  }
}

/* Footer baseline */
.site-footer {
  padding: var(--space-8) 0 var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #040612;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

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

/* =========================================
   Helper Classes for Game-Specific Styling
   ========================================= */

.text-neon-primary {
  color: var(--color-primary);
}

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

.text-neon-info {
  color: var(--color-info);
}

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

/* Element color hints (for spells & powers sections) */
.spell-fire { color: #ff8a4a; }
.spell-ice { color: #7fd9ff; }
.spell-arcane { color: #b98cff; }
.spell-shadow { color: #9b59ff; }
.spell-nature { color: #5df59a; }

/* Timeline / patch note helper */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 0.2rem;
  bottom: 0.2rem;
  width: 2px;
  background: linear-gradient(to bottom, rgba(71, 243, 255, 0.3),
      rgba(255, 79, 123, 0.3));
}

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

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.6rem;
  top: 0.3rem;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--color-primary);
  box-shadow: var(--shadow-neon-primary);
}
