/* Deckrypt site. Tokens mirror lib/game/ui/theme (colors.dart, spacing.dart,
   typography.dart, game_motion.dart) in the app repo. */

@font-face {
  font-family: "Cinzel";
  src: url("../fonts/cinzel.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "PhosphorFill";
  src: url("../fonts/phosphor-fill.woff2") format("woff2");
  font-display: block;
}
@font-face {
  font-family: "PhosphorRegular";
  src: url("../fonts/phosphor-regular.woff2") format("woff2");
  font-display: block;
}

:root {
  /* GameColors */
  --night: #0e0f1a;
  --surface: #171a2b;
  --surface-high: #20243a;
  --gold: #d9b56c;
  --gold-bright: #f2d48b;
  --gold-deep: #7e6a47; /* lerp(gold, night, .45): the frame's dark end */
  --ink: #ede7da;
  --ink-muted: #8a8fa8;
  --monster: #c2414b;
  --weapon: #a9c1d9;
  --shield: #4f7cc9;
  --potion: #3fbf8a;
  --gold-coin: #e6b84a;
  --trap: #e07b39;
  --scroll: #9b6be0;
  --key: #4cc3c3;
  --curse: #6b3fa0;
  --curse-glow: #d14fd1;
  --souls: #b9c6ff;
  --runes: #ff7ad9;
  /* DungeonTint */
  --tint-crypt: #4f6e70;
  --tint-catacombs: #9a8e78;
  --tint-mine: #c2552b;
  --tint-library: #4651b8;
  --tint-treasury: #c9a04a;
  --tint-abyss: #7a34b0;
  /* Radii */
  --r-card: 10px;
  --r-button: 14px;
  --r-panel: 16px;
  --r-sheet: 24px;
  /* Motion (Motion / GameMotion) */
  --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1); /* easeOutCubic */
  --ease-back: cubic-bezier(0.175, 0.885, 0.32, 1.275); /* easeOutBack */
  --t-press: 100ms;
  --t-lift: 120ms;
  --t-snap: 220ms;
  --t-deal: 320ms;
  /* Type */
  --display: "Cinzel", "Iowan Old Style", Georgia, serif;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 20px;
  --wrap: 1120px;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--night);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--night);
  color: var(--ink);
  font: 400 1rem/1.6 var(--ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

main {
  flex: 1;
}

main:focus {
  outline: none;
}

img,
svg,
picture {
  display: block;
  max-width: 100%;
}

a {
  color: var(--gold-bright);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: #fff1c6;
}

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

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem);
  color: var(--gold-bright);
  letter-spacing: 0.01em;
}

h3 {
  font-size: 1.375rem;
  color: var(--ink);
}

