/* EmpireSporePlus — global styles */

:root {
  --bg: #0a0a12;
  --bg-elev: #14141f;
  --bg-elev-2: #1c1c2b;
  --surface: #1c1c2b;
  --crimson: #c8102e;
  --crimson-2: #e23148;
  --crimson-soft: #7a0a1e;
  --gold: #d4a84b;
  --gold-2: #f0c870;
  --gold-soft: #8a6b25;
  --ink: #f5ecd9;
  --ink-dim: #c8c0b4;
  --muted: #7c7488;
  --line: rgba(212, 168, 75, .18);
  --line-strong: rgba(212, 168, 75, .42);
  --glass: rgba(20, 20, 31, .65);
  --shadow: 0 18px 44px rgba(0, 0, 0, .42);
  --shadow-glow: 0 0 32px rgba(200, 16, 46, .35);
  --grad-crimson: linear-gradient(135deg, #c8102e 0%, #7a0a1e 100%);
  --grad-gold: linear-gradient(135deg, #f0c870 0%, #8a6b25 100%);
  --grad-empire: linear-gradient(135deg, #c8102e 0%, #d4a84b 100%);
  --c-bg: var(--bg);
  --c-line: var(--line);
  --c-text: var(--ink);
  --c-grad: var(--grad-empire);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
}

* { box-sizing: border-box; }
*:focus { outline: none; }
*:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

html { overflow-x: clip; scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}
main { flex: 1; }

/* Heraldic background grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(200, 16, 46, .12), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(212, 168, 75, .07), transparent 60%);
  z-index: -1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: .015em;
  color: var(--ink);
  margin: 0 0 .5em;
  overflow-wrap: break-word;
  word-break: break-word;
}
h1 { font-size: clamp(40px, 6vw, 76px); font-weight: 800; letter-spacing: .02em; }
h2 { font-size: clamp(30px, 4.2vw, 52px); }
h3 { font-size: clamp(22px, 2.6vw, 30px); }
h4 { font-size: clamp(18px, 2vw, 22px); }
p { margin: 0 0 1em; }
a {
  color: var(--gold);
  text-decoration: none;
  transition: color .22s var(--ease);
  overflow-wrap: break-word;
  word-break: break-word;
}
a:hover { color: var(--gold-2); }
strong { color: var(--ink); font-weight: 600; }

::selection { background: var(--crimson); color: var(--ink); }

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

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding-inline: 24px;
}
@media (max-width: 520px) { .container { padding-inline: 16px; } }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Buttons */
.btn {
  --pad-x: 26px;
  --pad-y: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: var(--pad-y) var(--pad-x);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font: 600 15px/1 'Inter', sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  position: relative;
  overflow: hidden;
  transition: transform .22s var(--ease), box-shadow .25s var(--ease), color .22s var(--ease), background .25s var(--ease), border-color .25s var(--ease);
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .18), transparent 70%);
  transform: translateX(-120%);
  transition: transform .65s var(--ease);
  pointer-events: none;
}
.btn:hover::after { transform: translateX(120%); }
.btn--primary {
  color: var(--ink);
  background: var(--grad-crimson);
  box-shadow: 0 12px 32px rgba(200, 16, 46, .35), inset 0 0 0 1px rgba(212, 168, 75, .25);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(200, 16, 46, .5), inset 0 0 0 1px rgba(212, 168, 75, .45); color: var(--ink); }
.btn--ghost {
  color: var(--gold);
  background: transparent;
  border-color: var(--line-strong);
}
.btn--ghost:hover { color: var(--ink); border-color: var(--gold); background: rgba(212, 168, 75, .08); }
.btn--gold {
  color: #1a0d05;
  background: var(--grad-gold);
  box-shadow: 0 10px 30px rgba(212, 168, 75, .35);
}
.btn--gold:hover { transform: translateY(-2px); color: #0c0703; box-shadow: 0 14px 38px rgba(212, 168, 75, .5); }
.btn--block { width: 100%; }
.btn--sm { --pad-x: 18px; --pad-y: 10px; font-size: 13px; }

/* Section base */
.section {
  position: relative;
  padding: clamp(72px, 9vw, 128px) 0;
}
.section.about,
.section.quiz,
.section.contact {
  content-visibility: auto;
  contain-intrinsic-size: 1px 1200px;
}
.site-footer {
  content-visibility: auto;
  contain-intrinsic-size: 1px 600px;
}
.section__head {
  margin-bottom: clamp(40px, 5vw, 64px);
  text-align: center;
}
.section__kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 12px/1 'Inter', sans-serif;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}
.section__kicker::before, .section__kicker::after {
  content: '';
  width: 32px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.section__kicker::after { background: linear-gradient(270deg, transparent, var(--gold)); }
.section__lead {
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--ink-dim);
  margin: 12px auto 0;
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.reveal.is-revealed { opacity: 1; transform: translateY(0); }

@keyframes firstFadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes firstFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.first-reveal {
  animation: firstFadeUp .9s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(14px);
  background: rgba(10, 10, 18, .72);
  border-bottom: 1px solid var(--line);
  overflow: visible;
  transition: background .3s var(--ease);
}
.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 800 22px/1 'Cinzel', serif;
  letter-spacing: .04em;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 520px) {
  .brand { font-size: 16px; gap: 8px; letter-spacing: .02em; }
  .brand__mark { width: 34px; height: 34px; }
  .brand__mark svg { width: 34px; height: 34px; }
}
@media (max-width: 360px) {
  .brand__text { display: none; }
}
.brand:hover { color: var(--gold); }
.brand__mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  filter: drop-shadow(0 4px 12px rgba(200, 16, 46, .28));
  transition: transform .35s var(--ease), filter .35s var(--ease);
}
.brand:hover .brand__mark {
  transform: translateY(-1px) rotate(-2deg);
  filter: drop-shadow(0 6px 16px rgba(212, 168, 75, .35));
}
.brand__mark svg { width: 42px; height: 42px; display: block; }
.brand__text { display: inline-flex; align-items: baseline; gap: 2px; }
.brand__text b { font-weight: 800; color: var(--ink); }
.brand__text span { color: var(--gold); }

