/* Mix Poker website — "The Card Room" design system.
   Shared by every page in public/. Plan: website_redesign_plan.md.
   Paper, ink and card red, taken from the app icon. No build step: this file ships as is. */

/* ── Tokens ─────────────────────────────────────────────── */

:root {
  color-scheme: light dark;

  --paper: #d5e0eb;        /* the landing page's blue-gray (src/theme/colors.ts lightPalette.background) */
  --paper-2: #c8d5e2;
  --raised: #ffffff;
  --ink: #111826;
  --graphite: #3b4859;
  --muted: #4c5a6d;
  --rule: #b6c5d5;
  --accent: #0a72e8;       /* the app's blue (#007AFF), a touch deeper so white text on it stays readable */
  --accent-ink: #0055b3;   /* the same blue for small text and links */
  --on-accent: #ffffff;
  --danger: #b3261e;       /* red only where it means bad: mistakes, warnings, don'ts */
  --brass: #6b4f12;

  /* The app's four-colour deck (src/components/wizard/CardSelector.tsx). */
  --spade: #111826;
  --heart: #d7263d;
  --diamond: #1d4fc4;
  --club: #12672f;
  --card-face: #ffffff;
  --card-edge: #c3cfdc;

  /* Night bands: deep navy, the table after dark. */
  --night: #0f1d33;
  --night-raised: #18294a;
  --night-ink: #e8eef6;
  --night-muted: #a8b7cb;
  --night-rule: #263a5c;

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --wrap: 1120px;
  --measure: 64ch;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --shadow-1: 0 1px 2px rgb(15 25 45 / 0.06), 0 2px 8px rgb(15 25 45 / 0.05);
  --shadow-2: 0 2px 4px rgb(15 25 45 / 0.06), 0 12px 32px rgb(15 25 45 / 0.10);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-deal: cubic-bezier(0.16, 0.84, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1622;
    --paper-2: #0b121c;
    --raised: #162131;
    --ink: #e8eef6;
    --graphite: #b4c0cf;
    --muted: #9aa8ba;
    --rule: #26354a;
    --spade: #e8eef6;
    --heart: #f0606e;
    --diamond: #7aa7ff;
    --club: #3fbf6f;
    --accent: #4c95ff;
    --accent-ink: #79b0ff;
    --on-accent: #07101c;
    --danger: #ff6b6b;
    --brass: #d4ab55;
    --night: #070e1a;
    --night-raised: #101b2e;
    --night-rule: #22324b;
    --card-edge: #b7c3d1;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-2: 0 2px 4px rgb(0 0 0 / 0.35), 0 14px 36px rgb(0 0 0 / 0.45);
  }
}

/* ── Base ───────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Card-stock grain, kept just above invisible. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' 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 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; }
strong { font-weight: 650; color: var(--ink); }
::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

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

/* ── Type ───────────────────────────────────────────────── */

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.04;
  color: var(--ink);
  text-wrap: balance;
}

.display {
  font-size: clamp(2.75rem, 1.4rem + 5.6vw, 5.5rem);
  font-weight: 640;
  letter-spacing: -0.035em;
  line-height: 0.96;
}
.display em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

.h2 { font-size: clamp(1.9rem, 1.25rem + 2.5vw, 3.1rem); }
.h3 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem); letter-spacing: -0.012em; line-height: 1.15; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin: 0 0 1.4rem;
  font: 650 0.78rem/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1.5px;
  background: currentColor;
}

.lead {
  font-size: clamp(1.125rem, 1.02rem + 0.45vw, 1.35rem);
  line-height: 1.55;
  color: var(--graphite);
  max-width: 34em;
  text-wrap: pretty;
}
.lead strong { color: var(--ink); }

.prose { max-width: var(--measure); color: var(--graphite); text-wrap: pretty; }
.prose strong { color: var(--ink); }

.num { font-variant-numeric: tabular-nums lining-nums; }

/* Section index, set like a card's corner index. */
.sec-index {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 18px;
  font: italic 500 1.05rem/1 var(--serif);
  color: var(--accent-ink);
}
.sec-index::after {
  content: "";
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: var(--rule);
  transform: translateY(-4px);
}

/* ── Layout ─────────────────────────────────────────────── */

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

.section { padding: clamp(64px, 9vw, 128px) 0; }
.section + .section:not(.band-night) { padding-top: 0; }
.section--tight { padding: clamp(48px, 6vw, 80px) 0; }