p {
  margin: 0 0 1em;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  border-radius: var(--r-button);
  background: var(--gold);
  color: var(--night);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.ph {
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  display: inline-block;
  speak: never;
}

.ph--fill {
  font-family: "PhosphorFill";
}

.ph--reg {
  font-family: "PhosphorRegular";
}

.eyebrow {
  margin: 0 0 0.75rem;
  font: 600 0.8125rem/1.3 var(--ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 10;
}

.site-header__in {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
}

.brand img {
  width: 34px;
  height: 34px;
}

.brand__name {
  font: 700 1.25rem/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff1c6 0%, var(--gold-bright) 42%, var(--gold) 58%, #a47b37 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background-color var(--t-snap) var(--ease-out), color var(--t-snap) var(--ease-out);
}

.site-nav a:hover {
  background: rgb(237 231 218 / 0.06);
  color: var(--gold-bright);
}

.site-nav a[aria-current="page"] {
  color: var(--gold-bright);
}

.lang {
  display: inline-flex;
  padding: 3px;
  border: 1px solid rgb(217 181 108 / 0.35);
  border-radius: 999px;
  background: rgb(14 15 26 / 0.6);
}

.lang__opt {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  font: 600 0.8125rem/1 var(--ui);
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  text-decoration: none;
}

.lang__opt[aria-current] {
  background: var(--gold);
  color: var(--night);
}

a.lang__opt:hover {
  color: var(--gold-bright);
}

@media (max-width: 560px) {
  .site-nav {
    display: none;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 96px;
  border-top: 1px solid rgb(217 181 108 / 0.18);
  background: linear-gradient(180deg, rgb(23 26 43 / 0.7), var(--night));
  font-size: 0.9375rem;
}

.site-footer__in {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 32px;
  padding-top: 48px;
  padding-bottom: 32px;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  align-self: start;
  gap: 14px;
}

.site-footer__brand p {
  margin: 0;
  color: var(--ink-muted);
}

.site-footer__name {
  font: 700 1.125rem/1.4 var(--display);
  letter-spacing: 0.06em;
  color: var(--gold-bright);
}

.site-footer__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.site-footer__nav a,
.site-footer__contact a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--ink);
  text-decoration: none;
}

.site-footer__nav a:hover,
.site-footer__contact a:hover {
  color: var(--gold-bright);
  text-decoration: underline;
}

.site-footer__nav a[aria-current="page"] {
  color: var(--gold-bright);
}

.site-footer__h {
  margin: 0 0 4px;
  font: 600 0.75rem/1.3 var(--ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.site-footer__contact a {
  overflow-wrap: anywhere;
}

.site-footer__legal {
  padding-top: 20px;
  padding-bottom: 32px;
  border-top: 1px solid rgb(138 143 168 / 0.15);
  color: var(--ink-muted);
  font-size: 0.8125rem;
}

.site-footer__legal p {
  margin: 0 0 4px;
}

.site-footer__legal a {
  color: var(--ink-muted);
}

@media (max-width: 760px) {
  .site-footer__in {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ---------- DeckCard (ux_spec §1.4) ----------
   Proportions are designed at a 76 px wide card (CardSizes.reference) and
   scale with the card through container units: 1 px at 76 = 1.3158cqw. */

.dc {
  --w: 96px;
  --c: var(--weapon);
  --glow: var(--c);
  --badge: var(--c);
  --on-badge: var(--night);
  container-type: inline-size;
  position: relative;
  width: var(--w);
  aspect-ratio: 3 / 4;
  flex: none;
}

.dc--monster { --c: var(--monster); --badge: #b03c46; --on-badge: var(--ink); }
.dc--weapon { --c: var(--weapon); }
.dc--shield { --c: var(--shield); }
.dc--potion { --c: var(--potion); }
.dc--gold { --c: var(--gold-coin); }
.dc--trap { --c: var(--trap); }
.dc--scroll { --c: var(--scroll); }
.dc--key,
.dc--chest { --c: var(--key); }
.dc--curse { --c: var(--curse); --glow: var(--curse-glow); --on-badge: var(--ink); }

.dc__face {
  position: absolute;
  inset: 0;
  border: 1.5px solid transparent;
  border-radius: 13.16cqw;
  overflow: hidden;
  background:
    linear-gradient(180deg, transparent calc(100% - 23.68cqw), rgb(14 15 26 / 0.55) 0) padding-box,
    radial-gradient(
        circle 68.4cqw at 50% 45%,
        color-mix(in srgb, var(--glow) 32%, transparent) 0%,
        color-mix(in srgb, var(--glow) 8%, transparent) 45%,
        transparent 100%
      )
      padding-box,
    linear-gradient(180deg, var(--surface-high), var(--surface)) padding-box,
    linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 45%, var(--gold-deep) 100%) border-box;
  box-shadow: 0 3px 6px rgb(0 0 0 / 0.4);
  transition: box-shadow var(--t-lift) var(--ease-out);
}

/* The faint inner rule, 3.5 px inside the frame. */
.dc__face::before {
  content: "";
  position: absolute;
  inset: 4.6cqw;
  border: 0.75px solid rgb(217 181 108 / 0.16);
  border-radius: 8.6cqw;
  pointer-events: none;
}

/* The ribbon's top line, brightest in the middle. */
.dc__face::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 23.68cqw;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--glow) 70%, transparent), transparent);
}

.dc__badge {
  position: absolute;
  z-index: 1;
  top: 6.58cqw;
  left: 6.58cqw;
  display: grid;
  place-items: center;
  min-width: 31.58cqw;
  height: 31.58cqw;
  padding: 0 3.95cqw;
  border-radius: 9.21cqw;
  background: var(--badge);
  color: var(--on-badge);
  box-shadow: inset 0 0 0 max(1px, 1.3cqw) rgb(14 15 26 / 0.35), 0 1.3cqw 5.3cqw rgb(0 0 0 / 0.45);
  font: 700 18.42cqw/1 var(--display);
  font-variant-numeric: tabular-nums lining-nums;
}

/* Badge shape groups the types: threats are cut-cornered, loot is round. */
.dc--monster .dc__badge,
.dc--trap .dc__badge,
.dc--curse .dc__badge {
  border-radius: 0;
  clip-path: polygon(
    9.21cqw 0, calc(100% - 9.21cqw) 0, 100% 9.21cqw, 100% calc(100% - 9.21cqw),
    calc(100% - 9.21cqw) 100%, 9.21cqw 100%, 0 calc(100% - 9.21cqw), 0 9.21cqw
  );
}

.dc--gold .dc__badge,
.dc--chest .dc__badge {
  border-radius: 999px;
  padding: 0;
  width: 31.58cqw;
}

.dc__icon {
  position: absolute;
  inset: 10.5cqw 0 23.68cqw;
  display: grid;
  place-items: center;
  font: 48cqw/1 "PhosphorFill";
  color: var(--glow);
  text-shadow: 0 2.6cqw 7.9cqw rgb(0 0 0 / 0.5);
}

.dc__ribbon {
  position: absolute;
  left: 5.26cqw;
  right: 5.26cqw;
  bottom: 0;
  height: 23.68cqw;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3.95cqw;
  font: 700 11.2cqw/1 var(--ui);
  letter-spacing: 1.05cqw;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
}

.dc__ribbon i {
  font: 11.84cqw/1 "PhosphorFill";
  font-style: normal;
  letter-spacing: 0;
  color: var(--glow);
}

/* A light sweep on entry, twice (GameMotion.shimmer). */
.dc__shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgb(242 212 139 / 0.2) 50%,
    transparent 65%
  );
  background-size: 300% 100%;
  background-position: 120% 0;
  mix-blend-mode: plus-lighter;
  opacity: 0;
}

