/* ============ Fonts (self-hosted: no reader IP goes to a font CDN) ============ */
@font-face {
  font-family: "Big Shoulders Display"; font-style: normal; font-weight: 600 900; font-display: swap;
  src: url(../fonts/big-shoulders-display-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: "Big Shoulders Display"; font-style: normal; font-weight: 600 900; font-display: swap;
  src: url(../fonts/big-shoulders-display-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Libre Franklin"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../fonts/libre-franklin-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: "Libre Franklin"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../fonts/libre-franklin-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Libre Franklin"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(../fonts/libre-franklin-italic-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: "Libre Franklin"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(../fonts/libre-franklin-italic-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* The hidden SVG sprite with the four suit shapes. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ============ Tokens ============
   60 / 30 / 10: white paper is where you read, felt green is where you play,
   table wood frames the play and marks every action. */
:root {
  color-scheme: light;

  /* 60: paper */
  --paper: #FCFCFA;
  --paper-alt: #F2F4F0;
  --ink: #12302A;
  --ink-2: #4E625C;
  --rule: #DCE2DC;

  /* 30: felt */
  --felt: #1D5B47;
  --felt-hi: #2B7A60;
  --felt-deep: #174C3B;
  --felt-shadow: #0F3529;
  --on-felt: #EEF5F0;
  --on-felt-2: #B6D1C4;
  --felt-line: rgba(238, 245, 240, 0.16);
  --felt-text-dark: #12302A;

  /* 10: wood */
  --wood-900: #2A180B;
  --wood-800: #452814;
  --wood-700: #6A3F20;
  --wood-600: #7A4A24;
  --wood-500: #9C6334;
  --wood-300: #D69E5E;
  --wood-200: #EEC48C;
  --wood-100: #FBEBD3;

  /* Accent by surface: walnut on white, maple on felt and on dark */
  --accent-paper: var(--wood-600);
  --accent-paper-hi: #8E5A2E;
  --accent-paper-ink: #FCF6EE;
  --accent-felt: var(--wood-300);
  --accent-felt-hi: #E6B377;
  --accent-felt-ink: #2A1708;

  /* Card inks */
  --red: #C8283A;
  --red-deep: #9E1B2B;
  --blue: #1F5FB4;
  --green: #1E7F45;
  --card-face: #FFFFFF;
  --card-ink: #13201E;
  --card-shadow: rgba(4, 24, 18, 0.45);

  --neg-paper: #B4232F;
  --neg-felt: #FFA3AC;

  /* Sequential ramp for the range chart: one wood hue, light = earliest seat (validated on both felts) */
  --tier-0: #FBEBD3;
  --tier-1: #EEC48C;
  --tier-2: #D69E5E;
  --tier-3: #B8783E;
  --tier-ink: #2A1708;
  --tier-none: rgba(238, 245, 240, 0.07);

  /* Paper-zone roles (the default zone) */
  --zone: var(--paper);
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --line: var(--rule);
  --inverse: var(--paper);
  --accent: var(--accent-paper);
  --accent-hi: var(--accent-paper-hi);
  --accent-ink: var(--accent-paper-ink);
  --neg: var(--neg-paper);
  --well: var(--paper-alt);
  --track: rgba(18, 48, 42, 0.09);
  --seg-bg: rgba(18, 48, 42, 0.08);
  --hover: rgba(18, 48, 42, 0.05);
  --lift-shadow: 0 24px 48px -28px rgba(15, 53, 41, 0.55);

  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Libre Franklin", "Segoe UI", system-ui, sans-serif;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;

  /* Motion */
  --ease-ui: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-enter: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.175, 1);
  --m-in: 150ms;
  --m-out: 120ms;
  --m-press: 90ms;
  --m-slide: 240ms;
}

/* Dark: a card room after hours. Deep felt-black paper, the felt one step darker, maple wood. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0D1512;
  --paper-alt: #121D19;
  --ink: #E7EEEA;
  --ink-2: #A0B3AC;
  --rule: #24352F;

  --felt: #18503F;
  --felt-hi: #24694F;
  --felt-deep: #134333;
  --felt-shadow: #0A281E;

  --accent-paper: var(--wood-300);
  --accent-paper-hi: var(--wood-200);
  --accent-paper-ink: #2A1708;
  --neg-paper: #FF9AA4;

  --card-face: #F6F4EE;
  --card-shadow: rgba(0, 0, 0, 0.6);

  --track: rgba(231, 238, 234, 0.1);
  --seg-bg: rgba(231, 238, 234, 0.08);
  --hover: rgba(231, 238, 234, 0.06);
  --lift-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.8);
}

/* Felt choices. Green is the default. Each felt sets its own muted text, tinted from its hue (checked at 4.5:1 or more). */
:root[data-felt="blue"] {
  --felt: #1E4F6E; --felt-hi: #2B6A8E; --felt-deep: #19435E; --felt-shadow: #0F2D40;
  --on-felt-2: #B5CCDA;
}
:root[data-felt="red"] {
  --felt: #6A2230; --felt-hi: #873041; --felt-deep: #5A1C28; --felt-shadow: #3A0F18;
  --on-felt-2: #E3BDC3;
}
:root[data-theme="dark"][data-felt="blue"] { --felt: #1A4560; --felt-hi: #255C7C; --felt-deep: #153A52; --felt-shadow: #0B2232; }
:root[data-theme="dark"][data-felt="red"] { --felt: #5C1D29; --felt-hi: #772A38; --felt-deep: #4D1822; --felt-shadow: #300C14; }

/* Felt-zone roles: every surface where cards are dealt */
.felt, .felt-panel {
  --zone: var(--felt);
  --fg: var(--on-felt);
  --fg-2: var(--on-felt-2);
  --line: var(--felt-line);
  --inverse: var(--felt-text-dark);
  --accent: var(--accent-felt);
  --accent-hi: var(--accent-felt-hi);
  --accent-ink: var(--accent-felt-ink);
  --neg: var(--neg-felt);
  --well: rgba(0, 0, 0, 0.2);
  --track: rgba(238, 245, 240, 0.1);
  --seg-bg: rgba(0, 0, 0, 0.24);
  --hover: rgba(255, 255, 255, 0.06);
  color: var(--fg);
}
/* Wood-zone roles: the footer is the table's edge */
.wood {
  --zone: var(--wood-900);
  --fg: #F6EADA;
  --fg-2: #D3BB9E;
  --line: rgba(246, 234, 218, 0.16);
  --accent: var(--wood-200);
  color: var(--fg);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: color-mix(in srgb, var(--ink) 32%, transparent) var(--paper);
  accent-color: var(--accent);
  caret-color: var(--red);
  background: var(--paper);
}
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: color-mix(in srgb, var(--wood-300) 45%, transparent); color: inherit; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; touch-action: manipulation; }
a { color: inherit; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
h3 { font-size: 1.125rem; line-height: 1.3; font-weight: 600; }
p, dd, li { text-wrap: pretty; }
input[type="range"] { accent-color: var(--accent); }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 6px; font-weight: 600; }
.skip:focus { top: 12px; }

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

.pip { width: 1em; height: 1em; fill: currentColor; flex: none; }

/* ============ Surfaces ============ */
.felt {
  background-color: var(--felt);
  /* the table lamp: light pools at the top of every felt surface */
  background-image: radial-gradient(120% 70% at 50% -10%, rgba(255, 255, 255, 0.07), transparent 60%);
}
.felt-deep { background-color: var(--felt-deep); }
.paper { background: var(--paper); color: var(--ink); }
.paper-alt { background: var(--paper-alt); }
.wood {
  background-color: var(--wood-900);
  /* grain: drawn wavy lines, light and dark, that tile without a seam */
  background-image:
    var(--grain),
    linear-gradient(180deg, var(--wood-800), var(--wood-900));
  background-size: 420px 84px, auto;
}
:root {
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='84' fill='none'%3E%3Cpath d='M0 8C84 3 170 15 252 9S378 4 420 8' stroke='rgba(255,220,170,.07)' stroke-width='1.5'/%3E%3Cpath d='M0 23C104 28 190 16 274 22S368 29 420 23' stroke='rgba(0,0,0,.2)' stroke-width='2'/%3E%3Cpath d='M0 38C74 33 158 43 242 37S356 32 420 38' stroke='rgba(255,220,170,.05)' stroke-width='1'/%3E%3Cpath d='M0 53C94 59 200 46 294 53S388 58 420 53' stroke='rgba(0,0,0,.15)' stroke-width='2.6'/%3E%3Cpath d='M0 70C63 65 178 74 262 68S378 64 420 70' stroke='rgba(255,220,170,.06)' stroke-width='1.2'/%3E%3C/svg%3E");
}
/* a felt panel framed by a wood rail */
.felt-panel {
  background: var(--felt);
  background-image: radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.08), transparent 65%);
  border-radius: var(--radius);
  box-shadow: var(--lift-shadow);
}
.has-rail {
  border: 7px solid transparent;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.08), transparent 65%) padding-box,
    linear-gradient(var(--felt), var(--felt)) padding-box,
    linear-gradient(160deg, var(--wood-300), var(--wood-500) 30%, var(--wood-700) 70%, var(--wood-800)) border-box;
  border-radius: calc(var(--radius) + 6px);
}

.section { padding-block: clamp(72px, 9vw, 120px); }
.section-head { max-width: 62ch; margin-bottom: clamp(32px, 4vw, 48px); }
.section-head h2 { font-size: clamp(2.6rem, 6vw, 4rem); line-height: 0.95; margin-bottom: 14px; }
.section-head p { color: var(--fg-2); }

/* ============ Top bar ============ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--paper);
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner { display: flex; align-items: center; gap: 14px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 1.35rem; text-decoration: none; white-space: nowrap; }
.brand-mark { display: inline-grid; place-items: center; width: 26px; height: 34px; background: var(--card-face); color: var(--card-ink); border-radius: 4px; rotate: -6deg; box-shadow: 0 0 0 1px rgba(18, 48, 42, 0.12), 0 2px 4px rgba(0, 0, 0, 0.25); font-size: 15px; }
.mainnav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  position: relative; text-decoration: none; font-size: 0.9375rem; font-weight: 500;
  padding: 10px 10px; color: var(--ink-2); white-space: nowrap;
  transition: color var(--m-out) ease;
}
.mainnav a::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 4px; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform var(--m-out) var(--ease-ui);
}
.mainnav a[aria-current="true"] { color: var(--ink); }
.mainnav a[aria-current="true"]::after { transform: scaleX(1); }

.top-tools { display: flex; align-items: center; gap: 8px; }
.deck-toggle, .theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  background: transparent; border: 1px solid var(--rule); border-radius: 999px; padding: 6px 14px;
  cursor: pointer; color: var(--ink-2); font-size: 0.875rem; white-space: nowrap;
  transition: color var(--m-out) ease, border-color var(--m-out) ease, background-color var(--m-out) ease, transform var(--m-press) var(--ease-ui);
}
.deck-toggle:active, .theme-toggle:active { transform: scale(0.95); }
.deck-pips { display: inline-flex; gap: 3px; font-size: 12px; }
.deck-pips .pip { color: var(--ink); transition: color 200ms ease; }
.deck-pips .pip:nth-child(2), .deck-pips .pip:nth-child(3) { color: var(--red); }
.deck-toggle[aria-pressed="true"] { color: var(--ink); border-color: var(--accent); }
.deck-toggle[aria-pressed="true"] .pip:nth-child(3) { color: var(--blue); }
.deck-toggle[aria-pressed="true"] .pip:nth-child(4) { color: var(--green); }
:root[data-theme="dark"] .deck-pips .pip:nth-child(2), :root[data-theme="dark"] .deck-pips .pip:nth-child(3) { color: #FF7A86; }
:root[data-theme="dark"] .deck-toggle[aria-pressed="true"] .pip:nth-child(3) { color: #78AEFF; }
:root[data-theme="dark"] .deck-toggle[aria-pressed="true"] .pip:nth-child(4) { color: #62D493; }

/* Theme switch: the sun sets into a crescent */
.theme-toggle { width: 40px; padding: 0; }
.theme-toggle svg { width: 20px; height: 20px; overflow: visible; }
.theme-toggle .sun-core { fill: currentColor; transform-origin: 12px 12px; transition: transform 420ms var(--ease-out); }
.theme-toggle .sun-rays { stroke: currentColor; stroke-width: 2; stroke-linecap: round; transform-origin: 12px 12px; transition: transform 420ms var(--ease-out), opacity 240ms ease; }
.theme-toggle .moon-bite { fill: var(--paper); opacity: 0; transition: transform 420ms var(--ease-out), opacity 200ms ease; transform: translate(9px, -9px); }
:root[data-theme="dark"] .theme-toggle .moon-bite { opacity: 1; }
:root[data-theme="dark"] .theme-toggle .sun-core { transform: scale(1.55); }
:root[data-theme="dark"] .theme-toggle .sun-rays { transform: rotate(-60deg) scale(0.5); opacity: 0; }
:root[data-theme="dark"] .theme-toggle .moon-bite { transform: translate(3.6px, -3.6px); }

/* The new theme spreads out from the switch */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ============ Buttons & controls ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.9875rem; cursor: pointer; text-decoration: none; user-select: none;
  transition:
    background-color var(--m-out) ease,
    border-color var(--m-out) ease,
    color var(--m-out) ease,
    transform var(--m-out) var(--ease-ui),
    opacity var(--m-out) ease;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.975); transition-duration: var(--m-press); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18), 0 8px 18px -10px rgba(0, 0, 0, 0.5); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--fg); }
