/* DragonWar public site. Tokens follow design/prototype/prototype.html (docs/08). */
@font-face {
  font-family: 'Inter Display';
  src: url('/site/inter-display-900.d41e0cfa8d.woff') format('woff');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink-deep: #1a0e06;
  --bg: #140a04;
  --wood-2: #5b3519;
  --wood-3: #3d220f;
  --wood-4: #2a1608;
  --gold: #ffd23a;
  --gold-dim: #c9a24a;
  --gold-deep: #8a5a12;
  --parchment: #f7ecd2;
  --parchment-2: #ead6aa;
  --muted: #d9c39a;
  --cta-1: #ffe48a;
  --cta-2: #f6b42c;
  --cta-3: #d9861a;
  --cta-ink: #3a1804;
  --r-common: #b4bcc8;
  --r-rare: #6aa8ff;
  --r-epic: #c08cf2;
  --r-legendary: #ffb020;
  --r-ancient: #ff6a5c;
  --e-plasma: #48e0ff;
  --e-crystal: #b07cff;
  --e-fire: #ff7a1a;
  --e-lightning: #ffe14a;
  --e-ice: #9fe6ff;
  --e-wind: #8fe3b0;
  --e-shadow: #9a7cf0;
  --e-water: #2fa8e8;
  /* Inter Display is Latin only: Thai, Devanagari and CJK fall through to the system fonts listed after it. */
  --fs:
    'Noto Sans Thai', Thonburi, 'Leelawadee UI', 'Noto Sans Devanagari', 'Kohinoor Devanagari',
    'Nirmala UI', 'Mangal';
  --fd:
    'Inter Display', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'Noto Sans', 'Hiragino Sans', 'Apple SD Gothic Neo', 'Malgun Gothic', 'PingFang TC',
    'Microsoft JhengHei', var(--fs), sans-serif;
  --fb:
    system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans',
    'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Apple SD Gothic Neo', 'Malgun Gothic',
    'PingFang TC', 'Microsoft JhengHei', var(--fs), sans-serif;
  --r-m: 18px;
  --r-l: 26px;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg) radial-gradient(ellipse at 50% -10%, #3a1f0c 0, var(--bg) 60%) no-repeat;
  color: var(--parchment);
  font: 400 1.0625rem/1.65 var(--fb);
  overflow-x: hidden;
}

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

a {
  color: var(--gold);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--cta-1);
}

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

h1,
h2,
h3 {
  font-family: var(--fd);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 7vw, 3.6rem);
  color: var(--gold);
  text-shadow:
    0 3px 0 var(--ink-deep),
    0 0 24px rgb(0 0 0 / 0.6);
}

h2 {
  font-size: clamp(1.6rem, 4.5vw, 2.3rem);
  color: var(--gold);
}

h3 {
  font-size: 1.2rem;
  color: var(--parchment);
}

p {
  margin: 0 0 1em;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip:focus {
  left: 16px;
  top: 8px;
  z-index: 10;
  background: var(--gold);
  color: var(--cta-ink);
  padding: 12px 16px;
  border-radius: 10px;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.top {
  background: linear-gradient(var(--wood-4), rgb(42 22 8 / 0.92));
  border-bottom: 2px solid var(--gold-deep);
  position: relative;
  z-index: 5;
}

.top .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  font: 900 1.35rem/1 var(--fd);
  color: var(--gold);
  text-decoration: none;
  margin-right: auto;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.nav-wrap {
  order: 3;
  width: 100%;
}

.nav {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--parchment);
  text-decoration: none;
  font-weight: 700;
}

.nav a:hover,
.nav a[aria-current='page'] {
  background: var(--wood-3);
  color: var(--gold);
}

.nav .nav-play {
  margin-left: auto;
}

.nav .nav-play a {
  background: linear-gradient(var(--cta-1), var(--cta-2) 55%, var(--cta-3));
  color: var(--cta-ink);
  font-family: var(--fd);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.nav .nav-play a:hover {
  filter: brightness(1.08);
  color: var(--cta-ink);
}

/* Language switcher: <details>, works without JS */
.lang {
  position: relative;
}

.lang summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  min-width: 48px;
  padding: 0 14px;
  border: 1px solid var(--gold-deep);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  color: var(--parchment);
}

.lang summary::-webkit-details-marker {
  display: none;
}

.lang summary::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.lang[open] summary {
  background: var(--wood-3);
}

.lang ul {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: min(320px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--wood-4);
  border: 2px solid var(--gold-deep);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.5);
}

