/* قلعه‌شکن — daryastudio.site
   Palette from the game UI: lapis panels (Popups.cs 34,40,90), gold titles (#ffd246),
   cream text, the green build / yellow battle buttons, the rarity colours (UnitDef.RarityColor).
   Fonts as in the game (Docs/Credits.md): Lalezar for titles, buttons and numbers; Vazirmatn for text. */

@font-face {
  font-family: "Lalezar";
  src: url("../fonts/lalezar.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/vazirmatn-wght.woff2") format("woff2-variations"), url("../fonts/vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night: #0b0f2e;
  --ink: #0e1236;
  --ink-2: #151b4b;
  --panel: #22285a;
  --panel-2: #2c3577;
  --panel-3: #3a46a0;
  --gold: #ffd246;
  --gold-hi: #ffe98f;
  --gold-lo: #d98c0b;
  --gold-line: rgba(255, 210, 70, .38);
  --cream: #f5f0e6;
  --muted: #c8cde6;
  --sand: #f0a35a;
  --green-hi: #8fe36a;
  --green: #3fae3c;
  --green-lo: #1f7a2a;
  --red: #e0483e;
  --r-common: #bec8d7;
  --r-rare: #6edc5a;
  --r-epic-blue: #50aaff;
  --r-epic: #be6eff;
  --r-legendary: #ffc432;
  --display: "Lalezar", "Vazirmatn", Tahoma, sans-serif;
  --text: "Vazirmatn", Tahoma, sans-serif;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1200px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --pop: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.95;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
picture { display: contents; }
a { color: var(--gold-hi); text-underline-offset: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.35; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100;
  background: var(--gold); color: var(--night); padding: 8px 16px; border-radius: 10px; font-weight: 800;
  text-decoration: none; transition: top .2s;
}
.skip:focus { top: 12px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  --b1: var(--gold-hi); --b2: var(--gold); --b3: var(--gold-lo); --fg: #3b2300;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 6px 22px 8px;
  font-family: var(--display); font-size: 1.2rem; line-height: 1; color: var(--fg); text-decoration: none;
  background: linear-gradient(180deg, var(--b1), var(--b2) 48%, var(--b3));
  border: 2px solid rgba(60, 30, 0, .55); border-radius: 14px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), inset 0 -4px 0 rgba(0, 0, 0, .18), 0 4px 0 rgba(0, 0, 0, .35);
  cursor: pointer; transition: transform .15s var(--ease), filter .15s;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}
.btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), 0 1px 0 rgba(0, 0, 0, .35); }
.btn--green { --b1: var(--green-hi); --b2: var(--green); --b3: var(--green-lo); --fg: #fff; text-shadow: 0 2px 0 rgba(0, 60, 0, .55); border-color: rgba(0, 50, 0, .6); }
.btn--ghost {
  background: rgba(20, 26, 70, .7); color: var(--cream); border: 2px solid var(--gold-line);
  box-shadow: none; text-shadow: none;
}
.btn--ghost:hover { border-color: var(--gold); }
.btn--sm { white-space: nowrap; min-height: 44px; font-size: 1.05rem; padding: 4px 16px 6px; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, rgba(11, 15, 46, .92), rgba(11, 15, 46, .78));
  backdrop-filter: blur(10px) saturate(1.3); -webkit-backdrop-filter: blur(10px) saturate(1.3);
  border-bottom: 1px solid var(--gold-line);
}
.topbar__inner {
  max-width: var(--max); margin: 0 auto; padding: 8px var(--gutter);
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold); }
.brand__icon { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--gold); box-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.brand__name { font-family: var(--display); font-size: 1.55rem; line-height: 1; text-shadow: 0 2px 0 #5a3400; }
.topbar__inner { position: relative; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--cream); text-decoration: none; padding: 4px 12px; border-radius: 10px; font-weight: 700; font-size: .98rem; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: var(--gold-hi); }
.topbar .btn { margin-inline-start: 8px; }
.menu-btn {
  display: none; width: 44px; height: 44px; flex: none; place-items: center; cursor: pointer;
  border-radius: 12px; border: 2px solid var(--gold-line); background: rgba(34, 40, 90, .8); color: var(--gold);
}
.menu-btn svg { width: 24px; height: 24px; }
.menu-btn[aria-expanded="true"] { background: var(--panel-3); border-color: var(--gold); }
@media (max-width: 859px) {
  .topbar .btn { margin-inline-start: auto; }
  .js .menu-btn { display: grid; }
  .js .nav {
    display: none; position: absolute; top: calc(100% + 1px); inset-inline: 0; margin: 0;
    flex-direction: column; gap: 2px; padding: 8px var(--gutter) 14px;
    background: rgba(11, 15, 46, .97); border-bottom: 2px solid var(--gold-line); box-shadow: 0 20px 30px -10px rgba(0, 0, 0, .7);
  }
  .js .nav.is-open { display: flex; }
  .js .nav a { min-height: 48px; font-size: 1.05rem; }
  html:not(.js) .topbar__inner { flex-wrap: wrap; }
  html:not(.js) .nav { order: 3; width: 100%; flex-wrap: wrap; justify-content: center; }
}