.dc.is-shining .dc__shine {
  animation: shine 1100ms linear 2;
}

@keyframes shine {
  0% { background-position: 120% 0; opacity: 1; }
  100% { background-position: -20% 0; opacity: 1; }
}

/* ---------- Buttons and the Play badge ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--r-button);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--night);
  font: 600 1rem/1 var(--ui);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgb(217 181 108 / 0.18), inset 0 1px 0 rgb(255 255 255 / 0.35);
  transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-snap) var(--ease-out);
}

.btn:hover {
  color: var(--night);
  box-shadow: 0 8px 24px rgb(217 181 108 / 0.3), inset 0 1px 0 rgb(255 255 255 / 0.35);
}

.btn:active {
  transform: scale(0.96);
}

.btn--ghost {
  background: rgb(23 26 43 / 0.8);
  color: var(--ink);
  border: 1px solid rgb(217 181 108 / 0.4);
  box-shadow: none;
}

.btn--ghost:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
  box-shadow: none;
}

.btn .ph {
  font-size: 1.25rem;
}

.play-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 20px 8px 16px;
  border: 1px solid rgb(237 231 218 / 0.28);
  border-radius: 12px;
  background: #07080e;
  color: var(--ink);
  text-decoration: none;
  cursor: default;
}

.play-badge:hover {
  color: var(--ink);
}

.play-badge .ph {
  font-size: 30px;
  color: var(--ink);
}

.play-badge__text {
  display: grid;
  line-height: 1.1;
}

.play-badge__small {
  font: 600 0.6875rem/1.2 var(--ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.play-badge__big {
  font: 600 1.3125rem/1.15 var(--ui);
  letter-spacing: -0.01em;
}

/* ---------- Home: hero ---------- */

.page--home .site-header {
  position: absolute;
  inset: 0 0 auto;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 112px 0 72px;
  background:
    radial-gradient(ellipse 70% 60% at 72% 42%, rgb(52 48 106 / 0.75), transparent 70%),
    radial-gradient(ellipse 60% 50% at 20% 0%, rgb(70 81 184 / 0.18), transparent 70%),
    linear-gradient(180deg, #121428 0%, var(--night) 100%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 120px;
  background: linear-gradient(180deg, transparent, var(--night));
  pointer-events: none;
}

.motes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero__in {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
}

.hero__logo {
  margin: 0 0 24px;
  max-width: 500px;
}

.hero__logo img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 24px rgb(242 212 139 / 0.12));
}

