@font-face {
  font-family: Pofak;
  font-style: normal;
  font-weight: 100;
  font-display: swap;
  src:
    url("fonts/Pofak-Thin.woff2") format("woff2"),
    url("fonts/Pofak-Thin.woff") format("woff");
}

@font-face {
  font-family: Pofak;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src:
    url("fonts/Pofak-Regular.woff2") format("woff2"),
    url("fonts/Pofak-Regular.woff") format("woff");
}

@font-face {
  font-family: Pofak;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src:
    url("fonts/Pofak-Bold.woff2") format("woff2"),
    url("fonts/Pofak-Bold.woff") format("woff");
}

@font-face {
  font-family: Pofak;
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src:
    url("fonts/Pofak-Black.woff2") format("woff2"),
    url("fonts/Pofak-Black.woff") format("woff");
}

:root {
  --ink: #18201a;
  --night: #254449;
  --deep: #02343d;
  --field: #143236;
  --sand: #d9bb99;
  --sheet: #e7d4b4;
  --gold: #fec864;
  --gold-hi: #ffe29a;
  --cream: #f8f0dc;
  --paper: #fff8e6;
  --muted: #4a3828;

  /* The duel: Soosmur's blue vs. Eva's red, straight from the app icon */
  --blue: #58b4d6;
  --blue-hi: #a6dff0;
  --blue-deep: #2f86ad;
  --red: #c9552b;
  --red-hi: #d97d50;
  --red-deep: #a94a2a;

  --wrap: 1120px;
  --pop: cubic-bezier(0.2, 1.5, 0.4, 1);
  --burst: polygon(
    50% 0%, 58.7% 12%, 71.7% 5%, 74.3% 19.5%, 89.1% 18.8%, 85.1% 33.1%, 98.7% 38.9%,
    89% 50%, 98.7% 61.1%, 85.1% 66.9%, 89.1% 81.2%, 74.3% 80.5%, 71.7% 95%, 58.7% 88%,
    50% 100%, 41.3% 88%, 28.3% 95%, 25.7% 80.5%, 10.9% 81.2%, 14.9% 66.9%, 1.3% 61.1%,
    11% 50%, 1.3% 38.9%, 14.9% 33.1%, 10.9% 18.8%, 25.7% 19.5%, 28.3% 5%, 41.3% 12%
  );
  --dots: radial-gradient(circle at center, rgba(24, 32, 26, 0.16) 0 1.6px, transparent 2.2px);

  --pat-night:
    radial-gradient(ellipse 50% 44% at 0% 16%, rgba(132, 184, 82, 0.48), transparent 70%),
    radial-gradient(ellipse 44% 52% at 100% 0%, rgba(48, 120, 78, 0.55), transparent 68%),
    radial-gradient(ellipse 62% 38% at 58% 100%, rgba(8, 36, 26, 0.62), transparent 74%),
    radial-gradient(ellipse 24% 20% at 74% 38%, rgba(254, 200, 100, 0.18), transparent 70%);
  --pat-sand:
    radial-gradient(ellipse 75% 65% at 0% 0%, rgba(42, 88, 26, 0.55), transparent 68%),
    radial-gradient(ellipse 70% 60% at 100% 100%, rgba(54, 100, 30, 0.5), transparent 70%),
    linear-gradient(rgba(58, 96, 34, 0.2), rgba(58, 96, 34, 0.2));
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
  background: var(--field);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--field);
  background-image: var(--pat-night);
  background-attachment: fixed;
  color: var(--cream);
  font-family: Pofak, Tahoma, "Noto Naskh Arabic", sans-serif;
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.9;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

body.home {
  background: var(--ink);
}

img {
  max-width: 100%;
  height: auto;
}

button,
input {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

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

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.wrap {
  width: min(var(--wrap), calc(100% - 40px));
  margin-inline: auto;
}

main {
  flex: 1;
}

.home main {
  overflow-x: clip;
}

/* ───────────── Shared pieces ───────────── */

.stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.store-link {
  display: inline-flex;
  line-height: 0;
  border-radius: 12px;
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, 0.4));
  transition:
    translate 0.2s var(--pop),
    rotate 0.2s var(--pop),
    filter 0.2s ease;
}

.store-link:hover {
  translate: 0 -4px;
  rotate: -2deg;
  filter: drop-shadow(0 9px 0 rgba(0, 0, 0, 0.4));
}

.store-link:nth-child(even):hover {
  rotate: 2deg;
}

.store-link:active {
  translate: 0 2px;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.4));
}

.store-link img {
  height: 58px;
  width: auto;
}

/* Comic star-burst sticker */
.burst {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  color: var(--ink);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  filter: drop-shadow(4px 5px 0 var(--ink));
}

.burst::before,
.burst::after {
  content: "";
  position: absolute;
  z-index: -1;
  clip-path: var(--burst);
}