/* ---------------------------------------------------------------- hero */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: 28px 0 40px; }
.hero__scene { position: absolute; inset: 0; z-index: -1; }
.layer { position: absolute; inset-inline: 0; will-change: transform; }
.layer--sky { inset: 0; background: linear-gradient(180deg, #f09678 0%, #f5b596 45%, #fde4c4 70%, var(--ink) 100%); }
.layer--far, .layer--mid { left: -4%; right: -4%; background-repeat: repeat-x; background-position: center bottom; }
.layer--far {
  bottom: 30%; height: 42%;
  background-image: url("../img/scene/sunset_far.png");
  background-image: image-set(url("../img/scene/sunset_far.webp") type("image/webp"), url("../img/scene/sunset_far.png") type("image/png"));
  background-size: auto 100%;
}
.layer--mid {
  bottom: 14%; height: 40%;
  background-image: url("../img/scene/sunset_mid.png");
  background-image: image-set(url("../img/scene/sunset_mid.webp") type("image/webp"), url("../img/scene/sunset_mid.png") type("image/png"));
  background-size: auto 100%;
}
.layer--cloud { width: 300px; height: 138px; background-size: contain; background-repeat: no-repeat; opacity: .85; }
.layer--cloud1 {
  top: 6%; left: 8%;
  background-image: url("../img/art/cloud_1.png");
  background-image: image-set(url("../img/art/cloud_1.webp") type("image/webp"), url("../img/art/cloud_1.png") type("image/png"));
  animation: drift 70s linear infinite;
}
.layer--cloud2 {
  top: 18%; left: 55%; width: 220px; height: 101px; opacity: .7;
  background-image: url("../img/art/cloud_2.png");
  background-image: image-set(url("../img/art/cloud_2.webp") type("image/webp"), url("../img/art/cloud_2.png") type("image/png"));
  animation: drift 95s linear infinite reverse;
}
@keyframes drift { from { transform: translateX(-12vw); } to { transform: translateX(12vw); } }
.layer--fade { inset: auto 0 0 0; height: 46%; background: linear-gradient(180deg, rgba(14, 18, 54, 0), rgba(14, 18, 54, .85) 55%, var(--ink)); }

.hero__inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: center;
}
.hero__copy { text-align: center; }
.eyebrow {
  display: inline-block; font-weight: 800; font-size: .92rem; letter-spacing: 0;
  color: var(--gold-hi); background: rgba(14, 18, 54, .55); border: 1px solid var(--gold-line);
  padding: 2px 14px; border-radius: 999px;
}
.hero .eyebrow { color: #fff3c4; background: rgba(60, 20, 30, .45); border-color: rgba(255, 233, 160, .5); }
.hero__title { display: grid; justify-items: center; gap: 0; margin-top: 10px; }
.hero__emblem { width: min(240px, 58vw); height: auto; filter: drop-shadow(0 8px 14px rgba(70, 20, 0, .45)); }
.hero__title span {
  font-size: clamp(3.4rem, 13vw, 6.2rem); line-height: 1.3; margin-top: -4px;
  position: relative; z-index: 1;   /* above the emblem (its drop-shadow filter paints over plain text): the dots of «ش» stay visible */
  color: #ffd84a;
  -webkit-text-stroke: 3px #5a2e00; paint-order: stroke fill;
  text-shadow: 0 5px 0 #5a2e00, 0 12px 22px rgba(60, 10, 0, .5);
}
.hero__lead {
  margin: 10px auto 20px; max-width: 34ch; font-size: clamp(1.08rem, 2.6vw, 1.3rem); font-weight: 700;
  color: #fffaf0; text-shadow: 0 2px 10px rgba(60, 10, 20, .75), 0 1px 0 rgba(60, 10, 20, .6);
}
.hero__note { margin-top: 12px; font-size: .95rem; font-weight: 700; color: #fff4dc; text-shadow: 0 1px 6px rgba(40, 10, 20, .8); }
.hero__note a { color: #fff; }

@media (min-width: 960px) {
  .hero { padding: 48px 0 72px; min-height: min(860px, calc(100vh - 62px)); display: flex; align-items: center; }
  .hero__inner { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; width: 100%; }
  .hero__copy { text-align: start; }
  .hero__title { justify-items: start; }
  .hero__lead { margin-inline: 0; }
  .hero .stores { justify-content: flex-start; }
}

/* ---------------------------------------------------------------- store buttons */
.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.store {
  display: inline-flex; align-items: center; gap: 12px; min-width: 196px; min-height: 60px;
  padding: 8px 18px 8px 22px; border-radius: 16px; text-decoration: none; color: #fff;
  background: linear-gradient(180deg, #2f3b8f, #1b2263); border: 2px solid var(--gold);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .22), 0 5px 0 #0a0d2a, var(--shadow);
  transition: transform .18s var(--ease), box-shadow .18s, filter .18s;
}
.store__icon { width: 30px; height: 30px; flex: none; color: var(--gold); }
.store__text { display: grid; line-height: 1.25; text-align: start; }
.store__text small { font-size: .82rem; font-weight: 700; color: var(--muted); }
.store__text b { font-family: var(--display); font-weight: 400; font-size: 1.45rem; }
.store--bazaar .store__icon { color: #8fe36a; }
.store--myket .store__icon { color: #6fd0ff; }
.store:hover { transform: translateY(-2px); filter: brightness(1.12); }
.store:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .22), 0 1px 0 #0a0d2a; }
.store[aria-disabled="true"] {
  cursor: default; border-color: rgba(255, 210, 70, .35); filter: saturate(.55);
  background: linear-gradient(180deg, rgba(47, 59, 143, .75), rgba(27, 34, 99, .75));
}
.store[aria-disabled="true"]:hover, .store[aria-disabled="true"]:active { transform: none; filter: saturate(.55); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .22), 0 5px 0 #0a0d2a, var(--shadow); }
.store[aria-disabled="true"] .store__icon { color: var(--muted); }
.stores--big .store { min-width: 230px; min-height: 72px; }
.stores--big .store__text b { font-size: 1.7rem; }

/* ---------------------------------------------------------------- castle toy */
.toy { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.toy__frame {
  position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 16 / 10;
  background: #7fb7e8;
  border: 4px solid var(--gold);
  box-shadow: 0 0 0 3px #6b3a00, 0 0 0 6px rgba(255, 210, 70, .35), 0 30px 60px -20px rgba(0, 0, 0, .8);
}
@media (max-width: 599px) { .toy__frame { aspect-ratio: 4 / 3; border-radius: 18px; } .toy__help { font-size: .85rem; } }
.toy__canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; display: block; }
.toy__canvas:focus-visible { outline: 4px solid var(--gold-hi); outline-offset: -6px; border-radius: 16px; }
.toy__hud {
  position: absolute; top: 10px; inset-inline-start: 10px; z-index: 2; pointer-events: none;
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 10px;
  background: rgba(20, 26, 80, .82); border: 2px solid var(--gold-line); border-radius: 999px;
  font-family: var(--display); font-size: 1rem; line-height: 1;
}
.toy__label { color: #ffd0c8; }
.toy__bar { width: clamp(70px, 14vw, 140px); height: 12px; border-radius: 999px; background: #0b0f2e; overflow: hidden; border: 1px solid rgba(255, 255, 255, .25); }
.toy__fill { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff8a6a, var(--red)); border-radius: inherit; transition: width .45s var(--ease); transform-origin: right; }
.toy__pct { color: #fff; min-width: 3ch; }
.toy__aim {
  position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2; pointer-events: none;
  display: flex; gap: 6px; font-family: var(--display); font-size: .98rem; line-height: 1;
  opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .2s;
}
.toy__aim span { background: rgba(20, 26, 80, .85); border: 2px solid var(--gold-line); border-radius: 10px; padding: 5px 10px; color: var(--muted); }
.toy__aim b { color: #fff; font-weight: 400; }
.toy.is-aiming .toy__aim { opacity: 1; transform: none; }
.toy__noscript { position: absolute; inset: auto 12px 12px; background: rgba(11, 15, 46, .85); padding: 8px 12px; border-radius: 12px; }
.toy__win {
  position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 6px;
  padding: 16px; text-align: center;
  background: radial-gradient(circle at 50% 45%, rgba(255, 210, 70, .28), rgba(11, 15, 46, .78) 62%);
  animation: winIn .5s var(--pop);
}
.toy__win[hidden] { display: none; }
.toy__win img { width: min(300px, 62%); height: auto; margin-bottom: -8px; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .5)); }
.toy__win-title { font-family: var(--display); font-size: clamp(1.6rem, 4.6vw, 2.4rem); color: var(--gold); text-shadow: 0 3px 0 #5a3000; outline: none; }
.toy__win-text { font-weight: 700; color: #fff; }
.toy__win-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }
@keyframes winIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.toy__caption { display: grid; gap: 2px; text-align: center; }
.toy__title { font-family: var(--display); font-size: 1.3rem; color: var(--gold); }
.toy__help { font-size: .9rem; color: var(--muted); }
.toy__tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.toy__tools { flex-wrap: nowrap; }
.arenas { flex: 1 1 auto; min-width: 0; display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px; scrollbar-width: none; max-width: 100%; }
.arenas::-webkit-scrollbar { display: none; }
.arenas button {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 12px 4px 10px;
  border-radius: 999px; border: 2px solid rgba(255, 255, 255, .14); background: rgba(21, 27, 75, .85);
  font-size: .88rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s;
}
.arenas button img { width: 26px; height: 26px; }
.arenas button:hover { border-color: var(--gold-line); }
.arenas button[aria-checked="true"] { border-color: var(--gold); background: var(--panel-3); color: #fff; }

/* ---------------------------------------------------------------- facts */
.facts { position: relative; padding: 8px var(--gutter) 24px; }
.facts__list {
  list-style: none; margin: 0 auto; padding: 0; max-width: var(--max);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.facts__list li {
  display: grid; justify-items: center; text-align: center; gap: 2px; padding: 16px 10px 14px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 2px solid var(--gold-line); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), var(--shadow);
}
.count { font-family: var(--display); font-weight: 400; font-size: clamp(2.6rem, 8vw, 3.6rem); line-height: 1.1; color: var(--gold); text-shadow: 0 3px 0 #5a3000; }
.facts__list span { font-size: .92rem; font-weight: 600; color: var(--muted); line-height: 1.6; }
@media (min-width: 760px) { .facts__list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }

/* ---------------------------------------------------------------- sections */
.section { padding: clamp(56px, 9vw, 110px) var(--gutter); max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; }
.section__head { text-align: center; display: grid; justify-items: center; gap: 10px; margin-bottom: clamp(26px, 4vw, 44px); }
.section__head h2 { font-size: clamp(2.1rem, 6vw, 3.4rem); color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.section__lead { max-width: 56ch; color: var(--muted); font-weight: 600; }

/* ---------------------------------------------------------------- how */
.how__body { display: grid; gap: 22px; align-items: center; }
.how__steps { display: grid; gap: 10px; }
.how__step {
  display: flex; gap: 14px; align-items: flex-start; text-align: start; padding: 14px 16px;
  background: rgba(34, 40, 90, .55); border: 2px solid rgba(255, 255, 255, .08); border-radius: var(--radius);
  cursor: pointer; transition: background .2s, border-color .2s, transform .2s var(--ease);
}
.how__step:hover { border-color: var(--gold-line); }
.how__step[aria-selected="true"] { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border-color: var(--gold); }
.how__num {
  flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%;
  font-family: var(--display); font-size: 1.5rem; line-height: 1; color: #3b2300;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); box-shadow: 0 3px 0 #6b3a00;
}
.how__step b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.3rem; color: #fff; line-height: 1.5; }
.how__step small { display: block; font-size: .93rem; color: var(--muted); line-height: 1.8; }
.device {
  position: relative; border-radius: 28px; padding: 10px; aspect-ratio: auto;
  background: linear-gradient(145deg, #2a2f4d, #0c0f22); border: 2px solid #3b4170;
  box-shadow: 0 0 0 2px #05060f, 0 40px 70px -30px rgba(0, 0, 0, .9);
}
.device img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 18px; transition: opacity .3s; }
.device.is-swapping img { opacity: .2; }
@media (min-width: 960px) { .how__body { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; } }

/* ---------------------------------------------------------------- heroes */
.heroes { max-width: none; padding-inline: 0; }
.heroes .section__head, .heroes__bar { padding-inline: var(--gutter); }
.heroes__bar { max-width: var(--max); margin: 0 auto 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; box-sizing: content-box; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 14px;
  border-radius: 999px; border: 2px solid rgba(255, 255, 255, .14); background: var(--ink-2); cursor: pointer;
  font-weight: 700; font-size: .95rem; transition: background .15s, border-color .15s;
}
.chip img { width: 22px; height: 22px; }
.chip:hover { border-color: var(--gold-line); }
.chip[aria-pressed="true"] { background: var(--panel-3); border-color: var(--gold); color: #fff; }
.heroes__nav { display: flex; gap: 8px; }
.round {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); color: #3b2300; border: 2px solid #6b3a00;
  box-shadow: 0 3px 0 #4a2800;
}
.round svg { width: 24px; height: 24px; }
.round:active { transform: translateY(2px); box-shadow: 0 1px 0 #4a2800; }
.heroes__list {
  list-style: none; margin: 0; padding: 12px var(--gutter) 24px;
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(168px, 44vw, 214px); gap: 14px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  scrollbar-width: thin; scrollbar-color: var(--gold-lo) transparent;
}
.hcard[hidden] { display: none; }
.hcard { scroll-snap-align: start; perspective: 1000px; }
.hero__card {
  --rc: var(--r-legendary);
  position: relative; display: block; width: 100%; aspect-ratio: 2 / 3; padding: 0; border: 0; background: none; cursor: pointer;
  transform-style: preserve-3d; transition: transform .6s var(--ease);
  border-radius: 16px;
}
.hcard[data-rarity="common"] .hero__card { --rc: var(--r-common); }
.hcard[data-rarity="rare"] .hero__card { --rc: var(--r-rare); }
.hcard[data-rarity="epic-blue"] .hero__card { --rc: var(--r-epic-blue); }
.hcard[data-rarity="epic"] .hero__card { --rc: var(--r-epic); }
.hero__card[aria-pressed="true"] { transform: rotateY(180deg); }
.hero__front, .hero__back {
  position: absolute; inset: 0; border-radius: 16px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: 3px solid var(--rc);
  box-shadow: 0 0 0 2px #0b0f2e, 0 14px 26px -12px rgba(0, 0, 0, .8), inset 0 0 0 2px rgba(255, 255, 255, .15);
}
.hero__front {
  display: block;
  background: radial-gradient(120% 70% at 50% 30%, color-mix(in srgb, var(--rc) 45%, #2c3577), #151b4b 75%);
}
.hero__front img { position: absolute; inset: 6% 4% 14%; width: 92%; height: 80%; object-fit: contain; object-position: center bottom; transition: transform .4s var(--ease); }
.hero__card:hover .hero__front img { transform: scale(1.05) translateY(-2px); }
.hero__name {
  position: absolute; inset: auto 0 0; padding: 26px 8px 22px; text-align: center;
  font-family: var(--display); font-size: 1.25rem; line-height: 1.2; color: #fff; text-shadow: 0 2px 0 #000;
  background: linear-gradient(180deg, transparent, rgba(8, 10, 32, .92) 55%);
}
.hero__rarity {
  position: absolute; bottom: 6px; inset-inline: 0; text-align: center; font-size: .75rem; font-weight: 800; color: var(--rc); line-height: 1.4;
}
.hero__back {
  transform: rotateY(180deg); display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 16px 14px;
  text-align: center; background: linear-gradient(180deg, var(--panel-2), var(--panel) 60%, #161c4c);
}
.hero__role { display: inline-flex; align-self: center; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .3); font-size: .82rem; font-weight: 800; color: var(--gold-hi); }
.hero__role img { width: 24px; height: 24px; }
.hero__title { font-family: var(--display); font-size: 1.45rem; line-height: 1.3; color: var(--rc); text-shadow: 0 2px 0 #000; }
.hero__desc { font-size: .93rem; font-weight: 600; line-height: 1.85; color: var(--cream); }

/* ---------------------------------------------------------------- features (bento) */
.bento { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.tile {
  position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 22px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel) 55%, #1a2052);
  border: 2px solid var(--gold-line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), var(--shadow);
}
.tile > img, .tile > picture > img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; border-bottom: 2px solid var(--gold-line); }
.tile__body { position: relative; padding: 18px 20px 22px; display: grid; gap: 6px; }
.tile__icon { position: absolute; top: -30px; inset-inline-start: 16px; width: 54px; height: 54px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .6)); }
.tile h3 { font-size: 1.55rem; color: var(--gold); margin-top: 10px; }
.tile p { color: var(--muted); font-weight: 600; font-size: .98rem; line-height: 1.9; }
.tile--pass { background: radial-gradient(90% 60% at 50% 0%, #4b3a9a, var(--panel) 70%); }
.pass__skins { display: flex; justify-content: center; align-items: flex-end; height: 210px; padding-top: 14px; border-bottom: 2px solid var(--gold-line); background: radial-gradient(60% 70% at 50% 100%, rgba(255, 210, 70, .35), transparent 70%); }
.pass__skins img { width: auto; height: 190px; margin-inline: -18px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .5)); transition: transform .4s var(--ease); }
.pass__skins img:nth-of-type(1) { transform: rotate(4deg); }
.pass__skins picture:nth-child(2) img { height: 200px; z-index: 1; position: relative; }
.pass__skins picture:nth-child(3) img { transform: rotate(-4deg); }
@media (max-width: 420px) { .pass__skins { height: 170px; } .pass__skins img { height: 150px; margin-inline: -22px; } .pass__skins picture:nth-child(2) img { height: 160px; } }
.tile--pass:hover .pass__skins picture:nth-child(1) img { transform: rotate(8deg) translateY(-6px); }
.tile--pass:hover .pass__skins picture:nth-child(3) img { transform: rotate(-8deg) translateY(-6px); }
@media (min-width: 700px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile--wide, .tile--banner { grid-column: 1 / -1; }
  .tile--banner { flex-direction: row; align-items: center; }
  .tile--banner > picture > img { width: 50%; aspect-ratio: 3 / 1; border-bottom: 0; border-inline-end: 2px solid var(--gold-line); }
  .tile--banner .tile__body { flex: 1; }
  .tile--banner .tile__icon { position: static; margin-bottom: -6px; }
}
@media (min-width: 1040px) {
  .bento { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile--wide { grid-column: span 2; grid-row: span 2; }
  .tile--wide > picture > img { aspect-ratio: 16 / 9; flex: 1; }
}

/* ---------------------------------------------------------------- arenas band */
.arenas-band {
  position: relative; padding: 34px 0 30px; text-align: center; overflow: hidden;
  background-color: #1d2a7a;
  background-image: url("../img/art/bg_pattern_tile.jpg");
  background-image: image-set(url("../img/art/bg_pattern_tile.webp") type("image/webp"), url("../img/art/bg_pattern_tile.jpg") type("image/jpeg"));
  background-size: 160px;
  border-block: 3px solid var(--gold);
  box-shadow: inset 0 0 80px rgba(5, 8, 30, .7);
}
.arenas-band__title { font-size: clamp(1.6rem, 4.6vw, 2.4rem); color: var(--gold); text-shadow: 0 3px 0 #000; padding: 0 var(--gutter); }
.marquee { margin-top: 18px; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee__track { list-style: none; margin: 0; padding: 0; display: flex; gap: 12px; width: max-content; animation: marquee 60s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track li {
  flex: none; font-family: var(--display); font-size: 1.2rem; line-height: 1; padding: 12px 18px 14px; border-radius: 14px;
  background: rgba(11, 15, 46, .78); border: 2px solid var(--gold-line); color: #fff;
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(50%); } }

/* ---------------------------------------------------------------- download */
.download__card {
  position: relative; display: grid; gap: 18px; align-items: center; overflow: hidden;
  padding: clamp(24px, 5vw, 48px); border-radius: 28px; text-align: center;
  background:
    radial-gradient(60% 80% at 15% 50%, rgba(255, 196, 50, .25), transparent 70%),
    linear-gradient(180deg, var(--panel-2), var(--panel) 60%, #171d50);
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 3px #6b3a00, 0 40px 80px -30px rgba(0, 0, 0, .9);
}
.download__art { display: grid; place-items: center; }
.download__chest { width: min(240px, 60vw); filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .55)); animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-1.5deg); } }
.download__body { display: grid; gap: 14px; justify-items: center; }
.download__body h2 { font-size: clamp(2.1rem, 6vw, 3.2rem); color: #fff; }
.version { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.version__pill { font-family: var(--display); font-size: 1.15rem; padding: 4px 14px 6px; border-radius: 999px; background: rgba(0, 0, 0, .3); border: 2px solid var(--gold-line); }
.version__pill b { font-weight: 400; color: var(--gold); }
.version__date { color: var(--muted); font-weight: 700; font-size: .95rem; }
.version__date[hidden] { display: none; }
.notes { width: 100%; max-width: 560px; text-align: start; padding: 14px 18px; border-radius: 16px; background: rgba(11, 15, 46, .45); border: 1px solid rgba(255, 255, 255, .1); }
.notes[hidden] { display: none; }
.notes h3 { font-size: 1.25rem; color: var(--gold); margin-bottom: 4px; }
.notes ul { margin: 0; padding-inline-start: 22px; display: grid; gap: 4px; }
.notes li { font-size: .95rem; font-weight: 600; color: var(--cream); line-height: 1.8; }
.notes li::marker { color: var(--gold); }
.download__req { font-size: .9rem; color: var(--muted); font-weight: 600; }
/* direct download (assets/download.js): the main button while the game is not in the stores */
.store--direct { background: linear-gradient(180deg, #3fae3c, #1f7a2a); border-color: var(--green-hi); }
.store--direct .store__icon { color: #fff; }
.store--direct .store__text small { color: #e6ffd9; }
.direct {
  display: grid; gap: 10px; justify-items: center; width: 100%; max-width: 560px; padding: 16px 18px;
  border-radius: 18px; background: rgba(31, 122, 42, .18); border: 2px solid rgba(143, 227, 106, .45); text-align: center;
}
.direct__btn { width: min(100%, 360px); min-height: 64px; font-size: 1.6rem; padding: 8px 28px 10px; }
.direct__btn svg { width: 28px; height: 28px; flex: none; }
.btn[aria-disabled="true"] { cursor: default; filter: grayscale(.75); opacity: .75; transform: none; }
.direct__meta { font-weight: 800; color: #fff; font-size: 1rem; }
.direct__meta span { white-space: nowrap; }
.direct__note { font-size: .92rem; color: var(--muted); font-weight: 600; }
.direct__meta[hidden], .direct__note[hidden], [data-apk-check][hidden] { display: none; }
@media (min-width: 900px) {
  .download__card { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); text-align: start; }
  .download__body { justify-items: start; }
  .download__body .stores, .version { justify-content: flex-start; }
  .download__chest { width: min(300px, 100%); }
}

/* ---------------------------------------------------------------- FAQ */
.faq__list { max-width: 820px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { border-radius: var(--radius); background: rgba(34, 40, 90, .6); border: 2px solid rgba(255, 255, 255, .08); transition: border-color .2s, background .2s; }
.faq details[open] { border-color: var(--gold-line); background: rgba(34, 40, 90, .9); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; font-weight: 800; font-size: 1.05rem; min-height: 56px; border-radius: var(--radius);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
  font-family: var(--display); font-size: 1.5rem; line-height: 1; color: #3b2300; background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
  transition: transform .25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 18px 18px; color: var(--muted); font-weight: 600; }

/* ---------------------------------------------------------------- footer */
.footer { border-top: 2px solid var(--gold-line); background: var(--night); padding: 34px var(--gutter) calc(30px + env(safe-area-inset-bottom)); }
.footer__inner { max-width: var(--max); margin: 0 auto; display: grid; gap: 16px; justify-items: center; text-align: center; }
.footer__brand { display: grid; justify-items: center; gap: 4px; }
.footer__brand img { width: 120px; }
.footer__brand p { color: var(--muted); font-weight: 600; }
.footer__brand b { color: var(--gold); font-family: var(--display); font-weight: 400; font-size: 1.2rem; }
.footer__links { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; }
.footer__links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--cream); font-weight: 700; padding: 4px 6px; }
.footer__links a:hover { color: var(--gold); }
.footer__copy { font-size: .85rem; color: #8f96c0; }

/* ---------------------------------------------------------------- reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- privacy page */
.page-hero { position: relative; overflow: hidden; padding: 46px var(--gutter) 40px; text-align: center; border-bottom: 2px solid var(--gold-line);
  background:
    linear-gradient(180deg, rgba(14, 18, 54, .35), var(--ink)),
    url("../img/art/bg_pattern_tile.jpg");
  background-size: auto, 160px;
}
.page-hero h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); color: var(--gold); text-shadow: 0 3px 0 #5a3000; }
.page-hero p { margin: 8px auto 0; max-width: 60ch; color: var(--muted); font-weight: 600; }
.doc { max-width: 780px; margin: 0 auto; padding: 36px var(--gutter) 70px; }
.doc section { padding: 20px 22px; margin-bottom: 14px; border-radius: var(--radius); background: rgba(34, 40, 90, .55); border: 1px solid rgba(255, 255, 255, .08); }
.doc h2 { font-size: 1.5rem; color: var(--gold); margin-bottom: 6px; }
.doc p, .doc li { color: var(--cream); font-weight: 500; line-height: 2.05; }
.doc ul { margin: 0; padding-inline-start: 22px; display: grid; gap: 8px; }
.doc li::marker { color: var(--gold); }
.doc .back { display: inline-flex; margin-top: 10px; }
.doc .updated { color: var(--muted); font-size: .9rem; margin-top: 16px; text-align: center; }

/* ---------------------------------------------------------------- download page */
.dl { max-width: 780px; margin: 0 auto; padding: 30px var(--gutter) 70px; display: grid; gap: 18px; justify-items: center; }
.dl .direct { max-width: none; }
.dl .doc { padding: 0; width: 100%; }
.notice { width: 100%; padding: 14px 18px; border-radius: var(--radius); background: rgba(255, 210, 70, .12); border: 2px solid var(--gold-line); font-weight: 700; color: var(--cream); line-height: 2; }
.doc p + p { margin-top: 8px; }
.steps { counter-reset: step; list-style: none; padding: 0 !important; }
.steps li { counter-increment: step; position: relative; padding-inline-start: 46px; min-height: 36px; }
.steps li::before {
  content: counter(step, persian); position: absolute; inset-inline-start: 0; top: 2px; width: 34px; height: 34px;
  display: grid; place-items: center; border-radius: 50%; font-family: var(--display); line-height: 1;
  color: #3b2300; background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
}
.doc .faq { margin-top: 12px; }
.hashes { padding: 0 18px 18px; display: grid; gap: 6px; }
.faq .hashes p { padding: 0; }
.hash { display: block; direction: ltr; text-align: left; font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: .85rem; line-height: 1.6; word-break: break-all; user-select: all; background: rgba(0, 0, 0, .35); padding: 8px 10px; border-radius: 10px; color: var(--gold-hi); }
.hash--inline { display: inline; padding: 1px 6px; }
/* the inviter's username on /i/<username> (Persian or Latin) */
.invite-user { color: var(--gold-hi); unicode-bidi: isolate; word-break: break-word; }

/* ---------------------------------------------------------------- 404 */
.lost { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 40px var(--gutter); }
.lost h1 { font-size: clamp(2.4rem, 8vw, 4rem); color: var(--gold); }
.lost p { color: var(--muted); font-weight: 600; }

/* ---------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .layer { will-change: auto; }
  .marquee__track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; padding: 0 var(--gutter); }
  .marquee { mask-image: none; -webkit-mask-image: none; }
  .js .reveal { opacity: 1; transform: none; }
}
