/* 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;
  --fd:
    'Inter Display', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'Noto Sans', 'Hiragino Sans', 'Apple SD Gothic Neo', 'Malgun Gothic', 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', 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 {
  bottom: auto;
  height: calc(min(100vw - 32px, 560px) * 0.75 + 110px);
}

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

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

/* Faint 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;
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: hover 6s ease-in-out infinite;
  will-change: transform;
}

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

  50% {
    transform: translateY(-3%) rotate(-1.2deg);
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  .hero-art img,
  .hero-art::before {
    animation: 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);
}

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

.badges li {
  padding: 4px 12px;
  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 img {
  width: 100%;
  aspect-ratio: 13 / 10;
  object-fit: contain;
}

.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);
}

.shot {
  border-radius: var(--r-l);
  border: 2px solid var(--gold-deep);
  overflow: hidden;
}

.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;
}

.steps {
  counter-reset: step;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 16px 18px 16px 70px;
  background: var(--wood-4);
  border: 1px solid var(--wood-2);
  border-radius: var(--r-m);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 14px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(var(--cta-1), var(--cta-3));
  color: var(--cta-ink);
  font: 900 1.2rem/1 var(--fd);
}

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

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

.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);
}

.diagram {
  margin: 8px 0 20px;
  max-width: 760px;
}

.diagram svg {
  width: 100%;
  height: auto;
  display: block;
  background: linear-gradient(#24324a, #3b2a2a 70%, #1d2a3a);
  border: 2px solid var(--gold-deep);
  border-radius: var(--r-m);
}

.diagram figcaption {
  margin-top: 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

.d-sea {
  fill: #1b4a6e;
}
.d-land {
  fill: #6b4a2a;
  stroke: #3d2a14;
  stroke-width: 2;
}
.d-grass {
  fill: #4f7a2e;
}
.d-unit {
  fill: var(--e-plasma);
  stroke: #0b2a33;
  stroke-width: 2;
}
.d-foe {
  fill: #ec4a3a;
  stroke: #4a0a06;
  stroke-width: 2;
}
.d-path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-dasharray: 8 7;
}
.d-angle {
  fill: none;
  stroke: var(--parchment);
  stroke-width: 2;
}
.d-wind {
  fill: none;
  stroke: var(--e-wind);
  stroke-width: 4;
  stroke-linecap: round;
}
.d-head {
  fill: var(--e-wind);
}
.d-crater {
  fill: #1d2a3a;
}
.d-text {
  fill: var(--parchment);
  font: 700 15px var(--fb);
}
.d-bar {
  fill: var(--wood-4);
  stroke: var(--gold-deep);
  stroke-width: 2;
}
.d-fill {
  fill: var(--cta-2);
}

/* 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: 640px) {
  .dragons {
    grid-template-columns: repeat(4, 1fr);
  }
}

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

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

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

@media (min-width: 900px) {
  .hero-bg,
  .hero::before {
    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;
  }
}
