/* Budapest Rummy — the landing page.
 *
 * The page wears the game's own look: the lobby's deep felt green and gold, the splash art as the
 * hero, the in-game card face (cream, Roboto Bold index, the game's vector pips), the blue felt
 * and wooden rim of the table. Fonts are served from this site (no third-party request: a visit
 * here sends nothing to anyone else, so the privacy policy has nothing to add for it).
 *
 * Motion is decoration only and is switched off under prefers-reduced-motion. Nothing on the page
 * depends on JavaScript to be read: without it the reveals are simply already visible and the
 * table demo shows its last frame.
 */

/* ---- fonts ----------------------------------------------------------------------------------- */

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url('/assets/fonts/cinzel-latin-ext.woff2') format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url('/assets/fonts/cinzel-latin.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/roboto-latin-ext.woff2') format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/roboto-latin.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- tokens ---------------------------------------------------------------------------------- */

:root {
  --felt-950: #04110a;
  --felt-900: #071a11;
  --felt-850: #0a2216;
  --felt-800: #0d2b1c;
  --felt-700: #123826;
  --felt-600: #184a32;
  --felt-500: #1f5c3e;

  --gold-50: #fff8e1;
  --gold-100: #fbecb8;
  --gold-200: #f3d98a;
  --gold-300: #e8c062;
  --gold-400: #d4a64a;
  --gold-500: #b88a33;
  --gold-600: #8f6721;
  --gold-700: #5e4314;

  --text: #eee5d1;
  --text-dim: #bdb39c;
  --text-faint: #8f8875;

  --card-surface: #f4ecd8;
  --card-ink: #16202b;
  --card-red: #c42b3a;
  --suit-red-on-dark: #ff7a7f;
  --suit-black-on-dark: #f4ecd8;

  --felt-blue: #1f5296;
  --ok: #8fe07a;
  --owed: #ff4b3a;

  --line: rgba(212, 166, 74, 0.26);
  --line-strong: rgba(212, 166, 74, 0.55);
  --shadow-lg: 0 34px 70px -28px rgba(0, 0, 0, 0.8);

  --font-display: 'Cinzel', 'Trajan Pro', 'Times New Roman', Georgia, serif;
  --font-body: 'Roboto', system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --gold-text: linear-gradient(
    180deg,
    #fff4c9 0%,
    #f4da8c 30%,
    #d9ab4c 58%,
    #a97a24 80%,
    #e6bf62 100%
  );

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --gutter: clamp(16px, 4vw, 32px);
  --nav-h: 66px;

  /* The hero art box: the splash's own 1672x941 shape on a wide screen, never taller than most of
     the window, so the call to action under it stays in view. */
  --art-h: min(56.28vw, 74vh);
}
@supports (height: 1svh) {
  :root {
    --art-h: min(56.28vw, 74svh);
  }
}
@media (max-aspect-ratio: 1/1) {
  :root {
    --art-h: min(125.13vw, 80vh);
  }
  @supports (height: 1svh) {
    :root {
      --art-h: min(125.13vw, 80svh);
    }
  }
}

/* ---- base ------------------------------------------------------------------------------------ */

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

html {
  overflow-x: clip;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  background: var(--felt-900);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: clamp(16px, 0.95rem + 0.15vw, 17.5px);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--felt-900);
  background-image:
    radial-gradient(1100px 700px at 100% 18%, rgba(31, 92, 62, 0.32), transparent 62%),
    radial-gradient(1000px 800px at 0% 46%, rgba(31, 92, 62, 0.26), transparent 62%),
    radial-gradient(1200px 900px at 100% 78%, rgba(31, 92, 62, 0.24), transparent 62%);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The felt's grain: one fixed layer of noise over everything, never scrolled or repainted. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main,
.footer {
  position: relative;
  z-index: 1;
}

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

a {
  color: var(--gold-200);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--gold-50);
}

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

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--gold-300);
  color: #1d1406;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s;
}
.skip:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow {
  max-width: 860px;
}

/* ---- type ------------------------------------------------------------------------------------ */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.8em;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-300);
}
.eyebrow::before,
.eyebrow::after {
  content: '';
  flex: none;
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-400));
}
.eyebrow::after {
  transform: scaleX(-1);
}

.title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 1.1rem + 3.3vw, 3.55rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  margin-top: 14px;
  color: var(--gold-200);
  background: var(--gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.45)) drop-shadow(0 12px 26px rgba(0, 0, 0, 0.35));
  text-wrap: balance;
}

.lead {
  margin-top: 18px;
  font-size: clamp(1.02rem, 0.96rem + 0.3vw, 1.18rem);
  color: var(--text);
  opacity: 0.92;
  text-wrap: pretty;
}

.section__head {
  text-align: center;
  max-width: 760px;
  margin-inline: auto;
}

/* A suit inside running text: the game's own vector pip, never a font's symbol glyph. */
.suit {
  display: inline-block;
  width: 0.82em;
  height: 0.82em;
  vertical-align: -0.06em;
  margin-inline: 0.04em;
  fill: var(--suit-black-on-dark);
}
.suit--red {
  fill: var(--suit-red-on-dark);
}