.btn-ink { background: var(--fg); color: var(--inverse); }
.btn:disabled { cursor: default; opacity: 0.5; }

@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { transform: translateY(-1px); transition-duration: var(--m-in); }
  .btn-primary:hover:not(:disabled) { background: var(--accent-hi); }
  .btn-ghost:hover:not(:disabled) { border-color: color-mix(in srgb, var(--fg) 42%, transparent); background: var(--hover); }
  .btn-ink:hover:not(:disabled) { background: color-mix(in srgb, var(--fg) 86%, var(--zone)); }
  .mainnav a:hover { color: var(--ink); transition-duration: var(--m-in); }
  .mainnav a:hover::after { transform: scaleX(1); transform-origin: left; transition-duration: var(--m-in); }
  .deck-toggle:hover, .theme-toggle:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 40%, transparent); }
}

/* Segmented control with a sliding indicator */
.seg {
  position: relative; isolation: isolate;
  display: inline-flex; justify-self: start; align-self: start; flex-wrap: wrap; gap: 2px;
  padding: 3px; border-radius: 999px; background: var(--seg-bg);
}
.seg button {
  position: relative; border: 0; background: transparent; padding: 8px 14px; border-radius: 999px;
  cursor: pointer; font-size: 0.9rem; font-weight: 500; color: var(--fg); opacity: 0.8; min-height: 36px;
  transition: color var(--m-slide) ease, opacity var(--m-out) ease, background-color var(--m-out) ease;
}
.seg button[aria-pressed="true"] { opacity: 1; background: var(--fg); color: var(--inverse); }
.seg-ind {
  position: absolute; top: 0; left: 0; z-index: -1; border-radius: 999px;
  background: var(--fg); transform-origin: 0 0; pointer-events: none;
  transition: transform var(--m-slide) var(--ease-ui);
}
.seg.has-ind button[aria-pressed="true"] { background: transparent; }
.seg-small button { padding: 5px 11px; font-size: 0.8125rem; min-height: 30px; }
@media (hover: hover) and (pointer: fine) {
  .seg button:hover { opacity: 1; }
}