.lang a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--parchment);
  text-decoration: none;
}

.lang a:hover,
.lang a[aria-current='true'] {
  background: var(--wood-3);
  color: var(--gold);
}

/* Hero: sky picture (cover) + one transparent dragon in a fixed-aspect box (no layout shift).
   Phones stack dragon above the copy; from 900px the copy sits left and the dragon faces it. */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--bg);
}

.hero-bg,
.hero-bg picture,
.hero-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-bg {
  z-index: -2;
}

.hero-bg img {
  object-fit: cover;
  object-position: 78% 50%;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(transparent 55%, var(--bg));
}

/* Phones: the sky only spans the dragon box, then fades into the page behind the copy. */
.hero-bg,
.hero::before,
.sky-lane {
  bottom: auto;
  height: calc(min(100vw - 32px, 560px) * 0.78 + 110px);
}

.hero-inner {
  display: grid;
  gap: 4px;
  padding-top: 12px;
  padding-bottom: 32px;
}

.hero-art {
  position: relative;
  width: min(100%, 560px);
  margin: 0 auto;
}

/* Ember glow behind the dragon */
.hero-art::before {
  content: '';
  position: absolute;
  inset: 8% 10% 4%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgb(255 138 42 / 0.5),
    rgb(255 90 20 / 0.18) 55%,
    transparent
  );
  filter: blur(8px);
  animation: ember 5s ease-in-out infinite;
}

/* The whole dragon glides up and down; the wing beats come from the sprite frames. */
.hero-fly {
  animation: hover 5.5s ease-in-out infinite;
  will-change: transform;
}

@keyframes hover {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }

  30% {
    transform: translate(-1.2%, -3.5%) rotate(-1.4deg);
  }

  65% {
    transform: translate(0.8%, -1%) rotate(0.6deg);
  }
}