.nav { display: flex; align-items: center; gap: 28px; }
.nav-mobile-actions { display: none; }
.nav a {
  font: 600 14px/1 'Inter', sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  position: relative;
  padding: 6px 0;
  transition: color .22s var(--ease);
}
.nav a::before {
  content: '';
  position: absolute; left: 50%; right: 50%; bottom: -4px; height: 2px;
  background: var(--grad-gold);
  transition: left .35s var(--ease), right .35s var(--ease);
  border-radius: 2px;
}
.nav a:hover, .nav a.is-active { color: var(--ink); }
.nav a:hover::before, .nav a.is-active::before { left: 0; right: 0; }

.header-actions { display: inline-flex; align-items: center; gap: 14px; }
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(28, 28, 43, .6);
  font: 600 12px/1 'Inter', sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.lang-switch svg { width: 14px; height: 14px; color: var(--gold); }
.lang-switch b { color: var(--ink); }

/* Burger */
.burger {
  display: none;
  width: 44px; height: 44px;
  position: relative;
  z-index: 110;
  flex-shrink: 0;
  border-radius: var(--r-md);
  background: rgba(212, 168, 75, .06);
  border: 1px solid var(--line);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
.burger span {
  position: absolute;
  left: 12px; right: 12px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s var(--ease), top .3s var(--ease);
}
.burger span:nth-child(1) { top: 15px; }
.burger span:nth-child(2) { top: 21px; }
.burger span:nth-child(3) { top: 27px; }
.burger[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

@media (max-width: 1220px) {
  .burger { display: block; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    width: 100%;
    max-width: 100vw;
    max-height: calc(100dvh - var(--header-offset, 64px));
    z-index: 100;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 20px 24px 28px;
    background: linear-gradient(160deg, #0a0a12 0%, #1c0a14 100%);
    border-top: 1px solid var(--line);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .3s var(--ease), opacity .25s var(--ease), visibility 0s linear .3s;
  }
  .nav[data-open="true"] {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform .3s var(--ease), opacity .25s var(--ease), visibility 0s linear 0s;
  }
  .nav a {
    width: 100%;
    padding: 16px 0;
    font-size: 18px;
    letter-spacing: .14em;
    text-align: left;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
  }
  .nav a::before { display: none; }
  .nav-mobile-actions {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
  }
  .header-actions > .lang-switch { display: none; }
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100svh - var(--header-offset, 72px));
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero__slides {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hero__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  animation: heroCycle 40s infinite linear;
  will-change: transform, opacity;
}
.hero__slide:nth-child(1) { animation-delay: 0s;  background-image: url('/assets/img/hero/slide-1.avif'); }
.hero__slide:nth-child(2) { animation-delay: 8s; }
.hero__slide:nth-child(3) { animation-delay: 16s; }
.hero__slide:nth-child(4) { animation-delay: 24s; }
.hero__slide:nth-child(5) { animation-delay: 32s; }
@keyframes heroCycle {
  0%   { opacity: 0; transform: scale(1.0); }
  5%   { opacity: 1; }
  20%  { opacity: 1; transform: scale(1.12); }
  25%  { opacity: 0; transform: scale(1.14); }
  100% { opacity: 0; transform: scale(1.14); }
}
.hero__overlay {
  position: absolute; inset: 0; z-index: 2;
  background:
    radial-gradient(ellipse at 78% 18%, rgba(200, 16, 46, .35), transparent 55%),
    radial-gradient(ellipse at 18% 88%, rgba(28, 12, 60, .55), transparent 55%),
    linear-gradient(180deg, rgba(10, 10, 18, .45) 0%, rgba(10, 10, 18, .72) 60%, var(--bg) 100%);
}
.hero__sigil {
  position: absolute;
  z-index: 2;
  top: 12vh; left: 50%;
  width: min(560px, 60vw);
  height: min(560px, 60vw);
  transform: translateX(-50%);
  opacity: .2;
  color: var(--gold);
  pointer-events: none;
  animation: sigilSpin 120s linear infinite;
}
.hero__sigil svg { width: 100%; height: 100%; }
@keyframes sigilSpin {
  from { transform: translateX(-50%) rotate(0deg); }
  to   { transform: translateX(-50%) rotate(360deg); }
}
.hero__inner {
  position: relative;
  z-index: 3;
  width: 100%;
  padding-block: clamp(40px, 8vh, 90px) clamp(70px, 11vh, 120px);
}
.hero__title {
  font-size: clamp(44px, 7vw, 92px);
  line-height: 1.04;
  margin-bottom: 24px;
  text-shadow: 0 6px 30px rgba(0, 0, 0, .55);
}
.hero__title em {
  font-style: normal;
  background: var(--grad-empire);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}
.hero__sub {
  font-size: clamp(16px, 1.6vw, 20px);
  color: var(--ink-dim);
  margin-bottom: 36px;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 28px;
  color: var(--ink-dim);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero__badges span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero__badges svg { width: 16px; height: 16px; color: var(--gold); }
.hero__scroll {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ink-dim);
  font: 600 11px/1 'Inter', sans-serif;
  letter-spacing: .3em;
  text-transform: uppercase;
}
.hero__scroll svg { width: 18px; height: 18px; color: var(--gold); animation: bobDown 2.4s var(--ease) infinite; }
@keyframes bobDown {
  0%, 100% { transform: translateY(0); opacity: .8; }
  50% { transform: translateY(6px); opacity: 1; }
}

@media (max-width: 820px) {
  .hero { min-height: 0; padding-block: 32px 36px; }
  .hero__inner { padding-block: 0; }
  .hero__title { font-size: clamp(28px, 7vw, 38px); margin-bottom: 8px; }
  .hero__sub { font-size: 13px; margin-bottom: 18px; }
  .hero__cta { display: none; }
  .hero__badges { gap: 6px 14px; font-size: 10px; margin-top: 16px; }
  .hero__scroll { display: none; }
  .section { padding-block: clamp(36px, 5vw, 64px); }
  .section__head { margin-bottom: clamp(20px, 3vw, 32px); }
  h2 { font-size: clamp(18px, 4.6vw, 26px); }
}

/* Games */
.games { background: linear-gradient(180deg, var(--bg), var(--bg-elev) 80%); }
.games__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  align-items: start;
}
.games__lead {
  margin: clamp(28px, 4vw, 48px) auto 0;
  text-align: center;
}
.game {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.game:hover {
  transform: translateY(-6px);
  border-color: var(--gold);
  box-shadow: 0 22px 50px rgba(200, 16, 46, .22), inset 0 0 0 1px rgba(212, 168, 75, .45);
}
.game__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}
.game__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease);
}
.game:hover .game__media img { transform: scale(1.08); }
.game__media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(10, 10, 18, .96) 100%);
}
.game__chip {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(10, 10, 18, .7);
  border: 1px solid var(--line-strong);
  color: var(--gold);
  font: 600 11px/1 'Inter', sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.game__rating {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(200, 16, 46, .9);
  color: var(--ink);
  font: 700 12px/1 'Inter', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.game__rating svg { width: 12px; height: 12px; color: var(--gold-2); }
.game__body {
  position: relative;
  z-index: 2;
  padding: 22px 22px 26px;
  margin-top: -42%;
}
.game__title { font-size: 22px; margin-bottom: 8px; }
.game__desc { font-size: 14px; color: var(--ink-dim); margin-bottom: 18px; line-height: 1.55; }
.game__cta { display: flex; align-items: center; gap: 12px; }
.game__cta .btn { flex: 1; }

/* Games — wide tablet 820-1219: one hero + 2x2 */
@media (max-width: 1219px) and (min-width: 821px) {
  .games__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .game:first-child {
    grid-column: 1 / -1;
  }
  .game:first-child .game__media { aspect-ratio: 16 / 7; }
  .game:first-child .game__body { margin-top: -16%; }
}

@media (max-width: 820px) {
  .games__grid { grid-template-columns: 1fr; gap: 18px; }
  .game__media { aspect-ratio: 16 / 10; }
  .game__body { margin-top: -20%; }
}

/* About */
.about {
  background-image: url('/assets/img/sections/about-bg.avif');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
}
.about::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 18, .9), rgba(10, 10, 18, .96));
}
.about > * { position: relative; z-index: 1; }
.about__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 5vw, 64px);
}
.about__intro {
  font-size: clamp(17px, 1.5vw, 19px);
  color: var(--ink);
  line-height: 1.75;
}
.about__intro::first-letter {
  font: 800 64px/0.9 'Cinzel', serif;
  float: left;
  color: var(--gold);
  margin: 6px 14px 0 0;
}
.about__columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.about__col h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  margin-bottom: 14px;
  color: var(--ink);
}
.about__col h3 svg { width: 22px; height: 22px; color: var(--gold); flex-shrink: 0; }
.about__col p { color: var(--ink-dim); font-size: 15px; line-height: 1.7; margin-bottom: 12px; }
.about__points {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
}
.about__points li {
  position: relative;
  padding: 10px 0 10px 28px;
  border-bottom: 1px dashed var(--line);
  color: var(--ink-dim);
  font-size: 15px;
}
.about__points li::before {
  content: '';
  position: absolute;
  left: 0; top: 16px;
  width: 8px; height: 8px;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 12px rgba(212, 168, 75, .6);
}
.about__points li strong { color: var(--ink); margin-right: 4px; }
.about__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: clamp(40px, 5vw, 56px);
}
.stat {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--glass);
  backdrop-filter: blur(10px);
  text-align: center;
}
.stat__num {
  font: 800 clamp(28px, 3vw, 40px)/1 'Cinzel', serif;
  background: var(--grad-empire);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: block;
  margin-bottom: 6px;
}
.stat__label {
  font: 600 11px/1 'Inter', sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

@media (max-width: 980px) {
  .about__columns { grid-template-columns: 1fr; }
  .about__stats { grid-template-columns: repeat(2, 1fr); }
  .about { background-attachment: scroll; }
}
@media (max-width: 430px) {
  .about__stats { grid-template-columns: 1fr; }
}

/* Quiz */
.quiz {
  background-image: url('/assets/img/sections/quiz-bg.avif');
  background-size: cover;
  background-position: center;
  position: relative;
}
.quiz::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at center, rgba(10, 10, 18, .76), rgba(10, 10, 18, .96)),
    linear-gradient(135deg, rgba(122, 10, 30, .25), transparent);
}
.quiz > * { position: relative; z-index: 1; }
.quiz__card {
  margin: 0 auto;
  max-width: 760px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(28px, 4vw, 48px);
  box-shadow: var(--shadow);
}
.quiz__progress {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}
.quiz__progress span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.quiz__progress span.is-done::after {
  content: '';
  position: absolute; inset: 0;
  background: var(--grad-empire);
  transform-origin: left;
  animation: progBar .5s var(--ease) forwards;
}
@keyframes progBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.quiz__step {
  display: none;
}
.quiz__step.is-active {
  display: block;
  animation: quizFade .5s var(--ease);
}
@keyframes quizFade {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.quiz__q {
  font: 700 clamp(22px, 2.6vw, 30px)/1.3 'Cinzel', serif;
  margin-bottom: 24px;
}
.quiz__opts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 28px;
}
.quiz__opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(28, 28, 43, .6);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  font: 500 15px/1.4 'Inter', sans-serif;
  color: var(--ink);
  text-align: left;
  transition: background .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.quiz__opt::before {
  content: '';
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-soft);
  flex-shrink: 0;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.quiz__opt:hover { border-color: var(--gold); background: rgba(212, 168, 75, .08); transform: translateX(4px); }