/* ============ Playing cards ============ */
.card {
  --cw: 64px;
  position: relative;
  width: var(--cw);
  aspect-ratio: 5 / 7;
  flex: none;
  transform-style: preserve-3d;
  font-family: var(--display);
  user-select: none;
  transition: translate 260ms var(--ease-out), transform 300ms var(--ease-out);
}
.card-inner { position: absolute; inset: 0; transform-style: preserve-3d; }
.card-face {
  position: absolute; inset: 0;
  border-radius: 8% / 5.7%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.card-front {
  container-type: inline-size;
  background: var(--card-face);
  color: var(--card-ink);
  box-shadow: 0 0 0 1px rgba(18, 48, 42, 0.08), 0 1px 0 rgba(0, 0, 0, 0.12), 0 6px 14px -4px var(--card-shadow);
  overflow: hidden;
}
.card[data-s="h"] .card-front, .card[data-s="d"] .card-front { color: var(--red); }
.four-color .card[data-s="d"] .card-front { color: var(--blue); }
.four-color .card[data-s="c"] .card-front { color: var(--green); }
.card-front, .pk { transition: color 200ms ease, opacity 260ms ease, filter 260ms ease; }

.ci {
  position: absolute; top: 5%; left: 7%;
  display: flex; flex-direction: column; align-items: center; gap: 2cqw;
  font-weight: 800; font-size: 30cqw; line-height: 0.82; letter-spacing: -0.02em;
}
.ci .pip { width: 19cqw; height: 19cqw; }
.ci-b { top: auto; left: auto; right: 8%; bottom: 5%; rotate: 180deg; }
.cc { position: absolute; inset: 0; display: grid; place-items: center; }
.cc .pip { width: 42cqw; height: 42cqw; }
.card[data-r="A"] .cc .pip { width: 56cqw; height: 56cqw; }
.cf {
  position: absolute; inset: 21% 19%;
  display: grid; place-items: center; align-content: center; gap: 3cqw;
  border-radius: 6cqw;
  background: color-mix(in srgb, currentColor 7%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 30%, transparent);
}
.cf b { font-size: 40cqw; line-height: 0.8; font-weight: 900; }
.cf .pip { width: 18cqw; height: 18cqw; }

@container (max-width: 52px) {
  .ci-b { display: none; }
  .cc { inset: auto 8% 6% auto; display: block; }
  .cc .pip, .card[data-r="A"] .cc .pip { width: 48cqw; height: 48cqw; }
  .cf { inset: auto 8% 6% auto; background: none; box-shadow: none; display: block; }
  .cf b { display: none; }
  .cf .pip { width: 48cqw; height: 48cqw; }
}

.card-back {
  transform: rotateY(180deg);
  background-color: var(--red);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Cpath d='M5 0.5L9.5 5L5 9.5L0.5 5Z' fill='none' stroke='%23ffffff' stroke-opacity='.3' stroke-width='.9'/%3E%3C/svg%3E"),
    radial-gradient(circle at 50% 40%, #D9384A, var(--red-deep));
  background-size: 10px 10px, cover;
  box-shadow:
    inset 0 0 0 calc(var(--cw) * .055) var(--card-face),
    inset 0 0 0 calc(var(--cw) * .07) rgba(0, 0, 0, .12),
    0 6px 14px -4px var(--card-shadow);
}
.card.is-down .card-inner { transform: rotateY(180deg); }

.card.dim .card-front { opacity: 0.4; filter: saturate(0.5); }
.card.dim { translate: 0 4px; }
.card.lift { translate: 0 -8px; }

.slot {
  --cw: 64px;
  width: var(--cw); aspect-ratio: 5 / 7; flex: none;
  border-radius: 8% / 5.7%;
  border: 1.5px dashed color-mix(in srgb, var(--fg) 30%, transparent);
}

/* ============ Hero ============ */
.hero { padding-block: clamp(28px, 4vw, 56px) clamp(56px, 8vw, 104px); overflow: hidden; position: relative; }
/* the lamp over the table: a warm pool of light behind the stage */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(48% 60% at 72% 42%, color-mix(in srgb, var(--wood-200) 22%, transparent), transparent 70%);
}
:root[data-theme="dark"] .hero::before {
  background: radial-gradient(46% 58% at 72% 40%, rgba(214, 158, 94, 0.13), transparent 72%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 4vw, 56px); align-items: center; }
.hero h1 { font-size: clamp(3.2rem, 6.4vw, 5.6rem); line-height: 0.9; margin-bottom: 24px; font-weight: 900; }
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.08em 0.02em 0.1em; margin: -0.08em -0.02em -0.1em; }
.hero h1 .wi { display: inline-block; }
html.m-enter:not(.m-enter-done) .hero h1 { visibility: hidden; }
.lede { font-size: 1.1875rem; color: var(--fg-2); max-width: 44ch; margin-bottom: 28px; }
.hero-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 24px; }