.hero__name {
  display: block;
  margin-top: -2px;
  text-align: center;
  font: 600 0.875rem/1.2 var(--ui);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero__tagline {
  margin: 0 0 20px;
  font: 700 clamp(1.5rem, 1.1rem + 1.6vw, 2.125rem)/1.25 var(--display);
  color: var(--ink);
}

.hero__lead {
  max-width: 34em;
  font-size: 1.125rem;
  color: rgb(237 231 218 / 0.86);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 28px;
}

.hero__note {
  margin: 0;
  max-width: 22em;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.hero__art {
  position: relative;
  height: 480px;
}

.hero__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 470px;
  height: 470px;
  transform: translate(-50%, -50%);
  opacity: 0.9;
}

.hero__halo {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 420px;
  height: 420px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(242 212 139 / 0.16), transparent 65%);
}

.hero__emblem {
  position: absolute;
  left: 50%;
  top: 4%;
  width: 190px;
  transform: translateX(-50%) rotate(3deg);
}

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

.fan {
  position: absolute;
  left: 50%;
  top: 56%;
  width: 0;
  height: 0;
}

.fan .dc {
  --w: 132px;
  position: absolute;
  left: calc(var(--w) / -2);
  top: calc(var(--w) * -0.6667);
  transform: translate(var(--x), var(--y)) rotate(var(--r));
  transform-origin: 50% 120%;
  transition: transform var(--t-lift) var(--ease-out);
}

.fan .dc .dc__face {
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.5);
}

.fan .dc:nth-child(1) { --x: -166px; --y: 18px; --r: -16deg; }
.fan .dc:nth-child(2) { --x: -57px; --y: -6px; --r: -5deg; }
.fan .dc:nth-child(3) { --x: 54px; --y: -4px; --r: 5deg; }
.fan .dc:nth-child(4) { --x: 162px; --y: 20px; --r: 15deg; }

@media (hover: hover) {
  .fan .dc:hover {
    transform: translate(var(--x), calc(var(--y) - 14px)) rotate(var(--r)) scale(1.06);
  }

  .fan .dc:hover .dc__face {
    box-shadow: 0 16px 32px rgb(0 0 0 / 0.55);
  }
}

/* Deal-in on load (GameMotion.deal: 320 ms easeOutCubic, 60 ms stagger,
   a slight rotation settling; never from scale 0). */
.js .fan .dc {
  animation: fan-in var(--t-deal) var(--ease-out) both;
}

.js .fan .dc:nth-child(1) { animation-delay: 260ms; }
.js .fan .dc:nth-child(2) { animation-delay: 320ms; }
.js .fan .dc:nth-child(3) { animation-delay: 380ms; }
.js .fan .dc:nth-child(4) { animation-delay: 440ms; }

@keyframes fan-in {
  from {
    opacity: 0;
    transform: translate(0, 80px) rotate(0deg) scale(0.9);
  }
}

@media (max-width: 900px) {
  .hero {
    padding: 96px 0 40px;
  }

  .hero__in {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero__text {
    display: contents;
  }

  .hero__logo {
    order: 1;
    max-width: 420px;
    margin-inline: auto;
  }

  .hero__tagline {
    order: 2;
    text-align: center;
    margin-bottom: 0;
  }

  .hero__art {
    order: 3;
    height: 330px;
    margin-top: 4px;
  }

  .hero__lead {
    order: 4;
    margin-inline: auto;
    text-align: center;
    font-size: 1.0625rem;
  }

  .hero__cta {
    order: 5;
    justify-content: center;
    flex-direction: column;
    margin-top: 8px;
    text-align: center;
  }

  .hero__ring {
    width: 330px;
    height: 330px;
  }

  .hero__halo {
    width: 300px;
    height: 300px;
  }

  .hero__emblem {
    width: 128px;
    top: 2%;
  }

  .fan {
    top: 60%;
  }

  .fan .dc {
    --w: 92px;
  }

  .fan .dc:nth-child(1) { --x: -104px; --y: 12px; }
  .fan .dc:nth-child(2) { --x: -36px; --y: -4px; }
  .fan .dc:nth-child(3) { --x: 34px; --y: -3px; }
  .fan .dc:nth-child(4) { --x: 102px; --y: 13px; }
}

@media (max-width: 380px) {
  .fan .dc {
    --w: 84px;
  }

  .fan .dc:nth-child(1) { --x: -94px; }
  .fan .dc:nth-child(4) { --x: 92px; }
}

/* ---------- Home: sections ---------- */

.section {
  position: relative;
  padding: 88px 0;
}

.section--tinted::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at var(--tint-x, 50%) 35%, color-mix(in srgb, var(--tint) 20%, transparent), transparent 72%);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent);
  pointer-events: none;
}

.section > .wrap {
  position: relative;
}

.section__intro {
  max-width: 40em;
  color: rgb(237 231 218 / 0.86);
}

