/* The inner pages (a game's page, its rules, About). The front page keeps its own inline CSS;
   the paper, ink, copper and faces here are the front page's. */
@font-face {
  font-family: "Besley";
  src: url("/fonts/besley-latin.woff2") format("woff2");
  font-weight: 700 800;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --paper: #fbf6e8;
  --ink: #191a15;
  --quiet: #4a473d;
  --copper: #c86a38;
  --copper-deep: #8f4520;
  --rule: rgba(25, 26, 21, 0.18);
  --plum: #3b2230;
  --plum-lit: #4f2f41;
  --card: #fdf9ef;
  --card-red: #b3242b;
  --card-black: #1b1c19;
  --felt: #88a9a0;
  --serif: "Besley", Georgia, "Times New Roman", serif;
  --sans: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 16px;
  --measure: 29.5em;
  --wide: 70rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font-family: var(--sans);
  font-size: 1.1875rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
@media (min-width: 700px) {
  body { font-size: 1.25rem; }
  :root { --gutter: 32px; }
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--ink); text-decoration-line: underline; text-decoration-thickness: 0.09em; text-underline-offset: 0.2em; text-decoration-color: var(--copper-deep); }
a:hover { text-decoration-thickness: 0.16em; }
a:focus-visible, .button:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; border-radius: 4px; }

/* The house mark: docs/platform/design/brand-standard.md. Each place carries the drawings it may need and shows
   the one for its drawn size: the ring from 32 px, the small ring from 20, the small coin from 16. */
.ringp { display: block; flex: none; width: var(--size); height: var(--size); container: ringp / inline-size; }
.ringp svg { display: block; width: 100%; height: 100%; }
.ringp .small, .ringp .coin { display: none; }
@container ringp (max-width: 31.98px) { .ringp .ring { display: none; } .ringp .small { display: block; } }
@container ringp (max-width: 19.98px) { .ringp .small { display: none; } .ringp .coin { display: block; } }
@container ringp (max-width: 15.98px) { .ringp .coin { display: none; } }

/* the house line at the top */
.site-head {
  padding: 18px var(--gutter) 16px;
  border-bottom: 1px solid var(--rule);
}
.site-head-inner { max-width: var(--wide); margin: 0 auto; }
/* The name never wraps, so it shrinks to fit: the lockup is 14.6 name-sizes wide (mark 1.70, gap 0.54, the name
   12.34 in Besley); 15 leaves room for a fallback face. */
.house {
  --house: min(1.0625rem, (100vw - 2 * var(--gutter)) / 15);
  display: inline-flex;
  align-items: center;
  gap: calc(var(--house) * 1.7 * 0.32);
  min-height: 48px;
  text-decoration: none;
  color: var(--ink);
}
.house .ringp { --size: calc(var(--house) * 1.7); color: var(--copper); }
.house-name {
  font-family: var(--serif);
  font-weight: 800;
  font-size: var(--house);
  line-height: 1;
  letter-spacing: 0.005em;
  white-space: nowrap;
}
.house:hover .house-name { text-decoration: underline; text-decoration-thickness: 0.09em; text-underline-offset: 0.25em; text-decoration-color: var(--copper-deep); }
@media (min-width: 700px) {
  .site-head { padding-top: 24px; padding-bottom: 20px; }
  .house { --house: min(1.25rem, (100vw - 2 * var(--gutter)) / 15); }
}

/* the reading column, with room for pictures to stand wider than the words */
.page {
  display: grid;
  grid-template-columns: 1fr min(var(--measure), 100% - 2 * var(--gutter)) 1fr;
  padding: 0 0 72px;
}
.page > * { grid-column: 2; }
.page > .wide { grid-column: 1 / -1; width: min(var(--wide), 100% - 2 * var(--gutter)); margin-left: auto; margin-right: auto; }

h1, h2, h3 { font-family: var(--serif); font-weight: 800; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 2.5rem; margin-top: 40px; letter-spacing: -0.01em; }
h2 { font-size: 1.75rem; margin-top: 2.2em; font-weight: 700; }
h3 { font-size: 1.3rem; margin-top: 1.6em; font-weight: 700; line-height: 1.25; }
h2 + p, h2 + ul, h2 + ol, h2 + figure, h2 + .table-wrap { margin-top: 0.6em; }
h3 + p { margin-top: 0.4em; }
@media (min-width: 700px) {
  h1 { font-size: 3.25rem; margin-top: 64px; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.375rem; }
}

p, ul, ol { margin: 1em 0 0; }
.lead { font-size: 1.2em; line-height: 1.5; margin-top: 0.6em; }

ul, ol { padding-left: 1.4em; }
li { margin-top: 0.55em; padding-left: 0.2em; }
li::marker { color: var(--copper-deep); font-weight: 700; }
ul li::marker { content: "\2022\00a0\00a0"; }
.steps { padding-left: 1.6em; }
.steps li { padding-left: 0.3em; }

.breadcrumb { margin-top: 28px; font-size: 1.0625rem; }
@media (min-width: 700px) { .breadcrumb { font-size: 1.125rem; } }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; column-gap: 0.25em; }
.breadcrumb li { margin: 0; padding: 0; display: flex; align-items: center; }
.breadcrumb li + li::before { content: "/"; color: var(--quiet); margin-right: 0.35em; }
.breadcrumb a { display: inline-flex; align-items: center; min-height: 48px; }
.breadcrumb [aria-current] { color: var(--quiet); }
.breadcrumb + h1 { margin-top: 8px; }