/* Links: a hairline at rest; on hover a solid line draws left to right and leaves to the right */
.hero-links a {
  position: relative; display: inline-block; padding-block: 8px;
  font-weight: 600; text-decoration: none;
  transition: color var(--m-out) ease;
}
.hero-links a::before, .hero-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 2px; border-radius: 2px;
}
.hero-links a::before { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.hero-links a::after {
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 220ms var(--ease-out);
}
.aside a, .points a {
  font-weight: 600; color: var(--accent);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transition: text-decoration-color var(--m-out) ease;
}
@media (hover: hover) and (pointer: fine) {
  .hero-links a:hover { color: var(--accent); transition-duration: var(--m-in); }
  .hero-links a:hover::after { transform: scaleX(1); transform-origin: left; }
  .aside a:hover, .points a:hover { text-decoration-color: currentColor; }
}

/* The 3D stage. The canvas draws the table; the HTML table below stays for screen readers and as the fallback. */
.stage { position: relative; }
.stage-canvas {
  position: relative; display: none;
  width: calc(100% + 120px); margin: -40px -96px -28px -24px;
  aspect-ratio: 16 / 10;
  touch-action: pan-y;
  cursor: grab;
  /* soft edges: the table's shadow fades out instead of stopping at the canvas */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 5%, #000 82%, transparent), linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(to bottom, transparent, #000 5%, #000 82%, transparent), linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
          mask-composite: intersect;
}
.stage-canvas.grabbing { cursor: grabbing; }
.stage-canvas canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; outline: none; }
.demo.is-3d .stage-canvas { display: block; }
.demo.is-3d .table-rail {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
/* Felt picker: three swatches over the top-left of the table */
.demo { position: relative; }
.felt-picker {
  position: absolute; z-index: 2; left: 0; top: 0;
  display: flex; align-items: center; gap: 2px;
  margin: 0; padding: 3px 6px 3px 14px; border: 1px solid var(--rule); border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
}
.felt-picker legend { float: left; padding: 0; margin-right: 4px; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
.felt-picker label { position: relative; display: grid; place-items: center; width: 34px; height: 34px; cursor: pointer; border-radius: 50%; }
.felt-picker input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.felt-sw {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.12);
  outline: 2px solid transparent; outline-offset: 2px;
  transition: outline-color var(--m-out) ease, transform var(--m-press) var(--ease-ui);
}
:root[data-theme="dark"] .felt-sw { box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.22); }
.felt-picker label:active .felt-sw { transform: scale(0.9); }
.felt-picker input:checked + .felt-sw { outline-color: var(--accent); }
.felt-picker input:focus-visible + .felt-sw { outline-color: var(--ink); outline-style: dashed; }
@media (hover: hover) and (pointer: fine) {
  .felt-picker label:hover .felt-sw { transform: scale(1.1); }
}
.felt-green { --c: #1D5B47; }
.felt-blue { --c: #1E4F6E; }
.felt-red { --c: #6A2230; }
.demo:not(.is-3d) .felt-picker { position: static; margin-bottom: 12px; width: max-content; }

.stage-hint {
  position: absolute; right: 112px; top: 9%;
  font-size: 0.8125rem; font-weight: 500; color: var(--ink-2);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  border: 1px solid var(--rule); border-radius: 999px; padding: 5px 12px;
  pointer-events: none;
  transition: opacity 320ms ease, transform 320ms var(--ease-out);
}
.stage-hint.gone { opacity: 0; transform: translateY(6px); }
@media (hover: none) { .stage-hint { display: none; } }

/* HTML table: the fallback when WebGL is off */
.table-rail {
  padding: clamp(10px, 1.6vw, 16px);
  border-radius: 999px;
  background:
    var(--grain) 0 0 / 420px 84px,
    linear-gradient(180deg, var(--wood-500), var(--wood-700) 55%, var(--wood-800));
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 255, 255, .18) inset;
}
.table-felt {
  position: relative;
  border-radius: 999px;
  background:
    radial-gradient(60% 55% at 50% 38%, rgba(255, 255, 255, .12), transparent 70%),
    radial-gradient(ellipse 80% 70% at 50% 45%, var(--felt-hi), var(--felt) 75%);
  box-shadow: inset 0 14px 40px rgba(0, 0, 0, .38);
  padding: clamp(26px, 4vw, 44px) clamp(20px, 5vw, 56px) clamp(22px, 3vw, 34px);
  display: flex; flex-direction: column; align-items: center; gap: clamp(16px, 2.4vw, 24px);
  perspective: 1100px;
}
/* the betting line printed on the felt */
.table-felt::before {
  content: ""; position: absolute; inset: 8px; border-radius: inherit; pointer-events: none;
  border: 1.5px solid rgba(214, 158, 94, .4);
}
.board, .hole { display: flex; gap: clamp(5px, 1vw, 10px); justify-content: center; transform-style: preserve-3d; }
.board .card, .board .slot { --cw: clamp(44px, 7.6vw, 74px); }
.hole .card { --cw: clamp(56px, 8.6vw, 84px); }
.hole .card:nth-child(1) { rotate: -4deg; }
.hole .card:nth-child(2) { rotate: 5deg; margin-left: -8px; }

.deck {
  --cw: clamp(30px, 4.4vw, 44px);
  position: absolute; left: clamp(22px, 8%, 70px); bottom: clamp(30px, 18%, 64px);
  width: var(--cw); aspect-ratio: 5 / 7;
  rotate: -8deg;
}
.deck span {
  position: absolute; inset: 0; border-radius: 8% / 5.7%;
  background-color: var(--red);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M4 0.5L7.5 4L4 7.5L0.5 4Z' fill='none' stroke='%23ffffff' stroke-opacity='.3' stroke-width='.8'/%3E%3C/svg%3E");
  box-shadow: inset 0 0 0 calc(var(--cw) * .07) var(--card-face), 0 1px 0 rgba(0, 0, 0, .2);
}
.deck span:nth-child(1) { translate: 0 4px; }
.deck span:nth-child(2) { translate: 0 2px; }
.deck span:nth-child(3) { box-shadow: inset 0 0 0 calc(var(--cw) * .07) var(--card-face), 0 6px 12px -2px rgba(0, 0, 0, .4); }
.dealer-btn {
  position: absolute; right: clamp(24px, 10%, 84px); bottom: clamp(34px, 22%, 72px);
  width: clamp(26px, 3.4vw, 34px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 40% 35%, #fff, #E4E8E5);
  color: #12302A; font-family: var(--display); font-weight: 900; font-size: clamp(0.85rem, 1.4vw, 1.05rem);
  box-shadow: 0 0 0 2px rgba(16, 48, 44, .2) inset, 0 4px 8px rgba(0, 0, 0, .35);
}

.demo-panel { margin-top: 22px; display: grid; gap: 16px; position: relative; }
.streets { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.streets li { position: relative; font-size: 0.8125rem; font-weight: 600; color: var(--fg-2); padding-top: 10px; transition: color 240ms ease; }
.streets li::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: 3px; background: var(--track); }
.streets li::after {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: 3px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform 360ms var(--ease-out), opacity 240ms ease;
}
.streets li.done::after { transform: scaleX(1); opacity: 0.45; }
.streets li.now { color: var(--fg); }
.streets li.now::after { transform: scaleX(1); opacity: 1; }
.demo-read { min-height: 96px; }
.demo-hand { font-family: var(--display); font-weight: 800; font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.05; }
.demo-tip { color: var(--fg-2); margin-top: 6px; max-width: 60ch; }
.equity-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.9375rem; color: var(--fg-2); margin-bottom: 10px; }
.meter { height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.meter-fill {
  display: block; height: 100%; width: 100%; border-radius: 999px; background: var(--felt);
  transform: scaleX(0); transform-origin: left; transition: transform 520ms var(--ease-out);
}
:root[data-theme="dark"] .meter-fill { background: var(--accent); }
.equity-value { margin-top: 8px; color: var(--fg-2); font-size: 0.9375rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.equity-value strong { font-family: var(--display); font-size: 1.9rem; color: var(--fg); font-variant-numeric: tabular-nums; font-weight: 800; min-width: 2.4ch; }
.equity-delta { font-size: 0.875rem; font-weight: 600; color: var(--fg-2); min-height: 1.4em; }
.equity-delta[data-dir="up"] { color: var(--accent); }
.equity-delta[data-dir="down"] { color: var(--neg); }
.demo-showdown { font-size: 0.9375rem; font-weight: 600; color: var(--fg); min-height: 1.4em; }
.demo-showdown:empty { min-height: 0; }
.demo-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============ Rules ============ */
.rules-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: start; }
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 52px 1fr; column-gap: 16px; padding: 18px 0; border-top: 1px solid var(--rule); }
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps li::before { content: counter(step); grid-row: span 2; font-family: var(--display); font-weight: 800; font-size: 2.6rem; line-height: 0.85; color: var(--accent); font-variant-numeric: tabular-nums; }
.steps h3 { margin-bottom: 4px; }
.steps p { color: var(--ink-2); }

.seats-card { padding: clamp(20px, 3vw, 28px); position: sticky; top: 84px; display: grid; gap: 16px; }
.seats-head { display: grid; gap: 14px; }
.seats-head h3 { font-family: var(--display); font-size: 1.75rem; font-weight: 800; }
.seats-head p { color: var(--fg-2); font-size: 0.9375rem; min-height: 4.4em; }
.seats { width: 100%; height: auto; overflow: visible; }
.seats-card .btn-ink { justify-self: start; }
.seat .seat-disc { fill: var(--felt-shadow); stroke: rgba(238, 245, 240, .28); stroke-width: 1.5; transition: fill 200ms ease, stroke 200ms ease; }
.seat > text { fill: var(--on-felt); font-family: var(--display); font-weight: 800; font-size: 17px; transition: fill 200ms ease; }
.seat .order-badge circle { fill: var(--accent-felt); }
.seat .order-badge text { fill: var(--accent-felt-ink); font-family: var(--body); font-size: 12px; font-weight: 700; }
.seat.active .seat-disc { fill: var(--accent-felt); stroke: var(--accent-felt); }
.seat.active > text { fill: var(--accent-felt-ink); }
.action-ring { fill: none; stroke: var(--accent-felt); stroke-width: 2.5; opacity: 0; transition: transform 420ms var(--ease-io), opacity 200ms ease; }
.action-ring.on { opacity: 1; }

.actions-block { margin-top: clamp(48px, 6vw, 72px); }
.actions-block > h3 { font-family: var(--display); font-size: 1.75rem; font-weight: 800; margin-bottom: 16px; }
.actions-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.actions-list > div { padding: 14px 16px 0 0; }
.actions-list > div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.actions-list dt { font-family: var(--display); font-weight: 800; font-size: 1.5rem; }
.actions-list dd { color: var(--ink-2); font-size: 0.9375rem; }

/* ============ Statement (scroll moment): each word swings up into place as it lights ============ */
.statement { position: relative; height: 170vh; background-color: var(--felt-deep); }
.statement-pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; align-items: center; overflow: hidden; }
.statement-pin > .wrap { width: 100%; }
.statement-text {
  font-family: var(--display); font-weight: 800; font-size: clamp(2.4rem, 6vw, 5.2rem); line-height: 1;
  max-width: 19ch; color: var(--on-felt); letter-spacing: -0.01em;
  perspective: 900px;
}
.statement.is-live .sw {
  display: inline-block; color: color-mix(in srgb, var(--on-felt) 44%, var(--felt-deep));
  transform: rotateX(-48deg) translateY(0.1em); transform-origin: 50% 100%;
  transition: color 260ms ease, transform 520ms var(--ease-out);
}
.statement.is-live .sw.lit { color: var(--on-felt); transform: none; }
.statement.is-live .sw.key.lit { color: var(--accent-felt); }

/* ============ Rankings ============ */
.rankings { list-style: none; padding: 0; counter-reset: rk; }
.rank-row {
  counter-increment: rk;
  display: grid;
  grid-template-columns: 44px minmax(170px, 1.1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 12px 28px;
  padding: 16px 12px;
  border-top: 1px solid var(--rule);
  border-radius: 10px;
  transition: background-color 300ms ease;
}
.rank-row:last-child { border-bottom: 1px solid var(--rule); }
.rank-row::before { content: counter(rk); font-family: var(--display); font-weight: 800; font-size: 2rem; color: var(--ink-2); line-height: 1; font-variant-numeric: tabular-nums; }
.rank-name h3 { font-family: var(--display); font-size: 1.6rem; font-weight: 800; line-height: 1; }
.rank-name p { color: var(--ink-2); font-size: 0.9375rem; margin-top: 4px; }
.rank-cards { display: flex; gap: 4px; perspective: 700px; }
.rank-cards .card { --cw: 40px; }
.rank-cards .card.dim { translate: none; }
/* cards turn face up as their row scrolls into view */
.rankings.will-flip .card-inner { transition: transform 620ms cubic-bezier(0.65, 0, 0.35, 1); transition-delay: var(--fd, 0ms); }
.rank-freq { display: grid; gap: 6px; }
.freq-bar { height: 8px; border-radius: 0 4px 4px 0; background: var(--track); overflow: hidden; }
.freq-bar span { display: block; height: 100%; width: 100%; background: var(--felt); border-radius: 0 4px 4px 0; transform-origin: left; }
:root[data-theme="dark"] .freq-bar span { background: var(--felt-hi); }
.rank-freq p { font-size: 0.875rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rank-freq p strong { color: var(--ink); font-weight: 600; }
.rank-row.is-yours { background: color-mix(in srgb, var(--wood-300) 18%, transparent); }
.yours-tag { display: inline-block; margin-left: 8px; font-family: var(--body); font-size: 0.75rem; font-weight: 600; letter-spacing: 0; background: var(--accent); color: var(--accent-ink); padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.rankings-note { margin-top: 14px; color: var(--ink-2); font-size: 0.875rem; max-width: 75ch; }
@media (hover: hover) and (pointer: fine) {
  /* the hand fans toward you */
  .rank-row:hover .rank-cards .card { transform: translateZ(18px) rotateX(10deg); }
  .rank-row:hover .rank-cards .card:nth-child(2) { transition-delay: 25ms; }
  .rank-row:hover .rank-cards .card:nth-child(3) { transition-delay: 50ms; }
  .rank-row:hover .rank-cards .card:nth-child(4) { transition-delay: 75ms; }
  .rank-row:hover .rank-cards .card:nth-child(5) { transition-delay: 100ms; }
}

/* ============ Range chart ============ */
.ranges-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(28px, 4vw, 56px); align-items: start; }
.chart-wrap { display: grid; gap: 16px; }
.hand-chart { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 2px; max-width: 640px; perspective: 900px; }
.hc {
  --d: 0ms;
  aspect-ratio: 1;
  border: 0; padding: 0;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(0.56rem, 1.5vw, 0.95rem);
  border-radius: 3px;
  cursor: pointer;
  background: var(--tier-none);
  color: rgba(238, 245, 240, .55);
  transition: background-color 240ms ease var(--d), color 240ms ease var(--d), transform 120ms var(--ease-ui), box-shadow 120ms ease;
}
.hc.pair { box-shadow: inset 0 0 0 1px rgba(238, 245, 240, .22); }
.hc[data-tier] { color: var(--tier-ink); }
.hc[data-tier="0"] { background: var(--tier-0); }
.hc[data-tier="1"] { background: var(--tier-1); }
.hc[data-tier="2"] { background: var(--tier-2); }
.hc[data-tier="3"] { background: var(--tier-3); }
.hc[data-tier="sb"] { background: var(--on-felt); color: var(--felt-text-dark); }
.hc.off { background: var(--tier-none); color: rgba(238, 245, 240, .38); }
.hc:focus-visible, .hc.hot { transform: scale(1.18) translateZ(20px); position: relative; z-index: 2; box-shadow: 0 0 0 2px var(--felt), 0 0 0 4px var(--on-felt), 0 10px 18px -6px rgba(0, 0, 0, .5); outline: none; }
@media (hover: hover) and (pointer: fine) {
  .hc:hover { transform: scale(1.18) translateZ(20px); position: relative; z-index: 2; box-shadow: 0 0 0 2px var(--felt), 0 0 0 4px var(--on-felt), 0 10px 18px -6px rgba(0, 0, 0, .5); }
}
.chart-key { font-size: 0.875rem; color: var(--fg-2); }

.range-side { display: grid; gap: 22px; position: sticky; top: 84px; }
.range-summary { font-size: 1rem; color: var(--fg-2); }
.range-summary b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.share { height: 8px; border-radius: 999px; background: rgba(0, 0, 0, .28); overflow: hidden; margin-top: 12px; }
.share span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; transition: transform 360ms var(--ease-out); }
.legend { list-style: none; padding: 0; display: grid; gap: 8px; font-size: 0.9375rem; }
.legend li { display: flex; align-items: center; gap: 10px; }
.legend .sw { width: 18px; height: 18px; border-radius: 3px; flex: none; }
.legend .sw-none { background: var(--tier-none); box-shadow: inset 0 0 0 1px rgba(238, 245, 240, .18); }
.legend span:last-child { color: var(--fg-2); }
.legend b { color: var(--fg); font-weight: 600; }
.hand-info { border-top: 1px solid var(--line); padding-top: 18px; min-height: 150px; }
.hand-info-key { font-family: var(--display); font-weight: 900; font-size: 3rem; line-height: 1; }
.hand-info-name { color: var(--fg-2); margin-top: 6px; }
.hand-info-verdict { margin-top: 10px; }

/* ============ Odds ============ */
.odds-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.odds-input { padding: clamp(18px, 2.6vw, 28px); }
.slots { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 14px; }
.slot-group h3 { font-size: 0.9375rem; font-weight: 600; color: var(--fg-2); margin-bottom: 10px; }
.slot-row { display: flex; gap: 6px; perspective: 900px; }
.slot-row .card, .slot-row .slot { --cw: clamp(40px, 6vw, 58px); }
.pick-slot { padding: 0; background: transparent; border: 0; cursor: pointer; border-radius: 6px; display: block; transition: transform var(--m-press) var(--ease-ui); }
.pick-slot:active { transform: scale(0.96); }
.pick-slot .slot { transition: border-color 150ms ease, background-color 150ms ease; }
.pick-slot.active .slot { border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.pick-slot.active .card-front { outline: 3px solid var(--accent); outline-offset: 0; }
.picker-hint { font-size: 0.9375rem; color: var(--fg-2); margin-bottom: 10px; min-height: 1.5em; }
.picker { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 4px; perspective: 800px; }
.pk {
  aspect-ratio: 5 / 7;
  border: 0; border-radius: 5px; padding: 0;
  background: var(--card-face); color: var(--card-ink);
  font-family: var(--display); font-weight: 800; font-size: clamp(0.72rem, 1.5vw, 1.05rem);
  line-height: 1;
  display: grid; place-items: center; align-content: center; gap: 3px;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .15);
  transition: transform var(--m-out) var(--ease-ui), opacity 200ms ease, color 200ms ease, box-shadow var(--m-out) ease;
}
.pk .pip { width: 0.8em; height: 0.8em; }
.pk[data-s="h"], .pk[data-s="d"] { color: var(--red); }
.four-color .pk[data-s="d"] { color: var(--blue); }
.four-color .pk[data-s="c"] { color: var(--green); }
.pk:active:not(:disabled) { transform: scale(0.94); transition-duration: var(--m-press); }
.pk:disabled { opacity: 0.14; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .pk:hover:not(:disabled) { transform: translateY(-4px) translateZ(12px) rotateX(12deg); box-shadow: 0 8px 12px -6px rgba(0, 0, 0, .5); transition-duration: var(--m-in); }
}
.odds-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 5px 5px 16px; font-size: 0.9375rem; color: var(--fg-2); min-height: 46px; }
.stepper span { margin-right: 6px; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--track); color: var(--fg); cursor: pointer; font-size: 1.1rem; transition: background-color var(--m-out) ease, transform var(--m-press) var(--ease-ui); }
.stepper button:active:not(:disabled) { transform: scale(0.92); }
.stepper button:disabled { opacity: .35; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .stepper button:hover:not(:disabled) { background: color-mix(in srgb, var(--fg) 18%, transparent); }
}
.stepper output { min-width: 22px; text-align: center; font-family: var(--display); font-weight: 800; font-size: 1.25rem; color: var(--fg); font-variant-numeric: tabular-nums; }