.burst::before {
  inset: 0;
  background: var(--ink);
}

.burst::after {
  inset: 5%;
  background: var(--gold);
}

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

.kicker {
  display: inline-block;
  padding: 0.12rem 1rem 0.02rem;
  background: var(--gold);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 1rem;
  font-weight: 900;
  rotate: -3deg;
}

.sec-head h2 {
  margin: 0.8rem 0 0;
  font-size: clamp(2.1rem, 4.8vw, 3.6rem);
  font-weight: 900;
  line-height: 1.2;
  text-wrap: balance;
}

.sec-head p {
  margin: 0.5rem auto 0;
  max-width: 34rem;
  font-size: 1.18rem;
  line-height: 1.75;
  text-wrap: pretty;
}

/* Reveal on scroll (only when JS is running) */
.js [data-reveal] {
  opacity: 0;
  translate: 0 36px;
  transition:
    opacity 0.45s ease,
    translate 0.65s var(--pop);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.js [data-reveal].is-in {
  opacity: 1;
  translate: 0 0;
}

/* Looping scenes rest while off screen */
.js .hero:not(.is-live) .fc,
.js .how:not(.is-live) .scene *,
.js .cast:not(.is-live) .roster img,
.js .download:not(.is-live)::before,
.js .download:not(.is-live) * {
  animation-play-state: paused;
}

/* ───────────── Hero ───────────── */

.hero {
  --mx: 0;
  --my: 0;
  --duel: clamp(280px, min(94vw, 100svh - 300px), 760px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--blue);
  text-align: center;
}

/* Halftone dots over the split */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--dots) 0 0 / 16px 16px;
  mask-image: linear-gradient(to bottom, transparent 5%, #000 75%);
  pointer-events: none;
}

.hero-logo {
  position: relative;
  z-index: 3;
  width: clamp(190px, 24vw, 330px);
  margin: clamp(14px, 2.4vh, 28px) 0 0;
  filter: drop-shadow(0 6px 0 rgba(24, 32, 26, 0.5));
  animation: drop-in 0.7s var(--pop) both;
}

.hero-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-duel {
  position: relative;
  flex: none;
  width: var(--duel);
  height: var(--duel);
  margin-top: calc(var(--duel) * -0.085);
}

/* Blue | red split, anchored to the slash between the two characters */
.hero-duel::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: 260vmax;
  height: 260vmax;
  translate: -50% -50%;
  background: linear-gradient(
    111deg,
    var(--blue-hi) calc(50% - 70vw),
    #4a9fbe calc(50% - 7px),
    var(--ink) calc(50% - 7px) calc(50% + 7px),
    var(--red-deep) calc(50% + 7px),
    var(--red-hi) calc(50% + 70vw)
  );
}

/* Speed lines */
.hero-duel::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 54%;
  z-index: -1;
  width: 170vmax;
  height: 170vmax;
  translate: -50% -50%;
  background: repeating-conic-gradient(from 3deg, rgba(255, 255, 255, 0.17) 0 5deg, transparent 5deg 15deg);
  mask-image: radial-gradient(circle, transparent 0 8%, #000 20%, transparent 58%);
}

.duel-art {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  translate: calc(var(--mx) * -12px) calc(var(--my) * -6px);
  transform-origin: 50% 100%;
  animation: pop-in 0.8s var(--pop) 0.12s both;
}

.duel-art .duel {
  display: block;
  width: 100%;
  height: 100%;
}

/* The branch in the art stops at the image edge; this carries it on to the top */
.branch {
  position: absolute;
  left: 65%;
  bottom: 99.8%;
  width: 26.5%;
  height: 40.2%;
}

.fc {
  --w: 1;
  --d: 16;
  position: absolute;
  z-index: 0;
  left: var(--x);
  top: var(--y);
  width: calc(clamp(58px, 8.4vw, 132px) * var(--w));
  height: auto;
  rotate: var(--r);
  translate: calc(var(--mx) * var(--d) * 1px) calc(var(--my) * var(--d) * 1px);
  filter: drop-shadow(5px 7px 0 rgba(24, 32, 26, 0.32));
  animation: bob var(--t, 4s) ease-in-out var(--dl, 0s) infinite alternate;
}

.fc-1 { --x: 7%; --y: 13%; --r: -16deg; --d: 26; }
.fc-2 { --x: 17%; --y: 47%; --r: 11deg; --w: 1.12; --d: 40; --t: 4.6s; --dl: -1.2s; }
.fc-3 { --x: 2.5%; --y: 58%; --r: -9deg; --w: 0.78; --d: 14; --t: 3.6s; --dl: -2.1s; }
.fc-4 { --x: 84%; --y: 12%; --r: 15deg; --d: 26; --t: 4.3s; --dl: -0.7s; }
.fc-5 { --x: 73%; --y: 46%; --r: -10deg; --w: 1.12; --d: 40; --t: 3.9s; --dl: -1.8s; }
.fc-6 { --x: 90%; --y: 57%; --r: 9deg; --w: 0.78; --d: 14; --t: 4.8s; --dl: -2.6s; }
.fc-7 { --x: 66%; --y: 5%; --r: -7deg; --w: 0.62; --d: 10; --t: 3.4s; --dl: -0.3s; }