.quiz__opt.is-selected { border-color: var(--crimson); background: rgba(200, 16, 46, .12); }
.quiz__opt.is-selected::before { background: var(--crimson); border-color: var(--crimson-2); box-shadow: inset 0 0 0 3px var(--ink); }
.quiz__nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.quiz__result { display: none; text-align: center; }
.quiz__result.is-active { display: block; animation: quizFade .6s var(--ease); }
.quiz__result-crest {
  width: 70px; height: 70px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: var(--grad-crimson);
  display: grid; place-items: center;
  box-shadow: var(--shadow-glow);
}
.quiz__result-crest svg { width: 36px; height: 36px; color: var(--gold-2); }
.quiz__result-title { font-size: clamp(24px, 3vw, 34px); margin-bottom: 8px; }
.quiz__result-name { font-size: clamp(20px, 2.2vw, 26px); color: var(--gold); margin-bottom: 14px; }
.quiz__result-desc { color: var(--ink-dim); margin-bottom: 26px; }
.quiz__result-cta { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* Contact — Cartographer's Hall */
.contact { background: linear-gradient(180deg, var(--bg), #060610); }
.contact__hall {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(20px, 2.4vw, 32px);
  align-items: stretch;
}
.contact__panel {
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(24px, 2.8vw, 36px);
  position: relative;
  overflow: hidden;
}
.contact__panel::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-gold);
  opacity: .7;
}
.contact__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.contact__row .field { margin-bottom: 18px; }
.contact__send-btn {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}
.contact__panel-note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ink-dim);
  text-align: center;
  line-height: 1.5;
}
.field { display: block; margin-bottom: 18px; }
.field__label {
  display: block;
  font: 600 12px/1 'Inter', sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.field__input, .field__area {
  width: 100%;
  padding: 14px 16px;
  background: rgba(10, 10, 18, .65);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink);
  font: 500 15px/1.5 'Inter', sans-serif;
  transition: border-color .22s var(--ease), background .22s var(--ease);
  min-width: 0;
}
.field__input:focus, .field__area:focus {
  border-color: var(--gold);
  background: rgba(10, 10, 18, .85);
  outline: none;
}
.field__area {
  resize: none;
  min-height: 140px;
}
.field__error {
  display: none;
  margin-top: 6px;
  font-size: 12px;
  color: var(--crimson-2);
}
.field.has-error .field__input,
.field.has-error .field__area { border-color: var(--crimson); }
.field.has-error .field__error { display: block; }