@keyframes ember {
  0%,
  100% {
    opacity: 0.75;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* Sprite loops (src/fx.js sets --sheet, --n and --ms, then adds .live). The still <picture> keeps the box size
   and stays visible until the sheet is decoded; .paused when off-screen. */
.sprite {
  position: relative;
}

.sprite img {
  width: 100%;
  height: auto;
}

.sprite.live {
  background: var(--sheet) 0 0 / calc(var(--n) * 100%) 100% no-repeat;
  animation: sprite var(--ms) steps(var(--n), jump-none) infinite;
}

.sprite.live > picture {
  visibility: hidden;
}

@keyframes sprite {
  to {
    background-position-x: 100%;
  }
}

/* A far dragon crossing the sky, right to left, slightly hazy. */
.sky-lane {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.sky-dragon {
  position: absolute;
  top: 7%;
  left: 0;
  width: clamp(80px, 11vw, 170px);
  opacity: 0;
  filter: saturate(0.75) brightness(0.8) contrast(0.95);
}

.sky-dragon.live {
  opacity: 0.8;
  animation:
    sprite var(--ms) steps(var(--n), jump-none) infinite,
    glide 34s linear infinite;
}

.sky-dragon.paused,
.sprite.paused {
  animation-play-state: paused;
}

@keyframes glide {
  0% {
    transform: translate(105vw, 30px) scale(0.85);
  }

  50% {
    transform: translate(48vw, 0) scale(1);
  }

  100% {
    transform: translate(-25vw, 22px) scale(0.9);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-fly,
  .hero-art::before {
    animation: none;
  }

  .sky-lane {
    display: none;
  }
}

.hero-copy {
  position: relative;
}

.lead {
  font-size: 1.15rem;
  color: var(--parchment-2);
  max-width: 36em;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 26px;
  border-radius: 16px;
  font: 900 1.15rem/1 var(--fd);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.btn-play {
  background: linear-gradient(var(--cta-1), var(--cta-2) 55%, var(--cta-3));
  color: var(--cta-ink);
  border: 2px solid #ffe9a8;
  box-shadow:
    0 5px 0 #8a4a0c,
    0 10px 24px rgb(0 0 0 / 0.45);
  min-width: 220px;
  font-size: 1.35rem;
}

.btn-play:hover {
  color: var(--cta-ink);
  filter: brightness(1.07);
}

.btn-ghost {
  color: var(--parchment);
  border: 2px solid var(--gold-deep);
  background: rgb(26 14 6 / 0.6);
}

.btn-ghost:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
}

/* "Get it on Google Play" (PLAY_LIVE): same size as the other ghost CTA, with a play mark. */
.btn-store {
  gap: 10px;
  text-transform: none;
}

.btn-store .ic {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.badges li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--gold-deep);
  background: rgb(26 14 6 / 0.7);
  font-size: 0.92rem;
  color: var(--parchment-2);
}

.page-head {
  padding-top: 20px;
  padding-bottom: 8px;
}

/* Sections */
main section {
  padding: 36px 0;
}

main section + section {
  border-top: 1px solid rgb(138 90 18 / 0.35);
}

.cols {
  display: grid;
  gap: 24px;
  align-items: center;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  background: linear-gradient(var(--wood-3), var(--wood-4));
  border: 2px solid var(--gold-deep);
  border-radius: var(--r-m);
  padding: 18px;
}

.card h3 {
  color: var(--gold);
  margin-bottom: 0.35em;
}

.card p {
  margin: 0;
  color: var(--parchment-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--wood-4);
  border: 1px solid var(--wood-2);
  font-weight: 700;
  font-size: 0.95rem;
}

.chip::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
}

.el-plasma {
  color: var(--e-plasma);
}
.el-crystal {
  color: var(--e-crystal);
}
.el-fire {
  color: var(--e-fire);
}
.el-lightning {
  color: var(--e-lightning);
}
.el-ice {
  color: var(--e-ice);
}
.el-wind {
  color: var(--e-wind);
}
.el-shadow {
  color: var(--e-shadow);
}
.el-water {
  color: var(--e-water);
}
.ra-common {
  color: var(--r-common);
}
.ra-rare {
  color: var(--r-rare);
}
.ra-epic {
  color: var(--r-epic);
}
.ra-legendary {
  color: var(--r-legendary);
}
.ra-ancient {
  color: var(--r-ancient);
}

.label {
  font: 900 0.85rem/1 var(--fd);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 10px;
}

.dragons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.dragon {
  margin: 0;
  padding: 12px;
  border-radius: var(--r-m);
  border: 2px solid var(--wood-2);
  background: radial-gradient(circle at 50% 40%, #4a2a12, var(--wood-4) 70%);
  text-align: center;
}

.dragon .stage {
  aspect-ratio: 13 / 10;
  container-type: size;
  display: grid;
  place-items: center;
}

/* Fit the loop inside the stage whatever its aspect (--ar per dragon, generated). */
.dragon .sprite {
  width: min(100cqw, 100cqh * var(--ar, 1.3));
}

.dragon figcaption {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--parchment-2);
}

.dragon strong {
  display: block;
  font: 900 1.1rem/1.2 var(--fd);
  color: var(--parchment);
}

.faq {
  display: grid;
  gap: 12px;
}

.faq h3 {
  color: var(--gold);
  margin-bottom: 0.3em;
}

.faq div {
  background: var(--wood-4);
  border: 1px solid var(--wood-2);
  border-radius: var(--r-m);
  padding: 16px 18px;
}

.faq p {
  margin: 0;
  color: var(--parchment-2);
}

.final {
  text-align: center;
  padding: 44px 0 56px;
}

.final .cta-row {
  justify-content: center;
}

/* How to play */
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 8px 0 0;
  align-items: center;
  list-style: none;
  font-size: 0.95rem;
  color: var(--muted);
}

.crumbs li + li::before {
  content: '/';
  margin-right: 6px;
  color: var(--gold-deep);
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

.table-wrap {
  overflow-x: auto;
  border: 2px solid var(--gold-deep);
  border-radius: var(--r-m);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid rgb(138 90 18 / 0.35);
}

thead th {
  background: var(--wood-3);
  color: var(--gold);
  font-family: var(--fd);
  font-weight: 900;
}

tbody th {
  color: var(--parchment);
}

td {
  color: var(--parchment-2);
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 6px;
  border: 1px solid var(--gold-dim);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: var(--wood-4);
  font: 700 0.85em/1.4 var(--fb);
  text-align: center;
  color: var(--parchment);
}

.bullets {
  margin: 0 0 1em;
  padding-left: 1.2em;
}

.bullets li {
  margin-bottom: 0.4em;
}

.bullets li::marker {
  color: var(--gold);
}

/* Icons: one 24 px line set (src/icons.ts), colour from the parent. */
.ic {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.badges .ic {
  color: var(--gold);
}

.ibadge {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 10px;
  border-radius: 14px;
  color: var(--gold);
  background: radial-gradient(circle at 35% 30%, #6a3d16, var(--wood-4) 75%);
  border: 2px solid var(--gold-deep);
  box-shadow:
    inset 0 1px 0 rgb(255 228 138 / 0.25),
    0 4px 10px rgb(0 0 0 / 0.35);
}

.ibadge .ic {
  width: 26px;
  height: 26px;
}

/* Screenshot frame */
.shot {
  position: relative;
  border-radius: var(--r-l);
  border: 2px solid var(--gold-deep);
  overflow: hidden;
  box-shadow:
    0 0 0 4px rgb(26 14 6 / 0.8),
    0 18px 40px rgb(0 0 0 / 0.5);
}

.shot img {
  width: 100%;
}

/* Feature cards: real game picture on top, icon + text below. */
.fcards {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fcard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-l);
  border: 2px solid var(--gold-deep);
  background: linear-gradient(var(--wood-3), var(--wood-4));
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.4);
  transition:
    transform 0.25s ease,
    border-color 0.25s ease;
}

.fcard:hover {
  transform: translateY(-4px);
  border-color: var(--gold-dim);
}

.fart {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #10202e;
  border-bottom: 2px solid var(--gold-deep);
}

.fart img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.fcard:hover .fart img {
  transform: scale(1.04);
}

.fbody {
  padding: 0 18px 20px;
  margin-top: -26px;
  position: relative;
}

.fbody h3 {
  color: var(--gold);
  margin-bottom: 0.35em;
}

.fbody p {
  margin: 0;
  color: var(--parchment-2);
}

/* Marquee of mounted dragons: two rows sliding opposite ways over a warm sky. */
.marquee {
  display: grid;
  grid-template-rows: 1fr 1fr;
  align-content: center;
  background:
    radial-gradient(ellipse at 50% 120%, rgb(255 138 42 / 0.45), transparent 60%),
    linear-gradient(#1d3550, #4a3a4a 65%, #6a3a1e);
}

.mrow {
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding-bottom: 2%;
}

.track {
  display: flex;
  width: max-content;
  height: 100%;
  animation: marquee 60s linear infinite;
}

.mrow.rev .track {
  animation-direction: reverse;
  animation-duration: 70s;
}

.marquee .track img {
  width: auto;
  height: 100%;
  max-width: none;
  transform: none;
}

.track picture {
  height: 100%;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* Showcase dragons */
.dragon {
  position: relative;
  overflow: hidden;
}

.dragon::before {
  content: '';
  position: absolute;
  inset: 10% 15% 30%;
  border-radius: 50%;
  background: radial-gradient(closest-side, currentColor, transparent);
  opacity: 0.22;
  filter: blur(6px);
}

.dragon .stage,
.dragon figcaption {
  position: relative;
}

/* Hatchery: eggs on the straw nests wobble, chests glow. Positions in % of the picture. */
.hatch {
  margin: 0;
}

.hitem {
  position: absolute;
  width: 10%;
  transform-origin: 50% 92%;
  animation: wobble 4.8s ease-in-out infinite;
  filter: drop-shadow(0 6px 6px rgb(0 0 0 / 0.55));
}

.hitem img {
  width: 100%;
}

.h-egg-2km {
  left: 21%;
  top: 47%;
}

.h-egg-5km {
  left: 32%;
  top: 52%;
  animation-delay: -1.2s;
}

.h-egg-10km {
  left: 73%;
  top: 45%;
  animation-delay: -2.4s;
}

.h-egg-12km {
  left: 64.5%;
  top: 49%;
  animation-delay: -3.6s;
}

.h-chest-gold,
.h-chest-divine {
  left: 51%;
  top: 67%;
  animation-delay: -1.6s;
}

.h-chest-gold {
  left: 35%;
  top: 66%;
}

.h-chest-divine {
  left: 51%;
  top: 67%;
  animation-delay: -1.6s;
}

@keyframes wobble {
  0%,
  70%,
  100% {
    transform: rotate(0deg);
  }

  76% {
    transform: rotate(-7deg);
  }

  82% {
    transform: rotate(6deg);
  }

  88% {
    transform: rotate(-3deg);
  }

  94% {
    transform: rotate(2deg);
  }
}

@keyframes glow {
  0%,
  100% {
    filter: drop-shadow(0 6px 6px rgb(0 0 0 / 0.55)) drop-shadow(0 0 0 rgb(255 210 58 / 0));
  }

  50% {
    filter: drop-shadow(0 6px 6px rgb(0 0 0 / 0.55)) drop-shadow(0 0 14px rgb(255 210 58 / 0.8));
  }
}

/* Game modes: icon left of the title and text. */
.cards.modes {
  grid-template-columns: 1fr;
}

.modes .card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 46px auto;
  align-content: start;
  column-gap: 14px;
  transition: border-color 0.2s ease;
}

.modes .ibadge {
  grid-row: span 2;
  margin: 0;
}

.modes .card h3 {
  align-self: center;
  margin: 0;
}

.modes .card p {
  margin-top: 4px;
}

/* Announced modes: dashed rim, muted icon and a "coming soon" tag. */
.modes .card.soon {
  border-style: dashed;
  background: linear-gradient(rgb(61 34 15 / 0.6), rgb(42 22 8 / 0.6));
}

.modes .card.soon .ibadge {
  filter: grayscale(0.6) brightness(0.85);
}

.modes .card.soon p {
  color: var(--muted);
}

.soon-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  vertical-align: 0.15em;
  font: 900 0.68rem/1.2 var(--fd);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cta-ink);
  background: linear-gradient(var(--cta-1), var(--cta-2));
  white-space: nowrap;
}

.modes .card:hover {
  border-color: var(--gold-dim);
}

/* How to play: battle screenshot with callouts (boxes generated from the capture's layout.json). */
.battle {
  margin: 8px 0 28px;
}

.battle-img {
  position: relative;
}

.co {
  position: absolute;
  border: 3px solid var(--gold);
  border-radius: 14px;
  box-shadow:
    0 0 0 3px rgb(26 14 6 / 0.55),
    0 0 18px rgb(255 210 58 / 0.55);
  animation: pulse 2.4s ease-in-out infinite;
}

.co-wind,
.co-shot {
  border-radius: 50%;
}

.co b {
  position: absolute;
  left: -14px;
  top: -14px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(var(--cta-1), var(--cta-3));
  color: var(--cta-ink);
  font: 900 0.95rem/1 var(--fd);
  border: 2px solid var(--ink-deep);
}

.co em {
  display: none;
  position: absolute;
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgb(26 14 6 / 0.88);
  border: 2px solid var(--gold);
  color: var(--parchment);
  font: 900 1rem/1.1 var(--fd);
  font-style: normal;
  letter-spacing: 0.02em;
}

.co-angle em,
.co-power em {
  bottom: calc(100% + 10px);
  left: 18px;
}

.co-wind em,
.co-shot em {
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
}

@keyframes pulse {
  50% {
    box-shadow:
      0 0 0 3px rgb(26 14 6 / 0.55),
      0 0 28px rgb(255 210 58 / 0.9);
  }
}

.battle figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--gold-deep);
  background: var(--wood-4);
  color: var(--parchment);
  font-weight: 700;
}