.hero-panel {
  position: relative;
  z-index: 3;
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: -36px;
  padding: 50px 20px 46px;
  background: var(--ink);
  clip-path: polygon(0 28px, 100% 0, 100% 100%, 0 100%);
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold);
  clip-path: polygon(0 28px, 100% 0, 100% 7px, 0 35px);
}

.hero-panel-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 44px;
  width: min(var(--wrap), 100%);
  text-align: start;
}

.hero-line {
  margin: 0;
  color: var(--gold);
  font-size: clamp(2.4rem, 4.8vw, 4rem);
  font-weight: 900;
  line-height: 1.2;
  text-shadow: 0 0.07em 0 var(--red);
}

.hero-sub {
  margin: 0.35rem 0 0;
  max-width: 31rem;
  color: var(--cream);
  font-size: 1.14rem;
  line-height: 1.75;
  text-wrap: pretty;
}

@media (min-width: 801px) {
  .hero {
    min-height: min(100svh, 1000px);
  }
}

@keyframes drop-in {
  from {
    opacity: 0;
    transform: translateY(-40px) rotate(-4deg);
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.82) translateY(40px);
  }
}

@keyframes bob {
  from {
    transform: translateY(0) rotate(0deg);
  }
  to {
    transform: translateY(-16px) rotate(3deg);
  }
}

/* ───────────── How to play ───────────── */

.how {
  padding: 5.4rem 0 6rem;
  background:
    var(--dots) 0 0 / 18px 18px,
    linear-gradient(var(--cream), #f3e3c0);
  color: var(--ink);
  color-scheme: light;
}

.panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  list-style: none;
  margin: 3.4rem 0 0;
  padding: 0;
}

.panel {
  position: relative;
  padding: 0 1.2rem 1.5rem;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 8px 8px 0 var(--ink);
  text-align: center;
}

.panel:nth-child(1) {
  rotate: -1.4deg;
}

.panel:nth-child(2) {
  rotate: 1deg;
  margin-top: 16px;
  margin-bottom: -16px;
}

.panel:nth-child(3) {
  rotate: -0.8deg;
}

.panel-num {
  position: absolute;
  top: -24px;
  inset-inline-start: -16px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding-top: 0.15em;
  background: var(--red);
  color: var(--cream);
  border: 4px solid var(--ink);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
  rotate: -8deg;
}

.panel h3 {
  margin: 0;
  font-size: clamp(1.5rem, 2.3vw, 1.85rem);
  font-weight: 900;
  line-height: 1.35;
}

.panel p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
  text-wrap: pretty;
}

.scene {
  position: relative;
  height: 270px;
  margin: 0 -1.2rem 1.1rem;
  overflow: hidden;
  border-bottom: 4px solid var(--ink);
  border-radius: 20px 20px 0 0;
  perspective: 700px;
}

.scene::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: repeating-conic-gradient(from 0deg at 50% 55%, rgba(255, 255, 255, 0.2) 0 7deg, transparent 7deg 18deg);
}

.scene-draw {
  background: linear-gradient(160deg, var(--blue-hi), var(--blue));
}