/* ---- buttons --------------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.85em 1.5em;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease-out),
    box-shadow 0.2s,
    filter 0.2s,
    background 0.2s;
}
.btn--gold {
  color: #2a1b04;
  background: linear-gradient(180deg, #ffeab0 0%, #f2cb64 46%, #c99431 100%);
  border-color: #8f6721;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -2px 0 rgba(0, 0, 0, 0.18),
    0 10px 22px -10px rgba(232, 192, 98, 0.75);
}
.btn--gold:hover {
  color: #2a1b04;
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.btn--ghost {
  color: var(--gold-100);
  border-color: var(--line-strong);
  background: rgba(10, 34, 22, 0.55);
}
.btn--ghost:hover {
  color: var(--gold-50);
  background: rgba(212, 166, 74, 0.12);
}
.btn--sm {
  padding: 0.7em 1.15em;
  font-size: 0.84rem;
}

/* ---- the store badges ------------------------------------------------------------------------ */

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 12px 14px;
}
.badge {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  border-radius: 10px;
  transition:
    transform 0.25s var(--ease-out),
    filter 0.25s;
}
.badge img {
  height: 52px;
  width: auto;
  border-radius: 9px;
  box-shadow:
    0 0 0 1px rgba(166, 166, 166, 0.55),
    0 14px 26px -14px rgba(0, 0, 0, 0.9);
}
a.badge:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}
.badge--soon {
  cursor: default;
}
@media (max-width: 480px) {
  .badge img {
    height: 46px;
  }
  .badges {
    gap: 10px 10px;
  }
}
@media (max-width: 380px) {
  .badge img {
    height: 42px;
  }
}
.badge__soon {
  margin-top: 7px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-300);
}

/* ---- navigation ------------------------------------------------------------------------------ */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  padding-top: env(safe-area-inset-top);
  transition:
    background 0.35s,
    box-shadow 0.35s,
    backdrop-filter 0.35s;
}
.nav.is-solid {
  background: rgba(6, 21, 13, 0.8);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow:
    0 1px 0 var(--line),
    0 12px 30px -16px rgba(0, 0, 0, 0.8);
}
.nav__inner {
  max-width: 1240px;
  height: var(--nav-h);
  margin: 0 auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--gold-200);
  text-decoration: none;
}
.nav__brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  box-shadow:
    0 0 0 1px rgba(212, 166, 74, 0.55),
    0 6px 14px rgba(0, 0, 0, 0.5);
}
.nav__links {
  display: flex;
  gap: 2px;
  margin-left: auto;
}
.nav__links a {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  opacity: 0.86;
  transition:
    background 0.2s,
    color 0.2s,
    opacity 0.2s;
}
.nav__links a:hover,
.nav__links a[aria-current='true'] {
  opacity: 1;
  color: var(--gold-100);
  background: rgba(212, 166, 74, 0.12);
}
.nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.nav__lang {
  display: inline-flex;
  align-items: center;
  padding: 0.62em 1em;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--gold-100);
  text-decoration: none;
  background: rgba(7, 26, 17, 0.45);
  transition:
    background 0.2s,
    color 0.2s;
}
.nav__lang:hover {
  color: var(--gold-50);
  background: rgba(212, 166, 74, 0.14);
}

@media (max-width: 1020px) {
  .nav__links {
    display: none;
  }
  .nav__actions {
    margin-left: auto;
  }
}
@media (max-width: 400px) {
  .nav__brand span {
    display: none;
  }
}

/* ---- the hero -------------------------------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  padding-bottom: clamp(56px, 8vw, 104px);
}
.hero__art {
  position: relative;
  height: var(--art-h);
  overflow: hidden;
  background: var(--felt-900);
}
.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  transform-origin: 50% 42%;
}
/* A shade under the menu bar, and the art melting into the felt at the bottom. */
.hero__art::before,
.hero__art::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  z-index: 2;
  pointer-events: none;
}
.hero__art::before {
  top: 0;
  height: 24%;
  background: linear-gradient(rgba(4, 14, 9, 0.7), rgba(4, 14, 9, 0));
}
.hero__art::after {
  bottom: 0;
  height: 54%;
  background: linear-gradient(
    rgba(7, 26, 17, 0) 0%,
    rgba(7, 26, 17, 0.55) 42%,
    rgba(7, 26, 17, 0.92) 78%,
    var(--felt-900) 100%
  );
}
.hero__sweep {
  position: absolute;
  inset: -10% -50%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    104deg,
    transparent 44%,
    rgba(255, 233, 170, 0.14) 49%,
    rgba(255, 245, 210, 0.22) 50%,
    rgba(255, 233, 170, 0.14) 51%,
    transparent 56%
  );
  mix-blend-mode: screen;
  opacity: 0;
}
.hero__dust {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero__body {
  position: relative;
  z-index: 4;
  margin-top: calc(var(--art-h) * -0.36);
  padding-inline: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero__body .eyebrow {
  margin-top: 10px;
}
@media (max-width: 480px) {
  .eyebrow {
    letter-spacing: 0.16em;
  }
  .eyebrow::before,
  .eyebrow::after {
    width: 18px;
  }
  .hero__body .eyebrow::before,
  .hero__body .eyebrow::after {
    display: none;
  }
}
.hero__lead {
  margin-top: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.42rem, 0.9rem + 2.2vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--gold-100);
  background: var(--gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.55)) drop-shadow(0 10px 24px rgba(0, 0, 0, 0.55));
  text-wrap: balance;
}
.hero__sub {
  max-width: 640px;
  margin: 10px auto 0;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.14rem);
  color: var(--text);
  opacity: 0.9;
  text-wrap: pretty;
}
.hero__body .badges {
  margin-top: 22px;
}
.hero__note {
  margin-top: 16px;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 4;
  width: 42px;
  height: 42px;
  margin-left: -21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--gold-200);
  border: 1px solid var(--line);
  background: rgba(7, 26, 17, 0.5);
}
.hero__scroll svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* On a short landscape screen the second sentence would push the badges under the fold; the same
   promise is made again in the very next section. */
@media (orientation: landscape) and (max-height: 820px) {
  .hero__sub {
    display: none;
  }
  .hero__scroll {
    display: none;
  }
}

/* ---- playing cards --------------------------------------------------------------------------- */

/* Proportions are the game's: a 64x90 face, the corner index at 30% of the width with a pip at 22%
   under it, the centre pip at 34%. --cw sets the width; everything else follows. */