/* Room demo */

.room__in {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: center;
}

.room__text p {
  color: rgb(237 231 218 / 0.86);
}

.room__text p.room__aside {
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.board {
  --tint: var(--tint-crypt);
  position: relative;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 18px 22px;
  border-radius: var(--r-sheet);
  border: 1px solid rgb(217 181 108 / 0.45);
  background:
    radial-gradient(ellipse 70% 40% at 50% 78%, rgb(242 212 139 / 0.07), transparent 70%),
    linear-gradient(180deg, #222c34 0%, #131721 55%, var(--night) 100%);
  box-shadow: 0 30px 60px rgb(0 0 0 / 0.45), inset 0 1px 0 rgb(242 212 139 / 0.12);
}

.board__hud {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.board__life {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.board__life .ph {
  font-size: 22px;
  color: var(--monster);
}

.board__life-num {
  font: 700 1.125rem/1 var(--display);
  font-variant-numeric: tabular-nums;
  min-width: 3.4em;
}

.board__bar {
  flex: 1;
  max-width: 140px;
  height: 8px;
  border-radius: 999px;
  background: rgb(14 15 26 / 0.8);
  overflow: hidden;
}

.board__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f9e70, var(--potion));
  transition: width 400ms var(--ease-out), background-color 200ms;
}

.board__bar.is-low span {
  background: linear-gradient(90deg, #8e2c35, var(--monster));
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgb(217 181 108 / 0.3);
  background: rgb(14 15 26 / 0.65);
  font: 600 0.875rem/1 var(--ui);
  white-space: nowrap;
}

.chip .ph {
  font-size: 16px;
  color: var(--gold);
}

.board__room {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 34px 8px 10px;
  border-radius: 14px;
  border: 1px solid rgb(217 181 108 / 0.14);
  background: rgb(14 15 26 / 0.35);
}

.slot {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-card);
  background: rgb(14 15 26 / 0.45);
  box-shadow: inset 0 0 0 1px rgb(138 143 168 / 0.14);
}

.slot .dc {
  --w: 100%;
  position: absolute;
  inset: 0;
}

.play {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--r-card);
  background: none;
  cursor: pointer;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.play:focus-visible {
  outline-offset: 4px;
}

.slot .dc {
  transition: transform var(--t-lift) var(--ease-out);
}

@media (hover: hover) {
  .slot:hover .dc {
    transform: translateY(-4px) scale(1.06);
  }

  .slot:hover .dc__face {
    box-shadow: 0 10px 16px rgb(0 0 0 / 0.55);
  }
}

.slot:focus-within .dc {
  transform: translateY(-4px) scale(1.06);
}

.slot:focus-within .dc__face {
  box-shadow: 0 10px 16px rgb(0 0 0 / 0.55), 0 0 18px 2px rgb(242 212 139 / 0.6);
}

/* Outcome label over a room card, like the drop-target labels in the game. */
.outcome {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1.5px solid var(--oc, var(--gold));
  background: var(--night);
  color: var(--ink);
  font: 600 0.75rem/1 var(--ui);
  white-space: nowrap;
  pointer-events: none;
}

.outcome--hurt { --oc: var(--monster); }
.outcome--heal { --oc: var(--potion); }
.outcome--gold { --oc: var(--gold-coin); }
.outcome--equip { --oc: var(--weapon); }
.outcome--kill { --oc: var(--gold-bright); }

.board__hero {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
}

.board__hand,
.board__purse {
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.hand-slot {
  position: relative;
  width: 64px;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-card);
  background: rgb(14 15 26 / 0.45);
  box-shadow: inset 0 0 0 1px rgb(138 143 168 / 0.18);
  display: grid;
  place-items: center;
}

.hand-slot > .ph {
  font-size: 24px;
  color: rgb(138 143 168 / 0.6);
}

.hand-slot .dc {
  --w: 64px;
  position: absolute;
  inset: 0;
}

.medal {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 5px solid var(--gold-bright);
  background: radial-gradient(circle at 50% 40%, #2a2d45, var(--night) 75%);
  box-shadow: 0 0 28px rgb(242 212 139 / 0.35), inset 0 0 18px rgb(0 0 0 / 0.6);
}

.medal .ph {
  font-size: 40px;
  color: var(--gold-bright);
}

.purse {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgb(217 181 108 / 0.7);
  background: var(--night);
}

.purse .ph {
  font-size: 26px;
  color: var(--gold-coin);
}

.board__purse b {
  font: 700 1.125rem/1 var(--display);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.board__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  min-height: 40px;
}

.pips {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.pips__dots {
  display: inline-flex;
  gap: 6px;
}

.pips__dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  transition: background-color var(--t-snap) var(--ease-out);
}

.pips__dots span.on {
  background: var(--gold);
}

.board__status {
  min-height: 1.5em;
  margin: 14px 0 0;
  font-size: 0.875rem;
  color: var(--ink);
  text-align: center;
}

.reset {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.875rem;
}

.board__end {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 28px;
  border-radius: inherit;
  background: rgb(14 15 26 / 0.88);
  text-align: center;
  animation: fade-in var(--t-deal) var(--ease-out);
}

.board__end h3 {
  margin: 0;
  color: var(--gold-bright);
}

.board__end p {
  max-width: 24em;
  margin: 0;
  color: rgb(237 231 218 / 0.86);
}

.board__end[hidden] {
  display: none;
}

@keyframes fade-in {
  from { opacity: 0; }
}

.float {
  position: absolute;
  z-index: 6;
  transform: translate(-50%, -50%);
  font: 700 1.5rem/1 var(--display);
  pointer-events: none;
  text-shadow: 0 2px 6px rgb(0 0 0 / 0.6);
  animation: float-up 700ms var(--ease-out) forwards;
}

@keyframes float-up {
  0% { opacity: 0; transform: translate(-50%, -30%); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -160%); }
}

.medal.is-hit {
  animation: shake 280ms linear;
  box-shadow: 0 0 32px rgb(194 65 75 / 0.7), inset 0 0 18px rgb(0 0 0 / 0.6);
  border-color: var(--monster);
}

.medal.is-heal {
  box-shadow: 0 0 32px rgb(63 191 138 / 0.7), inset 0 0 18px rgb(0 0 0 / 0.6);
}

@keyframes shake {
  0% { transform: translateX(0); }
  17% { transform: translateX(6px); }
  33% { transform: translateX(-5px); }
  50% { transform: translateX(3.5px); }
  67% { transform: translateX(-2.5px); }
  83% { transform: translateX(1px); }
  100% { transform: translateX(0); }
}

@media (max-width: 900px) {
  .room__in {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

@media (max-width: 400px) {
  .board {
    padding: 16px 12px 18px;
  }

  .board__room {
    gap: 6px;
    padding: 32px 6px 8px;
  }

  .outcome {
    font-size: 0.6875rem;
    padding: 0 6px;
  }

  .medal {
    width: 80px;
    height: 80px;
  }
}

/* Feature rows */

.feature__in {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 72px;
  align-items: center;
}

.feature--flip .feature__in {
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
}

.feature--flip .feature__media {
  order: 2;
}

.feature__text {
  max-width: 600px;
}

.feature__text > p {
  color: rgb(237 231 218 / 0.86);
}

.shot {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.shot img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 30px 40px rgb(0 0 0 / 0.5)) drop-shadow(0 0 40px color-mix(in srgb, var(--tint, var(--gold)) 25%, transparent));
}

@media (max-width: 860px) {
  .feature__in,
  .feature--flip .feature__in {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .feature__media,
  .feature--flip .feature__media {
    order: 2;
  }

  .shot {
    max-width: 280px;
  }
}

/* Heroes */

.heroes {
  list-style: none;
  margin: 0 0 1.5em;
  padding: 0;
  display: grid;
  gap: 14px;
}

.heroes li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: start;
}

.heroes .medal {
  width: 52px;
  height: 52px;
  border-width: 3px;
  border-color: var(--hc, var(--gold-bright));
  box-shadow: 0 0 16px color-mix(in srgb, var(--hc, var(--gold-bright)) 30%, transparent), inset 0 0 10px rgb(0 0 0 / 0.6);
}

.heroes .medal .ph {
  font-size: 24px;
  color: var(--hc, var(--gold-bright));
}

.heroes strong {
  display: block;
  font: 700 1.0625rem/1.3 var(--display);
  color: var(--ink);
}

.heroes span {
  color: rgb(237 231 218 / 0.8);
  font-size: 0.9375rem;
}

.hero--warrior { --hc: var(--gold-bright); }
.hero--rogue { --hc: var(--key); }
.hero--mage { --hc: var(--scroll); }
.hero--necromancer { --hc: var(--curse-glow); }

.heroes .stat {
  color: var(--ink-muted);
  white-space: nowrap;
}

/* Relic rarities */

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

.rarities li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--rc);
  background: color-mix(in srgb, var(--rc) 10%, var(--night));
  color: var(--rc);
  font: 600 0.75rem/1 var(--ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rarities .ph {
  font-size: 14px;
}

.r-common { --rc: #a9adc2; }
.r-rare { --rc: var(--key); }
.r-epic { --rc: #b18cf0; }
.r-legendary { --rc: var(--gold-bright); }

.relic-examples {
  display: grid;
  gap: 10px;
  margin: 0 0 1.5em;
}

.relic {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--r-panel);
  border: 1px solid rgb(217 181 108 / 0.2);
  background: rgb(23 26 43 / 0.7);
}

.relic .ph {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--rc) 14%, var(--night));
  color: var(--rc);
  font-size: 20px;
}

.relic b {
  font: 700 1rem/1.3 var(--display);
}

.relic span {
  font-size: 0.9375rem;
  color: rgb(237 231 218 / 0.8);
}

/* Dungeons */

.dungeons {
  list-style: none;
  margin: 0 0 1.5em;
  padding: 0;
  display: grid;
  gap: 8px;
}

.dungeons li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 2px 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--dt) 16%, transparent), transparent 70%);
  border-left: 2px solid var(--dt);
}