.split {
  display: grid;
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
@media (min-width: 880px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .split--even { grid-template-columns: 1fr 1fr; }
}

.band-night {
  --ink: var(--night-ink);
  --graphite: var(--night-muted);
  --muted: var(--night-muted);
  --rule: var(--night-rule);
  --raised: var(--night-raised);
  --accent-ink: #8ab8ff;
  background: var(--night);
  color: var(--night-ink);
}
.band-night + .section { padding-top: clamp(64px, 9vw, 128px); }

/* ── Header ─────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, background-color 0.25s;
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 650 1.15rem/1 var(--serif);
  letter-spacing: -0.01em;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 0 0 1px var(--rule);
}

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  position: relative;
  padding: 8px 12px;
  font-size: 0.94rem;
  font-weight: 550;
  color: var(--graphite);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.2s;
}
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.nav a.btn--ink { color: var(--paper); margin-left: 8px; }
.nav a[aria-current]::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--raised);
  color: var(--ink);
  font: 600 0.9rem/1 var(--sans);
  cursor: pointer;
}

@media (max-width: 899px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: var(--shadow-2);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s var(--ease), visibility 0s 0.2s;
  }
  .nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.2s, transform 0.25s var(--ease);
  }
  .nav a { padding: 14px 4px; font-size: 1.05rem; border-bottom: 1px solid var(--rule); border-radius: 0; }
  .nav a[aria-current]::after { display: none; }
  .nav a[aria-current] { color: var(--accent-ink); }
  .nav .btn { margin-top: 16px; justify-content: center; }
}

/* ── Buttons and links ──────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 11px;
  border: 1px solid transparent;
  font: 650 1rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background-color 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--accent { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 0 rgb(0 0 0 / 0.12), 0 6px 18px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn--accent:hover { background: var(--accent-ink); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--line { border-color: color-mix(in srgb, var(--ink) 22%, transparent); color: var(--ink); background: transparent; }
.btn--line:hover { border-color: var(--ink); }
.btn--sm { padding: 10px 14px; font-size: 0.9rem; border-radius: 9px; }

.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat;
  padding-bottom: 2px;
  transition: background-size 0.3s var(--ease);
}
.link-arrow:hover { background-size: 100% 1.5px; }
.link-arrow .arrow { transition: transform 0.2s var(--ease); }
.link-arrow:hover .arrow { transform: translateX(3px); }

/* ── Playing cards ──────────────────────────────────────── */
/* Rendered by site.js from data-cards="As Kh Td 9c". */

.hand {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  --cw: 54px;
}
.hand--sm { --cw: 44px; gap: 6px; }

.pc {
  position: relative;
  width: var(--cw, 54px);
  aspect-ratio: 5 / 7;
  perspective: 600px;
  flex: none;
}
.pc-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease-deal);
}
.pc.is-down .pc-inner { transform: rotateY(180deg); }
.pc-face, .pc-back {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--cw, 54px) * 0.13);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.pc-face {
  background: var(--card-face);
  border: 1px solid var(--card-edge);
  box-shadow: 0 1px 1px rgb(0 0 0 / 0.06), 0 3px 8px -2px rgb(0 0 0 / 0.12);
  color: var(--suit);
}
.pc-back {
  transform: rotateY(180deg);
  background:
    repeating-linear-gradient(45deg, transparent 0 5px, rgb(255 255 255 / 0.13) 5px 6px),
    repeating-linear-gradient(-45deg, transparent 0 5px, rgb(255 255 255 / 0.13) 5px 6px),
    var(--accent);
  border: calc(var(--cw, 54px) * 0.07) solid #fff;
  box-shadow: 0 0 0 1px var(--card-edge), 0 3px 8px -2px rgb(0 0 0 / 0.18);
}
.pc--back-only .pc-face { display: none; }
.pc--back-only .pc-back { transform: none; }