.card {
  --cw: 64px;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--cw);
  height: calc(var(--cw) * 1.40625);
  border-radius: calc(var(--cw) * 0.075);
  background: var(--card-surface);
  border: 1px solid rgba(0, 0, 0, 0.35);
  color: var(--card-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 12px 20px -12px rgba(0, 0, 0, 0.8),
    0 2px 4px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  user-select: none;
}
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 38%),
    linear-gradient(0deg, rgba(120, 90, 40, 0.08), rgba(0, 0, 0, 0) 40%);
}
.card--red {
  color: var(--card-red);
}
.card__i {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 700;
  font-size: calc(var(--cw) * 0.3);
  line-height: 0.92;
}
.card__i b {
  font-weight: 700;
}
.card--ten .card__i b {
  letter-spacing: -0.08em;
  margin-left: -0.08em;
}
.card__i--tl {
  top: calc(var(--cw) * 0.06);
  left: calc(var(--cw) * 0.06);
}
.card__i--br {
  right: calc(var(--cw) * 0.06);
  bottom: calc(var(--cw) * 0.06);
  transform: rotate(180deg);
}
.card__s {
  width: calc(var(--cw) * 0.22);
  height: calc(var(--cw) * 0.22);
  margin-top: calc(var(--cw) * 0.025);
  fill: currentColor;
}
.card__p {
  width: calc(var(--cw) * 0.34);
  height: calc(var(--cw) * 0.34);
  fill: currentColor;
  opacity: 0.92;
}
.card--joker {
  background: #fff url('/assets/img/joker.webp') center / 100% 100% no-repeat;
}
.card--back {
  background: #7a0e24 url('/assets/img/card-back.webp') center / 100% 100% no-repeat;
  border-color: rgba(0, 0, 0, 0.55);
}
.card--back::after {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 40%);
}

/* The hand fanned out under the hero art: Q K [joker] 2 3 of hearts — the game's signature
   wrap-around run, with a joker standing in for the ace. */
.fan {
  --cw: min(clamp(58px, 15vw, 92px), 17vh);
  position: relative;
  width: calc(var(--cw) * 3.9);
  height: calc(var(--cw) * 1.48);
  /* The outer cards lean out past the box; this keeps the line under them clear. */
  margin-bottom: calc(var(--cw) * 0.2);
  animation: fan-float 7s ease-in-out infinite;
}
.fan .card {
  --cw: inherit;
}
.fan__slot {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: var(--cw);
  margin-left: calc(var(--cw) / -2);
  transform-origin: 50% 135%;
  transform: translateX(var(--x)) translateY(var(--y)) rotate(var(--r));
  transition: transform 0.4s var(--ease-out);
}
.fan__slot:nth-child(1) {
  --x: calc(var(--cw) * -1.3);
  --y: calc(var(--cw) * 0.13);
  --r: -15deg;
}
.fan__slot:nth-child(2) {
  --x: calc(var(--cw) * -0.66);
  --y: calc(var(--cw) * 0.03);
  --r: -7.5deg;
}
.fan__slot:nth-child(3) {
  --x: 0px;
  --y: calc(var(--cw) * -0.06);
  --r: 0deg;
  z-index: 2;
}
.fan__slot:nth-child(4) {
  --x: calc(var(--cw) * 0.66);
  --y: calc(var(--cw) * 0.03);
  --r: 7.5deg;
  z-index: 3;
}
.fan__slot:nth-child(5) {
  --x: calc(var(--cw) * 1.3);
  --y: calc(var(--cw) * 0.13);
  --r: 15deg;
  z-index: 4;
}
.fan__slot:hover {
  transform: translateX(var(--x)) translateY(calc(var(--y) - var(--cw) * 0.2)) rotate(var(--r));
}
.fan__slot:nth-child(3) .card {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 12px 20px -12px rgba(0, 0, 0, 0.8),
    0 0 28px rgba(255, 214, 120, 0.42);
}

/* ---- sections -------------------------------------------------------------------------------- */

.section {
  position: relative;
  padding-block: clamp(84px, 11vw, 150px);
  /* Decoration (the Legend's glow, the frame ornaments) may spill sideways but must never widen
     the page: a phone would zoom the whole site out to fit it. */
  overflow-x: clip;
}
/* The game's frame ornament between sections: a gold rule with a diamond. */
.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: min(560px, 76vw);
  height: 12px;
  transform: translate(-50%, -50%);
  opacity: 0.75;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 560 12'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23d4a64a' stop-opacity='0'/%3E%3Cstop offset='.5' stop-color='%23e8c062'/%3E%3Cstop offset='1' stop-color='%23d4a64a' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect y='5.5' width='560' height='1' fill='url(%23g)'/%3E%3Cpath d='M280 0l6 6-6 6-6-6z' fill='%23e8c062'/%3E%3Cpath d='M262 6l4-4 4 4-4 4zM290 6l4-4 4 4-4 4z' fill='%23b88a33'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

/* ---- the game: the table demo ---------------------------------------------------------------- */

