/* Backgammon Pearl / Tavla Pearl, backgammonpearl.com.
   The app's world by day: a café table of cream travertine. The site is always the day look
   (the owner, 2026-10-13: the dark look was too dark), whatever the visitor's
   system setting; the app keeps its own evening theme.
   Tokens are the app's (apps/mobile/src/theme/tokens.ts), value for value. */

:root {
  --page: #ebe7df;
  --page-rule: rgba(120, 100, 70, .035);
  --ink: #1f2430;
  --ink2: #5a6170;
  --ink3: #7d8592;
  --panel: rgba(255, 255, 255, .86);
  --panel-solid: #fbfaf7;
  --panel-line: rgba(31, 36, 48, .12);
  --panel-shadow: 0 2px 6px rgba(30, 30, 25, .08);
  --act: #34507c;
  --act-hi: #4a6a9c;
  --act-lo: #27406a;
  --act-ink: #ffffff;
  --act-soft: rgba(52, 80, 124, .12);
  --happened: #b24a33;
  --ok: #2f7d5a;
  --ok-soft: rgba(47, 125, 90, .12);
  --head-ink: #1f2430;
  --accent-ink: #34507c;
  /* the app's day surface (D15 follow-up, 2026-10-13): travertine, base and opacity as in tokens.ts */
  --surface: #e0ceb0;
  --surface-tex: url("/img/travertine.webp");
  --surface-op: .95;
  --surface-light: radial-gradient(110% 90% at 40% 40%, rgba(255,255,255,0), rgba(0,0,0,0) 50%, rgba(60,60,55,.12) 100%);
  --shadow-ink: rgba(40, 40, 35, .32);
  --frame: #1b1613;
  --frame-edge: #3a322b;
  --mono-bg: rgba(31, 36, 48, .05);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Onest", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  background-image: repeating-linear-gradient(0deg, var(--page-rule) 0 1px, transparent 1px 7px);
  color: var(--ink);
  font: 400 17px/1.6 var(--font-body);
  overflow-x: hidden;
}
img, svg, picture { display: block; max-width: 100%; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--act); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.1; margin: 0; color: var(--head-ink); text-wrap: balance; letter-spacing: .005em; }
h1 { font-size: clamp(38px, 6.2vw, 64px); font-variation-settings: "opsz" 144; }
h2 { font-size: clamp(28px, 4vw, 40px); font-variation-settings: "opsz" 72; }
h3 { font-size: 22px; font-variation-settings: "opsz" 36; }
p { margin: 0; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
@media (min-width: 720px) { .wrap { width: min(1120px, 100% - 48px); } }
.eyebrow { font: 600 13px/1.3 var(--font-body); letter-spacing: .09em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 12px; }
.lede { font-size: 19px; line-height: 1.55; color: var(--ink2); max-width: 54ch; text-wrap: pretty; }
.muted { color: var(--ink2); }
.small { font-size: 14px; }
.mono { font-family: var(--font-mono); font-size: .92em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-head { display: flex; align-items: center; gap: 14px; padding: 18px 0 10px; }
.lockup { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.lockup .mark { width: 40px; height: 40px; flex: none; }
.lockup .words { display: grid; line-height: 1; }
.lockup .words b { font: 500 22px/1 var(--font-display); color: var(--ink); letter-spacing: .005em; }
.lockup .words small { font: 500 11px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); margin-top: 5px; }
.site-nav { margin-inline-start: auto; display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a { font: 600 15px/1 var(--font-body); color: var(--ink2); text-decoration: none; padding: 8px 0; }
.site-nav a:hover { color: var(--ink); }
.site-nav .hide-sm { display: none; }
@media (min-width: 720px) { .site-nav .hide-sm { display: inline; } }
/* the language menu (site/tools/i18n.py writes it): ten languages in their own names */
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 7px; font: 700 13px/1 var(--font-body); letter-spacing: .04em; padding: 8px 11px; border: 1px solid var(--panel-line); border-radius: 999px; background: var(--panel); box-shadow: var(--panel-shadow); color: var(--ink2); cursor: pointer; user-select: none; -webkit-user-select: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--ink); border-color: var(--act); }
.lang-menu summary svg { width: 16px; height: 16px; flex: none; }
.lang-menu summary .caret { width: 9px; height: 9px; transition: transform .15s; }
.lang-menu[open] summary .caret { transform: rotate(180deg); }
.lang-menu summary .name { display: none; letter-spacing: 0; }
@media (min-width: 720px) { .lang-menu summary .name { display: inline; } .lang-menu summary .code { display: none; } }
.lang-menu ul { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 30; margin: 0; padding: 6px; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; width: max-content; min-width: 250px; max-width: calc(100vw - 32px); background: var(--panel-solid); border: 1px solid var(--panel-line); border-radius: 14px; box-shadow: 0 14px 34px var(--shadow-ink); }
.site-nav .lang-menu a { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-radius: 9px; font: 500 15px/1.2 var(--font-body); letter-spacing: 0; color: var(--ink); text-decoration: none; }
.site-nav .lang-menu a:hover { background: var(--act-soft); }
.site-nav .lang-menu a[aria-current] { font-weight: 700; color: var(--accent-ink); background: var(--act-soft); }
.site-nav .lang-menu a[aria-current]::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--happened); margin-inline-start: auto; flex: none; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 28px 0 24px; align-items: center; }
.hero > *, .row > *, .pair > *, .rooms > *, .band > *, .steps > *, .table-card, .phone, .row-fig { min-width: 0; }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; padding: 40px 0 36px; } }
.hero-copy .kicker { display: inline-flex; align-items: center; gap: 8px; font: 600 13px/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); margin-bottom: 18px; }
.hero-copy .kicker i { width: 8px; height: 8px; border-radius: 50%; background: var(--happened); display: inline-block; }
.hero-copy h1 { margin-bottom: 16px; }
.hero-copy .lede { margin-bottom: 26px; }
.micro { font-size: 13.5px; color: var(--ink3); margin-top: 16px; max-width: 48ch; }
.hero-board { margin: 0; min-width: 0; }
.hero-board .phone { width: 100%; padding: 1.6%; }
.hero-copy .micro { color: var(--ink2); max-width: 55ch; }
@media (max-width: 899px) {
  .hero { gap: 24px; padding-top: 16px; }
  .hero-copy .kicker { margin-bottom: 14px; }
  .hero-copy .lede { font-size: 17px; line-height: 1.5; margin-bottom: 20px; }
}

