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

:root {
  /* Colors */
  --color-bg: #050812; /* deep cosmic */
  --color-bg-elevated: #0b1020;
  --color-bg-soft: #11182a;
  --color-text: #f5f7ff;
  --color-text-muted: #a9b2d9;

  --color-primary: #8a5bff; /* arcane violet */
  --color-primary-soft: rgba(138, 91, 255, 0.16);
  --color-primary-strong: #a884ff;

  --color-success: #2ecc71;
  --color-warning: #f1c40f;
  --color-danger: #e74c3c;

  --color-border-subtle: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.18);

  --color-neutral-50: #f9fafb;
  --color-neutral-100: #f3f4f6;
  --color-neutral-200: #e5e7eb;
  --color-neutral-300: #d1d5db;
  --color-neutral-400: #9ca3af;
  --color-neutral-500: #6b7280;
  --color-neutral-600: #4b5563;
  --color-neutral-700: #374151;
  --color-neutral-800: #1f2933;
  --color-neutral-900: #111827;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Cinzel", "Cinzel Decorative", "Cormorant Garamond", Georgia, serif;
  --font-mono: "JetBrains 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-md: 1.0625rem; /* 17px */
  --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: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Radius */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Shadows (glow-centric for fantasy theme) */
  --shadow-soft: 0 14px 30px rgba(0, 0, 0, 0.45);
  --shadow-strong: 0 30px 80px rgba(0, 0, 0, 0.85);
  --shadow-glow-primary: 0 0 0 1px rgba(138, 91, 255, 0.6), 0 0 24px rgba(138, 91, 255, 0.7);

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

  /* Layout */
  --layout-max-width: 1200px;
  --layout-max-width-wide: 1440px;
}

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

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

html,
body {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
}

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

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

ul,
ol {
  margin: 0;
  padding: 0;
}

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

button {
  border: none;
  background: none;
  cursor: pointer;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   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 {
  min-height: 60vh;
}

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

h1 {
  font-size: clamp(2.25rem, 3vw, 3rem);
  letter-spacing: 0.02em;
}

h2 {
  font-size: clamp(1.75rem, 2.4vw, 2.25rem);
}

h3 {
  font-size: clamp(1.4rem, 2vw, 1.8rem);
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.1rem;
}

h6 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

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;
  transition: color var(--transition-base), text-shadow var(--transition-base);
}

a:hover {
  color: var(--color-primary);
  text-shadow: 0 0 18px rgba(138, 91, 255, 0.7);
}

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

strong,
b {
  font-weight: 600;
}

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

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

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

@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;
  }
}

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

/* Layout containers */

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

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

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

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

/* 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-4 {
  gap: var(--space-4);
}

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

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

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

/* Spacing utilities (margin & padding) */

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

.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-10 { margin-bottom: var(--space-10); }

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

.px-4 {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

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

/* 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:focus-visible {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Background helpers */

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

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

/* Text color helpers */

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

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

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

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color var(--transition-base),
    border-color var(--transition-base),
    color var(--transition-fast),
    box-shadow var(--transition-base),
    transform var(--transition-fast);
}

.btn-primary {
  background: radial-gradient(circle at 0% 0%, #c9a6ff 0, #8a5bff 40%, #28175c 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-soft), 0 0 14px rgba(138, 91, 255, 0.6);
}

.btn-primary:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: var(--shadow-strong), 0 0 22px rgba(138, 91, 255, 0.85);
}

.btn-primary:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 0 0 1px rgba(138, 91, 255, 0.6);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

.btn-outline:hover {
  background: var(--color-primary-soft);
  border-color: var(--color-primary-strong);
  box-shadow: 0 0 16px rgba(138, 91, 255, 0.4);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text-muted);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
}

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

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

/* Inputs & form controls */

.input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-subtle);
  background-color: rgba(5, 8, 18, 0.9);
  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-fast);
}