.legend .ic {
  color: var(--gold);
}

.legend b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(var(--cta-1), var(--cta-3));
  color: var(--cta-ink);
  font: 900 0.85rem/1 var(--fd);
}

.legend b {
  order: -1;
}

.battle figcaption p {
  margin: 0;
}

/* Steps: picture on top, number badge over its corner. */
.steps {
  counter-reset: step;
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  counter-increment: step;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-l);
  border: 2px solid var(--gold-deep);
  background: linear-gradient(var(--wood-3), var(--wood-4));
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.4);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  z-index: 1;
  left: 14px;
  top: 14px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(var(--cta-1), var(--cta-3));
  color: var(--cta-ink);
  font: 900 1.4rem/1 var(--fd);
  border: 3px solid var(--ink-deep);
  box-shadow: 0 4px 10px rgb(0 0 0 / 0.5);
}

.sart {
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-bottom: 2px solid var(--gold-deep);
  background: #10202e;
}

.sart img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sbody {
  padding: 16px 18px 20px;
}

.steps h3 {
  margin-bottom: 0.25em;
  color: var(--gold);
}

.steps p {
  margin: 0;
  color: var(--parchment-2);
}

@media (prefers-reduced-motion: reduce) {
  .track,
  .hitem,
  .co {
    animation: none;
  }

  .fcard,
  .fart img {
    transition: none;
  }
}