.scene-pick {
  background: linear-gradient(160deg, var(--gold-hi), #f4b24a);
}

.scene-match {
  background: linear-gradient(160deg, #e79a6c, var(--red));
}

.scene img {
  position: absolute;
  height: auto;
  filter: drop-shadow(0 5px 0 rgba(24, 32, 26, 0.35));
}

/* Scene 1: draw a card you can't see */
.deck {
  bottom: 24px;
  left: calc(50% - 52px);
  width: 104px;
}

.d3 {
  translate: 10px 8px;
}

.d2 {
  translate: 5px 4px;
}

.draw-card {
  animation: draw 3.6s ease-in-out infinite;
}

.q {
  position: absolute;
  color: var(--cream);
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  text-shadow:
    3px 0 0 var(--ink),
    -3px 0 0 var(--ink),
    0 3px 0 var(--ink),
    0 -3px 0 var(--ink),
    2px 2px 0 var(--ink),
    -2px 2px 0 var(--ink),
    2px -2px 0 var(--ink),
    -2px -2px 0 var(--ink),
    0 7px 0 var(--ink);
  animation: q-pop 3.6s var(--pop) infinite;
}

.q1 {
  top: 34px;
  left: calc(50% - 118px);
  rotate: -16deg;
}

.q2 {
  top: 16px;
  left: calc(50% + 70px);
  font-size: 3.6rem;
  rotate: 14deg;
  animation-delay: 0.15s;
}

.q3 {
  top: 112px;
  left: calc(50% + 92px);
  font-size: 2.3rem;
  rotate: 24deg;
  animation-delay: 0.3s;
}

@keyframes draw {
  0%,
  12% {
    transform: translateY(0) rotate(0deg);
  }
  30% {
    transform: translateY(-44px) rotate(-8deg);
  }
  40% {
    transform: translateY(-44px) rotate(7deg);
  }
  50% {
    transform: translateY(-44px) rotate(-5deg);
  }
  60%,
  78% {
    transform: translateY(-44px) rotate(0deg);
  }
  92%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes q-pop {
  0%,
  28% {
    transform: scale(0);
  }
  40%,
  74% {
    transform: scale(1);
  }
  84%,
  100% {
    transform: scale(0);
  }
}

/* Scene 2: left or right? */
.pile {
  bottom: 22px;
  width: 96px;
}

.pile-l {
  left: calc(50% - 118px);
  rotate: -5deg;
}

.pile-r {
  left: calc(50% + 22px);
  rotate: 4deg;
}

.pick-card {
  top: 14px;
  left: calc(50% - 39px);
  width: 78px;
  animation: sway 2.8s ease-in-out infinite alternate;
}

.arrow {
  position: absolute;
  top: 52px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 3px 0 var(--ink);
  animation: nudge 5.6s ease-in-out infinite;
}

.arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arrow-l {
  left: calc(50% - 134px);
}

.arrow-r {
  left: calc(50% + 96px);
  animation-delay: -2.8s;
}

@keyframes sway {
  from {
    transform: translateX(-64px) rotate(-11deg);
  }
  to {
    transform: translateX(64px) rotate(11deg);
  }
}

@keyframes nudge {
  0%,
  100% {
    transform: scale(1.3);
    background-color: var(--paper);
  }
  30%,
  70% {
    transform: scale(0.85);
    background-color: #f1c979;
  }
}

/* Scene 3: it matched, take the pile */
.stack,
.flipper {
  bottom: 20px;
  left: calc(50% - 50px);
  width: 100px;
}

.stack.u2 {
  rotate: 9deg;
  translate: 12px 2px;
}

.stack.u1 {
  rotate: -9deg;
  translate: -12px 2px;
}

.flipper {
  position: absolute;
  aspect-ratio: 300 / 516;
  transform: rotateY(180deg);
  transform-style: preserve-3d;
  animation: match-card 4.8s ease-in-out infinite;
}

.stack {
  animation: pile 4.8s ease-in-out infinite;
}

.flipper img {
  inset: 0;
  width: 100%;
  filter: none;
  backface-visibility: hidden;
}

.flipper .f-front {
  transform: rotateY(180deg);
}

.pow {
  top: 12px;
  right: calc(50% - 150px);
  width: 124px;
  font-size: 1.28rem;
  rotate: 10deg;
  animation: pow 4.8s var(--pop) infinite;
}

.pow span {
  margin-top: 0.1em;
}

/* No opacity here: fading the flipper would flatten it and break the 3D flip.
   The card drops in from above and the whole pile is swept off the bottom. */
@keyframes match-card {
  0% {
    transform: translate(-74px, -320px) rotateY(0deg) rotate(-10deg);
  }
  10%,
  22% {
    transform: translate(-74px, -66px) rotateY(0deg) rotate(-10deg);
  }
  38% {
    transform: translate(-38px, -72px) rotateY(180deg) rotate(4deg);
  }
  50% {
    transform: translate(0, -8px) rotateY(180deg) rotate(0deg);
  }
  54%,
  84% {
    transform: translate(0, 0) rotateY(180deg) rotate(0deg);
  }
  95%,
  100% {
    transform: translate(0, 330px) rotateY(180deg) rotate(0deg);
  }
}

@keyframes pile {
  0% {
    transform: translateY(-330px);
  }
  9%,
  84% {
    transform: translateY(0);
  }
  95%,
  100% {
    transform: translateY(330px);
  }
}

@keyframes pow {
  0%,
  52% {
    transform: scale(0) rotate(-30deg);
  }
  60%,
  88% {
    transform: scale(1) rotate(0deg);
  }
  96%,
  100% {
    transform: scale(0) rotate(0deg);
  }
}

/* ───────────── Screenshots ───────────── */

.shots-sec {
  padding: 5.4rem 0 5.6rem;
  background-color: var(--field);
  background-image: var(--pat-night);
  color: var(--cream);
}

.shots-sec h2 {
  color: var(--gold);
  text-shadow: 0 0.07em 0 var(--ink);
}

.shots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  list-style: none;
  width: min(var(--wrap), calc(100% - 56px));
  margin: 3.2rem auto 0;
  padding: 0;
}

.frame {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  background: var(--deep);
  border: 5px solid var(--cream);
  border-radius: 26px;
  box-shadow:
    0 0 0 3px var(--ink),
    9px 11px 0 3px rgba(4, 20, 22, 0.75);
  color: inherit;
  cursor: zoom-in;
  rotate: var(--r, 0deg);
  transition:
    rotate 0.3s var(--pop),
    scale 0.3s var(--pop);
}

.frame:hover,
.frame:focus-visible {
  rotate: 0deg;
  scale: 1.06;
}

.shot {
  position: relative;
}

.shot:hover,
.shot:focus-within {
  z-index: 2;
}

.frame img {
  display: block;
  width: 100%;
  height: auto;
}

@keyframes hover-bob {
  from {
    transform: translateY(0) rotate(-3deg);
  }
  to {
    transform: translateY(-10px) rotate(3deg);
  }
}

/* ───────────── Characters ───────────── */

.cast {
  padding: 5.4rem 0 5rem;
  background-color: var(--sand);
  background-image: var(--pat-sand);
  color: var(--ink);
  color-scheme: light;
}

.versus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  max-width: 900px;
  margin: 7.4rem auto 0;
}

.fighter {
  position: relative;
  padding: 104px 14px 14px;
  border: 4px solid var(--ink);
  border-radius: 26px;
  box-shadow: 8px 8px 0 var(--ink);
  text-align: center;
}

.fighter.blue {
  background:
    var(--dots) 0 0 / 14px 14px,
    linear-gradient(160deg, var(--blue-hi), var(--blue));
  rotate: -1.6deg;
}

.fighter.red {
  background:
    var(--dots) 0 0 / 14px 14px,
    linear-gradient(200deg, var(--red-hi), var(--red));
  rotate: 1.6deg;
}

.fighter > img {
  position: absolute;
  top: -84px;
  left: calc(50% - 88px);
  width: 176px;
  filter: drop-shadow(0 8px 0 rgba(24, 32, 26, 0.3));
  transition: scale 0.3s var(--pop), rotate 0.3s var(--pop);
}

.fighter:hover > img {
  scale: 1.1;
  rotate: -5deg;
}

.fighter.red:hover > img {
  rotate: 5deg;
}

.fighter-body {
  padding: 0.9rem 1rem 1.1rem;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 16px;
}

.fighter h3 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  font-weight: 900;
  line-height: 1.3;
}