.odds-output { background: var(--well); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 28px); min-height: 400px; }
.odds-empty { min-height: 340px; display: grid; place-items: center; align-content: center; gap: 18px; text-align: center; color: var(--fg-2); }
.odds-empty p { max-width: 30ch; }
.odds-now { font-family: var(--display); font-weight: 800; font-size: 1.75rem; line-height: 1.1; margin-bottom: 18px; }
.odds-now small { display: block; font-family: var(--body); font-weight: 400; font-size: 0.9375rem; color: var(--fg-2); margin-top: 6px; line-height: 1.45; }
.wtl { position: relative; height: 22px; border-radius: 4px; overflow: hidden; background: var(--track); }
.wtl span { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); transition: transform 320ms var(--ease-out); }
.wtl .w { background: var(--accent); }
.wtl .t { background: var(--fg-2); }
.wtl .l { background: color-mix(in srgb, var(--fg) 18%, transparent); }
.wtl-legend { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 4px 28px; margin-top: 12px; }
.wtl-legend div { display: grid; }
.wtl-legend dt { font-size: 0.8125rem; color: var(--fg-2); display: flex; align-items: center; gap: 6px; }
.wtl-legend dt::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.wtl-legend dd { font-family: var(--display); font-weight: 800; font-size: 2rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.dist-title { font-size: 0.9375rem; font-weight: 600; color: var(--fg-2); margin: 26px 0 10px; }
.dist { list-style: none; padding: 0; display: grid; gap: 6px; }
.dist li { display: grid; grid-template-columns: 118px 1fr 52px; gap: 10px; align-items: center; font-size: 0.875rem; transition: opacity 200ms ease; }
.dist .bar { height: 10px; background: var(--track); border-radius: 0 4px 4px 0; overflow: hidden; }
.dist .bar span { display: block; height: 100%; width: 100%; background: var(--felt); border-radius: 0 4px 4px 0; transform: scaleX(0); transform-origin: left; transition: transform 320ms var(--ease-out); }
:root[data-theme="dark"] .dist .bar span { background: var(--felt-hi); }
.dist .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--fg-2); }
.dist li.zero { opacity: 0.45; }
.odds-foot { margin-top: 18px; font-size: 0.8125rem; color: var(--fg-2); font-variant-numeric: tabular-nums; }

