/* ========================================================================== 
   VARIABLES
   ========================================================================== */

:root {
  /* Colors - fantasy, subdued, immersive */
  --color-bg: #05070d; /* deep night */
  --color-surface: #0b1019;
  --color-surface-alt: #121826;
  --color-text: #e5e8f0;
  --color-text-muted: #a0a7ba;

  --color-primary: #f1c15b; /* golden accent (fantasy, UI) */
  --color-primary-soft: rgba(241, 193, 91, 0.12);
  --color-primary-strong: #f7d57f;

  --color-success: #36c38b;
  --color-warning: #f0b454;
  --color-danger: #f46c6c;

  /* Neutral grays (cool, readable) */
  --gray-50: #f8fafc;
  --gray-100: #edf2f7;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5f5;
  --gray-400: #a0aec0;
  --gray-500: #718096;
  --gray-600: #4a5568;
  --gray-700: #2d3748;
  --gray-800: #1a202c;
  --gray-900: #0b1019;

  /* Borders, shadows, overlays */
  --color-border-subtle: rgba(255, 255, 255, 0.06);
  --color-border-strong: rgba(255, 255, 255, 0.16);
  --color-backdrop: rgba(4, 6, 12, 0.75);

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

  /* Font sizes (clamp for responsiveness) */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: clamp(2.25rem, 2.1rem + 0.6vw, 2.5rem);
  --font-size-5xl: clamp(2.75rem, 2.4rem + 1.2vw, 3.5rem);

  /* Line heights */
  --line-height-tight: 1.15;
  --line-height-snug: 1.3;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.75;

  /* Spacing scale (0–96px) */
  --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-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-full: 999px;

  /* Shadows (soft, atmospheric) */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.7);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-base: 180ms ease-out;
  --transition-slow: 260ms ease-out;

  /* Layout */
  --layout-max-width: 1120px;
  --layout-gutter: 1.25rem;

  /* Focus */
  --focus-ring-color: rgba(241, 193, 91, 0.8);
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;
}

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


/* ========================================================================== 
   RESET / NORMALIZE
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}

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

body {
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
}

ol,
ul {
  list-style: none;
}

blockquote,
q {
  quotes: none;
}

blockquote::before,
blockquote::after,
q::before,
q::after {
  content: "";
}

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

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

img {
  height: auto;
}

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

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

button,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"] {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
}

/* Remove default link styling; will be redefined in Base */
a {
  color: inherit;
  text-decoration: none;
}


/* ========================================================================== 
   BASE STYLES
   ========================================================================== */

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  display: block;
}

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

p:last-child {
  margin-bottom: 0;
}

strong,
b {
  font-weight: 600;
}

em,
i {
  font-style: italic;
}

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

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

pre {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background-color: var(--gray-900);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* Headings: fantasy-inspired, clear hierarchy */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: var(--line-height-snug);
  color: #ffffff;
}

h1 {
  font-size: var(--font-size-5xl);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

h2 {
  font-size: var(--font-size-3xl);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

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

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

h5 {
  font-size: var(--font-size-lg);
  margin-top: var(--space-3);
  margin-bottom: var(--space-1);
}

h6 {
  font-size: var(--font-size-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: var(--space-3);
  margin-bottom: var(--space-1);
}

/* Links: subtle, professional, with clear focus */

a {
  color: var(--color-primary);
  text-decoration: none;
  text-underline-offset: 0.18em;
  transition: color var(--transition-base), text-decoration-color var(--transition-base), opacity var(--transition-fast);
}

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

a:active {
  opacity: 0.8;
}

a[href^="mailto:"]::before,
a[href^="tel:"]::before {
  content: "";
}

/* Horizontal rules */

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

/* Form basics */

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

textarea {
  resize: vertical;
}


/* ========================================================================== 
   ACCESSIBILITY & FOCUS
   ========================================================================== */

:focus {
  outline: none;
}

:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* Ensure keyboard focus is visible even on custom components */
[tabindex]:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 0 3px var(--focus-ring-color);
}

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


/* ========================================================================== 
   UTILITIES
   ========================================================================== */

/* Layout container */

.container {
  width: 100%;
  max-width: var(--layout-max-width);
  margin-inline: auto;
  padding-inline: var(--layout-gutter);
  overflow-x: hidden;
}

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

/* Flex utilities */

.flex {
  display: flex;
}

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

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

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

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

.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-end {
  justify-content: flex-end;
}

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

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

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

/* Grid utilities */

.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 (limited, core usage) */

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

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

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

.px-4 {
  padding-inline: var(--space-4) !important;
}

.px-6 {
  padding-inline: var(--space-6) !important;
}

/* Text utilities */

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

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

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

.text-uppercase {
  text-transform: uppercase !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;
}

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

/* Hero / immersive background helpers */

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

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

.backdrop-blur {
  backdrop-filter: blur(18px);
}


/* ========================================================================== 
   COMPONENTS
   ========================================================================== */

/* Buttons */

.btn {
  --btn-bg: var(--color-primary);
  --btn-bg-hover: var(--color-primary-strong);
  --btn-text: #1b1204;
  --btn-border: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--btn-border);
  font-weight: 600;
  font-size: var(--font-size-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  background: radial-gradient(circle at 20% 0%, #fff3d0 0, var(--btn-bg) 40%, #d99b31 100%);
  color: var(--btn-text);
  box-shadow: var(--shadow-sm);
  transition:
    background var(--transition-base),
    color var(--transition-base),
    box-shadow var(--transition-fast),
    transform var(--transition-fast),
    border-color var(--transition-fast),
    opacity var(--transition-fast);
}

.btn:hover {
  background: radial-gradient(circle at 20% 0%, #fff8e0 0, var(--btn-bg-hover) 40%, #e8ac3c 100%);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

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

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

.btn-outline {
  --btn-bg: transparent;
  --btn-bg-hover: rgba(241, 193, 91, 0.15);
  --btn-text: var(--color-primary);
  --btn-border: rgba(241, 193, 91, 0.6);

  background: var(--btn-bg);
  color: var(--btn-text);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--btn-bg-hover);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-bg-hover: rgba(255, 255, 255, 0.06);
  --btn-text: var(--color-text);
  --btn-border: transparent;

  background: transparent;
  color: var(--btn-text);
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--btn-bg-hover);
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: var(--font-size-xs);
  color: var(--btn-text)!important;
}

.btn-lg {
  padding: 0.8rem 1.8rem;
  font-size: var(--font-size-base);
  color: var(--btn-text)!important;
}

/* Inputs & form controls */

.input,
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: rgba(7, 11, 20, 0.9);
  color: var(--color-text);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base);
}

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

.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), 0 0 0 2px rgba(241, 193, 91, 0.65);
  background-color: #070b14;
}