.dungeons .n {
  grid-row: span 2;
  font: 700 1.125rem/1.35 var(--display);
  color: var(--dt-text, var(--gold-bright));
}

.dungeons b {
  font: 700 1rem/1.35 var(--display);
}

.dungeons span {
  font-size: 0.9375rem;
  color: rgb(237 231 218 / 0.8);
}

.d-crypt { --dt: var(--tint-crypt); }
.d-catacombs { --dt: var(--tint-catacombs); }
.d-mine { --dt: var(--tint-mine); }
.d-library { --dt: var(--tint-library); }
.d-treasury { --dt: var(--tint-treasury); }
.d-abyss { --dt: var(--tint-abyss); }

/* Modes */

.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 36px;
}

.panel {
  position: relative;
  padding: 28px;
  border-radius: var(--r-sheet);
  border: 1px solid rgb(217 181 108 / 0.28);
  background:
    radial-gradient(ellipse 80% 70% at 100% 0%, color-mix(in srgb, var(--pc, var(--gold)) 14%, transparent), transparent 70%),
    linear-gradient(180deg, var(--surface-high), var(--surface));
  box-shadow: 0 20px 40px rgb(0 0 0 / 0.3);
}

.panel__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  border-radius: 50%;
  border: 2px solid var(--pc, var(--gold));
  background: var(--night);
  color: var(--pc, var(--gold));
  font-size: 26px;
  box-shadow: 0 0 20px color-mix(in srgb, var(--pc, var(--gold)) 30%, transparent);
}