.pc-rank {
  position: absolute;
  top: 7%;
  left: 11%;
  font: 700 calc(var(--cw, 54px) * 0.34)/1 var(--sans);
  letter-spacing: -0.04em;
}
.pc-mini {
  position: absolute;
  top: 37%;
  left: 12%;
  font-size: calc(var(--cw, 54px) * 0.2);
  line-height: 1;
}
.pc-pip {
  position: absolute;
  right: 9%;
  bottom: 6%;
  font-size: calc(var(--cw, 54px) * 0.5);
  line-height: 1;
}
/* On the white card face the deck colours never change with the scheme. */
.pc[data-suit="s"] { --suit: #17171b; }
.pc[data-suit="h"] { --suit: #d7263d; }
.pc[data-suit="d"] { --suit: #2563eb; }
.pc[data-suit="c"] { --suit: #15803d; }
.pc.is-dim .pc-face { filter: saturate(0.4); opacity: 0.55; }
.pc.is-mark .pc-face { box-shadow: 0 0 0 2px var(--danger), 0 3px 8px -2px rgb(0 0 0 / 0.12); }

/* ── Panels and cards ───────────────────────────────────── */

.panel {
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(22px, 3vw, 36px);
}

/* Game tile: a tall card with a corner index. */
.game-tiles {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.game-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 24px 24px 22px;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 18px;
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}
.game-tile:hover {
  transform: translateY(-4px) rotate(-0.4deg);
  box-shadow: var(--shadow-2);
  border-color: color-mix(in srgb, var(--ink) 25%, var(--rule));
}

.game-tile .corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  font: 600 3rem/0.9 var(--serif);
  letter-spacing: -0.03em;
  color: var(--suit, var(--ink));
}
.game-tile .corner span { font-size: 1.1rem; margin-top: 6px; }
.game-tile .corner--flip {
  position: absolute;
  right: 22px;
  bottom: 20px;
  transform: rotate(180deg);
  opacity: 0.13;
  transition: opacity 0.35s;
}
.game-tile:hover .corner--flip { opacity: 0.28; }

.game-tile h3 { margin: 22px 0 10px; font-size: 1.45rem; }
.game-tile p { font-size: 0.97rem; color: var(--graphite); margin-bottom: 18px; }
.game-tile .link-arrow { margin-top: auto; font-size: 0.95rem; width: max-content; }
.game-tile:hover .link-arrow { background-size: 100% 1.5px; }
.game-tile:hover .link-arrow .arrow { transform: translateX(3px); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 4px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--graphite);
  background: var(--paper);
}

/* Acronym table: the six letters spelled out. */
.acronym { margin: 0; border-top: 1px solid var(--rule); }
.acronym div {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.acronym dt {
  font: 600 1.9rem/1 var(--serif);
  color: var(--suit, var(--ink));
}
.acronym dd { margin: 0; }
.acronym .name { font-weight: 650; color: var(--ink); }
.acronym .kind { font-size: 0.86rem; color: var(--muted); text-align: right; }
@media (max-width: 520px) {
  .acronym div { grid-template-columns: 40px 1fr; row-gap: 2px; }
  .acronym .kind { grid-column: 2; text-align: left; }
}

/* Journey: Learn → Practice → Compete → Improve. */
.journey {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 18px;
  overflow: hidden;
}
@media (min-width: 900px) { .journey { grid-template-columns: repeat(4, 1fr); } }

.journey-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 26px 26px;
  background: var(--night);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.3s;
}
a.journey-step:hover { background: var(--raised); }
.journey-step .step-no {
  font: italic 500 0.95rem/1 var(--serif);
  color: var(--accent-ink);
}
.journey-step h3 { font-size: 1.5rem; }
.journey-step p { margin: 0; font-size: 0.95rem; color: var(--graphite); }
.journey-step .link-arrow { margin-top: auto; padding-top: 10px; font-size: 0.93rem; width: max-content; }
a.journey-step:hover .link-arrow { background-size: 100% 1.5px; }
.journey-step.is-here { background: var(--night-raised); }
.journey-step.is-here .here {
  align-self: flex-start;
  margin-top: auto;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--graphite);
}

/* Closing call to action. */
.cta {
  display: grid;
  gap: 28px;
  align-items: end;
  padding-top: clamp(48px, 7vw, 96px);
  margin-top: clamp(48px, 7vw, 96px);
  border-top: 1px solid var(--rule);
}
@media (min-width: 880px) { .cta { grid-template-columns: 1fr auto; } }
.cta p { margin: 14px 0 0; color: var(--graphite); max-width: 36em; }

/* ── Hub hero: the rotation ─────────────────────────────── */

.hero { padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 8vw, 112px); }
.hero .split { align-items: center; row-gap: 12px; }
@media (min-width: 880px) { .hero .split { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); } }
.hero .lead { margin: 26px 0 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.rotation {
  --iw: clamp(84px, 10.5vw, 136px);
  --spread: 7deg;
  position: relative;
  display: grid;
  justify-items: center;
}
.fan {
  position: relative;
  width: 100%;
  height: calc(var(--iw) * 1.4 + var(--iw) * 0.45);
}
.fan-card {
  --r: calc((var(--i) - 2.5) * var(--spread));
  position: absolute;
  left: calc(50% - var(--iw) / 2);
  bottom: 0;
  width: var(--iw);
  aspect-ratio: 5 / 7;
  border-radius: calc(var(--iw) * 0.11);
  background: var(--card-face);
  border: 1px solid var(--card-edge);
  box-shadow: 0 1px 1px rgb(0 0 0 / 0.05), 0 8px 18px -8px rgb(0 0 0 / 0.28);
  color: var(--suit);
  text-decoration: none;
  transform-origin: 50% 300%;
  transform: rotate(var(--r));
  transition: transform 0.55s var(--ease-deal), box-shadow 0.4s;
}
.fan-card .letter {
  position: absolute;
  top: 8%;
  left: 12%;
  font: 600 calc(var(--iw) * 0.46)/0.9 var(--serif);
  letter-spacing: -0.03em;
}
.fan-card .pip {
  position: absolute;
  top: calc(8% + var(--iw) * 0.47);
  left: 14%;
  font-size: calc(var(--iw) * 0.17);
  line-height: 1;
}
.fan-card.is-active {
  transform: rotate(var(--r)) translateY(calc(var(--iw) * -0.24));
  box-shadow: 0 1px 1px rgb(0 0 0 / 0.05), 0 22px 36px -14px rgb(0 0 0 / 0.38);
}
.fan-card:focus-visible { outline-offset: 4px; border-radius: calc(var(--iw) * 0.11); }

/* The dealer button travels along the arc to the game being dealt. */
.dealer {
  position: absolute;
  left: calc(50% - var(--iw) / 2);
  bottom: 0;
  width: var(--iw);
  aspect-ratio: 5 / 7;
  transform-origin: 50% 300%;
  transform: rotate(calc((var(--at, 0) - 2.5) * var(--spread)));
  transition: transform 0.6s var(--ease-deal), opacity 0.4s;
  pointer-events: none;
  z-index: 3;
}
.dealer span {
  position: absolute;
  left: 50%;
  bottom: calc(var(--iw) * -0.4);
  width: calc(var(--iw) * 0.3);
  height: calc(var(--iw) * 0.3);
  margin-left: calc(var(--iw) * -0.15);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fbfcfe;
  border: 1px solid #c3cfdc;
  box-shadow: inset 0 0 0 calc(var(--iw) * 0.025) #fbfcfe, inset 0 0 0 calc(var(--iw) * 0.035) #c3cfdc, 0 5px 12px -4px rgb(0 0 0 / 0.35);
  font: 700 calc(var(--iw) * 0.13)/1 var(--serif);
  color: #17171b;
  transform: rotate(calc((var(--at, 0) - 2.5) * var(--spread) * -1));
  transition: transform 0.6s var(--ease-deal);
}

.rotation-caption {
  margin-top: calc(var(--iw) * 0.55);
  text-align: center;
  min-height: 4.8em;
}
.rotation-caption .now {
  display: block;
  font: 650 0.74rem/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.rotation-caption .game {
  display: block;
  margin-top: 10px;
  font: 600 1.6rem/1.1 var(--serif);
  letter-spacing: -0.015em;
}
.rotation-caption .what {
  display: block;
  margin-top: 6px;
  font-size: 0.95rem;
  color: var(--graphite);
}
.rotation-caption .swap { display: inline-block; transition: opacity 0.25s, transform 0.25s var(--ease); }
.rotation-caption.is-swapping .swap { opacity: 0; transform: translateY(6px); }

/* ── Game guides ────────────────────────────────────────── */

/* The rotation rail: the six games as small index cards. */
.rail {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.rail-label {
  margin-right: 10px;
  font: 650 0.72rem/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  align-self: center;
}
.rail a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 46px;
  border-radius: 6px;
  background: var(--card-face);
  border: 1px solid var(--card-edge);
  box-shadow: 0 1px 1px rgb(0 0 0 / 0.05);
  font: 600 1.2rem/1 var(--serif);
  color: var(--suit);
  text-decoration: none;
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.rail a:hover { transform: translateY(-3px); box-shadow: var(--shadow-1); }
.rail a[aria-current="page"] {
  transform: translateY(-8px);
  box-shadow: 0 0 0 2px var(--accent), 0 10px 18px -8px rgb(0 0 0 / 0.35);
}
@media (max-width: 420px) { .rail-label { display: none; } }

.guide-hero { padding: clamp(32px, 5vw, 72px) 0 clamp(56px, 8vw, 104px); }
.guide-hero .split { align-items: center; }
@media (min-width: 880px) { .guide-hero .split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.guide-hero .display { font-size: clamp(2.5rem, 1.4rem + 4.4vw, 4.6rem); }
.guide-hero .lead { margin-top: 24px; margin-bottom: 0; }

/* A hand on the table: dark mat, white cards. */
.mat {
  --ink: var(--night-ink);
  --graphite: var(--night-muted);
  position: relative;
  padding: clamp(22px, 3vw, 32px);
  border-radius: 20px;
  background: var(--night);
  color: var(--night-ink);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06), var(--shadow-2);
}
.mat .hand { --cw: clamp(48px, 4.6vw, 64px); gap: clamp(6px, 0.7vw, 10px); flex-wrap: nowrap; margin: 18px 0 16px; }
.mat-label {
  font: 650 0.72rem/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8ab8ff;
}
.mat-caption { margin: 0; font-size: 0.95rem; color: var(--night-muted); }
.mat-caption strong { color: var(--night-ink); }

.section-head { margin-bottom: clamp(28px, 4vw, 48px); }
.section-head .prose { margin: 0; align-self: end; }

/* The three rules that define a game. */
.rules {
  list-style: none;
  margin: clamp(32px, 4vw, 48px) 0 0;
  padding: 0;
  display: grid;
  gap: 28px;
}
@media (min-width: 760px) { .rules { grid-template-columns: repeat(3, 1fr); gap: 36px; } }
.rules li { padding-top: 18px; border-top: 2px solid var(--ink); }
.rules .rule-no { display: block; margin-bottom: 12px; font: italic 500 1.05rem/1 var(--serif); color: var(--accent-ink); }
.rules h3 { font-size: 1.3rem; margin-bottom: 8px; }
.rules p { margin: 0; font-size: 0.97rem; color: var(--graphite); }

/* Hand rankings. */
.ranks { display: grid; gap: 12px; }
.rank {
  display: grid;
  gap: 18px;
  align-items: center;
  padding: clamp(18px, 2.4vw, 26px);
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 16px;
}
@media (min-width: 760px) { .rank { grid-template-columns: 1fr auto; } }
.rank h3 { font-size: 1.3rem; margin-top: 8px; }
.rank p { margin: 6px 0 0; font-size: 0.95rem; color: var(--graphite); }
.tone {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.tone--best { color: var(--club); }
.tone--good { color: var(--graphite); }
.tone--high { color: var(--diamond); }
.tone--bad { color: var(--danger); }
.rank .hand { --cw: 50px; }

/* Street by street. */
.streets {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  max-width: 820px;
}
.streets::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--rule);
}
.street {
  position: relative;
  padding: 0 0 clamp(32px, 4vw, 44px) 64px;
}
.street:last-child { padding-bottom: 0; }
.street-no {
  position: absolute;
  left: 0;
  top: -4px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 1.05rem/1 var(--serif);
  box-shadow: 0 0 0 6px var(--paper);
  transition: background-color 0.4s, color 0.4s;
}
.motion .street:not(.is-in) .street-no { background: var(--paper); color: var(--muted); box-shadow: 0 0 0 6px var(--paper), inset 0 0 0 2px var(--rule); }
.street h3 { font-size: 1.35rem; margin-bottom: 8px; }
.street p { margin: 0; color: var(--graphite); max-width: 60ch; }
.street .hand { --cw: 46px; margin-top: 16px; }

/* Strategy: do, don't and tactics. */
.tactics { display: grid; gap: 16px; }
@media (min-width: 860px) { .tactics { grid-template-columns: 1fr 1fr; } }
.tactics .panel h3 { font-size: 1.35rem; margin-bottom: 18px; }
.tactic-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.tactic-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  font-size: 0.97rem;
  color: var(--graphite);
}
.tactic-list .mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}
.mark--do { background: color-mix(in srgb, var(--club) 14%, transparent); color: var(--club); }
.mark--dont { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.mark--tip { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }

/* Cheat sheet, printed like a card. */
.cheat {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 52px) clamp(22px, 5vw, 72px);
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 22px;
  box-shadow: var(--shadow-2);
}
.cheat::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  pointer-events: none;
}
.cheat .corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  font: 600 1.6rem/0.9 var(--serif);
  color: var(--suit);
}
.cheat .corner span { font-size: 0.9rem; margin-top: 4px; }
.cheat .corner--tl { top: 22px; left: 24px; }
.cheat .corner--br { right: 24px; bottom: 22px; transform: rotate(180deg); }
.cheat h2 { text-align: center; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); margin-bottom: clamp(20px, 3vw, 32px); padding: 0 28px; }
.cheat dl { margin: 0; display: grid; column-gap: 48px; }
@media (min-width: 760px) { .cheat dl { grid-template-columns: 1fr 1fr; } }
.cheat dl div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--rule);
}
.cheat dt { font-weight: 650; color: var(--ink); white-space: nowrap; }
.cheat dd { margin: 0; text-align: right; color: var(--graphite); font-size: 0.95rem; }
.cheat dd.is-key { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.cheat dd.is-warn { color: var(--danger); font-weight: 700; letter-spacing: 0.02em; }
@media (max-width: 520px) {
  .cheat dl div { flex-direction: column; gap: 2px; }
  .cheat dd { text-align: left; }
}

/* FAQ. */
.faq { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  font: 600 1.15rem/1.3 var(--serif);
  letter-spacing: -0.01em;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq-icon {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  transition: transform 0.3s var(--ease), background-color 0.2s;
}
.faq-icon::before, .faq-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 1.5px;
  margin: -0.75px 0 0 -6px;
  background: var(--ink);
  transition: transform 0.3s var(--ease);
}
.faq-icon::after { transform: rotate(90deg); }
.faq details[open] .faq-icon { transform: rotate(180deg); background: var(--raised); }
.faq details[open] .faq-icon::after { transform: rotate(0deg); }
.faq summary:hover .faq-icon { background: var(--raised); }
.faq details p { margin: 0 0 22px; max-width: 64ch; color: var(--graphite); }
.motion .faq details[open] p { animation: faq-open 0.35s var(--ease); }
@keyframes faq-open { from { opacity: 0; transform: translateY(-6px); } }

/* Previous / next game. */
.pager {
  display: grid;
  gap: 12px;
  margin-top: clamp(40px, 6vw, 72px);
}
@media (min-width: 700px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  text-decoration: none;
  color: var(--ink);
  transition: background-color 0.25s, border-color 0.25s;
}
.pager a:hover { background: var(--night-raised); border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.pager .next { justify-content: flex-end; text-align: right; }
.pager .mini {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 52px;
  border-radius: 6px;
  background: var(--card-face);
  border: 1px solid var(--card-edge);
  font: 600 1.35rem/1 var(--serif);
  color: var(--suit);
}
.pager small { display: block; font-size: 0.78rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--graphite); }
.pager b { display: block; margin-top: 4px; font: 600 1.3rem/1.15 var(--serif); }

@media (max-width: 480px) {
  .rank .hand, .street .hand { --cw: 42px; gap: 5px; }
}

/* ── Product pages: Practice Tables, MTT Circuit, Training ── */

.product-hero { padding: clamp(40px, 6vw, 88px) 0 clamp(56px, 8vw, 112px); }
.product-hero .split { align-items: center; }
@media (min-width: 880px) { .product-hero .split { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); } }
.product-hero .lead { margin: 24px 0 32px; }

