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

:root {
  /* Color Palette - Dravonya Fantasy Theme */
  --color-bg: #050815;              /* Main background: deep night */
  --color-bg-elevated: #0a1022;     /* Elevated surfaces */
  --color-bg-muted: #0f172a;        /* Muted sections */

  --color-text: #f9fafb;            /* Primary text */
  --color-text-muted: #9ca3af;      /* Secondary text */
  --color-text-soft: #6b7280;       /* Tertiary text */

  --color-primary: #7c3aed;         /* Arcane violet */
  --color-primary-soft: rgba(124, 58, 237, 0.16);
  --color-primary-strong: #a855f7;

  --color-success: #22c55e;
  --color-warning: #fbbf24;
  --color-danger: #ef4444;

  /* Neutral Grays */
  --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", 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.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: 0.25rem;  /* 4px */
  --radius-md: 0.5rem;   /* 8px */
  --radius-lg: 0.75rem;  /* 12px */
  --radius-xl: 1rem;     /* 16px */
  --radius-full: 999px;

  /* Shadows - soft fantasy glow */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.45);
  --shadow-sm: 0 4px 10px rgba(15, 23, 42, 0.5);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.7);
  --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.35);

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

  /* Layout */
  --layout-max-width: 1120px;
  --layout-max-width-wide: 1280px;
  --container-padding-x: 1.5rem;
}

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

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

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

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

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

body {
  min-height: 100vh;
}

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

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

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

/* Remove animations / transitions for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !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);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--gray-50);
  line-height: var(--line-height-snug);
  text-transform: uppercase;
}

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-base);
  margin-bottom: var(--space-2);
}

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

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

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

a:hover {
  color: #c4b5fd;
  text-shadow: 0 0 8px rgba(124, 58, 237, 0.4);
}

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

strong,
b {
  font-weight: 600;
}

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

pre {
  padding: var(--space-3);
  background-color: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

hr {
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  margin: var(--space-6) 0;
}

/* ========================================================================
   Accessibility & Focus
   ======================================================================== */

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

[tabindex="-1"]:focus {
  outline: none !important;
}

/* Visually hidden but accessible to screen readers */
.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
   ======================================================================== */

/* Layout Containers */

.container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--container-padding-x);
  padding-left: var(--container-padding-x);
  max-width: var(--layout-max-width);
}

.container--wide {
  max-width: var(--layout-max-width-wide);
}

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

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

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

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

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

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

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

/* Grid Helpers */

.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: minmax(0, 1fr);
  }
}

/* Alignment & Text */

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

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

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

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

/* Utility Backgrounds & Surfaces */

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

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

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

/* Spacing Utilities (Y-axis margins) */

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

.mt-6 {
  margin-top: var(--space-6);
}

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

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

.py-4 {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

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

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

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

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

/* Buttons */

.btn {
  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.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  background-image: radial-gradient(circle at top left, rgba(250, 250, 250, 0.12), transparent 55%),
    linear-gradient(135deg, #4c1d95, #7c3aed, #a855f7);
  color: #f9fafb;
  box-shadow: var(--shadow-sm);
  transition:
    background 200ms ease-out,
    box-shadow var(--transition-base),
    transform var(--transition-fast),
    border-color var(--transition-base),
    color var(--transition-base);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

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

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

.btn--ghost {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.4);
  color: var(--color-text);
  box-shadow: var(--shadow-xs);
}

.btn--ghost:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--color-primary-strong);
}

.btn--outline {
  background: transparent;
  border-color: rgba(124, 58, 237, 0.7);
  color: var(--color-primary-strong);
}

.btn--outline:hover {
  background: var(--color-primary-soft);
}

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

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

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

/* Form Inputs */

.input,
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.4);
  background-color: rgba(15, 23, 42, 0.85);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: 1.4;
  transition:
    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,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--color-primary-strong);
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.65), 0 0 18px rgba(124, 58, 237, 0.55);
  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(--gray-100);
}

/* Cards - for Game Overview, Classes, Magic, etc. */

.card {
  position: relative;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.15), transparent 60%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(124, 58, 237, 0.12), transparent 55%);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

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

.card--soft {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.98));
  border-color: rgba(148, 163, 184, 0.25);
}

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

.card__subtitle {
  margin-bottom: var(--space-4);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-text-soft);
}

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

/* Tag / Pill - for classes, abilities, difficulty, etc. */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: var(--color-text-muted);
  background: rgba(15, 23, 42, 0.9);
}

.badge--primary {
  border-color: rgba(124, 58, 237, 0.7);
  color: var(--color-primary-strong);
  background: rgba(124, 58, 237, 0.1);
}

.badge--success {
  border-color: rgba(34, 197, 94, 0.75);
  color: var(--color-success);
  background: rgba(34, 197, 94, 0.12);
}

.badge--danger {
  border-color: rgba(239, 68, 68, 0.75);
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.12);
}

/* ========================================================================
   Helper Sections for Hero / Visual Blocks (Placeholders)
   ======================================================================== */

.scene-placeholder {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: radial-gradient(circle at 10% 0, rgba(59, 130, 246, 0.2), transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(124, 58, 237, 0.35), transparent 55%),
    linear-gradient(145deg, #020617, #020617 40%, #0b1120 80%);
  min-height: 220px;
  box-shadow: var(--shadow-md);
}

.scene-placeholder--tall {
  min-height: 320px;
}

.scene-placeholder__overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.15), transparent 70%);
}

.scene-placeholder__label {
  position: absolute;
  inset: auto auto 1rem 1.2rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.45);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-soft);
}

/* ========================================================================
   End of base.css
   ======================================================================== */
