/* ========================================================================
   Variables
   ======================================================================== */

:root {
  /* Color Palette - tuned for a modern, immersive fantasy gaming theme */
  --color-bg: #050814; /* deep fantasy night */
  --color-bg-elevated: #0b1020;
  --color-surface: #111729;
  --color-surface-soft: #181f34;
  --color-text: #f5f7ff;
  --color-text-muted: #a7b0d0;

  --color-primary: #5a8cff; /* arcane blue highlight */
  --color-primary-soft: rgba(90, 140, 255, 0.16);
  --color-primary-strong: #2d6bff;

  --color-success: #3dd68c;
  --color-warning: #ffb648;
  --color-danger: #ff5b6e;

  --color-border-subtle: #262f4a;
  --color-border-strong: #3a4670;

  /* Neutral grays (for borders, UI, text accents) */
  --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,
    "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Poppins", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Font sizes (mobile-first, rem-based) */
  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-md: 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 hero */

  --line-height-tight: 1.1;
  --line-height-snug: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* 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: 0.125rem;
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows - subtle glow suitable for gaming UI */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.65);
  --shadow-glow-primary: 0 0 24px rgba(90, 140, 255, 0.45);

  /* Transitions */
  --transition-fast: 150ms ease-out;
  --transition-base: 200ms ease-out;
  --transition-slow: 300ms ease-out;
}

/* Slightly scale up headings on larger viewports */
@media (min-width: 768px) {
  :root {
    --font-size-3xl: 2.125rem;
    --font-size-4xl: 2.5rem;
    --font-size-5xl: 3.5rem;
  }
}

/* ========================================================================
   Reset / Normalize
   ======================================================================== */

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

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

body {
  margin: 0;
}

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

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

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

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

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

img {
  height: auto;
}

textarea {
  resize: vertical;
}

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

/* Remove default focus outline so we can style focus-visible */
:focus {
  outline: none;
}

/* ========================================================================
   Base Styles
   ======================================================================== */

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  background: radial-gradient(circle at top, #182142 0, #050814 55%, #02030a 100%);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

.main-root {
  /* optional wrapper if used */
  min-height: 100vh;
}

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

h1 { font-size: var(--font-size-4xl); margin-bottom: var(--space-4); }
h2 { font-size: var(--font-size-3xl); 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); }
h5 { font-size: var(--font-size-lg);  margin-bottom: var(--space-2); }
h6 { font-size: var(--font-size-md);  margin-bottom: var(--space-2); }

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

strong,
b {
  font-weight: 600;
}

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

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

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

/* Links - gaming-style subtle underline and glow on hover */

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

a:hover {
  color: var(--color-primary-strong);
  text-shadow: 0 0 12px rgba(90, 140, 255, 0.7);
}

a:active {
  opacity: 0.85;
}

/* Lists */

ul,
ol {
  padding-left: 1.25rem;
  margin: 0 0 var(--space-4);
}

/* ========================================================================
   Accessibility & Motion
   ======================================================================== */

:focus-visible {
  outline: 2px solid var(--color-primary);
  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;
}

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

/* Responsive container for main page sections */

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

@media (min-width: 1024px) {
  .container {
    max-width: 1200px;
  }
}

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

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

/* 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-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid helpers for responsive card layouts */

.grid {
  display: grid;
}

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

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

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

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

/* Width helpers */

.w-full {
  width: 100%;
}

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

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

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

/* Spacing utilities (commonly used) */

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.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-6 { padding-top: var(--space-6); }
.pt-8 { padding-top: var(--space-8); }

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

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

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

/* Buttons - primary CTA (e.g. Google Play / App Store), secondary, ghost */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transition:
    background-color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast),
    color var(--transition-base),
    opacity var(--transition-base);
}

.button--primary {
  background: radial-gradient(circle at 20% 0, #8aa8ff 0, #5a8cff 40%, #2746a6 100%);
  border-color: rgba(199, 210, 254, 0.4);
  color: #0b1020;
  box-shadow: var(--shadow-glow-primary);
}

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

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

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.button--primary:hover:not(:disabled) {
  background: radial-gradient(circle at 20% 0, #9fb8ff 0, #6a96ff 40%, #3151b8 100%);
}

.button--secondary:hover:not(:disabled),
.button--ghost:hover:not(:disabled) {
  background-color: rgba(30, 64, 175, 0.35);
}

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

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

.button--icon-only {
  padding: 0.5rem;
  border-radius: var(--radius-full);
}

/* Form inputs - for search bars, email capture, etc. */

.input,
.select,
.textarea {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: rgba(15, 23, 42, 0.9);
  color: var(--color-text);
  padding: 0.6rem 0.8rem;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base);
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(90, 140, 255, 0.7);
  background-color: rgba(15, 23, 42, 1);
}

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

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

/* Card - for guide previews, mechanics explanations, feature highlights */

.card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.98));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background: radial-gradient(circle at top left, rgba(90, 140, 255, 0.2), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

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

.card--featured {
  border-color: rgba(90, 140, 255, 0.7);
  box-shadow: var(--shadow-glow-primary);
}

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

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

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

/* Hero-specific helpers (for immersive homepage) */

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

.hero__eyebrow {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.hero__title {
  font-size: var(--font-size-4xl);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-3);
}

.hero__subtitle {
  max-width: 34rem;
  font-size: var(--font-size-md);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.hero__badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* Tag / pill for showing difficulty, category etc. */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.8);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  gap: 0.35rem;
}

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

/* Simple chip-style label for categories */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(30, 64, 175, 0.4);
  font-size: var(--font-size-xs);
  color: var(--color-text);
}

/* ========================================================================
   Navigation & Footer basics (common for multi-page portal)
   ======================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: linear-gradient(to bottom, rgba(5, 8, 20, 0.98), rgba(5, 8, 20, 0.85));
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem var(--space-4);
  max-width: 1120px;
  margin: 0 auto;
}

.site-nav {
  display: none;
}

@media (min-width: 768px) {
  .site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-4);
  }
}

.site-nav__link {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  position: relative;
  padding: 0.25rem 0;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #5a8cff, #a855f7);
  transition: width var(--transition-base);
}

.site-nav__link:hover {
  color: var(--color-text);
}

.site-nav__link:hover::after,
.site-nav__link--active::after {
  width: 100%;
}

.site-footer {
  padding: var(--space-6) 0;
  border-top: 1px solid rgba(31, 41, 55, 0.9);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), #02030a 70%);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ========================================================================
   Media wrappers (for screenshot / video placeholders)
   ======================================================================== */

.media-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: radial-gradient(circle at top, rgba(148, 163, 184, 0.25), rgba(15, 23, 42, 1));
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: var(--shadow-md);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.1), rgba(5, 8, 20, 0.8));
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.media-frame--rounded {
  border-radius: var(--radius-xl);
}

/* Aspect ratio helper for YouTube / trailer embeds */

.ratio-16x9 {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}

.ratio-16x9 > iframe,
.ratio-16x9 > video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ========================================================================
   Misc helpers
   ======================================================================== */

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

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

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

.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

.hide-mobile {
  display: none;
}

@media (min-width: 768px) {
  .hide-mobile {
    display: initial;
  }
}

.show-mobile-only {
  display: initial;
}

@media (min-width: 768px) {
  .show-mobile-only {
    display: none;
  }
}