.panel h3 {
  margin-bottom: 0.4em;
}

.panel p {
  margin-bottom: 0.6em;
  color: rgb(237 231 218 / 0.86);
}

.panel .meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

@media (max-width: 760px) {
  .modes {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 22px;
  }
}

/* Plain-talk block about money */

.fair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  padding: 40px;
  border-radius: var(--r-sheet);
  border: 1px solid rgb(217 181 108 / 0.3);
  background:
    radial-gradient(ellipse 60% 80% at 0% 0%, rgb(63 191 138 / 0.08), transparent 70%),
    linear-gradient(180deg, rgb(32 36 58 / 0.9), rgb(23 26 43 / 0.9));
}

.fair p {
  color: rgb(237 231 218 / 0.86);
}

.fair p:last-child {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .fair {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 26px 22px;
  }
}

/* Closing call */

.cta {
  text-align: center;
}

.cta__emblem {
  width: 132px;
  margin: 0 auto 18px;
}

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

.cta p {
  max-width: 32em;
  margin-inline: auto;
  color: rgb(237 231 218 / 0.86);
}

.cta .play-badge {
  margin-top: 12px;
}

/* Reveal on scroll (only with JS; reduced motion shows everything at once). */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Text pages (legal, support) ---------- */

.doc {
  position: relative;
  padding: 24px 0 0;
}

.doc::before {
  content: "";
  position: absolute;
  inset: -72px 0 auto;
  height: 420px;
  background: radial-gradient(ellipse 60% 70% at 50% 0%, rgb(52 48 106 / 0.55), transparent 70%);
  pointer-events: none;
}

.doc__head {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 0 28px;
  text-align: center;
}