.potodds { margin-top: clamp(48px, 6vw, 72px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(24px, 4vw, 56px); padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--line); }
.potodds-copy h3 { font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1; margin-bottom: 12px; }
.potodds-copy p { color: var(--fg-2); }
.potodds-tool { display: grid; gap: 18px; }
.po-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 52px; align-items: center; gap: 14px; }
.po-row label, .po-label { font-size: 0.9375rem; color: var(--fg-2); }
.po-row output { font-family: var(--display); font-weight: 800; font-size: 1.4rem; text-align: right; font-variant-numeric: tabular-nums; }
.po-row-draws, .po-row:has(.seg) { grid-template-columns: 150px minmax(0, 1fr); }
input[type="range"] { width: 100%; height: 28px; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 8px 14px; min-height: 38px;
  cursor: pointer; font-size: 0.875rem; font-weight: 500;
  transition: background-color var(--m-out) ease, color var(--m-out) ease, border-color var(--m-out) ease, transform var(--m-press) var(--ease-ui);
}
.chips button:active { transform: scale(0.96); }
.chips button small { color: var(--fg-2); font-size: 0.8em; margin-left: 4px; transition: color var(--m-out) ease; }
.chips button[aria-pressed="true"] { background: var(--fg); color: var(--inverse); border-color: var(--fg); }
.chips button[aria-pressed="true"] small { color: color-mix(in srgb, var(--inverse) 72%, transparent); }
@media (hover: hover) and (pointer: fine) {
  .chips button:hover:not([aria-pressed="true"]) { border-color: color-mix(in srgb, var(--fg) 40%, transparent); }
}
.po-verdict { border-radius: var(--radius); background: var(--well); border: 1px solid var(--line); padding: 18px 20px; display: grid; gap: 14px; }
.po-compare { display: grid; gap: 8px; }
.po-line { display: grid; grid-template-columns: 120px 1fr 52px; align-items: center; gap: 12px; font-size: 0.875rem; color: var(--fg-2); }
.po-line .bar { height: 10px; border-radius: 0 4px 4px 0; background: var(--track); overflow: hidden; }
.po-line .bar span { display: block; height: 100%; width: 100%; border-radius: 0 4px 4px 0; transform-origin: left; transition: transform 320ms var(--ease-out); }
.po-line.need .bar span { background: var(--fg-2); }
.po-line.have .bar span { background: var(--accent); }
.po-line b { text-align: right; color: var(--fg); font-variant-numeric: tabular-nums; }
.po-say { font-size: 1.0625rem; }
.po-say strong { color: var(--accent); }
.po-say.no strong { color: var(--neg); }
.po-rule { font-size: 0.8125rem; color: var(--fg-2); }