/* Footer */
.foot {
  border-top: 2px solid var(--gold-deep);
  background: var(--wood-4);
  padding: 24px 0 32px;
  font-size: 0.95rem;
  color: var(--muted);
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 10px;
  color: var(--parchment-2);
}

.foot a[aria-current='true'] {
  color: var(--gold);
}

@media (min-width: 560px) {
  .cards.modes {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 640px) {
  .dragons {
    grid-template-columns: repeat(4, 1fr);
  }

  .co em {
    display: block;
  }

  .legend {
    display: none;
  }

  .fcards {
    grid-template-columns: repeat(2, 1fr);
  }

  .fcards > :first-child {
    grid-column: span 2;
  }

  .fcards > :first-child .fart {
    aspect-ratio: 21 / 9;
  }
}

@media (min-width: 760px) {
  .nav-wrap {
    order: 0;
    width: auto;
  }

  .nav .nav-play {
    margin-left: 6px;
  }

  .cols {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .steps {
    grid-template-columns: 1fr 1fr;
  }

  .cols.flip > :first-child {
    order: 2;
  }
}

@media (min-width: 1000px) {
  .cards.modes {
    grid-template-columns: repeat(3, 1fr);
  }

  .fcards {
    grid-template-columns: repeat(6, 1fr);
  }

  .fcards > * {
    grid-column: span 2;
  }

  .fcards > :nth-child(-n + 2) {
    grid-column: span 3;
  }

  .fcards > :first-child .fart {
    aspect-ratio: 16 / 10;
  }
}

@media (min-width: 900px) {
  .hero-bg,
  .hero::before,
  .sky-lane {
    bottom: 0;
    height: auto;
  }

  .hero::before {
    background:
      linear-gradient(
        90deg,
        rgb(20 10 4 / 0.94) 0,
        rgb(20 10 4 / 0.7) 34%,
        rgb(20 10 4 / 0.1) 62%,
        transparent 80%
      ),
      linear-gradient(transparent 78%, var(--bg));
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 24px;
    min-height: min(640px, 78vh);
    padding-top: 40px;
    padding-bottom: 56px;
  }

  .hero-art {
    order: 2;
    width: 100%;
    max-width: 640px;
    margin: 0 0 0 auto;
  }

  .hero-copy {
    order: 1;
  }
}

/* Guide pages (dragon list, bosses and maps, wind guide, FAQ, about) */
.nav {
  flex-wrap: wrap;
}

.cards.guides h3 a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--gold);
}

