@font-face {
  font-family: "Vazir";
  src: url("../fonts/vazir-bold.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy: #0f1a3d;
  --navy-deep: #080f26;
  --navy-light: #1c2e61;
  --panel: #0d1433;
  --gold: #facc61;
  --gold-deep: #c8922f;
  --turquoise: #5ce0d9;
  --cream: #faf0d6;
  --muted: #a8b8db;
  --warning: #ff8c73;
  --r-common: #dbd1b8;
  --r-rare: #40d1c7;
  --r-epic: #bd73f5;
  --r-legendary: #fac74d;
  --line: rgba(250, 204, 97, 0.28);
  --line-soft: rgba(168, 184, 219, 0.16);
  --radius: 18px;
  --gutter: 16px;
  --max: 1180px;
  --shadow: 0 18px 50px rgba(2, 6, 20, 0.55);
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23facc61' stroke-width='5'%3E%3Crect x='22' y='22' width='56' height='56'/%3E%3Crect x='22' y='22' width='56' height='56' transform='rotate(45 50 50)'/%3E%3C/g%3E%3C/svg%3E");
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Vazir", Tahoma, sans-serif;
  font-weight: 700;
  color: var(--cream);
  background-color: var(--navy-deep);
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(92, 224, 217, 0.08), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%231c2e61' stroke-width='1.2' opacity='.55'%3E%3Crect x='35' y='35' width='50' height='50'/%3E%3Crect x='35' y='35' width='50' height='50' transform='rotate(45 60 60)'/%3E%3Cpath d='M0 60h25M95 60h25M60 0v25M60 95v25'/%3E%3C/g%3E%3C/svg%3E");
  line-height: 1.9;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--turquoise); text-decoration: none; }
a:hover { color: var(--gold); }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 800; }
p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--turquoise);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 100;
  background: var(--gold);
  color: var(--navy);
  padding: 8px 14px;
  border-radius: 10px;
}
.skip:focus { top: 12px; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background-color .35s, box-shadow .35s, backdrop-filter .35s;
}
.site-header.scrolled {
  background: rgba(8, 15, 38, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  font-size: 1.25rem;
  font-weight: 900;
}
.brand img {
  width: 40px; height: 40px;
  border-radius: 11px;
  box-shadow: 0 0 0 1px var(--line), 0 6px 16px rgba(0,0,0,.4);
}
.nav-links {
  display: flex;
  gap: 4px;
  margin-inline-start: auto;
  list-style: none;
  padding: 0;
  margin-block: 0;
}
.nav-links a {
  display: block;
  padding: 6px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: .95rem;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); background: rgba(250, 204, 97, .08); }