.role {
  display: inline-block;
  padding: 0 0.8rem;
  border-radius: 999px;
  color: var(--cream);
  font-size: 0.95rem;
  font-weight: 700;
}

.blue .role {
  background: #1f6d91;
}

.red .role {
  background: var(--red-deep);
}

.fighter p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
  text-wrap: pretty;
}

.vs {
  position: relative;
  z-index: 3;
  width: 104px;
  margin-inline: -30px;
}

.js .vs[data-reveal] {
  translate: 0 0;
  scale: 0;
  rotate: -90deg;
  transition:
    opacity 0.3s ease,
    scale 0.55s var(--pop),
    rotate 0.55s var(--pop);
  transition-delay: 0.3s;
}

.js .vs[data-reveal].is-in {
  scale: 1;
  rotate: 0deg;
}

.vs svg {
  width: 46%;
  fill: var(--ink);
}

.roster {
  margin-top: 3.4rem;
  text-align: center;
}

.roster ul {
  display: flex;
  justify-content: center;
  gap: clamp(6px, 2vw, 22px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.roster li {
  width: clamp(70px, 20vw, 112px);
}

.roster img {
  display: block;
  width: 100%;
  filter: drop-shadow(0 6px 0 rgba(24, 32, 26, 0.25));
  animation: hover-bob 3s ease-in-out infinite alternate;
  animation-delay: calc(var(--i, 0) * -0.8s);
}

.roster p {
  margin: 0.9rem 0 0;
  font-size: 1.3rem;
  font-weight: 900;
}

/* ───────────── Download ───────────── */

.download {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 5rem 0 5.4rem;
  background: var(--gold);
  color: var(--ink);
  color-scheme: light;
  text-align: center;
}

/* Slow sunburst */
.download::before {
  content: "";
  position: absolute;
  left: calc(50% - 60vmax);
  top: calc(50% - 60vmax);
  z-index: -1;
  width: 120vmax;
  height: 120vmax;
  background: repeating-conic-gradient(from 0deg, var(--gold-hi) 0 7.5deg, transparent 7.5deg 15deg);
  animation: spin 90s linear infinite;
}

.dl-icon {
  display: block;
  width: 136px;
  margin: 0 auto 1.3rem;
  border: 4px solid var(--ink);
  border-radius: 30px;
  box-shadow: 7px 7px 0 var(--ink);
  rotate: -6deg;
  animation: hover-bob 3.2s ease-in-out infinite alternate;
}

.download h2 {
  margin: 0 auto;
  font-size: clamp(2.5rem, 6.4vw, 4.4rem);
  font-weight: 900;
  line-height: 1.2;
  text-wrap: balance;
}

.download p {
  margin: 0.5rem auto 0;
  max-width: 28rem;
  font-size: 1.3rem;
  font-weight: 700;
}

.download .stores {
  margin-top: 1.7rem;
}

.dl-wave {
  position: absolute;
  bottom: -70px;
  right: max(2vw, calc(50% - 560px));
  width: clamp(150px, 17vw, 220px);
  filter: drop-shadow(0 0 0 var(--ink));
  transform-origin: 50% 100%;
  animation: wave 1.6s ease-in-out infinite alternate;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes wave {
  from {
    transform: rotate(-3deg);
  }
  to {
    transform: rotate(4deg);
  }
}

/* ───────────── Sticky download bar ───────────── */

.dock {
  position: fixed;
  z-index: 50;
  inset-inline: 0;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100% - 16px);
  margin-inline: auto;
  padding: 8px 10px;
  background: var(--cream);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 5px 5px 0 var(--ink);
  opacity: 0;
  visibility: hidden;
  translate: 0 150%;
  transition:
    translate 0.4s var(--pop),
    opacity 0.2s ease,
    visibility 0s 0.4s;
}

.dock.is-on {
  opacity: 1;
  visibility: visible;
  translate: 0 0;
  transition-delay: 0s;
}

.dock-icon {
  flex: none;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  border-radius: 12px;
}

.dock-text {
  display: flex;
  flex-direction: column;
  margin-inline-end: 8px;
  line-height: 1.3;
}

.dock-text strong {
  font-size: 1.1rem;
  font-weight: 900;
}

.dock-text small {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.dock .store-link {
  filter: none;
}

.dock .store-link img {
  height: 42px;
}

/* ───────────── Footer ───────────── */

.site-footer {
  background: #0f1511;
  color: rgba(246, 240, 228, 0.82);
  padding: 28px 0 36px;
}

/* Room for the sticky download bar */
.home .site-footer {
  padding-bottom: 96px;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
}

.footer-grid p {
  margin: 0;
}

a.footer-name {
  display: inline-block;
  font-weight: 900;
  font-size: 1.35rem;
  color: var(--cream);
  text-decoration: none;
}

.footer-grid a {
  font-weight: 700;
}

.footer-grid nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.site-footer a:hover {
  color: var(--gold);
}

.footer-grid .copyright {
  margin-top: 0.15rem;
  font-size: 0.92rem;
  color: rgba(246, 240, 228, 0.62);
}

/* ───────────── Sub-pages (privacy, terms, contact) ───────────── */

body.sub {
  background:
    var(--dots) 0 0 / 18px 18px,
    linear-gradient(var(--cream), #f3e3c0);
  color: var(--ink);
  color-scheme: light;
}

/* A short strip of the hero's blue | red duel */
.sub-head {
  position: relative;
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 22px 20px 60px;
  background:
    var(--dots) 0 0 / 16px 16px,
    repeating-conic-gradient(from 3deg at 50% 60%, rgba(255, 255, 255, 0.16) 0 5deg, transparent 5deg 15deg),
    linear-gradient(
      111deg,
      var(--blue-hi) 0%,
      #4a9fbe calc(50% - 6px),
      var(--ink) calc(50% - 6px) calc(50% + 6px),
      var(--red-deep) calc(50% + 6px),
      var(--red-hi) 100%
    );
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), 0 100%);
}

/* Ink and gold stripe along the slanted bottom edge */
.sub-head::before,
.sub-head::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 40px;
}

.sub-head::before {
  background: var(--ink);
  clip-path: polygon(0 calc(100% - 14px), 100% 0, 100% 14px, 0 100%);
}

.sub-head::after {
  background: var(--gold);
  clip-path: polygon(0 calc(100% - 11px), 100% 3px, 100% 11px, 0 calc(100% - 3px));
}

.sub-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: clamp(170px, 20vw, 230px);
  filter: drop-shadow(0 6px 0 rgba(24, 32, 26, 0.5));
  transition:
    rotate 0.25s var(--pop),
    scale 0.25s var(--pop);
}