/* How-to steps (numbered, serif numerals). */
.howto { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; counter-reset: howto; }
.howto li {
  position: relative;
  padding-left: 40px;
  color: var(--graphite);
  font-size: 0.98rem;
  counter-increment: howto;
}
.howto li::before {
  content: counter(howto);
  position: absolute;
  left: 0;
  top: -1px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--rule);
  font: italic 600 0.9rem/1 var(--serif);
  color: var(--accent-ink);
}
.howto-title { margin-top: 26px; font: 650 0.76rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.checks { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
.checks li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; color: var(--graphite); }
.checks li::before { content: "\2713"; color: var(--club); font-weight: 700; }

/* An opponent's seat card. */
.seat {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 18px;
  box-shadow: var(--shadow-2);
}
.avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  background: #eef3f8;
  box-shadow: 0 0 0 1px var(--rule);
}
.seat .who { font: 600 1.45rem/1.1 var(--serif); }
.seat .tagline { margin: 4px 0 10px; color: var(--graphite); font-size: 0.95rem; }
.seat-stack { position: relative; display: grid; gap: 14px; }
.seat-stack .seat:nth-child(2) { margin-left: 28px; opacity: 0.85; }
.seat-stack .seat:nth-child(3) { margin-left: 56px; opacity: 0.7; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; }