.game__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.game__copy .title {
  margin-top: 14px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px 9px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(12, 40, 26, 0.65);
  font-size: 0.9rem;
  color: var(--text);
}
.chips svg,
.ticks svg,
.note svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: var(--gold-300);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.demo {
  position: relative;
  margin: 0;
}
.demo__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.demo__tab {
  appearance: none;
  padding: 10px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 32, 21, 0.7);
  color: var(--text-dim);
  font: 500 0.88rem/1 var(--font-body);
  cursor: pointer;
  transition:
    background 0.25s,
    color 0.25s,
    border-color 0.25s,
    box-shadow 0.25s;
}
.demo__tab:hover {
  color: var(--gold-100);
  border-color: var(--line-strong);
}
.demo__tab[aria-pressed='true'] {
  color: #2a1b04;
  background: linear-gradient(180deg, #ffe8a6, #e3b552);
  border-color: #946c22;
  box-shadow: 0 8px 18px -10px rgba(232, 192, 98, 0.8);
}

/* The table: the game's blue felt inside a polished wooden rim. */
.demo__table {
  position: relative;
  padding: clamp(10px, 1.5vw, 16px);
  border-radius: 28px;
  background: linear-gradient(140deg, #b2733a 0%, #74401a 34%, #94592a 62%, #5c3013 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.65),
    inset 0 2px 0 rgba(255, 222, 176, 0.38),
    inset 0 -3px 0 rgba(0, 0, 0, 0.42),
    var(--shadow-lg);
}
.demo__table::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.35;
  background: repeating-linear-gradient(
    96deg,
    rgba(255, 255, 255, 0) 0 9px,
    rgba(255, 230, 190, 0.09) 9px 10px,
    rgba(0, 0, 0, 0) 10px 23px,
    rgba(0, 0, 0, 0.12) 23px 24px
  );
}
.demo__felt {
  position: relative;
  aspect-ratio: 16 / 10.4;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(115% 90% at 50% 38%, #2d6ab4 0%, #215698 44%, #183f76 100%);
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.38),
    inset 0 12px 40px rgba(0, 0, 0, 0.45),
    inset 0 -30px 50px rgba(0, 0, 0, 0.18);
}
.demo__felt::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .13 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* The felt's embossed name, as on the in-game table. */
.demo__mark {
  position: absolute;
  inset: 0 0 18%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.1rem, 3.6vw, 2.4rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(9, 25, 54, 0.38);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.07);
  pointer-events: none;
}
.demo__hand {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--hand-h, 34%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(225, 236, 255, 0.45);
  background: linear-gradient(rgba(5, 17, 40, 0), rgba(5, 17, 40, 0.38));
  border-top: 1px dashed rgba(200, 220, 255, 0.16);
  pointer-events: none;
}
/* Without JavaScript the felt shows the first lesson's finished board. */
.demo__static {
  position: absolute;
  inset: 12% 0 auto;
  display: flex;
  justify-content: center;
  gap: 22px;
  --cw: clamp(40px, 9vw, 64px);
}
.demo__meld {
  display: flex;
}
.demo__static .card {
  --cw: inherit;
}
.demo__meld .card + .card {
  margin-left: calc(var(--cw) * -0.44);
}
.demo.is-live .demo__static {
  display: none;
}
.demo.is-live .card {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  will-change: transform;
  transition:
    transform 0.75s var(--ease-out),
    box-shadow 0.35s,
    opacity 0.4s;
}
.demo .card.is-lifted {
  z-index: 5;
  box-shadow:
    0 0 0 2px var(--gold-200),
    0 0 26px rgba(255, 214, 110, 0.75),
    0 22px 30px -12px rgba(0, 0, 0, 0.8);
}
.demo .card.is-valid {
  box-shadow:
    0 0 0 2px rgba(143, 224, 122, 0.95),
    0 0 18px rgba(143, 224, 122, 0.5),
    0 12px 20px -12px rgba(0, 0, 0, 0.8);
}
.demo .card.is-owed {
  z-index: 5;
  box-shadow:
    0 0 0 3px var(--owed),
    0 0 20px rgba(255, 75, 58, 0.6),
    0 22px 30px -12px rgba(0, 0, 0, 0.8);
}
.demo .card.is-gone {
  opacity: 0;
}
.demo__ok {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px 4px 7px;
  border-radius: 999px;
  background: rgba(16, 52, 24, 0.92);
  border: 1px solid rgba(143, 224, 122, 0.8);
  color: #d9ffd0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 6px) scale(0.9);
  transition:
    opacity 0.35s,
    transform 0.45s var(--ease-spring);
  pointer-events: none;
}
.demo__ok svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: var(--ok);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.demo__ok.is-on {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
.demo__bar {
  height: 3px;
  margin: 18px 6px 0;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(212, 166, 74, 0.16);
}
.demo__bar span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--gold-500), var(--gold-200));
}
.demo__caption {
  min-height: 3.3em;
  margin-top: 14px;
  padding-inline: 6px;
  font-size: 1.02rem;
  color: var(--text);
  transition: opacity 0.3s;
}
.demo__caption.is-fading {
  opacity: 0;
}
.demo__replay {
  appearance: none;
  margin: 6px 0 0 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold-300);
  font: 500 0.86rem/1.4 var(--font-body);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.demo__replay:hover {
  color: var(--gold-100);
}

@media (max-width: 960px) {
  .game__grid {
    grid-template-columns: 1fr;
  }
  .game__copy {
    text-align: center;
  }
  .chips {
    justify-content: center;
  }
}
@media (max-width: 560px) {
  .demo__felt {
    aspect-ratio: 1 / 0.98;
  }
  .demo__tab {
    padding: 9px 12px;
    font-size: 0.82rem;
  }
}

/* ---- rules ----------------------------------------------------------------------------------- */