.dcards {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.dcard {
  scroll-margin-top: 16px;
}

.dcard .sub {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.dcard dl {
  display: grid;
  gap: 4px;
  margin: 0 0 10px;
}

.dcard dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgb(138 90 18 / 0.35);
  padding: 4px 0;
}

.dcard dt {
  color: var(--muted);
}

.dcard dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
  color: var(--parchment);
}

.dcard .label {
  margin: 0;
}

.chips.tier {
  margin: 10px 0 0;
}

.chips.tier a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--wood-4);
  border: 1px solid var(--wood-2);
  color: var(--parchment);
  font-weight: 700;
}

td small,
th small {
  color: var(--muted);
  font-weight: 400;
}

.foot .label {
  margin: 0 0 4px;
}

/* Traditional Chinese: Taiwanese glyph shapes first (Hiragino/Japanese forms otherwise win for shared Han). */
:lang(zh-TW) {
  --fd:
    'Inter Display', system-ui, -apple-system, 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC',
    'Segoe UI', Roboto, Arial, sans-serif;
  --fb:
    system-ui, -apple-system, 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', 'Segoe UI',
    Roboto, Arial, sans-serif;
}

/* Thai and Devanagari marks sit above and below the line: give one-line labels room. */
:lang(th) .btn,
:lang(hi) .btn {
  line-height: 1.35;
}