/* the store buttons (site/tools/store-buttons.py writes them): Shogi Castle's
   button, as the owner asked (2026-10-13). Cream, rounded, softly shadowed;
   the app's own bone checker on the left, a thin divider, the store's mark,
   the store's name over a small second line ("Coming soon" until launch,
   then "Free download" and a link; the tool flips both). Logical sides, so
   the Arabic, Hebrew and Persian pages mirror it. */
.stores { display: flex; align-items: center; gap: 14px 16px; flex-wrap: wrap; }
.sk { display: inline-flex; align-items: center; height: 54px; padding-inline: 10px 18px; text-decoration: none; color: var(--ink); background: var(--panel-solid); border: 1px solid var(--panel-line); border-radius: 13px; box-shadow: 0 2px 0 #d8d2c6, 0 6px 14px rgba(60, 45, 20, .12); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.sk .piece { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 1px 1px rgba(60, 45, 20, .3)); }
.sk .st { display: flex; align-items: center; gap: 9px; margin-inline-start: 10px; padding-inline-start: 11px; border-inline-start: 1px solid var(--panel-line); }
.sk .st > svg { flex: none; width: 19px; height: 21px; }
.sk .lab { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; }
.sk .lab b { font: 700 15.5px/1.15 var(--font-body); letter-spacing: .01em; }
.sk .lab small { font: 500 11.5px/1.3 var(--font-body); color: var(--ink2); }
a.sk:hover { border-color: var(--act); transform: translateY(-1px); box-shadow: 0 3px 0 #d8d2c6, 0 9px 18px rgba(60, 45, 20, .16); }
a.sk:active { transform: translateY(1px); box-shadow: 0 1px 0 #d8d2c6, 0 2px 4px rgba(60, 45, 20, .12); }
a.sk:focus-visible { outline: 3px solid var(--act); outline-offset: 3px; }
@media (max-width: 540px) {
  .stores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 10px; max-width: 380px; }
  .sk { min-width: 0; height: auto; min-height: 56px; padding: 8px; }
  .sk .piece { width: 30px; height: 30px; }
  .sk .st { min-width: 0; gap: 6px; margin-inline-start: 6px; padding-inline-start: 6px; }
  .sk .st > svg { width: 16px; height: 18px; }
  .sk .lab { min-width: 0; white-space: normal; }
  .sk .lab b { font-size: 13px; white-space: nowrap; }
  .sk .lab small { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) { .sk { transition: none; } }

/* the table card: the app's Home card, a café table seen from above, with the phone on it */
.table-card {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 10px 26px var(--shadow-ink), inset 0 1px 0 rgba(255,255,255,.08);
  border: 1px solid rgba(31, 36, 48, .10);
  padding: clamp(18px, 4vw, 44px) clamp(16px, 4vw, 40px) clamp(64px, 11vw, 120px);
  isolation: isolate;
}
.table-card::before { content: ""; position: absolute; inset: 0; background-image: var(--surface-tex); background-size: cover; background-position: 30% 40%; opacity: var(--surface-op); z-index: -2; }
.table-card::after { content: ""; position: absolute; inset: 0; background: var(--surface-light); z-index: -1; pointer-events: none; }
.table-card .piece { position: absolute; width: clamp(44px, 7vw, 76px); height: auto; filter: drop-shadow(3px 6px 8px var(--shadow-ink)); pointer-events: none; }
.table-card .tea { position: absolute; width: clamp(72px, 11vw, 120px); height: auto; inset-inline-end: 4%; top: 4%; filter: drop-shadow(3px 6px 8px var(--shadow-ink)); pointer-events: none; }
.table-card .checker-a { inset-inline-start: 7%; bottom: 3%; }
.table-card .checker-b { inset-inline-start: 15%; bottom: 7%; }
.table-card .die { inset-inline-end: 12%; bottom: 5%; width: clamp(34px, 5vw, 54px); transform: rotate(14deg); }
.table-card .phone { margin: 0 auto; width: min(100%, 560px); position: relative; }
.hero .table-card .phone { margin-top: clamp(28px, 6vw, 70px); }
@media (min-width: 900px) { .hero .table-card { margin-inline-end: -8px; } }

/* a phone held sideways */
.phone { padding: 2.2%; border-radius: 7.5% / 13%; background: linear-gradient(158deg, var(--frame-edge), var(--frame) 70%); box-shadow: 0 14px 34px var(--shadow-ink), inset 0 0 0 1px rgba(255,255,255,.08); }
.phone .screen { border-radius: 5% / 9%; overflow: hidden; aspect-ratio: 16 / 9; background: #000; }
.phone .screen img { width: 100%; height: 100%; object-fit: cover; }
.phone.plain { box-shadow: 0 10px 28px var(--shadow-ink), inset 0 0 0 1px rgba(255,255,255,.08); }

/* ---------- feature rows ---------- */
.rows { display: grid; gap: 40px; padding: 36px 0 0; }
@media (min-width: 900px) { .rows { gap: 64px; padding-top: 56px; } }
.row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: center; }
@media (min-width: 900px) {
  .row { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; }
  .row.flip .row-copy { order: 2; }
}
.row-copy h2 { margin-bottom: 14px; }
.row-copy p + p { margin-top: 12px; }
.row-copy .lede { font-size: 18px; }
.row-copy .more { display: inline-block; margin-top: 18px; font-weight: 600; }
.row-fig { margin: 0; }
.row-fig figcaption { font-size: 14px; color: var(--ink3); margin-top: 12px; text-align: center; }

/* Keep the invitation visible; the rules and settings are here when wanted. */
.feature-details { margin-top: 20px; border-top: 1px solid var(--panel-line); border-bottom: 1px solid var(--panel-line); }
.feature-details summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 10px 0; cursor: pointer; list-style: none; font-size: 15px; font-weight: 600; color: var(--accent-ink); }
.feature-details summary::-webkit-details-marker { display: none; }
.feature-details summary::after { content: "+"; flex: none; font-size: 24px; font-weight: 400; line-height: 1; }
.feature-details[open] summary::after { content: "−"; }
.feature-details[open] { padding-bottom: 18px; }
.feature-details > p { font-size: 15.5px; color: var(--ink2); }
.feature-details .rooms, .feature-details .steps { margin-top: 14px; }
.dice-link { margin-top: 16px; font-weight: 600; }
.theme-showcase { margin-top: 40px; }
.theme-showcase .row-copy { max-width: 68ch; }

/* the three steps of the seal */
.steps { counter-reset: step; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 22px 0 0; padding: 0; list-style: none; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
.steps li { counter-increment: step; position: relative; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 16px; padding: 18px; box-shadow: var(--panel-shadow); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--act-soft); color: var(--accent-ink); font: 500 18px/1 var(--font-display); margin-bottom: 12px; }
.steps li b { display: block; font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.steps li p { font-size: 15.5px; line-height: 1.5; color: var(--ink2); }
.steps li code { font-family: var(--font-mono); font-size: 13px; background: var(--mono-bg); padding: 2px 6px; border-radius: 6px; color: var(--ink); }

/* two screenshots side by side */
.pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 28px; }
@media (min-width: 720px) { .pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; } }
.pair figure { margin: 0; }
.pair figcaption { font-size: 14px; color: var(--ink3); margin-top: 10px; text-align: center; }

/* the rooms */
.rooms { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 24px; }
@media (min-width: 720px) { .rooms { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; } }
.room { background: var(--panel-solid); border: 1px solid var(--panel-line); border-radius: 18px; padding: 22px 22px 20px; box-shadow: var(--panel-shadow); }
.room h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.room h3 small { font: 600 13px/1 var(--font-body); color: var(--ink3); letter-spacing: .02em; white-space: nowrap; }
.room .sub { color: var(--ink2); font-size: 15.5px; margin-bottom: 14px; }
.room ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.room li { display: flex; gap: 10px; font-size: 15.5px; line-height: 1.45; }
.room li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--happened); flex: none; margin-top: 9px; }