.sub-logo:hover {
  rotate: -3deg;
  scale: 1.06;
}

.sub-logo img {
  display: block;
  width: 100%;
}

.sub-card {
  position: absolute;
  top: 16%;
  width: clamp(54px, 7vw, 84px);
  filter: drop-shadow(4px 6px 0 rgba(24, 32, 26, 0.32));
  animation: bob 4s ease-in-out infinite alternate;
}

.sub-card.l {
  left: max(4%, calc(50% - 430px));
  rotate: -14deg;
}

.sub-card.r {
  right: max(4%, calc(50% - 430px));
  rotate: 13deg;
  animation-delay: -1.6s;
}

.page {
  padding: 0 0 4.5rem;
}

.page-tabs {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: -26px;
  padding: 0 12px;
}

.page-tabs a {
  padding: 0.15rem 0.95rem 0.05rem;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.7;
  transition:
    translate 0.2s var(--pop),
    background-color 0.2s ease;
}

.page-tabs a:hover {
  translate: 0 -3px;
  background: var(--gold-hi);
}

.page-tabs a[aria-current="page"] {
  background: var(--gold);
  rotate: -2deg;
}

.page .wrap {
  width: min(46rem, calc(100% - 36px));
  margin-top: 2rem;
  padding: 2.4rem 2rem 2.8rem;
  background: var(--paper);
  color: var(--ink);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 9px 9px 0 var(--ink);
}