.input[aria-invalid="true"],
input:invalid,
textarea:invalid,
select:invalid {
  border-color: var(--color-danger);
}

.field-group {
  margin-bottom: var(--space-4);
}

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

/* Cards (for FAQ, news, guides, etc.) */

.card {
  position: relative;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  background:
    radial-gradient(circle at top left, rgba(241, 193, 91, 0.08), transparent 55%),
    radial-gradient(circle at bottom right, rgba(70, 126, 255, 0.08), transparent 55%),
    linear-gradient(145deg, #070a12 0%, #080c16 45%, #05070d 100%);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px);
}

.card + .card {
  margin-top: var(--space-4);
}

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

.card-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-meta {
  margin-top: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Tag / pill (for faction, role, etc.) */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background-color: rgba(6, 9, 17, 0.9);
}

.badge-primary {
  border-color: rgba(241, 193, 91, 0.8);
  color: var(--color-primary-strong);
  background-color: var(--color-primary-soft);
}

/* FAQ accordion basics (structure only, behavior by JS) */

.faq-item {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: rgba(6, 9, 17, 0.9);
  padding: var(--space-4);
}

.faq-item + .faq-item {
  margin-top: var(--space-3);
}

.faq-question {
  font-weight: 600;
  cursor: pointer;
}

.faq-answer {
  margin-top: var(--space-2);
  color: var(--color-text-muted);
}

/* Download / CTA banner */

.cta-banner {
  position: relative;
  padding: var(--space-5);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 0% 0%, rgba(241, 193, 91, 0.25), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(70, 126, 255, 0.35), transparent 55%),
    linear-gradient(135deg, #111827 0%, #020617 100%);
  border: 1px solid rgba(248, 250, 252, 0.08);
  box-shadow: var(--shadow-md);
}

.cta-banner-title {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--font-size-2xl);
}

.cta-banner-subtitle {
  margin-top: var(--space-2);
  color: var(--color-text-muted);
}

/* Navigation basics (structure, no layout enforcement) */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(20px);
  background: linear-gradient(to bottom, rgba(5, 7, 13, 0.94), rgba(5, 7, 13, 0.7));
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.nav-link {
  font-size: var(--font-size-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding-block: 0.6rem;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--color-primary-strong);
}

/* Hero text helper (for main game intro) */

.lead {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-muted);
}

.lead-strong {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-relaxed);
}

/* Utility: max content width for long-form guides */


.prose p + h2,
.prose p + h3 {
  margin-top: var(--space-6);
}

.prose ul,
.prose ol {
  margin-left: var(--space-5);
  margin-bottom: var(--space-4);
}

.prose li + li {
  margin-top: var(--space-1);
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

/* Prevent common overflow issues */
iframe,
embed,
object {
  max-width: 100%;
}

table {
  max-width: 100%;
  word-wrap: break-word;
}

/* Ensure long words don't cause overflow */
p, li, td, th, div {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Prevent wide elements from causing horizontal scroll */
section, article, aside, nav, main {
  overflow-x: hidden;
}