.doc__head h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  margin-bottom: 0.3em;
  background: linear-gradient(180deg, #fff1c6 0%, var(--gold-bright) 45%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.doc__head p {
  margin: 0;
  color: var(--ink-muted);
}

.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 18px auto 0;
  max-width: 320px;
  color: var(--gold);
}

.rule::before,
.rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.rule::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.rule i {
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: var(--gold);
}

.prose {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.prose h2 {
  margin: 2.2em 0 0.6em;
  font-size: 1.375rem;
  color: var(--gold-bright);
}

.prose h3 {
  margin: 1.6em 0 0.5em;
  font-size: 1.125rem;
}

.prose p,
.prose li {
  color: rgb(237 231 218 / 0.9);
}

.prose ul,
.prose ol {
  margin: 0 0 1.2em;
  padding-left: 1.3em;
}

.prose li {
  margin-bottom: 0.5em;
}

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

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.prose .note {
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.summary {
  margin: 0 0 2em;
  padding: 22px 24px;
  border-radius: var(--r-panel);
  border: 1px solid rgb(217 181 108 / 0.3);
  background: linear-gradient(180deg, var(--surface-high), var(--surface));
}

.summary p:last-child,
.summary ul:last-child {
  margin-bottom: 0;
}

.summary__title {
  margin: 0 0 0.5em;
  font: 600 0.75rem/1.3 var(--ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

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

.toc a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgb(138 143 168 / 0.3);
  color: var(--ink);
  font-size: 0.875rem;
  text-decoration: none;
}

.toc a:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

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

.steps li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 16px 18px 16px 64px;
  border-radius: var(--r-panel);
  border: 1px solid rgb(217 181 108 / 0.22);
  background: rgb(23 26 43 / 0.75);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--night);
  font: 700 1rem/1 var(--display);
}

.ui {
  display: inline-block;
  padding: 0 6px;
  border-radius: 6px;
  background: rgb(217 181 108 / 0.12);
  color: var(--gold-bright);
  font-weight: 600;
  white-space: nowrap;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 1.5em 0;
}

.contact-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 18px;
  align-items: center;
  margin: 0 0 2.5em;
  padding: 24px;
  border-radius: var(--r-sheet);
  border: 1px solid rgb(217 181 108 / 0.35);
  background:
    radial-gradient(ellipse 70% 90% at 0% 0%, rgb(242 212 139 / 0.1), transparent 70%),
    linear-gradient(180deg, var(--surface-high), var(--surface));
}

.contact-card .panel__icon {
  grid-row: span 3;
  margin: 0;
}

.contact-card p {
  margin: 0;
}

.contact-card .btn {
  justify-self: start;
  margin-top: 12px;
  overflow-wrap: anywhere;
}

@media (max-width: 520px) {
  .contact-card {
    grid-template-columns: 1fr;
  }

  .contact-card .panel__icon {
    grid-row: auto;
    margin-bottom: 8px;
  }

  .contact-card .btn {
    width: 100%;
    font-size: 0.9375rem;
    padding: 0 14px;
  }
}

/* FAQ */

.faq {
  display: grid;
  gap: 10px;
  margin: 0 0 2em;
}

.faq details {
  border-radius: var(--r-panel);
  border: 1px solid rgb(217 181 108 / 0.22);
  background: rgb(23 26 43 / 0.75);
  transition: border-color var(--t-snap) var(--ease-out);
}

.faq details[open] {
  border-color: rgb(217 181 108 / 0.5);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 12px 18px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--ink);
}

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

.faq summary::after {
  content: "\e136";
  font: 18px/1 "PhosphorRegular";
  color: var(--gold);
  transition: transform var(--t-snap) var(--ease-out);
}

.faq details[open] summary::after {
  transform: rotate(180deg);
}

.faq summary:focus-visible {
  outline-offset: -2px;
  border-radius: var(--r-panel);
}

.faq .answer {
  padding: 0 18px 16px;
}

.faq .answer p:last-child {
  margin-bottom: 0;
}

/* 404 */

.lost {
  max-width: 600px;
  margin: 0 auto;
  padding-top: 56px;
  text-align: center;
}

.lost .dc {
  --w: 120px;
  margin: 0 auto 28px;
  transform: rotate(-4deg);
}

/* ---------- Reduced motion ---------- */

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

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .dc.is-shining .dc__shine {
    animation: none;
  }

  .medal.is-hit {
    animation: none;
  }
}