.rules {
  background: linear-gradient(
    rgba(4, 17, 10, 0),
    rgba(4, 17, 10, 0.55) 30%,
    rgba(4, 17, 10, 0.55) 70%,
    rgba(4, 17, 10, 0)
  );
}
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
  margin-top: clamp(44px, 6vw, 72px);
}
.step {
  position: relative;
  text-align: center;
}
.step h3 {
  font-family: var(--font-display);
  font-size: 1.32rem;
  color: var(--gold-200);
  margin-top: 12px;
}
.step p {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 0.97rem;
  text-wrap: pretty;
}
.step__num {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  color: #2a1b04;
  background: radial-gradient(circle at 34% 30%, #fff2bd, #e5b955 56%, #a6771f);
  box-shadow:
    0 0 0 4px rgba(212, 166, 74, 0.18),
    0 8px 16px rgba(0, 0, 0, 0.5);
}
/* The dotted rail the four numbers sit on. */
.steps::before {
  content: '';
  position: absolute;
  left: 12.5%;
  right: 12.5%;
  top: calc(var(--art) + 18px);
  --art: 150px;
  border-top: 1px dashed var(--line-strong);
}
.step__art {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mini {
  --cw: 56px;
}
.mini .card {
  --cw: inherit;
}
.mini--lay .card + .card,
.mini--rework .card + .card {
  margin-left: calc(var(--cw) * -0.42);
}
.mini--lay .card:nth-child(1) {
  transform: rotate(-6deg) translateY(4px);
}
.mini--lay .card:nth-child(3) {
  transform: rotate(6deg) translateY(4px);
}
.mini--rework .card:nth-child(3) {
  transform: translate(6px, -26px) rotate(9deg);
  box-shadow:
    0 0 0 2px var(--gold-200),
    0 0 22px rgba(255, 214, 110, 0.7),
    0 18px 24px -10px rgba(0, 0, 0, 0.8);
  z-index: 1;
}
.mini--rework .card:nth-child(4) {
  margin-left: calc(var(--cw) * -0.12);
}
.mini__pile {
  position: relative;
  display: inline-block;
  width: var(--cw);
  height: calc(var(--cw) * 1.40625);
}
.mini__pile .card {
  position: absolute;
  left: 0;
  top: 0;
}
.mini__pile .card:nth-child(2) {
  transform: translate(3px, -3px);
}
.mini__pile .card:nth-child(3) {
  transform: translate(6px, -6px);
}
.mini__up {
  margin-left: 22px;
  transform: rotate(8deg) translateY(4px);
}
.mini--take {
  gap: 0;
}
.mini__heap {
  position: relative;
  display: inline-block;
  width: calc(var(--cw) * 1.4);
  height: calc(var(--cw) * 1.40625);
}
.mini__heap .card {
  position: absolute;
  top: 0;
}
.mini__heap .card:nth-child(1) {
  left: 0;
  transform: rotate(-12deg);
}
.mini__heap .card:nth-child(2) {
  left: calc(var(--cw) * 0.3);
  transform: rotate(5deg);
}
.mini__throw {
  margin-left: calc(var(--cw) * -0.55);
  transform: translateY(-22px) rotate(22deg);
  position: relative;
  z-index: 1;
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(56px, 7vw, 84px);
  border-block: 1px solid var(--line);
}
.facts li {
  position: relative;
  padding: 26px 14px;
  text-align: center;
}
.facts li + li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 24%;
  bottom: 24%;
  border-left: 1px solid var(--line);
}
.facts strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.1rem);
  line-height: 1.05;
  color: var(--gold-200);
  background: var(--gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.facts span {
  display: block;
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.rules__scoring {
  max-width: 760px;
  margin: 28px auto 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.tutor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(18px, 3vw, 30px);
  align-items: center;
  max-width: 860px;
  margin: clamp(48px, 6vw, 72px) auto 0;
  padding: 20px clamp(20px, 3vw, 34px) 20px 20px;
  border-radius: 26px;
  border: 1px solid rgba(212, 166, 74, 0.38);
  background: linear-gradient(
    115deg,
    rgba(122, 14, 36, 0.62),
    rgba(48, 14, 22, 0.55) 34%,
    rgba(12, 38, 26, 0.85) 72%
  );
  box-shadow: var(--shadow-lg);
}
.tutor img {
  width: clamp(96px, 14vw, 136px);
  height: auto;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55));
}
.tutor h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--gold-200);
}
.tutor p {
  margin-top: 6px;
  color: var(--text);
  opacity: 0.9;
}

@media (max-width: 960px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 56px;
  }
  .steps::before {
    display: none;
  }
}
@media (max-width: 640px) {
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .facts li:nth-child(3)::before {
    display: none;
  }
  .facts li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 520px) {
  .steps {
    grid-template-columns: 1fr;
    row-gap: 48px;
  }
  .step__art {
    height: 128px;
  }
  .tutor {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 24px 20px;
  }
}

/* ---- the tables ------------------------------------------------------------------------------ */