/* The ladder: fourteen rungs in four bands. */
.ladder { display: grid; gap: 14px; }
@media (min-width: 720px) { .ladder { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .ladder { grid-template-columns: repeat(4, 1fr); } }
.band {
  padding: 18px;
  border-radius: 16px;
  background: var(--night-raised);
  border: 1px solid var(--night-rule);
}
.band-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.band-head h3 { font-size: 1.25rem; }
.band-head .stakes { font-size: 0.8rem; color: var(--night-muted); }
.rung {
  display: grid;
  grid-template-columns: 22px 40px 1fr;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--night-rule);
}
.rung .no { font: italic 500 0.9rem/1 var(--serif); color: var(--night-muted); text-align: right; }
.rung img { width: 40px; height: 40px; border-radius: 50%; background: #eef3f8; }
.rung b { display: block; font-weight: 650; color: var(--night-ink); }
.rung small { display: block; font-size: 0.8rem; line-height: 1.35; color: var(--night-muted); }
.rung .rating { font-variant-numeric: tabular-nums; }
.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.pill--free { color: #4cc77f; }
.pill--pro { color: #d9b25c; }
.motion .ladder .rung { opacity: 0; transform: translateX(-8px); transition: opacity 0.4s, transform 0.5s var(--ease); transition-delay: calc(var(--r) * 70ms); }
.motion .ladder.is-in .rung { opacity: 1; transform: none; }

/* Graded match report. */
.report { display: grid; gap: 18px; }
.report-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.report-score { font: 600 2.6rem/1 var(--serif); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.report-score small { font: 600 1rem/1 var(--sans); color: var(--graphite); margin-left: 6px; }
.meter { height: 8px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.meter-fill { height: 100%; width: calc(var(--v) * 1%); border-radius: inherit; background: var(--club); transition: width 1.4s var(--ease) 0.2s; }
.motion [data-reveal]:not(.is-in) .meter-fill { width: 0; }
.grades { display: flex; flex-wrap: wrap; gap: 8px; }
.grade { padding: 5px 11px; border-radius: 999px; font-size: 0.8rem; font-weight: 650; border: 1px solid currentColor; }
.grade--good { color: var(--club); }
.grade--inacc { color: var(--brass); }
.grade--mistake { color: #9a4a08; }
.grade--blunder { color: var(--danger); }
@media (prefers-color-scheme: dark) { .grade--mistake { color: #f0923a; } }
.report-row { padding-top: 14px; border-top: 1px solid var(--rule); }
.report-row .line { display: flex; justify-content: space-between; gap: 10px; font-weight: 650; }
.report-row .why { margin-top: 4px; font-size: 0.92rem; color: var(--graphite); }

/* Free vs Pro allowances. */
.compare { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--rule); border-radius: 16px; overflow: hidden; background: var(--raised); }
.compare > div { padding: 22px; }
.compare > div + div { border-left: 1px solid var(--rule); }
.compare h3 { font-size: 1.25rem; margin-bottom: 14px; }
.compare dl { margin: 0; display: grid; gap: 12px; }
.compare dt { font-size: 0.78rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.compare dd { margin: 2px 0 0; font: 600 1.15rem/1.2 var(--serif); font-variant-numeric: tabular-nums; }
.stack-big { font: 600 clamp(2.6rem, 2rem + 3vw, 4rem)/1 var(--serif); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

/* A link card with art, used for hand-offs between pages. */
.link-card {
  display: grid;
  gap: 20px;
  align-items: center;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--rule);
  border-radius: 20px;
  text-decoration: none;
  color: var(--ink);
  transition: background-color 0.3s, border-color 0.3s;
}
@media (min-width: 760px) { .link-card { grid-template-columns: auto 1fr auto; } }
.link-card:hover { background: var(--night-raised); border-color: color-mix(in srgb, var(--ink) 28%, transparent); }
.link-card img { width: 120px; height: auto; }
.link-card h3 { font-size: 1.6rem; margin-bottom: 8px; }
.link-card p { margin: 0; color: var(--graphite); max-width: 52ch; }
.link-card:hover .link-arrow { background-size: 100% 1.5px; }

/* The bracelet on its stand. */
.trophy {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(28px, 4vw, 48px) clamp(16px, 3vw, 32px);
  border-radius: 24px;
  background: radial-gradient(120% 90% at 50% 30%, #22375c 0%, #0f1d33 62%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06), var(--shadow-2);
  overflow: hidden;
}
.trophy img { width: min(100%, 440px); height: auto; filter: drop-shadow(0 18px 24px rgb(0 0 0 / 0.5)); }
.trophy figcaption { margin-top: 10px; text-align: center; color: #a8b7cb; font-size: 0.9rem; }
.trophy figcaption b { display: block; color: #e8eef6; font: 600 1.15rem/1.3 var(--serif); }
.trophy::after, .case .won::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(105deg, transparent 40%, rgb(255 255 255 / 0.16) 50%, transparent 60%);
  transform: translateX(-100%);
  pointer-events: none;
}
.motion .trophy.is-in::after { animation: sweep 1.6s var(--ease) 0.5s 1 both; }
.motion .case.is-in .won::after { animation: sweep 1.2s var(--ease) both; animation-delay: calc(0.4s + var(--k) * 0.15s); }
@keyframes sweep { to { transform: translateX(100%); } }

/* The ten events, as a tournament sheet. */
.sheet { border-top: 2px solid var(--ink); }
.event {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 4px 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 860px) {
  .event { grid-template-columns: 72px minmax(0, 2.2fr) 0.8fr 1.5fr 1fr 1fr; }
  .sheet-head { display: grid; }
}
.event img { width: 64px; height: auto; grid-row: span 2; }
@media (min-width: 860px) { .event img { grid-row: auto; width: 72px; } }
.event .ev-name { font: 600 1.2rem/1.2 var(--serif); }
.event .ev-name span { font: italic 500 0.95rem/1 var(--serif); color: var(--accent-ink); margin-right: 8px; }
.event .ev-cell { font-size: 0.92rem; color: var(--graphite); font-variant-numeric: tabular-nums; }
.event .ev-cell b { color: var(--ink); font-weight: 650; }
.event .ev-mobile { grid-column: 2; font-size: 0.88rem; color: var(--graphite); }
@media (min-width: 860px) { .event .ev-mobile { display: none; } }
@media (max-width: 859px) { .event .ev-cell { display: none; } }
.sheet-head {
  display: none;
  grid-template-columns: 72px minmax(0, 2.2fr) 0.8fr 1.5fr 1fr 1fr;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.event--champ { background: linear-gradient(90deg, color-mix(in srgb, var(--brass) 10%, transparent), transparent 70%); }
.event--champ .ev-name { color: var(--brass); }
.field-tag { font-weight: 650; }
.field-tag--easy { color: var(--club); }
.field-tag--hu { color: var(--diamond); }
.field-tag--champ { color: var(--brass); }

/* Live tournament lobby. */
.lobby { display: grid; gap: 18px; }
.lobby-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.lobby-head h3 { font-size: 1.5rem; }
.itm { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass); }
.lobby .sub { margin: -10px 0 0; font-size: 0.92rem; color: var(--graphite); font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { padding: 14px 10px; border-radius: 12px; background: var(--paper); text-align: center; }
.stat b { display: block; font: 600 1.35rem/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.stat small { font-size: 0.8rem; color: var(--graphite); }
.standings { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.standings li { display: flex; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.standings li span:last-child { color: var(--graphite); }
.standings .me { font-weight: 700; }
.standings .me span:first-child::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; }

/* Bracelet collection. */
.case { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.case > div {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.case img { width: 86%; height: auto; }
.case .locked img { filter: grayscale(1) brightness(0.9); opacity: 0.28; }
.case .locked span { position: absolute; font: 600 1.1rem/1 var(--serif); color: var(--muted); }
.case-caption { margin-top: 14px; text-align: center; font-size: 0.9rem; color: var(--graphite); }

/* Tutor chat. */
.chat { display: grid; gap: 12px; }
.chat-head { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.chat-head .badge { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 600 0.95rem/1 var(--serif); }
.bubble { max-width: 88%; padding: 12px 16px; border-radius: 16px; font-size: 0.95rem; line-height: 1.5; }
.bubble--tutor { background: var(--paper); border: 1px solid var(--rule); border-top-left-radius: 4px; color: var(--ink); }
.bubble--me { justify-self: end; background: var(--ink); color: var(--paper); border-top-right-radius: 4px; }
.motion .chat .bubble { opacity: 0; transform: translateY(8px); transition: opacity 0.4s, transform 0.5s var(--ease); }
.motion .chat.is-in .bubble { opacity: 1; transform: none; }
.motion .chat.is-in .bubble--me { transition-delay: 0.9s; }

/* Equity comparison. */
.equity { display: grid; gap: 14px; }
.equity-row { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; padding: 14px; border-radius: 14px; background: var(--paper); border: 1px solid var(--rule); }
.equity-row .hand { --cw: 40px; gap: 5px; }
.equity-row .pct { text-align: right; font: 600 1.6rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.equity-row .pct small { display: block; margin-top: 4px; font: 500 0.78rem/1.2 var(--sans); color: var(--graphite); }
.equity-row .meter { grid-column: 1 / -1; }
.equity-row:nth-child(2) .meter-fill { background: var(--muted); }

/* Example questions. */
.asks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.asks li {
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--raised);
  border: 1px solid var(--rule);
  font: italic 500 1.05rem/1.4 var(--serif);
  color: var(--ink);
}
.asks li::before { content: "\201C"; color: var(--accent-ink); margin-right: 2px; }
.asks li::after { content: "\201D"; color: var(--accent-ink); margin-left: 2px; }

.panel-stack { display: grid; gap: 16px; }
.media-split { display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (min-width: 880px) {
  .media-split { grid-template-columns: 1fr 1fr; }
  .media-split--flip > :first-child { order: 2; }
}

/* ── Articles: long-form strategy, reference and practice pages ── */

.article-hero { padding: clamp(32px, 5vw, 72px) 0 clamp(48px, 7vw, 88px); }
.article-hero .split { align-items: start; }
@media (min-width: 880px) { .article-hero .split { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); } }
.article-hero .display { font-size: clamp(2.2rem, 1.3rem + 3.4vw, 3.9rem); line-height: 1.02; }
.article-hero .lead { margin: 24px 0 0; }
.article-hero .hero-actions { margin-top: 28px; }
.article-hero .hero-note { margin: 14px 0 0; font-size: 0.92rem; color: var(--muted); }

/* On this page. */
.toc { padding: 20px 24px 14px; background: var(--raised); border: 1px solid var(--rule); border-radius: var(--radius); }
.toc-title { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font: 650 0.74rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); cursor: pointer; list-style: none; }
.toc-title::-webkit-details-marker { display: none; }
.toc-title::after { content: "+"; margin-left: auto; font-size: 1rem; letter-spacing: 0; }
.toc[open] .toc-title::after { content: "\2212"; }
.toc:not([open]) { padding-bottom: 20px; }
.toc:not([open]) .toc-title { margin: 0; }
.toc-count { letter-spacing: 0.04em; text-transform: none; font-weight: 500; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc li + li a { border-top: 1px solid var(--rule); }
.toc a {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 4px;
  padding: 9px 0;
  color: var(--graphite);
  text-decoration: none;
  font-size: 0.94rem;
  line-height: 1.35;
  transition: color 0.2s;
}
.toc a::before { content: counter(toc, decimal-leading-zero); font: italic 500 0.9rem/1.45 var(--serif); color: var(--accent-ink); }
.toc a:hover { color: var(--ink); }

.section--article { padding: clamp(44px, 5.5vw, 80px) 0; }
/* The rest of the intro continues straight on from the hero. */
.article-hero + .section--article { padding-top: 0; }
@media (max-width: 879px) { .section--article .split > div:empty { display: none; } }
@media (min-width: 880px) {
  .section--article .split { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
  .article-head { position: sticky; top: 92px; }
}
.section--article .h2 { font-size: clamp(1.7rem, 1.2rem + 1.9vw, 2.6rem); line-height: 1.08; }

.article-body { max-width: 68ch; color: var(--graphite); text-wrap: pretty; }
.article-body p { margin: 0 0 1.05em; }
.article-body > :last-child { margin-bottom: 0; }
.article-body h3 { margin: 2em 0 0.6em; font-size: clamp(1.25rem, 1.1rem + 0.55vw, 1.5rem); letter-spacing: -0.012em; line-height: 1.2; }
.article-body h4 { margin: 1.6em 0 0.5em; font: 650 1.02rem/1.3 var(--sans); letter-spacing: 0; }
.article-body > h3:first-child { margin-top: 0; }
.article-body a:not(.btn) { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.article-body a:not(.btn):hover { text-decoration-thickness: 2px; }
.article-body ul, .article-body ol { margin: 0 0 1.1em; padding-left: 1.3em; display: grid; gap: 0.55em; }
.article-body li { padding-left: 0.2em; }
.article-body li::marker { color: var(--accent-ink); }
.article-body ol > li::marker { font: italic 600 1em var(--serif); }
.article-body code { font-size: 0.9em; }

/* Key point. */
.callout {
  margin: 1.6em 0;
  padding: 18px 22px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--raised);
  font: 500 1.08rem/1.5 var(--serif);
  color: var(--ink);
}
.callout-label { display: block; margin-bottom: 6px; font: 650 0.72rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-ink); }
.callout p { margin: 0; }
.callout p + p { margin-top: 0.6em; }

/* Tables: rows on wide screens, labeled cards on phones. */
.table-wrap { margin: 1.6em 0; }
.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
.data th {
  padding: 0 14px 10px 0;
  text-align: left;
  vertical-align: bottom;
  font: 650 0.72rem/1.3 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--ink);
}
.data td { padding: 12px 14px 12px 0; vertical-align: top; border-bottom: 1px solid var(--rule); color: var(--graphite); }
.data td:first-child { color: var(--ink); font-weight: 600; }
.data th:last-child, .data td:last-child { padding-right: 0; }
.data .hand { --cw: 34px; gap: 3px; }
@media (max-width: 600px) {
  .data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .data, .data tbody, .data tr, .data td { display: block; }
  .data tr { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .data tr:first-child { border-top: 2px solid var(--ink); }
  .data td { display: grid; grid-template-columns: minmax(92px, 36%) 1fr; gap: 12px; padding: 3px 0; border: 0; }
  .data td::before { content: attr(data-label); font: 650 0.7rem/1.6 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
  .data td:first-child { display: block; padding-bottom: 6px; font: 600 1.05rem/1.3 var(--serif); }
  .data td:first-child::before { display: none; }
  .data td:empty { display: none; }
}

/* Example hands, dealt on the dark mat. */
.deal {
  margin: 1.6em 0;
  padding: clamp(16px, 2.4vw, 24px);
  display: grid;
  gap: 16px;
  border-radius: 18px;
  background: var(--night);
  color: var(--night-ink);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06), var(--shadow-1);
}
.deal-row { display: grid; gap: 9px; }
.deal-label { font: 650 0.7rem/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: #8ab8ff; }
.deal .hand { --cw: clamp(36px, 9vw, 52px); gap: clamp(5px, 0.8vw, 8px); }
.deal-note { margin: 0; font-size: 0.84rem; color: var(--night-muted); }
.hand--inline { display: inline-flex; vertical-align: middle; --cw: 36px; gap: 4px; margin: 3px 2px; }
.hole-note { display: block; margin-top: 4px; font-size: 0.84rem; color: var(--muted); }

/* Stud hole cards: dealt face down, shown face up with a bar underneath. */
.pc.is-hole::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: calc(var(--cw, 54px) * -0.14);
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
}
.deal .pc.is-hole::after { background: #8ab8ff; }
.hand:has(.is-hole) { padding-bottom: calc(var(--cw, 54px) * 0.16); }

/* Collapsible answers to exercises. */
.answer { margin: 0.4em 0 1.1em; }
.answer summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--accent-ink);
}
.answer summary::-webkit-details-marker { display: none; }
.answer summary::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 0.9rem;
  line-height: 1;
}
.answer[open] summary::before { content: "\2212"; }
.answer-body { margin-top: 10px; padding: 14px 18px; border: 1px solid var(--rule); border-radius: 12px; background: var(--raised); color: var(--ink); }
.answer-body p { margin: 0; }
.answer-body p + p { margin-top: 0.6em; }

/* Glossary terms. */
.glossary { margin: 0 0 1.6em; border-top: 1px solid var(--rule); }
.glossary > div { display: grid; gap: 4px 28px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 700px) { .glossary > div { grid-template-columns: 11em 1fr; } }
.glossary dt { font: 600 1.08rem/1.35 var(--serif); color: var(--ink); }
.glossary dd { margin: 0; }
.glossary dd p { margin: 0; }
.glossary .deal { margin: 12px 0 2px; }

/* Guides index: one card per article. */
.guide-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.guide-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 22px 20px;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 16px;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}
.guide-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--ink) 25%, var(--rule)); }
.guide-card h3 { font-size: 1.3rem; line-height: 1.2; }
.guide-card p { margin: 0; font-size: 0.95rem; color: var(--graphite); }
.guide-card .tags { margin-top: auto; padding-top: 10px; }
.guide-section-lead { margin: 14px 0 0; max-width: 60ch; color: var(--graphite); }

/* "Play this game free" block on the game guides. */
.play-free { display: grid; gap: clamp(24px, 4vw, 48px); align-items: center; padding: clamp(24px, 4vw, 44px); background: var(--raised); border: 1px solid var(--rule); border-radius: 22px; }
@media (min-width: 880px) { .play-free { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.play-free .h2 { font-size: clamp(1.7rem, 1.2rem + 1.9vw, 2.5rem); margin-bottom: 18px; }
.play-free .prose p { margin: 0 0 0.9em; }
.play-free .facts { margin: 0 0 22px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 0.94rem; color: var(--graphite); }
.play-free .mat .hand { flex-wrap: wrap; --cw: clamp(36px, 8.5vw, 54px); }
.play-free .mat + .mat { margin-top: 12px; }

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

.site-footer {
  padding: 64px 0 40px;
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}
.footer-grid {
  display: grid;
  gap: 36px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.site-footer h2 {
  margin-bottom: 14px;
  font: 650 0.76rem/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.site-footer a { color: var(--graphite); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.site-footer .brand { margin-bottom: 14px; color: var(--ink); }
.site-footer .fine {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.86rem;
}

/* ── In-app mode (iOS WebView and the web app's iframe) ─── */

.in-app .site-header,
.in-app .site-footer,
.in-app .skip-link,
.in-app [data-web-only] { display: none !important; }
.in-app .hero { padding-top: 28px; }

.app-backbar {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 12px var(--gutter);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.app-backbar a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-ink);
  font-weight: 650;
  font-size: 0.95rem;
  text-decoration: none;
}

/* ── Motion ─────────────────────────────────────────────── */
/* Only when site.js has set .motion (JS on, reduced motion off),
   so the page is complete without either. */

.motion [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.8s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.motion [data-reveal].is-in { opacity: 1; transform: none; }

/* Deal-in: cards start stacked on the deck, then fan out. */
.motion .fan:not(.is-dealt) .fan-card {
  transform: translateY(40px) rotate(0deg);
  opacity: 0;
}
.motion .fan.is-dealt .fan-card {
  transition: transform 0.75s var(--ease-deal) calc(var(--i) * 85ms), opacity 0.3s calc(var(--i) * 85ms), box-shadow 0.4s;
}
.motion .fan.is-settled .fan-card { transition: transform 0.55s var(--ease-deal), box-shadow 0.4s; }
.motion .fan:not(.is-dealt) .dealer { opacity: 0; }
.motion .fan.is-dealt .dealer { transition: transform 0.6s var(--ease-deal), opacity 0.4s 0.7s; }
.motion .fan.is-settled .dealer { transition: transform 0.6s var(--ease-deal), opacity 0.4s; }

.motion .hand[data-deal] .pc { opacity: 0; transform: translate(-14px, 10px) rotate(-6deg); }
.motion .hand[data-deal].is-in .pc {
  opacity: 1;
  transform: none;
  transition: opacity 0.35s calc(var(--i) * 70ms), transform 0.55s var(--ease-deal) calc(var(--i) * 70ms);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