.page .wrap::after {
  content: "";
  display: block;
  clear: both;
}

.page h1 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(2.2rem, 5vw, 3.3rem);
  line-height: 1.25;
}

/* Section headings alternate the two duel colours */
.page h2 {
  margin: 2.2rem 0 0;
  padding-inline-start: 0.7rem;
  border-inline-start: 7px solid var(--red);
  font-weight: 900;
  font-size: 1.4rem;
  line-height: 1.5;
  scroll-margin-top: 20px;
}

.page h2:nth-of-type(even) {
  border-color: var(--blue);
}

.page p,
.page ul {
  max-width: none;
  margin: 0.5rem 0 0;
}

.page ul {
  padding-inline-start: 1.3rem;
}

.page li {
  margin-top: 0.4rem;
}

.page li::marker {
  color: var(--red);
}

.page .meta {
  margin-top: 0.7rem;
  font-size: 0.98rem;
  color: var(--muted);
}

.page h1 + .meta {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0 0.85rem;
  background: var(--gold-hi);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
}

.page .wrap a {
  color: #1c6485;
  font-weight: 700;
  text-decoration: underline 3px var(--gold);
  text-underline-offset: 4px;
}

.page .wrap a:hover {
  background: var(--gold);
  color: var(--ink);
}

.toc {
  margin-top: 1.5rem;
  padding: 0.9rem 1.1rem 1rem;
  background: #f6e9c9;
  border: 3px dashed var(--ink);
  border-radius: 16px;
}

.toc strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 900;
}

.toc ol {
  columns: 2;
  column-gap: 1.8rem;
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
}

.toc li {
  margin: 0;
  break-inside: avoid;
}

.page .wrap .toc a {
  display: block;
  padding: 0.08rem 0.3rem;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}

.page .wrap a.mail-button {
  display: inline-block;
  margin-top: 1.4rem;
  padding: 0.55rem 1.4rem 0.4rem;
  background: var(--gold);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.3;
  text-decoration: none;
  transition: translate 0.2s var(--pop), box-shadow 0.2s var(--pop);
}

.page .wrap a.mail-button:hover {
  translate: -2px -2px;
  background: var(--gold-hi);
  box-shadow: 6px 6px 0 var(--ink);
}

.page .wrap a.mail-button:active {
  translate: 3px 3px;
  box-shadow: 1px 1px 0 var(--ink);
}

/* Soosmur waving from the corner of the contact sheet */
.page-wave {
  float: left;
  float: inline-end;
  width: clamp(96px, 22vw, 160px);
  aspect-ratio: 635 / 780;
  margin: -0.4rem 0 0.8rem;
  margin-inline-start: 1.1rem;
  object-fit: cover;
  object-position: top;
  border-bottom: 4px solid var(--ink);
}

/* Download strip above the footer */
.page-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px 28px;
  padding: 2.2rem 20px 2.5rem;
  background:
    repeating-conic-gradient(from 0deg at 50% 130%, var(--gold-hi) 0 6deg, transparent 6deg 12deg),
    var(--gold);
  border-top: 4px solid var(--ink);
  color: var(--ink);
  text-align: center;
}

.page-cta-icon {
  width: 78px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 4px 4px 0 var(--ink);
  rotate: -6deg;
}

.page-cta p {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.6;
}

.page-cta strong {
  display: block;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .page .wrap {
    padding: 1.6rem 1.15rem 2rem;
  }

  .page-tabs {
    gap: 6px;
    padding: 0 8px;
  }

  .page-tabs a {
    padding-inline: 0.6rem;
    font-size: 0.86rem;
    box-shadow: 2px 3px 0 var(--ink);
  }

  .toc ol {
    columns: 1;
  }

  .page h2 {
    font-size: 1.28rem;
  }
}