.contact__map-pad {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 420px;
  height: 100%;
  background: #060610;
}
.contact__map-iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
  filter: hue-rotate(330deg) saturate(.55) brightness(.55) invert(.92);
}
.contact__map-overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 30% 30%, rgba(200, 16, 46, .28), transparent 70%),
    linear-gradient(180deg, rgba(10,10,18,.1), rgba(10,10,18,.82) 75%);
  pointer-events: none;
}
.map-sigils {
  position: absolute;
  left: 18px; right: 18px; bottom: 18px;
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2;
}
.map-sigil {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  background: rgba(10, 10, 18, .68);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(212, 168, 75, .28);
  border-radius: var(--r-md);
  transition: border-color .25s var(--ease), transform .25s var(--ease), background .25s var(--ease);
}
.map-sigil:hover {
  border-color: rgba(212, 168, 75, .6);
  background: rgba(10, 10, 18, .82);
  transform: translateX(2px);
}
.map-sigil__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(200, 16, 46, .2);
  border: 1px solid rgba(212, 168, 75, .35);
  display: grid; place-items: center;
  color: var(--gold);
}
.map-sigil__icon svg { width: 18px; height: 18px; }
.map-sigil__label {
  display: block;
  font: 600 11px/1 'Inter', sans-serif;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 3px;
}
.map-sigil__value {
  display: block;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.4;
}
.map-sigil__value a { color: var(--ink); }
.map-sigil__value a:hover { color: var(--gold); }