/* ============ Strategy ============ */
.strategy { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.strategy-tabs { position: sticky; top: 84px; isolation: isolate; display: grid; gap: 2px; }
.strategy-tabs button {
  text-align: left; border: 0; background: transparent; padding: 12px 16px; border-radius: 10px; min-height: 44px;
  cursor: pointer; font-weight: 500; color: var(--ink-2);
  transition: color var(--m-slide) ease, background-color var(--m-out) ease;
}
.strategy-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.strategy-tabs .seg-ind { background: var(--ink); border-radius: 10px; }
.strategy-tabs.has-ind button[aria-selected="true"] { background: transparent; }
@media (hover: hover) and (pointer: fine) {
  .strategy-tabs button:not([aria-selected="true"]):hover { color: var(--ink); background: var(--hover); }
}
.strategy-panels article { max-width: 68ch; }
.strategy-panels article:focus-visible { outline-offset: 8px; }
.strategy-panels h3 { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1; margin-bottom: 16px; }
.strategy-panels .big { font-size: 1.25rem; line-height: 1.5; margin-bottom: 22px; }
.points { padding: 0; list-style: none; display: grid; }
.points li { padding: 14px 0 14px 28px; border-top: 1px solid var(--rule); position: relative; color: var(--ink-2); }
.points li::before {
  content: ""; position: absolute; left: 2px; top: 19px; width: 12px; height: 12px; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 5C62 24 93 38 93 60c0 13-10 22-21 22-8 0-15-4-18-10 1 10 5 17 13 23H33c8-6 12-13 13-23-3 6-10 10-18 10C17 82 7 73 7 60 7 38 38 24 50 5Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 5C62 24 93 38 93 60c0 13-10 22-21 22-8 0-15-4-18-10 1 10 5 17 13 23H33c8-6 12-13 13-23-3 6-10 10-18 10C17 82 7 73 7 60 7 38 38 24 50 5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.points li strong { color: var(--ink); }
.aside { margin-top: 20px; padding: 16px 18px; background: color-mix(in srgb, var(--wood-300) 16%, transparent); border-radius: 10px; font-size: 0.9375rem; }
.sizing { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.sizing caption { text-align: left; font-weight: 600; margin-bottom: 8px; }
.sizing th, .sizing td { text-align: left; padding: 12px 12px 12px 0; border-top: 1px solid var(--rule); vertical-align: top; }
.sizing th { font-weight: 600; color: var(--ink-2); font-size: 0.8125rem; }
.sizing td:first-child { color: var(--ink-2); }
.sizing td:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.texture { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.texture figure { padding: 18px; display: grid; gap: 14px; align-content: start; }
.texture figcaption { font-size: 0.9375rem; color: var(--fg-2); }
.texture figcaption strong { color: var(--fg); }
.mini-cards { display: flex; gap: 5px; }
.mini-cards .card { --cw: 46px; }

/* ============ Practice ============ */
.drills { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 32px); align-items: start; }
.drill { background: var(--well); border-radius: var(--radius); padding: clamp(20px, 3vw, 30px); display: grid; gap: 20px; }
.drill-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.drill-head h3 { font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1; }
.score { font-size: 0.9375rem; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.score b { color: var(--fg); }
.sd-table { display: grid; gap: 18px; }
.sd-board {
  display: flex; gap: 6px; justify-content: center; padding: 18px; border-radius: 999px;
  background:
    radial-gradient(ellipse at 50% 40%, var(--felt-hi), var(--felt) 75%) padding-box,
    linear-gradient(160deg, var(--wood-300), var(--wood-600) 45%, var(--wood-800)) border-box;
  border: 6px solid transparent;
  box-shadow: inset 0 8px 24px rgba(0, 0, 0, .3), 0 12px 24px -16px rgba(0, 0, 0, .6);
  perspective: 900px;
}
.sd-board .card { --cw: clamp(40px, 6vw, 58px); }
.sd-players { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sd-player { border-radius: 12px; padding: 14px; border: 1px solid var(--line); outline: 2px solid transparent; outline-offset: -2px; display: grid; gap: 10px; justify-items: center; text-align: center; transition: outline-color 260ms ease, background-color 260ms ease; }
.sd-player.won { outline-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.sd-name { font-weight: 600; font-size: 0.9375rem; }
.sd-cards { display: flex; gap: 5px; perspective: 900px; }
.sd-cards .card { --cw: clamp(40px, 5.6vw, 54px); }
.sd-made { font-size: 0.875rem; color: var(--fg-2); min-height: 1.4em; }
.drill-answers { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-choice { flex: 1 1 0; background: var(--on-felt); color: var(--felt-text-dark); min-width: 120px; }
@media (hover: hover) and (pointer: fine) {
  .btn-choice:hover:not(:disabled) { background: #fff; }
}
.btn-choice:disabled { opacity: .42; }
.btn-choice.right { opacity: 1; background: var(--accent); color: var(--accent-ink); }
.btn-choice.wrong { opacity: 1; background: #F3B7BE; color: #5A0D16; text-decoration: line-through; }
.feedback { min-height: 1.5em; }
.feedback strong { color: var(--accent); }
.feedback.no strong { color: var(--neg); }
.drill > .btn-primary { justify-self: start; }
.pf-table { display: grid; gap: 18px; justify-items: center; text-align: center; padding: 10px 0; }
.pf-seat { color: var(--fg-2); }
.pf-seat strong { color: var(--fg); }
.pf-cards { display: flex; perspective: 900px; }
.pf-cards .card { --cw: clamp(72px, 9vw, 94px); }
.pf-cards .card:nth-child(1) { rotate: -5deg; }
.pf-cards .card:nth-child(2) { rotate: 5deg; margin-left: -12px; }

/* ============ Glossary ============ */
.glossary-head { max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; }
.search { width: min(320px, 100%); }
.search input {
  width: 100%; min-height: 46px; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper-alt); padding: 10px 18px;
  font: inherit; color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.search input::placeholder { color: var(--ink-2); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.glossary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 48px); }
.glossary > div { padding: 16px 0; border-top: 1px solid var(--rule); }
.glossary dt { font-family: var(--display); font-weight: 800; font-size: 1.375rem; line-height: 1.1; margin-bottom: 4px; }
.glossary dd { color: var(--ink-2); font-size: 0.9375rem; }
.glossary mark { background: color-mix(in srgb, var(--wood-300) 40%, transparent); color: inherit; border-radius: 2px; }
.glossary-empty { color: var(--ink-2); padding: 24px 0; }

/* ============ Footer ============ */
.footer { padding-block: 36px; border-top: 4px solid var(--wood-600); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer p:last-child { color: var(--fg-2); font-size: 0.9375rem; }
.footer-notes { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.footer-notes p, .footer-notes p:last-child { color: var(--fg-2); font-size: 0.8125rem; line-height: 1.5; margin: 0; max-width: 80ch; }
.footer-notes a { text-decoration: underline; text-underline-offset: 2px; }
.footer-notes a:hover { color: var(--fg); }

/* ============ Responsive ============ */
@media (max-width: 1080px) {
  .deck-label { display: none; }
}
@media (max-width: 960px) {
  .hero-grid { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .hero-copy { display: contents; }
  .hero h1 { order: 1; }
  .demo { order: 2; margin-bottom: 40px; }
  .lede { order: 3; }
  .hero-links { order: 4; }
  .hero::before { background: radial-gradient(70% 40% at 50% 34%, color-mix(in srgb, var(--wood-200) 22%, transparent), transparent 70%); }
  .stage-canvas { width: calc(100% + 2 * var(--gutter)); margin: -8px calc(var(--gutter) * -1) -12px; aspect-ratio: 16 / 11; }
  .rules-grid, .odds-grid, .drills, .potodds { grid-template-columns: 1fr; }
  .seats-card, .range-side, .strategy-tabs { position: static; }
  .ranges-grid { grid-template-columns: 1fr; }
  .range-side { grid-template-columns: 1fr 1fr; }
  .range-side .hand-info { grid-column: 1 / -1; }
  .strategy { grid-template-columns: 1fr; }
  .strategy-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions-list { grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 0; }
  .actions-list > div, .actions-list > div + div { padding: 14px 0; border-left: 0; border-top: 1px solid var(--rule); }
  .actions-list > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--rule); }
  .glossary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rank-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .rank-freq { grid-column: 2 / -1; }
}
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 0 10px; padding-block: 8px 0; }
  .brand { font-size: 1.2rem; }
  .top-tools { margin-left: auto; }
  .mainnav { order: 3; width: 100%; margin: 2px calc(var(--gutter) * -1) 0; padding: 0 calc(var(--gutter) - 10px); }
  .mainnav a { padding-block: 12px; }
  html { scroll-padding-top: 116px; }
}
@media (max-width: 640px) {
  .rank-row { grid-template-columns: 30px minmax(0, 1fr); gap: 10px 14px; padding: 16px 4px; }
  .rank-cards, .rank-freq { grid-column: 2 / -1; }
  .rank-cards .card { --cw: 40px; }
  .texture { grid-template-columns: 1fr; }
  .range-side { grid-template-columns: 1fr; }
  .strategy-tabs button { font-size: 0.9rem; padding: 10px 12px; }
  .glossary { grid-template-columns: 1fr; }
  .po-row, .po-row-draws, .po-row:has(.seg) { grid-template-columns: 1fr 52px; }
  .po-row label, .po-row .po-label { grid-column: 1 / -1; }
  .po-row-draws .chips, .po-row .seg { grid-column: 1 / -1; }
  .dist li { grid-template-columns: 100px 1fr 46px; }
  .po-line { grid-template-columns: 96px 1fr 46px; }
  .sd-players { gap: 8px; }
  .sd-player { padding: 10px 6px; }
  .sd-board { padding: 14px 10px; gap: 4px; }
  .odds-input { padding: 14px; }
  .picker { gap: 3px; }
  .seg-wide { flex-wrap: nowrap; }
  .seg-wide button { padding: 7px 9px; font-size: 0.8125rem; }
  .hand-chart { gap: 1px; }
  .wtl-legend { gap: 4px 18px; }
  .wtl-legend dd { font-size: 1.6rem; }
  .table-felt { border-radius: 120px; padding-inline: 16px; }
  .table-rail { border-radius: 136px; }
  .deck { left: 22px; bottom: 26px; }
  .dealer-btn { right: 26px; bottom: 34px; }
  .statement { height: 160vh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; }
  .felt-sw, .btn, .pk, .card, .seg-ind, .action-ring, .meter-fill, .share span, .wtl span, .dist .bar span, .po-line .bar span, .streets li::after, .mainnav a::after, .hero-links a::after, .hc, .card-inner, .theme-toggle .sun-core, .theme-toggle .sun-rays, .theme-toggle .moon-bite, .stage-hint {
    transition-property: opacity, color, background-color, border-color, fill !important;
  }
  .btn:active:not(:disabled), .pk:active:not(:disabled) { transform: none; filter: brightness(0.92); }
  .rank-row:hover .rank-cards .card, .pk:hover:not(:disabled) { transform: none; }
  .statement { height: auto; }
  .statement-pin { position: static; height: auto; padding-block: clamp(72px, 12vw, 140px); }
}
@media (forced-colors: active) {
  .hc[data-tier] { border: 1px solid CanvasText; }
  .meter-fill, .wtl span, .dist .bar span, .share span { forced-color-adjust: none; }
}