/* ───────────── English pages (/en/) ───────────── */

@font-face {
  font-family: "SN Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/SNPro-Regular.woff") format("woff");
}

@font-face {
  font-family: "SN Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/SNPro-Bold.woff") format("woff");
}

@font-face {
  font-family: "SN Pro";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("fonts/SNPro-Black.woff") format("woff");
}

/* The game's own English font; Pofak stays in the stack for the odd Persian word */
html[lang="en"] body {
  font-family: "SN Pro", Pofak, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
}

html[lang="en"] :is(h1, h2, h3, .hero-line) {
  letter-spacing: -0.01em;
}

html[lang="en"] :is(.hero-sub, .sec-head p, .panel p, .fighter p) {
  line-height: 1.6;
}

/* Pofak sits low in its line box; these undo the nudges made for it */
html[lang="en"] .kicker {
  padding: 0.18rem 1rem;
}

html[lang="en"] .page-tabs a {
  padding-block: 0.1rem;
}

html[lang="en"] .panel-num {
  padding-top: 0;
}

html[lang="en"] .burst span {
  margin-top: 0;
}

html[lang="en"] .page .wrap a.mail-button {
  padding-block: 0.5rem;
}

/* ───────────── Lightbox ───────────── */

dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 10px;
  border: 4px solid var(--ink);
  border-radius: 22px;
  background: var(--cream);
  box-shadow: 10px 10px 0 #01161b;
  color: var(--ink);
}

dialog[open] {
  animation: pop-in 0.35s var(--pop);
}

dialog::backdrop {
  background: rgba(8, 14, 10, 0.82);
}

dialog img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(80vh, 820px);
  object-fit: contain;
  border-radius: 14px;
  background: var(--deep);
}

.lightbox-caption {
  margin: 8px 8px 0;
  font-weight: 900;
  line-height: 1.4;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  inset-inline-start: 18px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  box-shadow: 2px 3px 0 var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

/* ───────────── Smaller screens ───────────── */

@media (max-width: 1000px) {
  .panels {
    gap: 22px;
  }

  .shots {
    gap: 20px;
  }
}

@media (max-width: 800px) {
  .hero {
    --duel: clamp(280px, min(96vw, 100svh - 340px), 520px);
  }

  .fc-3,
  .fc-6,
  .fc-7 {
    display: none;
  }

  .fc-1 { --x: 3%; --y: 7%; }
  .fc-2 { --x: -3%; --y: 40%; }
  .fc-4 { --x: 82%; --y: 9%; }
  .fc-5 { --x: 85%; --y: 42%; }

  .hero-panel {
    padding: 46px 18px 40px;
  }

  .hero-panel-in {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  .hero-sub {
    margin-inline: auto;
    font-size: 1.06rem;
  }

  .how,
  .shots-sec,
  .cast {
    padding-block: 4rem 4.2rem;
  }

  .panels {
    grid-template-columns: 1fr;
    gap: 44px;
    width: min(380px, 100%);
    margin-inline: auto;
  }

  .panel:nth-child(2) {
    margin-block: 0;
  }

  .scene {
    height: 250px;
  }

  /* Screenshots become a swipeable row */
  .shots {
    display: flex;
    gap: 18px;
    width: 100%;
    margin-top: 1.6rem;
    padding: 22px 24px 30px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .shots::-webkit-scrollbar {
    display: none;
  }

  .shot {
    flex: 0 0 min(66vw, 290px);
    scroll-snap-align: center;
  }

  .frame:hover,
  .frame:focus-visible {
    scale: 1;
  }

  .versus {
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 420px;
    margin-top: 6.6rem;
  }

  .vs {
    margin: -8px auto 62px;
    width: 92px;
  }

  .download {
    padding-bottom: 0;
  }

  .dl-wave {
    position: static;
    display: block;
    width: 150px;
    margin: 1.6rem auto -60px;
  }

  .store-link img {
    height: 52px;
  }
}

@media (max-width: 520px) {
  .dock-text {
    display: none;
  }

  .dock {
    gap: 8px;
  }

  .dock .store-link img {
    height: 40px;
  }
}

@media (max-width: 440px) {
  .store-link img {
    height: 46px;
  }

  .footer-grid,
  .footer-grid nav {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 360px) {
  .dock .store-link img {
    height: 34px;
  }

  .dock-icon {
    width: 38px;
    height: 38px;
  }
}

/* ───────────── Preferences ───────────── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js [data-reveal],
  .js .vs[data-reveal] {
    opacity: 1;
    translate: none;
    scale: 1;
    rotate: 0deg;
  }
}

@media (forced-colors: active) {
  .frame,
  .panel,
  .fighter,
  .dock,
  .mail-button,
  .page .wrap,
  dialog {
    border: 2px solid CanvasText;
    box-shadow: none;
  }
}