.tables {
  background: radial-gradient(800px 500px at 50% 46%, rgba(212, 166, 74, 0.09), transparent 70%);
}
.rooms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 34px);
  margin-top: clamp(44px, 6vw, 70px);
  perspective: 1200px;
}
/* The lobby's room plaque: a gold double frame around felt, with the frame's diamonds. */
.room {
  position: relative;
  padding: 3px;
  border-radius: 22px;
  background: linear-gradient(
    160deg,
    #f6dc8a 0%,
    #8f6721 30%,
    #e8c062 56%,
    #6e4f15 82%,
    #d4a64a 100%
  );
  box-shadow: var(--shadow-lg);
  transform-style: preserve-3d;
  transition:
    transform 0.5s var(--ease-out),
    box-shadow 0.5s;
}
.room:hover {
  box-shadow:
    0 40px 80px -30px rgba(0, 0, 0, 0.9),
    0 0 50px -12px rgba(232, 192, 98, 0.45);
}
.room__frame {
  position: relative;
  height: 100%;
  padding: 34px 22px 28px;
  border-radius: 19px;
  text-align: center;
  overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, #1f5f3f 0%, #10392a 52%, #0a2619 100%);
}
.room__frame::before {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(212, 166, 74, 0.5);
  border-radius: 13px;
  pointer-events: none;
}
/* The frame's two diamonds, top and bottom centre. */
.room::before,
.room::after {
  content: '';
  position: absolute;
  left: 50%;
  z-index: 2;
  width: 13px;
  height: 13px;
  margin-left: -6.5px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #fff0bb, #c9962f 60%, #8f6721);
  box-shadow: 0 0 0 2px #0a2619;
}
.room::before {
  top: -4px;
}
.room::after {
  bottom: -4px;
}
.room__art {
  height: clamp(120px, 14vw, 158px);
  width: auto;
  margin: 0 auto;
  filter: drop-shadow(0 20px 18px rgba(0, 0, 0, 0.6));
  transform: translateZ(40px);
}
.room__name {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.95rem);
  color: var(--gold-200);
  background: var(--gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.room__tag {
  margin-top: 2px;
  font-size: 0.86rem;
  color: var(--text-dim);
}
/* The Entry plate, as the lobby draws it: dark felt pill, gold rim, the coin and the fee. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 9px 18px 9px 16px;
  border-radius: 999px;
  border: 2px solid #c9a24a;
  background: linear-gradient(#124430, #0a2a1b);
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 180, 0.2),
    0 8px 18px -8px rgba(0, 0, 0, 0.8);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-200);
}
.pill span {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pill img {
  width: 22px;
  height: 22px;
}
.pill b {
  font-size: 1.12rem;
  letter-spacing: 0.02em;
}
.room__pay {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 18px 0 0;
  font-size: 0.86rem;
}
.room__pay div {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.room__pay dt {
  color: var(--text-faint);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.room__pay dd {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 2px 0 0;
  font-weight: 700;
  color: var(--text);
}
.room__pay img {
  width: 16px;
  height: 16px;
}

.notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
  margin-top: clamp(40px, 5vw, 60px);
}
.note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(8, 28, 18, 0.62);
  font-size: 0.93rem;
  color: var(--text-dim);
}
.note svg {
  margin-top: 2px;
}

@media (max-width: 900px) {
  .rooms,
  .notes {
    grid-template-columns: 1fr;
  }
  .rooms {
    max-width: 420px;
    margin-inline: auto;
  }
}

/* ---- the ladder ------------------------------------------------------------------------------ */

.ladder {
  background: radial-gradient(700px 520px at 74% 52%, rgba(26, 58, 120, 0.3), transparent 70%);
}
.ladder__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 70px);
  align-items: center;
}
.ladder__rp {
  width: 118px;
  height: auto;
  margin-bottom: 12px;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.55));
}
.ticks {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}
.ticks li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--text);
}
.ticks svg {
  margin-top: 3px;
  stroke: var(--ok);
}

/* The eight leagues as a staircase, Bronze at the foot and Budapest Legend at the top. */
.stairs {
  --step: clamp(10px, 1.6vw, 22px);
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  align-items: end;
  gap: 6px;
  min-height: calc(var(--step) * 7 + 170px);
  padding-top: 30px;
}
.stair {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translateY(calc(var(--s) * var(--step) * -1));
}
.stair img {
  width: 100%;
  max-width: 92px;
  height: auto;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.55));
  transition: transform 0.35s var(--ease-spring);
}
.stair:hover img {
  transform: translateY(-6px) scale(1.06);
}
.stair span {
  margin-top: 8px;
  font-size: clamp(0.6rem, 0.5rem + 0.22vw, 0.72rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold-100);
}
.stair small {
  margin-top: 2px;
  font-size: 0.68rem;
  color: var(--gold-300);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stair--legend img {
  max-width: 124px;
  width: 135%;
}
.stair--legend::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 34%;
  width: 230%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgba(255, 214, 120, 0.42) 0%,
    rgba(255, 214, 120, 0.12) 52%,
    transparent
  );
}
.stair--legend::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 34%;
  width: 260%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  z-index: -1;
  border-radius: 50%;
  opacity: 0.5;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 226, 150, 0.2) 0deg 6deg,
    transparent 6deg 18deg
  );
  -webkit-mask: radial-gradient(closest-side, #000 26%, transparent);
  mask: radial-gradient(closest-side, #000 26%, transparent);
}

@media (max-width: 960px) {
  .ladder__grid {
    grid-template-columns: 1fr;
  }
  .ladder__copy {
    text-align: center;
  }
  .ladder__rp {
    margin-inline: auto;
  }
  .ticks {
    justify-content: center;
    text-align: left;
  }
}
@media (max-width: 640px) {
  .stairs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: 30px;
    min-height: 0;
  }
  .stair {
    transform: translateY(calc(var(--m, 0) * -9px));
  }
  .stair:nth-child(4n + 2) {
    --m: 1;
  }
  .stair:nth-child(4n + 3) {
    --m: 2;
  }
  .stair:nth-child(4n + 4) {
    --m: 3;
  }
  .stair--legend img {
    width: 115%;
  }
}

/* ---- features -------------------------------------------------------------------------------- */

.feats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 1.8vw, 22px);
  margin-top: clamp(44px, 6vw, 70px);
}
.feat {
  position: relative;
  padding: 26px 22px 24px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 68, 45, 0.7), rgba(9, 32, 21, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 236, 180, 0.07);
  transition:
    transform 0.35s var(--ease-out),
    border-color 0.35s,
    box-shadow 0.35s;
}
.feat:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 180, 0.07),
    0 24px 44px -24px rgba(0, 0, 0, 0.9);
}
.feat h3 {
  font-family: var(--font-display);
  font-size: 1.16rem;
  color: var(--gold-200);
}
.feat p {
  margin-top: 6px;
  font-size: 0.93rem;
  color: var(--text-dim);
}
.feat__icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.5));
}
.feat__icon--wide {
  width: 92px;
}
.feat__icon--glyph {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #22704b, #0e3825 70%);
  box-shadow:
    0 0 0 3px #c9a24a,
    inset 0 0 0 1px rgba(0, 0, 0, 0.5),
    0 10px 14px rgba(0, 0, 0, 0.45);
}
.feat__icon--glyph svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--gold-200);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feat__bubbles {
  position: relative;
  height: 64px;
  margin-bottom: 16px;
}
.feat__bubbles span {
  position: absolute;
  padding: 7px 12px;
  border-radius: 14px;
  background: var(--card-surface);
  color: #1b2430;
  font-weight: 700;
  font-size: 0.84rem;
  white-space: nowrap;
  box-shadow: 0 8px 16px -8px rgba(0, 0, 0, 0.8);
}
.feat__bubbles span::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 16px;
  width: 12px;
  height: 12px;
  background: inherit;
  transform: rotate(45deg);
  border-radius: 2px;
}
.feat__bubbles span:nth-child(1) {
  left: 0;
  top: 0;
}
.feat__bubbles span:nth-child(2) {
  left: 38px;
  top: 30px;
  background: #ffe8a6;
}
.feat__bubbles span:nth-child(2)::after {
  left: auto;
  right: 18px;
}