/* the Play button: the game's plum, so the page ties to its box on the front page */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 28px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  padding: 12px 32px;
  border-radius: 12px;
  background: var(--plum);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 4px 4px 10px -3px rgba(28, 20, 6, 0.35), 1px 1px 1px rgba(28, 20, 6, 0.2);
  transition: background-color 0.12s ease, transform 0.12s ease;
}
.button:hover { background: var(--plum-lit); }
.button:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) { .button { transition: none; } .button:active { transform: none; } }
@media (max-width: 519.98px) { .actions .button { width: 100%; } }
.actions a:not(.button) { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; }

/* the real table, on a computer and on a phone */
.shots { display: grid; gap: 28px; margin-top: 48px; }
.shots figure { margin: 0; }
.shots img { border-radius: 10px; box-shadow: 0 1px 2px rgba(28, 20, 6, 0.25), 0 6px 18px -6px rgba(28, 20, 6, 0.35); }
.shots .phone img { border-radius: 18px; max-width: min(100%, 280px); margin: 0 auto; }
figcaption { margin-top: 10px; color: var(--quiet); font-size: 1.0625rem; line-height: 1.4; }
.shots .phone figcaption { text-align: center; }
@media (min-width: 700px) {
  .shots { grid-template-columns: 1600fr 462fr; align-items: start; gap: 28px; }
  .shots .phone img { max-width: 100%; }
  figcaption { font-size: 1.125rem; }
}

/* the cards drawn for the rules: the game's own card, cream with a bold corner and a large suit */
/* on the game's own sage felt, so cream cards stand off the cream page */
.cards-fig {
  margin: 1.4em 0 0;
  padding: 22px 16px 18px;
  container-type: inline-size;
  background: var(--felt);
  border-radius: 12px;
  box-shadow: inset 0 1px 3px rgba(28, 20, 6, 0.22);
}
.hand {
  --n: 3;
  --step: 0.62;
  --cw: min(150px, 100cqi / (1 + (var(--n) - 1) * var(--step)));
  position: relative;
  height: calc(var(--cw) * 1.4 + var(--lift, 0px) + 6px);
  width: calc(var(--cw) * (1 + (var(--n) - 1) * var(--step)));
  margin: 0 auto;
}
.card {
  position: absolute;
  left: calc(var(--i) * var(--cw) * var(--step));
  bottom: 6px;
  width: var(--cw);
  height: calc(var(--cw) * 1.4);
  background: var(--card);
  border-radius: calc(var(--cw) * 0.075);
  border: 1px solid rgba(60, 50, 30, 0.28);
  box-shadow: -1px 0 2px rgba(28, 20, 6, 0.12), 2px 3px 6px -2px rgba(28, 20, 6, 0.28);
  color: var(--card-black);
}
.card::before {
  content: "";
  position: absolute;
  inset: calc(var(--cw) * 0.035);
  border: 1px solid rgba(60, 50, 30, 0.12);
  border-radius: calc(var(--cw) * 0.05);
}
.card.red { color: var(--card-red); }
.card .rank {
  position: absolute;
  left: calc(var(--cw) * 0.09);
  top: calc(var(--cw) * 0.04);
  font-family: var(--sans);
  font-weight: 800;
  font-size: calc(var(--cw) * 0.36);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.card .pip, .card .big { position: absolute; fill: currentColor; }
.card .pip { left: calc(var(--cw) * 0.1); top: calc(var(--cw) * 0.47); width: calc(var(--cw) * 0.24); height: calc(var(--cw) * 0.24); }
.card .big { right: calc(var(--cw) * 0.09); bottom: calc(var(--cw) * 0.1); width: calc(var(--cw) * 0.4); height: calc(var(--cw) * 0.4); }
/* a covered card shows only its corner, as in the hand; the big suit would peek out as a stray blob */
.card:not(:last-child) .big { display: none; }
.card.lifted { bottom: calc(6px + var(--lift)); box-shadow: -1px 0 2px rgba(28, 20, 6, 0.12), 3px 10px 16px -4px rgba(28, 20, 6, 0.4); }
.pile { --n: 5; --step: 0.44; --lift: calc(var(--cw) * 0.24); }
@media (min-width: 700px) {
  .hand { --cw: min(170px, 100cqi / (1 + (var(--n) - 1) * var(--step))); }
  .pile { --step: 0.5; }
}

/* the scoring table */
.table-wrap { margin-top: 1em; }
table { width: 100%; border-collapse: collapse; font-size: 1em; line-height: 1.4; }
caption { text-align: left; }
th, td { text-align: left; vertical-align: top; padding: 14px 12px 14px 0; border-bottom: 1px solid var(--rule); }
thead th { font-weight: 800; border-bottom: 2px solid var(--ink); padding-top: 4px; }
tbody th { font-weight: 400; }
th:last-child, td:last-child { padding-right: 0; width: 40%; }
td { font-weight: 700; }

.example { margin-top: 1.4em; padding: 16px 20px; border-left: 4px solid var(--copper); background: rgba(200, 106, 56, 0.08); border-radius: 0 8px 8px 0; }

.closing { margin-top: 56px; }
.signed { color: var(--quiet); font-size: 1.0625rem; margin-top: 40px; }

/* the foot of every inner page */
.site-foot {
  border-top: 1px solid var(--rule);
  padding: 28px var(--gutter) 40px;
}
.site-foot-inner { max-width: var(--wide); margin: 0 auto; }
.site-foot p { margin: 0 0 12px; color: var(--quiet); }
.site-foot ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 32px; }
.site-foot li { margin: 0; padding: 0; }
.site-foot li::marker { content: none; }
.site-foot a { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; }
@media (max-width: 519.98px) { .site-foot ul { flex-direction: column; gap: 0; } }

.facts { color: var(--quiet); margin-top: 0.75rem; }
