:root {
  --paper: #f4efe3;
  --paper-deep: #e8dfcf;
  --paper-light: #fbf8f1;
  --ink: #17233f;
  --ink-soft: #43506a;
  --line: #b8ad99;
  --red: #c84630;
  --red-dark: #9d2f20;
  --gold: #e0a935;
  --green: #54745d;
  --shadow: 0 18px 50px rgba(23, 35, 63, 0.12);
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 4px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 35, 63, 0.028) 1px, transparent 1px) 0 0 / 100% 29px,
    radial-gradient(circle at 82% 8%, rgba(224, 169, 53, 0.16), transparent 30rem),
    var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--red-dark);
}

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

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  color: var(--paper-light);
  background: var(--ink);
}

.skip-link:focus {
  top: 0.75rem;
}

.wrap {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 10;
  padding: 20px 0 0;
  border-top: 6px solid var(--ink);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 48px;
  place-items: center;
  color: var(--paper-light);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 3px 3px 8px 8px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 3px 3px 0 var(--gold);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 23px;
  letter-spacing: -0.03em;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 22px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-nav a {
  padding: 6px 0;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--red-dark);
  border-bottom-color: var(--red);
}

.header-rule {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  width: min(calc(100% - 40px), var(--max));
  margin: 16px auto 0;
  padding: 7px 0;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-rule span + span::before {
  margin-right: 18px;
  content: "·";
  color: var(--red);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 13ch;
  margin-bottom: 22px;
  font-size: clamp(48px, 7.4vw, 96px);
  font-weight: 600;
}

h2 {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 600;
}

h3 {
  font-size: 23px;
  font-weight: 600;
}

p {
  max-width: 70ch;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--red-dark);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(200, 70, 48, 0.15);
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  color: var(--paper-light);
  background: var(--red);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.03em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover {
  color: var(--paper-light);
  background: var(--red-dark);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.button:disabled {
  color: #7d7465;
  background: #d9d0c1;
  border-color: #bfb4a3;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.button--quiet {
  color: var(--ink);
  background: transparent;
  border-color: var(--ink);
  box-shadow: none;
}

.button--quiet:hover {
  color: var(--paper-light);
  background: var(--ink);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 2px;
  color: var(--ink);
  border-bottom: 1px solid currentColor;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.text-link:hover {
  color: var(--red-dark);
}

.text-link--light {
  color: var(--paper-light);
}

.text-link--light:hover {
  color: var(--gold);
}

.home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(310px, 0.7fr);
  gap: clamp(32px, 7vw, 100px);
  align-items: center;
  padding-block: clamp(28px, 4vw, 52px) clamp(40px, 6vw, 72px);
}

.home-intro h1 {
  max-width: 10ch;
  margin-bottom: 12px;
  font-size: clamp(34px, 5.4vw, 68px);
}

.home-intro .hero-fineprint {
  margin-top: 0;
}

.hero-headline {
  max-width: 31ch;
  margin-bottom: 12px;
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 27px);
  font-weight: 600;
  line-height: 1.25;
}

.hero-sub {
  max-width: 63ch;
  margin-bottom: 28px;
  color: var(--ink-soft);
  font-size: 17px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.hero-fineprint {
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-fan {
  position: relative;
  min-height: 400px;
  isolation: isolate;
}

.fan-card {
  position: absolute;
  display: flex;
  width: 230px;
  height: 330px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  background: var(--paper-light);
  border: 1px solid var(--ink);
  border-radius: 5px;
  box-shadow: var(--shadow);
}

.fan-card::before {
  position: absolute;
  inset: 9px;
  content: "";
  border: 1px solid var(--line);
  border-radius: 2px;
  pointer-events: none;
}

.fan-card span {
  position: relative;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.fan-card strong {
  position: relative;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.05;
}

.fan-card small {
  position: relative;
  color: var(--ink-soft);
  font-size: 11px;
}

.fan-card--back {
  top: 6px;
  left: 2%;
  transform: rotate(-9deg);
  background: var(--gold);
}

.fan-card--middle {
  top: 24px;
  left: 20%;
  transform: rotate(-2deg);
  background: var(--ink);
  color: var(--paper-light);
}

.fan-card--front {
  top: 48px;
  left: 40%;
  transform: rotate(6deg);
}

.fan-stamp {
  position: absolute;
  right: 2%;
  bottom: 0;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  color: var(--red-dark);
  border: 2px solid var(--red);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  transform: rotate(11deg);
}

.board-shell {
  padding: clamp(22px, 3vw, 34px);
  background: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: 8px 8px 0 var(--gold);
}

.board-shell--daily {
  margin-top: 18px;
}

.board-shell .section-heading {
  color: var(--paper-light);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading .eyebrow {
  margin-bottom: 8px;
  color: #edc963;
}

.section-aside {
  max-width: 35ch;
  margin: 0;
  color: #b7bdcb;
  font-size: 12px;
  text-align: right;
}

.board__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  color: var(--paper-light);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.board__head .eyebrow {
  margin-bottom: 3px;
  color: var(--gold);
}

.deck-id {
  margin: 0;
  color: #c2c7d2;
  font-family: var(--mono);
  font-size: 10px;
}

.live-score {
  margin: 6px 0 0;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.clock {
  text-align: right;
}

.clock span {
  display: block;
  color: #b7bdcb;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.clock strong {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.hand {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.playing-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 205px;
  flex-direction: column;
  padding: 16px 14px 14px;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper-light);
  border: 1px solid var(--paper-light);
  border-radius: 3px;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.playing-card::after {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  content: "";
  border: 1px solid #9f9789;
  border-radius: 50%;
}

.playing-card:hover {
  transform: translateY(-4px);
  background: #fffdf8;
}

.playing-card:has(input:checked) {
  background: #fff7dd;
  border-color: var(--gold);
  box-shadow: inset 0 0 0 2px var(--gold);
}

.playing-card:has(input:checked)::after {
  content: "✓";
  color: var(--ink);
  background: var(--gold);
  border-color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.playing-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.playing-card:has(input:focus-visible) {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.card__category {
  max-width: calc(100% - 28px);
  color: var(--red-dark);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card__thumb {
  width: 100%;
  height: 92px;
  margin-top: 10px;
  object-fit: cover;
  object-position: center top;
  border: 1px solid #d9d2c5;
  filter: grayscale(0.25);
}

.card__name {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 29px);
  font-weight: 600;
  line-height: 0.98;
}

.card__year {
  margin-top: 8px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
}

.card__summary {
  display: -webkit-box;
  margin: 8px 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.card__hidden {
  margin: 14px 0 0;
  padding-top: 10px;
  color: #857e71;
  border-top: 1px solid #d9d2c5;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card__traits {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 12px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid #d9d2c5;
  list-style: none;
}

.card__traits li {
  padding: 2px 4px;
  color: var(--ink-soft);
  background: #eae3d7;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.3;
}

.playing-card.is-linked {
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--green);
}

.playing-card.is-revealed {
  cursor: default;
}

.playing-card.is-revealed::after {
  display: none;
}

.playing-card.is-linked .card__traits li {
  color: #263e2d;
  background: #d9e5d7;
}

.board__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
}

.selection-count {
  margin: 0;
  color: #c2c7d2;
  font-size: 11px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.board-shell .button {
  box-shadow: none;
}

.board-shell .button--quiet {
  color: var(--paper-light);
  border-color: #858da0;
}

.board-shell .button--quiet:hover {
  color: var(--ink);
  background: var(--paper-light);
}

.board-shell .button:disabled {
  color: #71798a;
  background: #303b52;
  border-color: #475168;
}

.pool-note {
  margin-top: 14px;
  padding-top: 12px;
  color: #b7bdcb;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 10px;
}

.pool-note summary {
  cursor: pointer;
}

.pool-note p {
  margin: 8px 0 0;
}

.board__status {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: var(--gold);
  font-size: 11px;
}

.empty-state {
  max-width: 55ch;
  margin: 0;
  padding: 36px 20px;
  color: var(--paper-light);
  border: 1px dashed #6c7486;
  text-align: center;
}

.result-panel {
  margin-top: 22px;
  padding: clamp(20px, 4vw, 36px);
  color: var(--ink);
  background: var(--paper-light);
  border-top: 6px solid var(--gold);
}

.result__hero {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.result__hero h2 {
  margin-bottom: 0;
  font-size: clamp(30px, 5vw, 56px);
}

.score-stamp {
  display: flex;
  min-width: 112px;
  flex-direction: column;
  align-items: flex-end;
}

.score-stamp strong {
  font-family: var(--serif);
  font-size: clamp(46px, 7vw, 76px);
  font-weight: 500;
  line-height: 0.9;
}

.score-stamp span {
  color: var(--red-dark);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result__math {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 20px;
}

.result__math span {
  padding: 4px 8px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  font-family: var(--mono);
  font-size: 10px;
}

.explainer {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: #fff4dc;
  border-left: 4px solid var(--red);
}

.explainer p {
  margin: 5px 0 0;
  font-size: 14px;
}

.cap-note {
  max-width: none;
  margin: -8px 0 20px;
  padding: 10px 12px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  font-family: var(--mono);
  font-size: 10px;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.pair-table,
.archive-table,
.stats-table,
.hand-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.pair-table caption {
  padding-bottom: 8px;
  color: var(--red-dark);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.pair-table th,
.archive-table th,
.stats-table th,
.hand-table th {
  padding: 8px 10px;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pair-table td,
.archive-table td,
.stats-table td,
.hand-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #d9d2c5;
  vertical-align: top;
}

.pair-table tbody tr:hover,
.archive-table tbody tr:hover,
.stats-table tbody tr:hover {
  background: #f7f1e4;
}

.best-line {
  margin-top: 18px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.best-line summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.best-line p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.result-panel .button {
  margin-top: 18px;
}

.share-status {
  min-height: 1em;
  margin: 8px 0 0;
  color: var(--green);
  font-size: 11px;
}

.process {
  padding-block: clamp(72px, 9vw, 120px);
}

.process .section-heading {
  color: var(--ink);
}

.process .section-heading .eyebrow {
  color: var(--red-dark);
}

.process .section-aside {
  color: var(--ink-soft);
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}

.step-card {
  min-height: 250px;
  padding: 26px 26px 20px 0;
  border-right: 1px solid var(--line);
}

.step-card + .step-card {
  padding-left: 26px;
}

.step-card:last-child {
  border-right: 0;
}

.step-number {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 34px;
  place-items: center;
  color: var(--paper-light);
  background: var(--ink);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 11px;
}

.step-card h3 {
  margin-bottom: 10px;
}

.step-card p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.split-feature {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-bottom: clamp(72px, 9vw, 118px);
}

.feature-block {
  min-height: 380px;
  padding: clamp(28px, 5vw, 58px);
}

.feature-block h2 {
  max-width: 12ch;
}

.feature-block p {
  font-size: 14px;
}

.feature-block--ink {
  color: var(--paper-light);
  background: var(--ink);
}

.feature-block--ink .eyebrow {
  color: var(--gold);
}

.feature-block--paper {
  background: var(--paper-deep);
  border: 1px solid var(--line);
}

.feature-block .text-link {
  margin-top: 14px;
}

.faq-section {
  padding-block: 0 clamp(80px, 10vw, 130px);
}

.faq-section .section-heading .eyebrow {
  color: var(--red-dark);
}

.faq-list {
  border-top: 2px solid var(--ink);
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  position: relative;
  padding: 20px 48px 20px 0;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  list-style: none;
}

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

.faq-item summary::after {
  position: absolute;
  top: 18px;
  right: 4px;
  content: "+";
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 400;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  max-width: 72ch;
  margin: 0;
  padding: 0 0 22px;
  color: var(--ink-soft);
  font-size: 14px;
}

.page {
  padding-block: clamp(52px, 8vw, 100px) clamp(76px, 10vw, 130px);
}

.page-hero {
  max-width: 980px;
  margin-bottom: clamp(38px, 6vw, 66px);
}

.page-hero h1 {
  max-width: 12ch;
}

.page-hero--daily h1 {
  max-width: 8ch;
}

.page-lede {
  max-width: 64ch;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(19px, 2.4vw, 26px);
  line-height: 1.4;
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(34px, 6vw, 86px);
  align-items: start;
}

.page-layout--reading {
  max-width: 1000px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
}

.prose {
  min-width: 0;
}

.prose h2 {
  margin-top: 2.1em;
  margin-bottom: 0.55em;
  font-size: clamp(28px, 3.6vw, 42px);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin-top: 1.8em;
  margin-bottom: 0.45em;
}

.prose p {
  margin-bottom: 1.15em;
  color: #293651;
}

.prose code {
  padding: 0.12em 0.34em;
  color: var(--red-dark);
  background: #eadfcf;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 0.84em;
}

.prose a {
  text-decoration-color: var(--red);
}

.prose > :first-child {
  margin-top: 0;
}

.prose--daily {
  max-width: 760px;
  padding-top: 42px;
  border-top: 1px solid var(--line);
}

.page-aside {
  display: grid;
  gap: 18px;
}

.side-card {
  padding: 24px;
  background: var(--paper-light);
  border: 1px solid var(--line);
  box-shadow: 4px 4px 0 rgba(23, 35, 63, 0.08);
}

.side-card h2 {
  margin-bottom: 16px;
  font-size: 27px;
}

.side-card .eyebrow {
  margin-bottom: 8px;
}

.side-card p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.side-card .text-link {
  margin-top: 16px;
}

.side-card--example {
  border-top: 5px solid var(--gold);
}

.side-card--note {
  background: var(--paper-deep);
}

.side-card--credit {
  border-top: 5px solid var(--red);
}

.hand-table td:first-child {
  padding-right: 14px;
}

.hand-table td strong,
.hand-table td span {
  display: block;
}

.hand-table td span {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.hand-table td:last-child {
  font-family: var(--mono);
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.mini-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 16px;
}

.mini-hand span {
  padding: 4px 7px;
  color: var(--paper-light);
  background: var(--ink);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 8px;
}

.pair-list {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.pair-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding-bottom: 9px;
  border-bottom: 1px solid #d9d2c5;
  font-size: 11px;
}

.pair-list small {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 8px;
}

.example-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px !important;
  color: var(--ink) !important;
  font-family: var(--mono);
  font-size: 11px !important;
}

.example-total strong {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
}

.fine-print {
  padding-top: 10px;
  border-top: 1px solid #d9d2c5;
  color: var(--ink-soft);
  font-size: 10px !important;
  line-height: 1.5;
}

.formula-banner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 46px;
  background: var(--ink);
  border: 1px solid var(--ink);
}

.formula-banner div {
  padding: 24px;
  background: var(--paper-light);
}

.formula-banner span {
  display: block;
  margin-bottom: 8px;
  color: var(--red-dark);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.formula-banner strong {
  font-family: var(--mono);
  font-size: clamp(11px, 1.4vw, 15px);
  font-weight: 500;
  line-height: 1.5;
}

.rule-list {
  margin: 0;
}

.rule-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  padding: 9px 0;
  border-top: 1px solid #ddd3c4;
}

.rule-list dt {
  color: var(--ink-soft);
  font-size: 11px;
}

.rule-list dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.example-lines {
  display: grid;
  gap: 6px;
  font-size: 11px;
}

.example-lines p {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 5px;
  border-bottom: 1px dotted #c8beae;
}

.example-lines small {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 8px;
}

.changelog-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  padding: 10px 0;
  border-top: 1px solid #ddd3c4;
}

.changelog-row strong {
  font-family: var(--mono);
  font-size: 10px;
}

.changelog-row span {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  text-align: right;
}

.changelog-row small {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 10px;
}

.archive-shell,
.stats-shell {
  margin-bottom: 48px;
  padding: clamp(16px, 3vw, 28px);
  background: var(--paper-light);
  border: 1px solid var(--line);
  box-shadow: 5px 5px 0 rgba(23, 35, 63, 0.08);
}

.archive-table th,
.stats-table th {
  font-size: 9px;
}

.archive-table td,
.stats-table td {
  font-family: var(--mono);
  font-size: 11px;
}

.archive-table td:first-child,
.stats-table td:first-child {
  font-weight: 700;
}

.table-link {
  display: inline-block;
  color: var(--red-dark);
  font-weight: 700;
  text-decoration: none;
}

.archive-shell .button {
  margin-top: 18px;
  box-shadow: none;
}

.storage-notice {
  max-width: none;
  margin: -16px 0 28px;
  padding: 12px 16px;
  color: var(--ink-soft);
  background: #fff4dc;
  border-left: 4px solid var(--gold);
  font-size: 12px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 26px;
  background: var(--line);
  border: 1px solid var(--line);
}

.stat {
  padding: 20px;
  background: var(--paper-light);
}

.stat span {
  display: block;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 7px;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 500;
  line-height: 1;
}

.subsection-title {
  margin: 26px 0 12px;
  font-size: 24px;
}

.stat-list {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  background: var(--line);
  list-style: none;
}

.stat-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--paper-light);
  font-size: 12px;
}

.stat-list strong {
  font-family: var(--mono);
}

.export-box {
  display: grid;
  gap: 9px;
}

.export-box label {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.export-box textarea {
  width: 100%;
  padding: 11px;
  color: var(--ink);
  background: #f8f4eb;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.5;
  resize: vertical;
}

.export-box .button-row {
  gap: 7px;
}

.export-box .button {
  min-height: 40px;
  margin: 0;
  padding: 8px 12px;
  box-shadow: none;
  font-size: 11px;
}

.analytics-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.analytics-list li {
  padding: 10px 0;
  border-top: 1px solid #ddd3c4;
}

.analytics-list strong,
.analytics-list span {
  display: block;
}

.analytics-list span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 11px;
}

.site-footer {
  color: #d9dde6;
  background: var(--ink);
  border-top: 8px solid var(--red);
}

.footer-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 50px;
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
  padding-block: 52px 38px;
}

.brand--footer {
  color: var(--paper-light);
}

.brand--footer:hover {
  color: var(--paper-light);
}

.brand--footer .brand-mark {
  color: var(--ink);
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 3px 3px 0 var(--paper-light);
}

.brand--footer .brand-copy small {
  color: #aab3c4;
}

.footer-note {
  max-width: 38ch;
  margin: 22px 0 0;
  color: #aab3c4;
  font-size: 13px;
}

.footer-nav {
  display: flex;
  gap: clamp(30px, 6vw, 80px);
}

.footer-nav div {
  display: flex;
  min-width: 110px;
  flex-direction: column;
  gap: 7px;
}

.footer-nav span {
  margin-bottom: 6px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-nav a {
  color: #d9dde6;
  font-size: 13px;
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--paper-light);
  text-decoration: underline;
}

.footer-fine {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
  padding: 22px 0 30px;
  color: #929cad;
  border-top: 1px solid #39445c;
  font-size: 10px;
  line-height: 1.6;
}

.footer-fine p {
  max-width: 95ch;
  margin: 0;
}

.footer-fine a {
  color: #c5cbd7;
}

.footer-fine span {
  flex: 0 0 auto;
  font-family: var(--mono);
}

@media (max-width: 980px) {
  .home-intro {
    grid-template-columns: 1fr;
  }

  .card-fan {
    min-height: 360px;
    max-width: 520px;
  }

  .page-layout,
  .page-layout--reading {
    grid-template-columns: 1fr;
  }

  .page-aside {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-aside > :only-child {
    grid-column: 1 / -1;
  }

  .hand {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .playing-card {
    min-height: 190px;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .wrap,
  .header-inner,
  .header-rule,
  .footer-main,
  .footer-fine {
    width: min(calc(100% - 28px), var(--max));
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
    gap: 8px 16px;
  }

  .header-rule {
    justify-content: flex-start;
    gap: 12px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .header-rule span + span::before {
    margin-right: 12px;
  }

  .home-intro {
    padding-top: 30px;
  }

  .card-fan {
    margin-inline: auto;
  }

  .fan-card {
    width: 190px;
    height: 280px;
  }

  .fan-card--back {
    left: 0;
  }

  .fan-card--middle {
    left: 15%;
  }

  .fan-card--front {
    left: 30%;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-aside {
    text-align: left;
  }

  .board__head,
  .board__controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .clock {
    text-align: left;
  }

  .step-grid,
  .split-feature {
    grid-template-columns: 1fr;
  }

  .step-card,
  .step-card + .step-card {
    min-height: 0;
    padding: 24px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .step-number {
    margin-bottom: 16px;
  }

  .feature-block {
    min-height: 0;
  }

  .page-aside {
    grid-template-columns: 1fr;
  }

  .formula-banner {
    grid-template-columns: 1fr;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .footer-fine {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .brand-mark {
    width: 38px;
    height: 44px;
  }

  h1 {
    font-size: clamp(42px, 14vw, 64px);
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .card-fan {
    min-height: 320px;
    overflow: hidden;
  }

  .fan-card {
    width: 168px;
    height: 252px;
    padding: 15px;
  }

  .fan-card strong {
    font-size: 23px;
  }

  .fan-card--back {
    left: -2%;
  }

  .fan-card--middle {
    left: 18%;
  }

  .fan-card--front {
    left: 38%;
  }

  .fan-stamp {
    right: -2%;
    width: 58px;
    height: 58px;
  }

  .board-shell {
    padding: 16px;
    box-shadow: 5px 5px 0 var(--gold);
  }

  .hand {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .playing-card {
    min-height: 168px;
  }

  .playing-card:last-child {
    grid-column: 1 / -1;
    min-height: 150px;
  }

  .button-row,
  .board-shell .button-row .button {
    width: 100%;
  }

  .result__hero {
    flex-direction: column;
  }

  .score-stamp {
    align-items: flex-start;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .stat strong {
    font-size: 34px;
  }

  .footer-nav {
    justify-content: space-between;
    gap: 20px;
  }
}

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