.input::placeholder,
textarea::placeholder {
  color: rgba(169, 178, 217, 0.6);
}

.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--color-primary-strong);
  box-shadow: var(--shadow-glow-primary);
  background-color: rgba(11, 16, 32, 0.98);
}

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

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

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

.form-hint {
  margin-top: 4px;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.form-error {
  margin-top: 4px;
  font-size: var(--font-size-xs);
  color: var(--color-danger);
}

/* Card / Panel */

.card {
  position: relative;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top, rgba(138, 91, 255, 0.18) 0, rgba(5, 8, 18, 0.96) 45%, rgba(5, 8, 18, 1) 100%);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.06), transparent 55%),
              radial-gradient(circle at 100% 100%, rgba(138, 91, 255, 0.2), transparent 60%);
  opacity: 0.7;
}

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

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

.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);
}

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

/* Tag / pill for competitive status */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background-color: rgba(11, 16, 32, 0.85);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-text-muted);
}

.badge-primary {
  border-color: rgba(138, 91, 255, 0.7);
  background: rgba(138, 91, 255, 0.12);
  color: var(--color-primary-strong);
}

.badge-success {
  border-color: rgba(46, 204, 113, 0.7);
  background: rgba(46, 204, 113, 0.12);
  color: var(--color-success);
}

/* Navigation shell (basic) */

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, rgba(5, 8, 18, 0.92), rgba(5, 8, 18, 0.7));
  border-bottom: 1px solid var(--color-border-subtle);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

.navbar-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.navbar-brand span {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.navbar-link {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-text-muted);
  padding: 4px 0;
  position: relative;
}

.navbar-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(138, 91, 255, 0.9), transparent);
  transform: scaleX(0);
  transform-origin: 50% 50%;
  transition: transform var(--transition-base);
}

.navbar-link:hover {
  color: var(--color-text);
}

.navbar-link:hover::after,
.navbar-link--active::after {
  transform: scaleX(1);
}

.navbar-link--active {
  color: var(--color-text);
}

@media (max-width: 768px) {
  .navbar-inner {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
  }

  .navbar-links {
    display: none;
  }
}

/* Hero / immersive background helpers (for ELDRAAVIA) */

.hero {
  position: relative;
  padding-top: var(--space-20);
  padding-bottom: var(--space-20);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 0%, rgba(138, 91, 255, 0.5), transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(0, 190, 255, 0.32), transparent 55%),
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.08), transparent 60%);
  opacity: 0.8;
  pointer-events: none;
}

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

.hero-kicker {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.hero-title {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  line-height: var(--line-height-tight);
  text-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
}

.hero-subtitle {
  margin-top: var(--space-4);
  max-width: 38rem;
}

.hero-cta {
  margin-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

@media (max-width: 768px) {
  .hero {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Status colors for game / leaderboard */

.status-win {
  color: var(--color-success);
}

.status-loss {
  color: var(--color-danger);
}

.status-live {
  color: var(--color-warning);
}

/* Table (for rankings) */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
}

.table thead th {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-strong);
}

.table tbody tr {
  border-bottom: 1px solid var(--color-border-subtle);
}

.table tbody tr:nth-child(even) {
  background-color: rgba(11, 16, 32, 0.6);
}

.table tbody tr:hover {
  background-color: rgba(138, 91, 255, 0.08);
}

/* Chips - for roles, regions, fantasy classes */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.chip + .chip {
  margin-left: var(--space-2);
}

.chip--accent {
  background-color: rgba(138, 91, 255, 0.16);
  color: var(--color-primary-strong);
}

/* Footer basics */

.footer {
  border-top: 1px solid var(--color-border-subtle);
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
  background: radial-gradient(circle at 50% -30%, rgba(138, 91, 255, 0.28), transparent 60%), var(--color-bg);
}

.footer-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--font-size-xs);
}

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

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

/* End of base.css for ELDRAAVIA */