/* Google Play store badge (black, grey outline, four-colour logo) */
.gp-badge{display:inline-flex;align-items:center;gap:12px;min-height:56px;padding:8px 18px 8px 14px;border:1px solid #a6a6a6;border-radius:10px;background:#000;color:#fff;text-decoration:none;line-height:1;transition:transform .15s,box-shadow .15s}
.gp-badge:hover,.gp-badge:focus-visible{transform:translateY(-1px);box-shadow:0 6px 18px rgba(0,0,0,.35);color:#fff}
.gp-badge .gp-logo{flex:none;width:26px;height:30px}
.gp-badge .gp-txt{display:flex;flex-direction:column;align-items:flex-start;gap:2px}
.gp-badge small{font:500 11px/1 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;letter-spacing:.06em;text-transform:uppercase}
.gp-badge b{font:500 22px/1.05 "Product Sans",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;letter-spacing:-.01em}

/* generated by src/assets.ts */
.co-angle{left:5.8%;top:79.6%;width:14.2%;height:19.4%}
.co-power{left:24.3%;top:88.9%;width:42.9%;height:5.2%}
.co-wind{left:42.8%;top:1.1%;width:7.5%;height:16.7%}
.co-shot{left:49.2%;top:45.2%;width:4.6%;height:9.6%}
.sky-dragon{aspect-ratio:300/274}
.sp-blazehorn{--ar:1.2955}
.sp-frostchoir{--ar:1.0031}
.sp-gloomtide{--ar:1.0959}
.sp-fyrstjarna{--ar:0.9329}