.nav-cta { white-space: nowrap; }
.menu-btn {
  display: none;
  margin-inline-start: auto;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(15, 26, 61, .7);
  cursor: pointer;
  align-items: center; justify-content: center;
}
.menu-btn span, .menu-btn span::before, .menu-btn span::after {
  display: block;
  width: 20px; height: 2px;
  background: var(--gold);
  border-radius: 2px;
  position: relative;
  transition: transform .3s, background .3s;
}
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; inset-inline-start: 0; }
.menu-btn span::before { top: -6px; }
.menu-btn span::after { top: 6px; }
.menu-open .menu-btn span { background: transparent; }
.menu-open .menu-btn span::before { transform: translateY(6px) rotate(45deg); }
.menu-open .menu-btn span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .2s, box-shadow .25s, background .25s, color .25s;
  text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn-gold {
  color: #2b1a05;
  background: linear-gradient(180deg, #ffe39a, var(--gold) 45%, var(--gold-deep));
  box-shadow: 0 8px 26px rgba(250, 204, 97, .32), inset 0 1px 0 rgba(255,255,255,.6);
}
.btn-gold:hover { color: #2b1a05; box-shadow: 0 12px 34px rgba(250, 204, 97, .45), inset 0 1px 0 rgba(255,255,255,.6); }
.btn-ghost {
  color: var(--cream);
  border-color: var(--line);
  background: rgba(15, 26, 61, .55);
}
.btn-ghost:hover { color: var(--gold); border-color: var(--gold); }
.btn-small { min-height: 40px; padding: 6px 16px; font-size: .92rem; border-radius: 12px; }
.btn .badge-soon {
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 26, 61, .85);
  color: var(--gold);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-poster {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: url("../img/splash.webp") center 30% / cover no-repeat;
  filter: saturate(1.05) brightness(.55);
  transition: opacity 1.2s;
}
.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0;
  transition: opacity 1.6s ease;
  touch-action: pan-y;
}
.hero.ready canvas { opacity: 1; }
.hero.ready .hero-poster { opacity: 0; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(270deg, rgba(8,15,38,.88) 0%, rgba(8,15,38,.55) 34%, rgba(8,15,38,0) 62%),
    linear-gradient(0deg, var(--navy-deep) 0%, rgba(8,15,38,0) 22%);
}
.hero-inner {
  width: 100%;
  padding-top: 90px;
  padding-bottom: 70px;
}
.hero-copy { max-width: 520px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--turquoise);
  font-size: .95rem;
  letter-spacing: 0;
}
.eyebrow::before {
  content: "";
  width: 16px; height: 16px;
  background: var(--star) center / contain no-repeat;
}
.logo-title {
  margin: 6px 0 4px;
  font-size: clamp(3.4rem, 11vw, 6.6rem);
  font-weight: 900;
  line-height: 1.25;
  background: linear-gradient(180deg, #fff3c8 0%, var(--gold) 45%, #b9791f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 rgba(60, 30, 0, .45)) drop-shadow(0 10px 28px rgba(250, 204, 97, .35));
}
.hero-lead {
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  color: var(--cream);
  margin-bottom: 26px;
  max-width: 34ch;
}
.hero-lead strong { color: var(--gold); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 34px;
  max-width: 520px;
}
.hero-stats div {
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(13, 20, 51, .62);
  border: 1px solid var(--line-soft);
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hero-stats b { display: block; font-size: 1.5rem; color: var(--gold); line-height: 1.4; }
.hero-stats span { font-size: .8rem; color: var(--muted); }
.scroll-cue {
  position: absolute;
  bottom: 18px;
  inset-inline: 0;
  margin-inline: auto;
  width: 26px; height: 42px;
  border: 2px solid rgba(250, 240, 214, .45);
  border-radius: 14px;
}
.scroll-cue::after {
  content: "";
  position: absolute;
  top: 8px; inset-inline-start: 50%;
  width: 4px; height: 8px;
  margin-inline-start: -2px;
  background: var(--gold);
  border-radius: 2px;
  animation: cue 1.8s infinite;
}
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- sections ---------- */
section { position: relative; }
.section { padding-block: 96px; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 46px; }
.section-head .eyebrow { justify-content: center; }
.section-title {
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  margin: 6px 0 12px;
  color: var(--cream);
}
.section-title em { font-style: normal; color: var(--gold); }
.section-sub { color: var(--muted); font-size: 1.05rem; }
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto;
  max-width: 320px;
  height: 22px;
}
.ornament::before, .ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.ornament::after { background: linear-gradient(270deg, transparent, var(--gold)); }
.ornament i {
  width: 18px; height: 18px;
  background: var(--star) center / contain no-repeat;
  animation: spin 18s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.panel {
  background: linear-gradient(180deg, rgba(28, 46, 97, .55), rgba(13, 20, 51, .78));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.alt-bg {
  background:
    linear-gradient(180deg, rgba(15, 26, 61, 0) 0%, rgba(15, 26, 61, .9) 14%, rgba(15, 26, 61, .9) 86%, rgba(15, 26, 61, 0) 100%);
}

/* ---------- battle ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.feature { padding: 20px 18px; }
.feature .ico {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: rgba(250, 204, 97, .1);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.feature .ico img, .feature .ico svg { width: 28px; height: 28px; }
.feature h3 { font-size: 1.12rem; color: var(--gold); margin-bottom: 4px; }
.feature p { color: var(--muted); font-size: .95rem; line-height: 1.85; }
.feature p b { color: var(--cream); }


.cost {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f6c8ff, #a24fd6 60%, #5c2387);
  color: #fff;
  font-size: .95rem;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.5), 0 0 0 2px rgba(255,255,255,.25);
}

/* ---------- army (3D gallery) ---------- */
.army {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-areas: "stage info" "picker picker";
  gap: 0 24px;
  align-items: stretch;
}
.army > .stage { grid-area: stage; }
.army > .card-info { grid-area: info; }
.army > .picker { grid-area: picker; }
.stage {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse at 50% 85%, rgba(250, 204, 97, .18), transparent 55%),
    radial-gradient(ellipse at 50% 30%, rgba(92, 224, 217, .12), transparent 60%),
    linear-gradient(180deg, #16244f, #0a1230);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  transition: opacity .6s;
  cursor: grab;
  touch-action: pan-y;
}
.stage canvas:active { cursor: grabbing; }
.stage.ready canvas { opacity: 1; }
.stage .poster {
  position: absolute;
  inset: 12% 18%;
  margin: auto;
  object-fit: contain;
  width: 64%; height: 76%;
  border-radius: 16px;
  transition: opacity .5s;
  z-index: -1;
}
.stage.ready .poster { opacity: 0; }
.stage .loading, .khan-boss .loading {
  position: absolute;
  inset-inline: 0;
  bottom: 16px;
  margin-inline: auto;
  width: max-content;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(8, 15, 38, .8);
  color: var(--muted);
  font-size: .85rem;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.stage.busy .loading, .khan-boss.busy .loading { opacity: 1; }
.loading::before {
  content: "";
  width: 14px; height: 14px;
  border: 2px solid var(--gold);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.stage-hint {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  font-size: .8rem;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(8, 15, 38, .6);
  pointer-events: none;
}
.chip-btn {
  border: 1px solid var(--line);
  background: rgba(8, 15, 38, .72);
  color: var(--cream);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: .85rem;
  cursor: pointer;
  min-height: 34px;
  transition: background .2s, color .2s, border-color .2s;
}
.chip-btn:hover { color: var(--gold); border-color: var(--gold); }
.chip-btn[aria-pressed="true"], .chip-btn.on { background: var(--gold); color: var(--navy); border-color: var(--gold); }

.card-info { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.card-info-top { display: flex; gap: 16px; align-items: center; }
.card-face {
  position: relative;
  flex: 0 0 auto;
  width: 112px;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid var(--rc, var(--r-common));
  box-shadow: 0 0 24px color-mix(in srgb, var(--rc, #dbd1b8) 35%, transparent);
  background: var(--cream);
}
.card-face img { width: 100%; height: 100%; object-fit: cover; }
.card-face .cost { position: absolute; top: 5px; inset-inline-start: 5px; }
.card-name { font-size: 1.7rem; color: var(--cream); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag {
  font-size: .8rem;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
  color: var(--muted);
  line-height: 1.7;
}
.tag.rarity { color: var(--rc, var(--r-common)); }
.card-desc { color: var(--cream); font-size: 1.05rem; line-height: 1.9; }
.card-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-meta div { padding: 10px 12px; border-radius: 12px; background: rgba(8, 15, 38, .55); border: 1px solid var(--line-soft); }
.card-meta dt { color: var(--muted); font-size: .78rem; }
.card-meta dd { margin: 0; color: var(--gold); }

.picker {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 6px 2px 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--navy-light) transparent;
}
.pick {
  flex: 0 0 auto;
  width: 86px;
  scroll-snap-align: start;
  border: 2px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
  background: var(--navy);
  padding: 0;
  cursor: pointer;
  position: relative;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.pick img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--cream); }
.pick span { display: block; font-size: .72rem; padding: 4px 2px; text-align: center; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick .cost { position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; font-size: .78rem; }
.pick:hover { transform: translateY(-3px); }
.pick[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(250, 204, 97, .25), 0 8px 18px rgba(0,0,0,.4); }
.pick::after {
  content: "";
  position: absolute;
  inset-inline: 0; top: 0;
  height: 4px;
  background: var(--rc, var(--r-common));
}

/* ---------- spells & buildings ---------- */
.spells {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 56px;
}
.spell { padding: 12px; text-align: center; transition: transform .3s, border-color .3s; }
.spell:hover { transform: translateY(-6px); border-color: var(--line); }
.spell .card-face { width: 100%; margin-bottom: 10px; }
.spell h3 { font-size: 1.05rem; color: var(--gold); }
.spell p { font-size: .85rem; color: var(--muted); line-height: 1.8; margin-top: 4px; }
.sub-title { font-size: 1.45rem; margin-bottom: 8px; color: var(--cream); display: flex; align-items: center; gap: 10px; }
.sub-title::before { content: ""; width: 20px; height: 20px; background: var(--star) center / contain no-repeat; }
.sub-lead { color: var(--muted); margin-bottom: 18px; }

.build {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 24px;
  align-items: stretch;
}
.build-list { display: flex; flex-direction: column; gap: 10px; }
.build-group-title { color: var(--turquoise); font-size: .95rem; margin-top: 8px; }
.build-btn {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: start;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(13, 20, 51, .7);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.build-btn img { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; background: var(--cream); }
.build-btn b { display: block; color: var(--cream); }
.build-btn small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.7; }
.build-btn:hover { border-color: var(--line); }
.build-btn[aria-pressed="true"] { border-color: var(--gold); background: rgba(250, 204, 97, .1); }
.build-btn[aria-pressed="true"] b { color: var(--gold); }

/* ---------- arenas ---------- */
.arenas {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  perspective: 1200px;
}
.arena {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .25s ease-out, box-shadow .3s;
}
.arena:hover { box-shadow: 0 26px 60px rgba(2, 6, 20, .7), 0 0 0 1px var(--gold); }
.arena-img { position: relative; aspect-ratio: 900 / 557; overflow: hidden; }
.arena-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s; }
.arena:hover .arena-img img { transform: scale(1.06); }
.arena-num {
  position: absolute;
  top: 12px; inset-inline-start: 12px;
  padding: 2px 12px;
  border-radius: 999px;
  background: rgba(8, 15, 38, .8);
  color: var(--turquoise);
  font-size: .85rem;
  border: 1px solid rgba(92, 224, 217, .4);
}
.arena-body { padding: 18px 18px 20px; }
.arena-body h3 { font-size: 1.4rem; color: var(--gold); }
.honor-need { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-top: 6px; font-size: .95rem; }
.honor-need img { width: 22px; height: 22px; }
.honor-need b { color: var(--cream); }
.arena-body p { color: var(--muted); font-size: .92rem; margin-top: 8px; }
.road-cards { margin-top: 30px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.road-cards img { border-radius: 14px; box-shadow: var(--shadow); width: 100%; height: auto; }

/* ---------- haft khan ---------- */
.khan-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.khan-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 78px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(13, 20, 51, .7);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.khan-tab b { font-size: 1.25rem; color: var(--gold); line-height: 1.3; }
.khan-tab span { font-size: .8rem; color: var(--muted); }
.khan-tab:hover { transform: translateY(-2px); }
.khan-tab[aria-selected="true"] { border-color: var(--gold); background: rgba(250, 204, 97, .12); }
.khan-tab[aria-selected="true"] span { color: var(--cream); }
.khan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}
.khan-art { position: relative; min-height: 420px; background: #0a1230; }
.khan-art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .5s; }
.khan-art::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(270deg, rgba(13,20,51,0) 55%, rgba(13,20,51,.95));
  pointer-events: none;
}
.khan-box.boss { display: flex; align-items: center; gap: 14px; padding: 10px; }
.khan-boss {
  position: relative;
  flex: 0 0 auto;
  width: 150px;
  height: 150px;
  border-radius: 12px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 80%, rgba(250, 204, 97, .2), transparent 60%), linear-gradient(180deg, #1a2858, #0a1230);
  border: 1px solid var(--line);
}
.khan-boss canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .6s; cursor: grab; touch-action: pan-y; }
.khan-boss.ready canvas { opacity: 1; }
.khan-boss .loading { bottom: 8px; padding: 2px 10px; font-size: 0; }
.khan-boss.busy .loading { opacity: 1; }
.boss-note { color: var(--muted) !important; font-size: .8rem; }
.khan-body { padding: 30px 28px; display: flex; flex-direction: column; gap: 14px; }
.khan-body h3 { font-size: 1.7rem; color: var(--gold); }
.khan-story { color: var(--cream); font-size: 1.05rem; line-height: 2; }
.khan-box { padding: 12px 14px; border-radius: 14px; background: rgba(8, 15, 38, .55); border: 1px solid var(--line-soft); }
.khan-box dt { color: var(--turquoise); font-size: .85rem; }
.khan-box dd { margin: 0; color: var(--cream); }
.khan-box.reward { border-color: var(--line); }
.khan-box.reward dt { color: var(--gold); }
.khan-progress { display: flex; gap: 6px; }
.khan-progress i { flex: 1; height: 5px; border-radius: 3px; background: rgba(168, 184, 219, .18); transition: background .4s; }
.khan-progress i.on { background: var(--gold); }

/* ---------- honor road ---------- */
.road-wrap { position: relative; }
.road {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 26px 6px 18px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--navy-light) transparent;
}
.step {
  position: relative;
  flex: 0 0 auto;
  width: 132px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  scroll-snap-align: center;
  padding-inline: 6px;
}
.step::before {
  content: "";
  position: absolute;
  top: 46px;
  inset-inline: 0;
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--gold-deep) 0 10px, rgba(200, 146, 47, .3) 10px 16px);
  z-index: 0;
}
.step:first-child::before { inset-inline-start: 50%; }
.step:last-child::before { inset-inline-end: 50%; }
.step-icon {
  position: relative;
  z-index: 1;
  width: 96px; height: 96px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #223872, #0d1433 70%);
  border: 2px solid var(--line);
  box-shadow: 0 8px 20px rgba(0,0,0,.45);
  transition: transform .3s, border-color .3s;
}
.step-icon img { width: 66px; height: 66px; object-fit: contain; }
.step-icon img.round { border-radius: 50%; object-fit: cover; width: 70px; height: 70px; }
.step:hover .step-icon { transform: translateY(-4px) scale(1.05); border-color: var(--gold); }
.step.big .step-icon { border-color: var(--turquoise); box-shadow: 0 0 0 4px rgba(92, 224, 217, .15), 0 8px 20px rgba(0,0,0,.45); }
.step-honor { margin-top: 8px; display: flex; align-items: center; gap: 4px; color: var(--gold); font-size: 1rem; }
.step-honor img { width: 18px; height: 18px; }
.step-what { color: var(--muted); font-size: .8rem; line-height: 1.6; }
.road-hint { text-align: center; color: var(--muted); font-size: .85rem; }

/* ---------- chests ---------- */
.chests {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
.chest { flex: 1 1 170px; max-width: 230px; padding: 14px 12px 18px; text-align: center; }
.chest-img { perspective: 600px; }
.chest-img img {
  width: 100%;
  max-width: 150px;
  margin: 0 auto;
  animation: float 5s ease-in-out infinite;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,.55));
}
.chest:nth-child(2) .chest-img img { animation-delay: -1s; }
.chest:nth-child(3) .chest-img img { animation-delay: -2s; }
.chest:nth-child(4) .chest-img img { animation-delay: -3s; }
.chest:nth-child(5) .chest-img img { animation-delay: -4s; }
.chest:last-child { border-color: var(--line); box-shadow: var(--shadow), 0 0 40px rgba(250, 204, 97, .12); }
@keyframes float {
  0%, 100% { transform: translateY(0) rotateY(-8deg); }
  50% { transform: translateY(-10px) rotateY(8deg); }
}
.chest h3 { font-size: 1.02rem; color: var(--gold); margin-top: 8px; }
.chest ul { list-style: none; padding: 0; margin: 8px 0 0; font-size: .84rem; color: var(--muted); line-height: 1.9; }
.chest li { display: flex; align-items: center; justify-content: center; gap: 5px; }
.chest li img { width: 18px; height: 18px; object-fit: contain; }
.chest li.chance { font-size: .76rem; color: var(--turquoise); margin-top: -4px; }
.currencies { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 26px; }
.currency { display: flex; gap: 16px; align-items: center; padding: 18px 20px; }
.currency img { width: 58px; height: 58px; object-fit: contain; flex: 0 0 auto; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.currency h3 { color: var(--gold); font-size: 1.15rem; }
.currency p { color: var(--muted); font-size: .92rem; }

/* ---------- identity ---------- */
.tabs-bar { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.tab-panel { animation: fade .45s ease; }
.tab-panel[hidden] { display: none; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.gallery { display: grid; gap: 14px; }
.portraits { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.portraits img { width: 100%; aspect-ratio: 1; object-fit: contain; transition: transform .3s; filter: drop-shadow(0 8px 14px rgba(0,0,0,.5)); }
.portraits img:hover { transform: scale(1.07) rotate(-2deg); }
.flags { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.flag { text-align: center; }
.flag img { height: 150px; width: auto; margin: 0 auto; object-fit: contain; transform-origin: 50% 0; animation: wave 4s ease-in-out infinite; filter: drop-shadow(0 10px 12px rgba(0,0,0,.5)); }
.flag:nth-child(even) img { animation-delay: -2s; }
@keyframes wave { 0%, 100% { transform: skewY(0deg) rotate(0deg); } 50% { transform: skewY(-2deg) rotate(1deg); } }
.flag span { display: block; margin-top: 8px; color: var(--cream); font-size: .88rem; }
.name-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.name-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(13, 20, 51, .75); border: 1px solid var(--line-soft); color: var(--cream); font-size: .9rem; }
.name-chip i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px rgba(255,255,255,.18); }
.mini-title { text-align: center; color: var(--turquoise); font-size: 1rem; margin: 30px 0 12px; }
.medals { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.medal { text-align: center; padding: 14px 10px; }
.medal img { height: 130px; width: auto; margin: 0 auto 8px; filter: drop-shadow(0 8px 12px rgba(0,0,0,.5)); transition: transform .4s; }
.medal:hover img { transform: rotateY(180deg); }
.medal h3 { font-size: 1rem; color: var(--gold); }
.medal p { color: var(--muted); font-size: .82rem; line-height: 1.7; }
.sets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

/* ---------- faq ---------- */
.faq { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq details { padding: 0; overflow: hidden; }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 1.05rem;
  color: var(--cream);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: 0 0 auto;
  width: 14px; height: 14px;
  background: var(--star) center / contain no-repeat;
  transition: transform .35s;
}
.faq details[open] summary { color: var(--gold); }
.faq details[open] summary::after { transform: rotate(135deg); }
.faq details p { padding: 0 20px 18px; color: var(--muted); }

/* ---------- cta + footer ---------- */
.cta {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 56px 24px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(8, 15, 38, .55), rgba(8, 15, 38, .92)),
    url("../img/arenas/snow.webp") center / cover;
  box-shadow: var(--shadow);
}
.cta img.app { width: 96px; height: 96px; border-radius: 24px; margin: 0 auto 14px; box-shadow: 0 0 0 1px var(--line), 0 12px 30px rgba(0,0,0,.5); }
.cta h2 { font-size: clamp(1.7rem, 5vw, 2.6rem); color: var(--gold); }
.cta p { color: var(--cream); margin: 8px auto 22px; max-width: 46ch; }
.site-footer { padding: 44px 0 34px; border-top: 1px solid var(--line-soft); margin-top: 80px; background: rgba(8, 15, 38, .85); }
.foot { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot nav a { color: var(--muted); font-size: .92rem; }
.foot nav a:hover { color: var(--gold); }
.copy { color: var(--muted); font-size: .85rem; margin-top: 18px; text-align: center; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .nav-links a { padding: 6px 8px; font-size: .88rem; }
  .spells { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .flags { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .medals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .nav-cta { display: none; }
  .nav-links {
    position: fixed;
    top: 64px;
    inset-inline: 0;
    flex-direction: column;
    gap: 2px;
    padding: 10px var(--gutter) 18px;
    background: rgba(8, 15, 38, .97);
    border-bottom: 1px solid var(--line);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, transform .25s, visibility .25s;
  }
  .menu-open .nav-links { opacity: 1; transform: none; visibility: visible; }
  .menu-open .site-header { background: rgba(8, 15, 38, .97); }
  .nav-links a { padding: 12px 10px; font-size: 1.05rem; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .army, .build, .khan { grid-template-columns: minmax(0, 1fr); }
  .army { grid-template-areas: "stage" "picker" "info"; }
  .army > .picker { margin-top: 12px; }
  .build > .stage { order: -1; min-height: 340px; }
  .arenas, .road-cards { grid-template-columns: minmax(0, 1fr); }
  .arenas { max-width: 560px; margin-inline: auto; }
  .road-cards { max-width: 560px; margin-inline: auto; }
  .khan-art { min-height: 0; aspect-ratio: 1; }
  .khan-art::after { background: linear-gradient(180deg, rgba(13,20,51,0) 60%, rgba(13,20,51,.95)); }
  .portraits { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* hero in portrait: the 3D scene above, the words below */
@media (max-width: 640px), (max-aspect-ratio: 6/5) and (max-width: 1100px) {
  .hero { align-items: flex-end; }
  .hero::after {
    background: linear-gradient(0deg, var(--navy-deep) 0%, rgba(8,15,38,.92) 34%, rgba(8,15,38,.35) 52%, rgba(8,15,38,0) 66%);
  }
  .hero-inner { padding-bottom: 40px; padding-top: 0; }
  .hero-copy { text-align: center; margin-inline: auto; }
  .eyebrow { justify-content: center; }
  .logo-title { margin-top: 0; }
  .hero-lead { margin-inline: auto; margin-bottom: 20px; }
  .hero-actions { justify-content: center; }
  .hero-stats { gap: 6px; margin-top: 20px; margin-inline: auto; }
  .scroll-cue { display: none; }
}

@media (max-width: 640px) {
  .section { padding-block: 70px; }
  .section-head { margin-bottom: 32px; }
  .logo-title { font-size: clamp(3rem, 15vw, 4.2rem); }
  .hero-lead { font-size: 1rem; line-height: 1.95; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-stats b { font-size: 1.2rem; }
  .hero-stats span { font-size: .72rem; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .stage { min-height: 360px; }
  .card-face { width: 92px; }
  .card-name { font-size: 1.4rem; }
  .spells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spells .spell:last-child { grid-column: 1 / -1; max-width: 50%; margin-inline: auto; }
  .chests { gap: 10px; }
  .chest { flex-basis: 140px; }
  .currencies { grid-template-columns: minmax(0, 1fr); }
  .portraits { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .flags { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flag img { height: 130px; }
  .medals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sets { grid-template-columns: minmax(0, 1fr); }
  .khan-body { padding: 22px 18px; }
  .khan-tab { min-width: 0; flex: 1 1 calc(25% - 8px); }
  .card-info { padding: 18px; }
  .foot { flex-direction: column; text-align: center; }
  .foot nav { justify-content: center; }
}