@media (max-width: 1040px) {
  .feats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .feats {
    grid-template-columns: 1fr;
  }
  .feat {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 18px;
  }
  .feat__icon,
  .feat__bubbles {
    margin: 0;
  }
  .feat__icon--wide {
    width: 64px;
  }
  .feat--emote {
    grid-template-columns: 1fr;
  }
  .feat__bubbles {
    height: 60px;
  }
}

/* ---- the screenshot gallery ------------------------------------------------------------------ */

.gallery {
  margin-top: clamp(40px, 5vw, 64px);
}
.gallery__track {
  position: relative;
  display: flex;
  gap: clamp(18px, 3vw, 40px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 12px max(var(--gutter), calc((100vw - 980px) / 2)) 26px;
  scroll-padding-inline: max(var(--gutter), calc((100vw - 980px) / 2));
}
.gallery__track::-webkit-scrollbar {
  display: none;
}
.shot {
  flex: 0 0 min(86vw, 980px);
  margin: 0;
  scroll-snap-align: center;
  transition:
    opacity 0.5s,
    transform 0.6s var(--ease-out);
}
.js .shot:not(.is-active) {
  opacity: 0.42;
  transform: scale(0.94);
}
/* A phone on its side: the game is played in landscape. */
.device {
  position: relative;
  padding: clamp(7px, 1.1vw, 14px) clamp(14px, 2.4vw, 30px);
  border-radius: clamp(24px, 3.6vw, 46px);
  background: linear-gradient(150deg, #34343a 0%, #111114 38%, #1d1d21 70%, #2b2b30 100%);
  box-shadow:
    0 0 0 1px #45454b,
    inset 0 0 0 2px #050506,
    inset 0 0 0 3px #2a2a2f,
    0 46px 90px -36px rgba(0, 0, 0, 0.95);
}
.device::before {
  content: '';
  position: absolute;
  left: clamp(5px, 0.9vw, 11px);
  top: 50%;
  width: clamp(4px, 0.55vw, 7px);
  height: clamp(28px, 6vw, 70px);
  transform: translateY(-50%);
  border-radius: 999px;
  background: #050506;
  box-shadow: inset 0 0 0 1px #26262b;
}
.device img {
  width: 100%;
  height: auto;
  aspect-ratio: 1600 / 736;
  border-radius: clamp(14px, 2.4vw, 30px);
  background: var(--felt-800);
}
.shot figcaption {
  margin-top: 16px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-dim);
}
.gallery__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 6px;
}
.gallery__btn {
  appearance: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(10, 32, 21, 0.7);
  color: var(--gold-200);
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
}
.gallery__btn:hover {
  background: rgba(212, 166, 74, 0.16);
}
.gallery__btn:active {
  transform: scale(0.94);
}
.gallery__btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gallery__dots {
  display: flex;
  gap: 8px;
}
.gallery__dots button {
  appearance: none;
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(212, 166, 74, 0.32);
  cursor: pointer;
  transition:
    width 0.35s var(--ease-out),
    background 0.35s;
}
.gallery__dots button[aria-current='true'] {
  width: 26px;
  background: var(--gold-300);
}

/* ---- FAQ ------------------------------------------------------------------------------------- */

.faq__list {
  margin-top: clamp(36px, 5vw, 56px);
  border-top: 1px solid var(--line);
}
.qa {
  border-bottom: 1px solid var(--line);
}
.qa summary {
  position: relative;
  padding: 22px 52px 22px 4px;
  list-style: none;
  cursor: pointer;
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--text);
  transition: color 0.2s;
}
.qa summary::-webkit-details-marker {
  display: none;
}
.qa summary:hover {
  color: var(--gold-100);
}
.qa summary::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  width: 11px;
  height: 11px;
  border-right: 2px solid var(--gold-300);
  border-bottom: 2px solid var(--gold-300);
  transform: translateY(-75%) rotate(45deg);
  transition: transform 0.3s var(--ease-out);
}
.qa[open] summary::after {
  transform: translateY(-25%) rotate(-135deg);
}
.qa__a {
  padding: 0 52px 24px 4px;
  color: var(--text-dim);
}
@supports (interpolate-size: allow-keywords) {
  :root {
    interpolate-size: allow-keywords;
  }
  .qa::details-content {
    block-size: 0;
    overflow: hidden;
    transition:
      block-size 0.35s var(--ease-out),
      content-visibility 0.35s allow-discrete;
  }
  .qa[open]::details-content {
    block-size: auto;
  }
}

/* ---- the closing call ------------------------------------------------------------------------ */

.cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(100px, 13vw, 170px);
  text-align: center;
}
.cta::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 44%;
  z-index: -1;
  width: min(760px, 110vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    closest-side,
    rgba(232, 192, 98, 0.2),
    rgba(232, 192, 98, 0.05) 55%,
    transparent
  );
}
.cta__bg {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: -2;
  width: 100%;
  height: 72%;
  object-fit: cover;
  object-position: 50% 60%;
  opacity: 0.3;
  filter: sepia(0.55) saturate(0.9) brightness(0.8) hue-rotate(-12deg);
  -webkit-mask: linear-gradient(transparent, #000 45%, #000 70%, transparent);
  mask: linear-gradient(transparent, #000 45%, #000 70%, transparent);
}
.cta__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cta__icon {
  width: clamp(96px, 12vw, 132px);
  height: auto;
  border-radius: 26%;
  box-shadow:
    0 0 0 1px rgba(212, 166, 74, 0.65),
    0 24px 50px -16px rgba(0, 0, 0, 0.9),
    0 0 90px rgba(232, 192, 98, 0.32);
}
.cta .lead {
  max-width: 560px;
}
.cta .badges {
  margin-top: 30px;
}

/* ---- footer ---------------------------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--line);
  background: rgba(3, 12, 7, 0.65);
  padding-block: 40px 30px;
  font-size: 0.9rem;
}
.footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 32px;
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.footer__brand img {
  width: 44px;
  height: 44px;
  border-radius: 11px;
}
.footer__brand strong {
  display: block;
  font-family: var(--font-display);
  color: var(--gold-200);
  font-size: 1.05rem;
}
.footer__brand small {
  display: block;
  color: var(--text-dim);
  font-size: 0.82rem;
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-left: auto;
}
.footer__links a {
  color: var(--text-dim);
  text-decoration: none;
}
.footer__links a:hover {
  color: var(--gold-100);
  text-decoration: underline;
}
.footer__legal {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(212, 166, 74, 0.14);
  color: var(--text-faint);
  font-size: 0.78rem;
  display: grid;
  gap: 6px;
}

@media (max-width: 760px) {
  .footer__top {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer__links {
    margin-left: 0;
    flex-direction: column;
  }
}

/* ---- the 404 page ---------------------------------------------------------------------------- */

.lost {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 40px var(--gutter);
  text-align: center;
}
.lost__main {
  position: relative;
  z-index: 1;
  max-width: 620px;
}
.lost__cards {
  display: flex;
  justify-content: center;
  margin-bottom: 26px;
}
.lost__cards .card {
  --cw: 84px;
}
.lost__cards .card:nth-child(1) {
  transform: rotate(-12deg) translate(22px, 10px);
}
.lost__cards .card:nth-child(2) {
  z-index: 1;
}
.lost__cards .card:nth-child(3) {
  transform: rotate(12deg) translate(-22px, 10px);
}
.lost__en {
  margin-top: 8px;
  color: var(--text-dim);
}
.lost__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

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

/* Reveal on scroll. Only with JavaScript running: without it everything is simply visible. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 110ms);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: no-preference) {
  .hero__img {
    animation: hero-drift 28s ease-in-out infinite alternate;
  }
  .hero__sweep {
    animation: hero-sweep 11s ease-in-out 1.2s infinite;
  }
  .fan .card {
    animation: deal 1s var(--ease-out) both;
    animation-delay: calc(0.35s + var(--i) * 0.12s);
  }
  .fan__slot:nth-child(3) .card {
    animation:
      deal 1s var(--ease-out) both,
      joker-glow 3.4s ease-in-out 1.8s infinite;
    animation-delay: calc(0.35s + var(--i) * 0.12s), 1.8s;
  }
  .js .hero__body > :not(.fan) {
    animation: rise 1s var(--ease-out) both;
  }
  .js .hero__body > .eyebrow {
    animation-delay: 0.95s;
  }
  .js .hero__body > .hero__lead {
    animation-delay: 1.05s;
  }
  .js .hero__body > .hero__sub {
    animation-delay: 1.15s;
  }
  .js .hero__body > .badges {
    animation-delay: 1.25s;
  }
  .js .hero__body > .hero__note {
    animation-delay: 1.35s;
  }
  .hero__scroll {
    animation: nudge 2.6s ease-in-out 2.4s infinite;
  }
  .room__art {
    animation: bob 6.5s ease-in-out infinite;
  }
  .room:nth-child(2) .room__art {
    animation-delay: -2.2s;
  }
  .room:nth-child(3) .room__art {
    animation-delay: -4.4s;
  }
  .stair--legend::after {
    animation: spin 40s linear infinite;
  }
  .stair--legend img {
    animation: legend-glow 3.6s ease-in-out infinite;
  }
  .cta__icon {
    animation: bob 7s ease-in-out infinite;
  }
  .feat__bubbles span:nth-child(1) {
    animation: bubble 5s ease-in-out infinite;
  }
  .feat__bubbles span:nth-child(2) {
    animation: bubble 5s ease-in-out 2.5s infinite;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fan {
    animation: none;
  }
  .demo .card,
  .demo__ok,
  .shot,
  .js [data-reveal] {
    transition: none !important;
  }
}

@keyframes hero-drift {
  from {
    transform: scale(1.02);
  }
  to {
    transform: scale(1.09) translateY(-0.8%);
  }
}
@keyframes hero-sweep {
  0% {
    opacity: 0;
    transform: translateX(-38%);
  }
  12% {
    opacity: 1;
  }
  48% {
    opacity: 1;
  }
  60%,
  100% {
    opacity: 0;
    transform: translateX(38%);
  }
}
@keyframes deal {
  from {
    opacity: 0;
    transform: translate(calc(var(--x) * -1), calc(var(--cw) * 1.1)) rotate(calc(var(--r) * -1))
      scale(0.72);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes joker-glow {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.75),
      0 12px 20px -12px rgba(0, 0, 0, 0.8),
      0 0 22px rgba(255, 214, 120, 0.3);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.75),
      0 12px 20px -12px rgba(0, 0, 0, 0.8),
      0 0 44px rgba(255, 214, 120, 0.7);
  }
}
@keyframes fan-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes nudge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0) translateZ(40px);
  }
  50% {
    transform: translateY(-8px) translateZ(40px);
  }
}
@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
@keyframes legend-glow {
  0%,
  100% {
    filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 0 rgba(255, 214, 120, 0));
  }
  50% {
    filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.55))
      drop-shadow(0 0 16px rgba(255, 214, 120, 0.6));
  }
}
@keyframes bubble {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}
