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

:root {
  /* Color Palette - Dark Magical Fantasy */
  --color-bg: #050712;
  --color-bg-elevated: #0b0f1e;
  --color-bg-soft: #111726;

  --color-text: #f5f3ff;
  --color-text-muted: #a4a8c6;
  --color-text-soft: #7d83a3;

  --color-primary: #7f5cff; /* arcane violet */
  --color-primary-soft: rgba(127, 92, 255, 0.15);
  --color-primary-strong: #b292ff;

  --color-success: #4fd1c5; /* emerald */
  --color-warning: #f6e05e; /* golden */
  --color-danger: #fc5c7d; /* cursed crimson */

  /* Neutral Grays (cool, mystical) */
  --color-gray-50: #0b0c18;
  --color-gray-100: #141626;
  --color-gray-200: #1e2133;
  --color-gray-300: #2a2e42;
  --color-gray-400: #3b4160;
  --color-gray-500: #4e5575;
  --color-gray-600: #666d8f;
  --color-gray-700: #858bb0;
  --color-gray-800: #c3c7e6;
  --color-gray-900: #f7f7ff;

  /* Accent Glows */
  --color-accent-arcane: rgba(127, 92, 255, 0.45);
  --color-accent-emerald: rgba(72, 187, 120, 0.4);
  --color-accent-gold: rgba(246, 224, 94, 0.45);

  /* Overlays */
  --color-overlay-soft: rgba(5, 7, 18, 0.72);
  --color-overlay-strong: rgba(0, 0, 0, 0.85);

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Noto Sans", sans-serif;
  --font-display: "Cinzel", "Cormorant Garamond", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "Fira Code", Menlo, Monaco, Consolas, monospace;

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

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

  /* 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.25rem;   /* 4px */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-pill: 999px;

  /* Shadows (ethereal) */
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.55);
  --shadow-glow-primary: 0 0 25px rgba(127, 92, 255, 0.6);
  --shadow-glow-emerald: 0 0 22px rgba(72, 187, 120, 0.55);
  --shadow-inner: inset 0 0 18px rgba(255, 255, 255, 0.08);

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

  /* Layout */
  --layout-max-width: 1120px;
  --layout-content-width: 1280px;
  --layout-gutter: var(--space-4);

  /* Z-index System */
  --z-base: 0;
  --z-header: 50;
  --z-overlay: 100;
  --z-modal: 200;
}

@media (min-width: 768px) {
  :root {
    --layout-gutter: var(--space-6);
  }
}


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

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

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

textarea {
  resize: vertical;
}

:focus {
  outline: none;
}


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

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

main {
  display: block;
}

/* Headings – cinematic Greek headings for epic sections */

h1,
.h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 3vw + 1.5rem, 3.25rem);
  line-height: var(--line-height-tight);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

h2,
.h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2vw + 1.1rem, 2.25rem);
  line-height: var(--line-height-snug);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

h3,
.h3 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.2vw + 1rem, 1.75rem);
  line-height: var(--line-height-snug);
  letter-spacing: 0.03em;
  margin-bottom: var(--space-3);
}

h4,
.h4 {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-2);
}

h5,
.h5 {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-2);
}

h6,
.h6 {
  font-size: var(--font-size-md);
  line-height: var(--line-height-snug);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

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

strong,
b {
  font-weight: 600;
  color: var(--color-text);
}

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

/* Links – arcane glow CTA-ready */

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

a:hover {
  color: #ffffff;
  text-shadow: 0 0 10px var(--color-accent-arcane);
}

a:active {
  opacity: 0.85;
}


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

/* Layout */

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

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

.section--tight {
  padding-block: var(--space-8);
}

.section--hero {
  padding-block: var(--space-16);
}

/* Flex helpers */

.flex {
  display: flex;
}

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

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

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

.flex-wrap {
  flex-wrap: wrap;
}

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

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

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

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

/* Grid helpers */

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

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

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

@media (max-width: 767.98px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Spacing utilities (margin / padding blocks) */

.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-3 { margin-bottom: var(--space-3) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-6 { margin-bottom: var(--space-6) !important; }

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

.py-section {
  padding-block: var(--space-12);
}

/* Text alignment */

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

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

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

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

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

/* Immersive backgrounds used across pages */

.bg-layered {
  position: relative;
  isolation: isolate;
}

.bg-layered::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(127, 92, 255, 0.3), transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(56, 178, 172, 0.3), transparent 55%);
  opacity: 0.9;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: -2;
}

.bg-layered::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(0, 0, 0, 0.35), transparent 65%);
  pointer-events: none;
  z-index: -1;
}


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

/* Buttons – primary CTAs for Greek fantasy παιχνίδι */

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

.btn-primary {
  background: linear-gradient(135deg, #7f5cff, #b794f4);
  color: #ffffff;
  box-shadow: var(--shadow-glow-primary);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn-primary:hover {
  filter: saturate(1.2);
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(127, 92, 255, 0.8);
}

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

.btn-secondary:hover {
  background: rgba(30, 41, 59, 0.95);
}

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

.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.85);
  color: var(--color-text);
}

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

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

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

/* Inputs – forms for community, guilds, contact */

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

.label {
  display: inline-block;
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-gray-300);
  background-color: rgba(15, 23, 42, 0.9);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast),
    transform var(--transition-fast);
}

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

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--color-primary-strong);
  box-shadow: 0 0 0 1px rgba(127, 92, 255, 0.55);
  transform: translateY(-1px);
}

.textarea {
  min-height: 120px;
  line-height: 1.5;
}

.input--error {
  border-color: var(--color-danger);
}

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

/* Cards – used for lore, classes, guides, news */

.card {
  position: relative;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(30, 64, 175, 0.8));
  background-color: var(--color-bg-elevated);
  border: 1px solid rgba(148, 163, 184, 0.28);
  padding: var(--space-5);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background:
    radial-gradient(circle at 0 0, rgba(129, 140, 248, 0.18), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.18), transparent 60%);
  opacity: 0.6;
  mix-blend-mode: screen;
}

.card__content {
  position: relative;
  z-index: 1;
}

.card--soft {
  background: rgba(15, 23, 42, 0.9);
}

.card--outline {
  background: transparent;
  border-style: dashed;
}

.card-title {
  font-family: var(--font-display);
  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.08em;
  color: var(--color-text-soft);
  margin-bottom: var(--space-2);
}

/* Hero overlay utility for homepage cinematic section */

.hero-shell {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.hero-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(129, 140, 248, 0.3), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(56, 178, 172, 0.3), transparent 60%);
  opacity: 0.9;
  mix-blend-mode: screen;
  pointer-events: none;
}

.hero-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(5, 7, 12, 0.4), rgba(5, 7, 12, 1));
  pointer-events: none;
}

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


/* =========================================================
   Accessibility
   ========================================================= */

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

a:focus-visible,
button:focus-visible,
.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible {
  box-shadow: 0 0 0 2px rgba(246, 224, 94, 0.7);
}

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


/* =========================================================
   Misc helpers for gaming UI
   ========================================================= */

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

.badge--primary {
  border-color: rgba(127, 92, 255, 0.8);
  background: rgba(127, 92, 255, 0.2);
  color: var(--color-primary-strong);
}

.badge--danger {
  border-color: rgba(252, 92, 125, 0.8);
  background: rgba(252, 92, 125, 0.18);
  color: var(--color-danger);
}

.taglist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.code-inline {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-xs);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
}
