/* ========================================================================== 
   Variables
   ========================================================================== */
:root {
  /* Colors */
  --color-bg: #050713; /* deep stormy night */
  --color-bg-elevated: #0b0f24;
  --color-bg-soft: #11152b;
  --color-text: #edf1ff;
  --color-text-muted: #a2a8d5;
  --color-primary: #6c7bff; /* arcane blue */
  --color-primary-soft: rgba(108, 123, 255, 0.15);
  --color-primary-strong: #9f86ff; /* violet accent */
  --color-success: #44d4a0;
  --color-warning: #ffb454;
  --color-danger: #ff5c7a;

  --color-gray-50: #0b0d19;
  --color-gray-100: #16192b;
  --color-gray-200: #1e2236;
  --color-gray-300: #2b3049;
  --color-gray-400: #53587a;
  --color-gray-500: #757ba0;
  --color-gray-600: #979dc0;
  --color-gray-700: #babfdb;
  --color-gray-800: #dfe2f7;
  --color-gray-900: #f6f7ff;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Cinzel", "Trajan Pro", "Times New Roman", serif;

  --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.5rem;    /* 24px */
  --font-size-2xl: 2rem;     /* 32px */
  --font-size-3xl: 2.5rem;   /* 40px */
  --font-size-4xl: 3rem;     /* 48px */

  --line-height-tight: 1.2;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.8;

  /* 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-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

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

  /* Shadows - subtle mystical glow */
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-strong: 0 18px 45px rgba(0, 0, 0, 0.75);
  --shadow-glow-primary: 0 0 24px rgba(151, 157, 255, 0.7);

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

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

/* ========================================================================== 
   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,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

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

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

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

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

/* ========================================================================== 
   Base Styles
   ========================================================================== */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  background: radial-gradient(circle at top, #1c2750 0, #050713 55%, #02030a 100%);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 60vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--line-height-tight);
  letter-spacing: 0.04em;
  color: var(--color-gray-900);
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.9);
}

h1 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-4);
}

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-3);
  color: var(--color-text-muted);
}

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

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

a:hover {
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(156, 165, 255, 0.7);
}

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

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

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

.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
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--space-4);
}

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

/* Layout helpers */
.d-flex {
  display: flex;
}

.d-grid {
  display: grid;
}

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

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

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

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

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

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

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

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

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

/* Basic grid utility for sections like heroes / quests */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: var(--space-4);
}

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

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

/* ========================================================================== 
   Components
   ========================================================================== */
/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(156, 165, 255, 0.5);
  background: radial-gradient(circle at 20% 0, rgba(160, 180, 255, 0.25) 0, rgba(39, 44, 94, 0.95) 42%, #11152b 100%);
  color: var(--color-text) !important;
  font-weight: 600;
  font-size: var(--font-size-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: background var(--transition-normal), box-shadow var(--transition-normal), transform var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.btn-primary {
  background: radial-gradient(circle at 20% 0, rgba(159, 134, 255, 0.55) 0, rgba(72, 84, 199, 0.96) 38%, #352982 100%);
  border-color: rgba(197, 192, 255, 0.9);
  box-shadow: var(--shadow-glow-primary);
}

.btn-outline {
  background: transparent;
  border-color: rgba(191, 197, 255, 0.7);
}

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

.btn-primary:hover {
  background: radial-gradient(circle at 20% 0, rgba(189, 167, 255, 0.7) 0, rgba(96, 108, 230, 1) 40%, #4c3aa6 100%);
}

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

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

/* Form controls */
.input,
textarea,
select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-gray-300);
  background-color: rgba(10, 13, 32, 0.95);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: 1.4;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.input::placeholder,
textarea::placeholder {
  color: var(--color-gray-500);
}

.input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary-strong);
  box-shadow: 0 0 0 1px rgba(145, 149, 255, 0.8), 0 0 18px rgba(87, 101, 255, 0.7);
  background-color: rgba(13, 18, 46, 0.98);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
}

/* Card - for heroes, quests, world areas */
.card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background: linear-gradient(145deg, rgba(15, 20, 56, 0.98), rgba(24, 16, 58, 0.96));
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(123, 134, 255, 0.4);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 10% 0, rgba(129, 208, 255, 0.18) 0, transparent 55%),
              radial-gradient(circle at 90% 100%, rgba(195, 134, 255, 0.16) 0, transparent 55%);
  opacity: 0.65;
  pointer-events: none;
  mix-blend-mode: screen;
}

.card > * {
  position: relative;
}

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

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

.card-meta {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-gray-600);
}

/* Panels - for quest logs, FAQ items */
.panel {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-gray-300);
  background-color: rgba(10, 13, 32, 0.9);
  padding: var(--space-3);
}

/* Tag / badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(159, 134, 255, 0.7);
  background: rgba(39, 44, 94, 0.8);
  color: var(--color-gray-800);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Sections - subtle top border glow */
.section {
  position: relative;
  padding-block: var(--space-8);
}

.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  max-width: 420px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(159, 134, 255, 0.8), transparent);
  opacity: 0.7;
}

.section-heading {
  text-align: center;
  margin-bottom: var(--space-6);
}

.section-heading p {
  margin-inline: auto;
}

/* Hero / cinematic header helper */
.hero {
  position: relative;
  padding-block: var(--space-16);
  background: radial-gradient(circle at top, rgba(55, 94, 181, 0.65) 0, rgba(5, 7, 19, 0.98) 55%, rgba(0, 0, 0, 1) 100%);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 10%, rgba(139, 210, 255, 0.28) 0, transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(196, 135, 255, 0.32) 0, transparent 55%);
  mix-blend-mode: screen;
  opacity: 0.7;
  pointer-events: none;
}

.hero-content {
  position: relative;
}

/* Table-like lists (e.g., heroes, guilds, arenas) */
.list-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

.list-table th,
.list-table td {
  padding: 0.75rem 0.9rem;
  font-size: var(--font-size-sm);
}

.list-table thead th {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--color-gray-700);
  border-bottom: 1px solid var(--color-gray-300);
}

.list-table tbody tr:nth-child(odd) {
  background-color: rgba(13, 17, 45, 0.9);
}

.list-table tbody tr:nth-child(even) {
  background-color: rgba(9, 12, 35, 0.9);
}

.list-table tbody tr:hover {
  background-color: rgba(40, 49, 122, 0.9);
}

/* FAQ accordion basic pattern (structure support) */
.faq-item {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-gray-300);
  background-color: rgba(8, 10, 30, 0.96);
  padding: var(--space-3);
}

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

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

@media(max-width: 825px) {
  .sr-header__notice{
    display: none;
  }
}

h1,
h2,
h3,
.section-title,
.arenas-section-header h2 {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

.btn{
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  text-align: center;
  line-height: 1.35;
}