/* a quiet statement band */
.band { margin-top: 56px; border-top: 1px solid var(--panel-line); border-bottom: 1px solid var(--panel-line); padding: 34px 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 900px) { .band { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; } }
.band h3 { font-size: 21px; margin-bottom: 8px; }
.band p { color: var(--ink2); font-size: 15.5px; line-height: 1.5; }
.band .mk { display: block; width: 28px; height: 3px; border-radius: 2px; background: var(--happened); margin-bottom: 14px; }

/* ---------- the home page's feature sections (2026-10-12) ----------
   What is inside, in six links under the hero; then one section a feature,
   each with a real screen. A section is a .feature: a .row (copy beside a
   screen) or copy over a .pair, with facts, the computer's ladder, the
   lesson list and the ten names as its own parts. */
.glance { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
@media (min-width: 600px) { .glance { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1000px) { .glance { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 18px; } }
.glance a { display: grid; gap: 3px; min-width: 0; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: var(--ink); background: var(--panel); border: 1px solid var(--panel-line); box-shadow: var(--panel-shadow); }
.glance a:hover { border-color: var(--act); }
.glance b { font: 600 15px/1.25 var(--font-body); }
.glance span { font-size: 13px; line-height: 1.3; color: var(--ink3); }

.feature > *, .glance > *, .lessons > *, .names > *, .ladder > * { min-width: 0; }
.feature .row + .rooms, .feature .row + .pair, .feature .row-copy + .pair { margin-top: 28px; }
.feature .row + .row { margin-top: 40px; }
@media (min-width: 900px) { .feature .row + .row { margin-top: 56px; } .row.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.feature > .row-copy .lede { margin-bottom: 0; }
.row-copy .lede + .facts, .row-copy p + .facts { margin-top: 16px; }
.facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.facts li { display: flex; gap: 10px; font-size: 16px; line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--happened); flex: none; margin-top: 10px; }

/* a taller phone (the 844x390 captures, a 19.5:9 screen) */
.phone.tall .screen { aspect-ratio: 844 / 390; }

/* the computer's eight levels */
.ladder { counter-reset: level; display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.ladder li { counter-increment: level; display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 6px; border-radius: 999px; border: 1px solid var(--panel-line); background: var(--panel); font: 500 14px/1 var(--font-body); color: var(--ink2); white-space: nowrap; }
.ladder li::before { content: counter(level); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--act-soft); color: var(--accent-ink); font: 600 12px/1 var(--font-body); }

/* the eight lessons, as the Learn sheet lists them */
.lessons { counter-reset: lesson; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 18px; margin: 0; padding: 0; list-style: none; align-self: center; }
@media (min-width: 560px) { .lessons { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lessons li { counter-increment: lesson; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--panel-line); box-shadow: var(--panel-shadow); font: 500 15.5px/1.3 var(--font-body); color: var(--ink); }
.lessons li::before { content: counter(lesson); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--panel-line); color: var(--ink2); font: 600 13px/1 var(--font-body); }
.lessons li small { margin-inline-start: auto; padding-inline-start: 8px; font: 500 12.5px/1 var(--font-body); color: var(--ink3); white-space: nowrap; }

/* the game's name in each language; the other scripts fall back to the
   system's serif, since a page loads only its own script's faces (D37) */
.names { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 0; padding: 0; list-style: none; align-self: center; }
@media (min-width: 560px) { .names { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.names li { display: grid; gap: 3px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--panel-line); box-shadow: var(--panel-shadow); }
.names b { font: 500 18px/1.25 var(--font-display); color: var(--head-ink); overflow-wrap: anywhere; }
.names span { font-size: 13px; color: var(--ink3); }
:root:lang(fa) .ladder li::before, :root:lang(fa) .lessons li::before { content: counter(level, persian); }
:root:lang(fa) .lessons li::before { content: counter(lesson, persian); }

/* ---------- closing ---------- */
.closing { text-align: center; padding: 64px 0 20px; }
.closing h2 { margin-bottom: 12px; }
.closing .lede { margin: 0 auto 26px; }
.closing .stores { justify-content: center; }
.closing .mail { display: inline-block; margin-top: 22px; font-weight: 600; }

/* ---------- footer ---------- */
.site-foot { margin-top: 36px; padding: 24px 0 44px; border-top: 1px solid var(--panel-line); color: var(--ink3); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.site-foot a { color: var(--ink2); text-decoration: none; }
.site-foot a:hover { color: var(--ink); text-decoration: underline; }
.site-foot .sep { opacity: .6; }
.site-foot .langs { margin-inline-start: auto; display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
/* "More games from us" (Cribbage Street D66): the footer's first row, full width, the
   other three games with their icons. On a phone the label takes its own line and
   the links wrap under it. Generated by tools/i18n.py (the i18n:more block). */
.site-foot .more-games { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 0 0 16px; margin: 0 0 6px; border-bottom: 1px solid var(--panel-line); }
.site-foot .more-games:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; } /* 404.html: the row is the whole footer */
.site-foot .more-games .mg-label { color: var(--ink3); margin-inline-end: 2px; }
.site-foot .more-games a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink2); font-size: 14.5px; font-weight: 500; }
.site-foot .more-games a:hover { color: var(--ink); }
.site-foot .more-games img { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--panel-line); background: var(--panel-solid); display: block; flex: none; }
@media (max-width: 480px) { .site-foot .more-games { gap: 10px 14px; } .site-foot .more-games .mg-label { width: 100%; } }

/* ---------- document pages (legal, check, 404) ---------- */
.doc { width: min(72ch, 100% - 32px); margin-inline: auto; padding-bottom: 60px; }
@media (min-width: 720px) { .doc { width: min(72ch, 100% - 48px); } }
.doc h1 { font-size: clamp(32px, 5vw, 44px); margin: 28px 0 6px; }
.doc h2 { font-size: 24px; margin: 36px 0 10px; }
.doc h3 { font-size: 19px; margin: 24px 0 8px; }
.doc p, .doc li { font-size: 16.5px; line-height: 1.65; }
.doc p + p { margin-top: 12px; }
.doc ul, .doc ol { padding-inline-start: 22px; margin: 10px 0; }
.doc li { margin: 6px 0; }
.doc .updated { color: var(--ink3); font-size: 14px; margin-bottom: 22px; }
.doc .lede { font-size: 18px; margin-bottom: 8px; max-width: none; }
.callout { border: 1px solid var(--panel-line); background: var(--panel-solid); border-radius: 14px; padding: 16px 18px; margin: 22px 0; box-shadow: var(--panel-shadow); }
.callout.good { border-color: rgba(47, 125, 90, .45); }
.callout.good strong { color: var(--ok); }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 12px 0; }
.doc th, .doc td { text-align: start; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--panel-line); }
.doc th { color: var(--ink3); font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.doc code { font-family: var(--font-mono); font-size: .9em; background: var(--mono-bg); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.doc pre { font-family: var(--font-mono); font-size: 13.5px; line-height: 1.5; background: var(--mono-bg); border: 1px solid var(--panel-line); border-radius: 12px; padding: 14px 16px; overflow-x: auto; }

/* ---------- the dice checker ---------- */
.check-form { display: grid; gap: 16px; margin: 26px 0 8px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.field .hint { font-size: 13.5px; color: var(--ink3); }
.field input, .field textarea { font: 400 15px/1.45 var(--font-mono); color: var(--ink); background: var(--panel-solid); border: 1px solid var(--panel-line); border-radius: 12px; padding: 11px 13px; width: 100%; box-shadow: var(--panel-shadow); }
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--act); box-shadow: 0 0 0 3px var(--act-soft); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--happened); }
.field-row { display: grid; gap: 16px; }
@media (min-width: 600px) { .field-row { grid-template-columns: 1fr 1fr; } }
.btn { font: 700 16px/1 var(--font-body); border: 0; border-radius: 14px; padding: 15px 22px; background: linear-gradient(180deg, var(--act-hi), var(--act) 55%, var(--act-lo)); color: var(--act-ink); cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 2px 8px var(--shadow-ink); }
.btn:hover { filter: brightness(1.04); }
.btn.quiet { background: var(--panel-solid); color: var(--ink); border: 1px solid var(--panel-line); box-shadow: var(--panel-shadow); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.result { margin-top: 28px; }
.result .seal-line { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--panel-line); background: var(--panel-solid); box-shadow: var(--panel-shadow); }
.result .seal-line .ic { width: 28px; height: 28px; flex: none; margin-top: 2px; }
.result .seal-line b { display: block; font-size: 16px; }
.result .seal-line code { display: block; margin-top: 4px; }
.result .seal-line.ok b { color: var(--ok); }
.result .seal-line.bad b { color: var(--happened); }
.rolls { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; margin-top: 18px; list-style: none; padding: 0; }
.rolls li { display: flex; align-items: baseline; gap: 8px; padding: 9px 10px; border-radius: 10px; background: var(--panel-solid); border: 1px solid var(--panel-line); font-family: var(--font-mono); font-size: 15px; white-space: nowrap; }
.rolls li .n { color: var(--ink3); font-size: 12.5px; min-width: 2ch; text-align: end; }
.rolls li .d { font-weight: 700; letter-spacing: .04em; }
.rolls li.bad { border-color: var(--happened); background: rgba(178, 74, 51, .08); }
.rolls li.bad .d { color: var(--happened); text-decoration: line-through; }
.rolls li.bad .rec { color: var(--happened); font-weight: 700; margin-inline-start: auto; }
.rolls li.ok { border-color: rgba(47, 125, 90, .35); }
.summary { margin-top: 16px; font-weight: 600; }
.summary.ok { color: var(--ok); }
.summary.bad { color: var(--happened); }
.err { color: var(--happened); font-weight: 600; margin-top: 8px; }