@media (max-width: 980px) {
  .contact__hall { grid-template-columns: 1fr; }
  .contact__map-pad { min-height: 400px; }
}
@media (max-width: 520px) {
  .contact__row { grid-template-columns: 1fr; gap: 0; }
  .contact__map-pad { min-height: 360px; }
  .map-sigil { grid-template-columns: 36px 1fr; padding: 10px 12px; gap: 10px; }
  .map-sigil__icon { width: 36px; height: 36px; }
  .map-sigils { left: 12px; right: 12px; bottom: 12px; }
}

/* Toast */
.toast {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.toast.is-open { display: flex; animation: toastIn .25s var(--ease); }
@keyframes toastIn { from { opacity: 0; } to { opacity: 1; } }
.toast__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .7); backdrop-filter: blur(8px); }
.toast__card {
  position: relative;
  background: var(--bg-elev-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  padding: 32px 36px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  animation: toastPop .4s var(--ease-bounce);
}
@keyframes toastPop {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.toast__icon {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid; place-items: center;
}
.toast--ok .toast__icon { background: rgba(46, 160, 67, .15); color: #4ade80; }
.toast--err .toast__icon { background: rgba(200, 16, 46, .18); color: var(--crimson-2); }
.toast__icon svg { width: 32px; height: 32px; }
.toast__title { font-size: 22px; margin-bottom: 8px; }
.toast__text { color: var(--ink-dim); font-size: 15px; }

/* Footer */
.site-footer {
  background: #060610;
  border-top: 1px solid var(--line);
  padding: clamp(56px, 6vw, 80px) 0 28px;
  font-size: 14px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer__brand { display: flex; flex-direction: column; gap: 16px; }
.footer__brand p { color: var(--ink-dim); line-height: 1.65; }
.footer__col h4 {
  font: 700 13px/1 'Inter', sans-serif;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
  font-family: 'Inter', sans-serif;
}
.footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.footer__col a { color: var(--ink-dim); font-size: 14px; }
.footer__col a:hover { color: var(--gold); }
.footer__col li { display: flex; align-items: center; gap: 8px; }
.footer__col li svg { width: 14px; height: 14px; color: var(--gold-soft); flex-shrink: 0; }
.footer__bottom {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 13px;
}
.footer__bottom-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.socials {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.socials a {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-dim);
  background: rgba(10, 10, 18, .55);
  transition: color .22s var(--ease), border-color .22s var(--ease), transform .22s var(--ease), background .22s var(--ease);
}
.socials a:hover {
  color: var(--gold);
  border-color: rgba(212, 168, 75, .55);
  background: rgba(212, 168, 75, .1);
  transform: translateY(-2px);
}
.socials svg { width: 18px; height: 18px; }
.footer__disclaimer {
  padding: 18px;
  border-radius: var(--r-md);
  background: rgba(200, 16, 46, .07);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 820px) {
  .footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
  .socials { width: 100%; }
}

/* Chat widget */
.chat {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 80;
  font-family: 'Inter', sans-serif;
}
.chat__toggle {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--grad-crimson);
  color: var(--gold-2);
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 14px 36px rgba(200, 16, 46, .45);
  transition: transform .22s var(--ease), box-shadow .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.chat__toggle:hover { transform: translateY(-3px) scale(1.04); }
.chat__toggle svg { width: 26px; height: 26px; }
.chat__toggle::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  opacity: 0;
  animation: chatPulse 2.6s var(--ease) infinite;
}
@keyframes chatPulse {
  0% { transform: scale(1); opacity: .6; }
  100% { transform: scale(1.5); opacity: 0; }
}
.chat__panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: 360px;
  height: 460px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 120px);
  background: var(--bg-elev-2);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 28px 60px rgba(0, 0, 0, .6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  visibility: hidden;
  transition: opacity .25s var(--ease), transform .3s var(--ease), visibility 0s linear .3s;
}
.chat[data-open="true"] .chat__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  transition: opacity .25s var(--ease), transform .3s var(--ease), visibility 0s linear 0s;
}
.chat__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(200, 16, 46, .25), rgba(122, 10, 30, .3));
  border-bottom: 1px solid var(--line);
}
.chat__avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--gold);
  flex-shrink: 0;
}
.chat__avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat__title { font: 700 14px/1.2 'Cinzel', serif; color: var(--ink); }
.chat__sub { font-size: 11px; color: var(--gold); display: inline-flex; align-items: center; gap: 6px; }
.chat__sub::before {
  content: '';
  width: 7px; height: 7px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 8px #4ade80;
}
.chat__close {
  margin-left: auto;
  width: 28px; height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  cursor: pointer;
  display: grid; place-items: center;
}
.chat__close svg { width: 14px; height: 14px; }
.chat__close:hover { color: var(--ink); border-color: var(--gold); }
.chat__body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat__msg {
  max-width: 80%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
}
.chat__msg--bot {
  background: rgba(212, 168, 75, .1);
  border: 1px solid var(--line);
  color: var(--ink);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat__msg--user {
  background: var(--grad-crimson);
  color: var(--ink);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat__quick {
  padding: 10px 14px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chat__quick button {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
  font: 500 12px/1 'Inter', sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.chat__quick button:hover { background: var(--gold); color: #0c0703; }
.chat__form {
  display: flex;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}
.chat__form input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  background: rgba(10, 10, 18, .6);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font: 400 13px/1.4 'Inter', sans-serif;
}
.chat__form input:focus { outline: none; border-color: var(--gold); }
.chat__form button {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--grad-crimson);
  color: var(--gold-2);
  border: none;
  cursor: pointer;
  display: grid; place-items: center;
  -webkit-tap-highlight-color: transparent;
}
.chat__form button svg { width: 16px; height: 16px; }
.chat__form button:hover { transform: scale(1.05); }

/* Legal pages */
.legal-hero {
  padding: clamp(72px, 9vw, 120px) 0 clamp(32px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(200, 16, 46, .14), transparent);
}
.legal-hero h1 { font-size: clamp(36px, 5vw, 56px); margin-bottom: 12px; }
.legal-hero p { color: var(--ink-dim); }
.legal-content {
  padding: clamp(40px, 5vw, 72px) 0;
}
.legal-content h2 { font-size: clamp(22px, 2.4vw, 28px); margin-top: 36px; margin-bottom: 14px; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 { font-size: clamp(18px, 2vw, 22px); margin-top: 24px; margin-bottom: 10px; }
.legal-content p { color: var(--ink-dim); line-height: 1.8; }
.legal-content ul { padding-left: 22px; color: var(--ink-dim); line-height: 1.8; }
.legal-content li { margin-bottom: 8px; }
.legal-content a { color: var(--gold); }

/* 404 */
.notfound {
  min-height: 70vh;
  display: flex;
  align-items: center;
  text-align: center;
  position: relative;
}
.notfound::before {
  content: '404';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 800 clamp(160px, 30vw, 320px)/1 'Cinzel', serif;
  background: var(--grad-empire);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: .12;
  pointer-events: none;
}
.notfound__inner { position: relative; width: 100%; }
.notfound h1 { font-size: clamp(32px, 4vw, 48px); margin-bottom: 14px; }
.notfound p { color: var(--ink-dim); margin-bottom: 28px; max-width: none; }
.notfound__cta { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* Mobile fine-tune */
@media (max-width: 520px) {
  .header-actions > .lang-switch { display: none; }
  .hero__sigil { width: min(420px, 90vw); height: min(420px, 90vw); top: 8vh; }
  .quiz__opt { padding: 14px 16px; font-size: 14px; }
  .toast__card { padding: 26px 22px; }
  .chat { bottom: 16px; right: 16px; }
  .chat__panel { right: -8px; }
}
@media (max-width: 430px) {
  body { font-size: 15px; }
  .btn { --pad-x: 22px; font-size: 14px; }
}
@media (max-width: 360px) {
  .container { padding-inline: 14px; }
}

/* Mobile perf: drop heavy compositing */
@media (max-width: 820px) {
  .site-header { backdrop-filter: none; background: rgba(10, 10, 18, .92); }
  .stat,
  .map-sigil,
  .quiz__card,
  .toast__backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .hero__sigil { display: none; }
  .games__grid .game:nth-child(n+4) .game__media img { content-visibility: auto; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
  .hero__slide { animation: none; opacity: 1; }
  .hero__slide:not(:first-child) { display: none; }
}