/* ---------- 404 ---------- */
.lost { text-align: center; padding: 60px 0 40px; }
.lost .lost-langs .lede { margin: 22px auto 0; }
.lost .die { width: 96px; margin: 0 auto 20px; filter: drop-shadow(3px 6px 8px var(--shadow-ink)); transform: rotate(-12deg); }

/* ---------- languages (D36, D37) ----------
   Each page loads only its own script's fonts from Google Fonts; these swap
   the families. Fraunces has no Greek or Cyrillic, Onest no Greek. */
:root:lang(el) { --font-display: "Literata", Georgia, serif; --font-body: "Manrope", "Segoe UI", system-ui, sans-serif; }
:root:lang(ru), :root:lang(bg) { --font-display: "Literata", Georgia, serif; }
:root:lang(ar), :root:lang(fa) { --font-display: "Noto Naskh Arabic", "Vazirmatn", Tahoma, serif; --font-body: "Vazirmatn", "Segoe UI", Tahoma, sans-serif; }
:root:lang(he) { --font-display: "Frank Ruhl Libre", "Times New Roman", serif; --font-body: "Heebo", "Segoe UI", Arial, sans-serif; }

/* Literata and the Arabic and Hebrew faces run larger or taller than Fraunces */
:root:lang(el) h1, :root:lang(ru) h1, :root:lang(bg) h1 { font-size: clamp(34px, 5.6vw, 58px); line-height: 1.12; }
:root:lang(el) .doc h1, :root:lang(ru) .doc h1, :root:lang(bg) .doc h1 { font-size: clamp(30px, 4.6vw, 40px); }
:root:lang(ar) :is(h1, h2, h3), :root:lang(fa) :is(h1, h2, h3) { line-height: 1.4; font-weight: 600; }
:root:lang(he) :is(h1, h2, h3) { line-height: 1.2; }
:root:lang(ar) .lockup .words b, :root:lang(fa) .lockup .words b, :root:lang(he) .lockup .words b { line-height: 1.25; font-weight: 600; }
:root:lang(ar) .lockup .words small, :root:lang(fa) .lockup .words small, :root:lang(he) .lockup .words small { margin-top: 2px; }

/* right to left: logical properties mirror the layout; these fix what letter
   tracking and capitals do to Arabic and Hebrew, and keep code, seeds and
   rolls left to right */
[dir="rtl"] :is(.eyebrow, .hero-copy .kicker, .sk .lab b, .doc th, .result .game-head, .room h3 small) { letter-spacing: 0; }
[dir="rtl"] .doc pre { direction: ltr; text-align: left; }
[dir="rtl"] :is(code, .mono) { unicode-bidi: isolate; }
[dir="rtl"] .field :is(input, textarea) { direction: ltr; text-align: left; }
[dir="rtl"] .field :is(input, textarea):not(#rolls):placeholder-shown { direction: rtl; text-align: right; }
[dir="rtl"] .rolls li .d, [dir="rtl"] .rolls li .rec s { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .lang-menu summary .caret { margin-inline-start: 1px; }
:root:lang(fa) .steps li::before { content: counter(step, persian); }
:root:lang(fa) .doc ol { list-style-type: persian; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
