/* Pixholm's handbook. Pages of cream paper floating in the island's sky, framed like the game's own boxes, with the
   game's bitmap type (built from src/components/title/pixel-font.ts) for everything the game would say. Its pixels are
   whole at 22, 33, 44 and 66 px. Day and night follow the reader's device, or the switch. */

@font-face { font-family: Pixholm; src: url(/intro-pixholm/fonts/pixholm.5cd8db0bd6.woff2) format('woff2'); font-display: block; }
@font-face { font-family: Geist; src: url(/intro-pixholm/fonts/Geist_400Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Geist; src: url(/intro-pixholm/fonts/Geist_500Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Geist; src: url(/intro-pixholm/fonts/Geist_600SemiBold.woff2) format('woff2'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(/intro-pixholm/fonts/GeistMono_400Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --b: 3px;
  --gutter: clamp(16px, 4vw, 40px);
  --sans: Geist, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, Menlo, monospace;
  --pixel: Pixholm, var(--mono);
}
:root,
:root[data-theme='day'] {
  color-scheme: light;
  --sky-top: #8fc6f2;
  --sky-bottom: #dff1fd;
  --paper: #fbf5e3;
  --paper-2: #f2e8cf;
  --ink: #2c2433;
  --ink-2: #5a4d46;
  --ink-3: #7d7067;
  --rule: #e0d3b6;
  --accent: #b8461f;
  --accent-bright: #ea6636;
  --gold: #a36d00;
  --glow: #ffd66b;
  --shadow: rgba(44, 36, 51, 0.26);
  --window-top: #9ccff5;
  --window-bottom: #ddf0fd;
  --tip-bg: #2c2433;
  --tip-ink: #f3ead6;
  --tip-title: #ffd66b;
  --dot: rgba(44, 36, 51, 0.045);
}
:root[data-theme='night'] {
  color-scheme: dark;
  --sky-top: #0a1029;
  --sky-bottom: #26306e;
  --paper: #191a2e;
  --paper-2: #212239;
  --ink: #efe7d6;
  --ink-2: #bdb4c9;
  --ink-3: #958da8;
  --rule: #2f3150;
  --accent: #ff9466;
  --accent-bright: #ff9466;
  --gold: #ffd66b;
  --glow: #ffd66b;
  --shadow: rgba(0, 0, 0, 0.5);
  --window-top: #0a1029;
  --window-bottom: #26306e;
  --tip-bg: #0d0e1c;
  --tip-ink: #e7dfcf;
  --tip-title: #ffd66b;
  --dot: rgba(239, 231, 214, 0.035);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font: 400 17px/1.65 var(--sans);
  color: var(--ink);
  background: linear-gradient(var(--sky-top), var(--sky-bottom)) fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img.sprite, .stage img, .px-art { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--accent-bright); }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px dashed var(--accent-bright); outline-offset: 4px; }
strong { font-weight: 600; }

/* The game's type: whole pixels, never smoothed. */
.px {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: 0;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-transform: none;
}

/* A box as the game draws one: a border with its corners left out, and a shadow a few pixels down. */
.box {
  background: var(--paper);
  box-shadow:
    0 calc(-1 * var(--b)) 0 0 var(--ink),
    0 var(--b) 0 0 var(--ink),
    calc(-1 * var(--b)) 0 0 0 var(--ink),
    var(--b) 0 0 0 var(--ink),
    0 calc(var(--b) * 3) 0 0 var(--shadow);
}

.skip { position: absolute; left: -999px; top: 8px; z-index: 50; }
.skip:focus { left: 12px; background: var(--paper); padding: 8px 12px; }

/* ---- the sky behind everything ---------------------------------------------------------------------------------- */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.sky-far, .sky-near {
  position: absolute; left: 0; right: 0; bottom: 0;
  background-repeat: repeat-x; image-rendering: pixelated;
  animation: drift 240s linear infinite;
}
.sky-far { height: 252px; background-image: url(/intro-pixholm/art/world-clouds-far-day.webp); background-size: 1440px 252px; opacity: 0.85; bottom: 40px; }
.sky-near { height: 216px; background-image: url(/intro-pixholm/art/world-clouds-near-day.webp); background-size: 1440px 216px; animation-duration: 140s; bottom: -40px; }
:root[data-theme='night'] .sky-far { background-image: url(/intro-pixholm/art/world-clouds-far-night.webp); }
:root[data-theme='night'] .sky-near { background-image: url(/intro-pixholm/art/world-clouds-near-night.webp); }
@keyframes drift { from { background-position-x: 0; } to { background-position-x: -1440px; } }
@media (prefers-reduced-motion: reduce) { .sky-far, .sky-near { animation: none; } }

.theme-toggle { position: absolute; top: 14px; right: 14px; z-index: 40; }
.toc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.toc-head h2 { margin: 0 !important; }
.toc-head .btn { min-height: 34px; padding: 0 10px 4px; }
.scene-legend { margin: 12px 4px 0; text-align: center; color: var(--ink); min-height: 2.6em; }

/* ---- buttons ---------------------------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 6px 14px 8px;
  color: var(--ink); background: var(--paper);
  border: 0; cursor: pointer; text-decoration: none;
  box-shadow:
    0 calc(-1 * var(--b)) 0 0 var(--ink),
    0 var(--b) 0 0 var(--ink),
    calc(-1 * var(--b)) 0 0 0 var(--ink),
    var(--b) 0 0 0 var(--ink),
    0 calc(var(--b) * 2) 0 0 var(--shadow);
  transition: transform 80ms steps(2);
}
.btn:hover { transform: translateY(-2px); color: var(--ink); }
.btn:active { transform: translateY(2px); }
.btn-primary, .btn[aria-selected='true'] { background: var(--ink); color: var(--paper); }
.btn-primary:hover, .btn[aria-selected='true']:hover { color: var(--paper); }
.btn[disabled] { opacity: 0.45; cursor: default; transform: none; }

/* ---- the cover -------------------------------------------------------------------------------------------------- */
.cover { position: relative; min-height: 100svh; display: grid; align-items: center; padding: 72px var(--gutter) 120px; }
.cover-stage { position: absolute; inset: 0; overflow: hidden; }
.cover-text { position: relative; z-index: 2; max-width: 560px; padding: clamp(20px, 4vw, 36px); margin-left: clamp(0px, 4vw, 64px); }
.kicker { color: var(--accent); margin: 0 0 6px; }
.title { font-size: 66px; line-height: 1; margin: 0; color: var(--ink); }
.subtitle { font-size: 33px; margin: 10px 0 18px; color: var(--accent); }
.lede { font-size: 18px; color: var(--ink-2); margin: 0 0 22px; }
.cover-actions { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: center; }
.soon { color: var(--ink-3); }
@media (max-width: 720px) {
  .cover { align-items: end; padding-top: 52vh; }
  .title { font-size: 44px; }
  .subtitle { font-size: 22px; }
  .cover-text { margin: 0; }
}

/* ---- the book --------------------------------------------------------------------------------------------------- */
.book { display: grid; grid-template-columns: 250px minmax(0, 860px); gap: 44px; justify-content: center; padding: 24px var(--gutter) 120px; }
.toc { position: sticky; top: 24px; align-self: start; padding: 18px 18px 14px; max-height: calc(100vh - 48px); overflow: auto; }
.toc h2 { margin: 0 0 10px; font-size: 22px; color: var(--accent); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li a { display: grid; grid-template-columns: 34px 1fr; gap: 6px; align-items: baseline; padding: 3px 0; text-decoration: none; font-size: 15px; line-height: 1.35; color: var(--ink-2); }
.toc li a .px { color: var(--ink-3); }
.toc li a:hover, .toc li a[aria-current='true'] { color: var(--ink); }
.toc li a[aria-current='true'] .px { color: var(--accent-bright); }
@media (max-width: 1000px) {
  .book { grid-template-columns: minmax(0, 860px); }
  .toc { position: static; max-height: none; }
  .toc ol { columns: 2; column-gap: 20px; }
}
@media (max-width: 520px) { .toc ol { columns: 1; } }

.pages { display: grid; gap: 56px; min-width: 0; }
.chapter {
  position: relative;
  padding: clamp(22px, 5vw, 56px) clamp(18px, 5vw, 60px);
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 6px 6px;
  box-shadow:
    0 calc(-1 * var(--b)) 0 0 var(--ink),
    0 var(--b) 0 0 var(--ink),
    calc(-1 * var(--b)) 0 0 0 var(--ink),
    var(--b) 0 0 0 var(--ink),
    0 calc(var(--b) * 4) 0 0 var(--shadow);
  min-width: 0;
}
.chapter > p, .chapter > ul, .chapter > ol, .chapter > dl, .chapter > h3 { max-width: 68ch; }
.chapter-head { margin-bottom: 26px; padding-bottom: 18px; background: repeating-linear-gradient(90deg, var(--rule) 0 6px, transparent 6px 12px) bottom / 100% 3px no-repeat; }
.chapter-no { margin: 0 0 6px; color: var(--accent); }
.chapter h2 { font-size: 44px; line-height: 1.1; margin: 0; }
@media (max-width: 560px) { .chapter h2 { font-size: 33px; } }
.chapter h3 { font-size: 22px; margin: 38px 0 10px; color: var(--ink); }
.chapter p { margin: 0 0 16px; }
.dropcap::first-letter { font-family: var(--pixel); font-size: 66px; float: left; line-height: 0.9; margin: 6px 6px 0 0; color: var(--accent-bright); -webkit-font-smoothing: none; }

.rules { padding-left: 0; list-style: none; margin: 0 0 18px; }
.rules li { position: relative; padding-left: 26px; margin: 0 0 9px; }
.rules li::before { content: ''; position: absolute; left: 4px; top: 0.62em; width: 8px; height: 8px; background: var(--accent-bright); box-shadow: 2px 2px 0 var(--shadow); }
.rules.numbered { counter-reset: step; }
.rules.numbered li { counter-increment: step; padding-left: 36px; }
.rules.numbered li::before { content: counter(step); width: auto; height: auto; top: -0.1em; left: 0; background: none; box-shadow: none; font-family: var(--pixel); font-size: 22px; color: var(--accent-bright); -webkit-font-smoothing: none; }

.formula { display: block; text-align: center; padding: 14px 18px; margin: 18px auto 22px; max-width: 520px; color: var(--ink); }

.tip { margin: 30px 0 6px; padding: 18px 22px 16px; background: var(--tip-bg); color: var(--tip-ink); max-width: 72ch; }
.tip .tip-title { margin: 0 0 6px; color: var(--tip-title); }
.tip p { margin: 0; }

/* ---- scenes ----------------------------------------------------------------------------------------------------- */
.scene { margin: 30px calc(-1 * clamp(0px, 3vw, 30px)); }
.scene .stage {
  position: relative; overflow: hidden; aspect-ratio: 16 / 8; min-height: 220px;
  background: linear-gradient(var(--window-top), var(--window-bottom));
  box-shadow:
    0 calc(-1 * var(--b)) 0 0 var(--ink),
    0 var(--b) 0 0 var(--ink),
    calc(-1 * var(--b)) 0 0 0 var(--ink),
    var(--b) 0 0 0 var(--ink);
}
.scene[data-scene='counters'] .stage { aspect-ratio: 16 / 10; }
.scene[data-scene='battle'] .stage { aspect-ratio: 16 / 9; }
.scene[data-scene='land'] .stage, .scene[data-scene='rows'] .stage { aspect-ratio: 16 / 9; }
@media (max-width: 600px) {
  .scene[data-scene] .stage { aspect-ratio: 4 / 3; min-height: 0; }
  .scene[data-scene='counters'] .stage { aspect-ratio: 3 / 4; }
}
.scene figcaption { margin: 14px 4px 0; font-size: 15px; color: var(--ink-2); text-align: center; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.world > * { position: absolute; }
.label { position: absolute; z-index: 999999; font-family: var(--pixel); font-size: 22px; line-height: 1.2; color: var(--ink); background: var(--paper); padding: 2px 8px 4px; white-space: nowrap; -webkit-font-smoothing: none; box-shadow: 0 -2px 0 var(--ink), 0 2px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink); }
.label.dim { color: var(--ink-3); }
.scene-controls { position: absolute; z-index: 999999; display: flex; flex-wrap: wrap; gap: 10px; }
.scene-controls .btn { min-height: 36px; padding: 2px 10px 4px; }
.mote { width: 2px; height: 2px; background: #ffe38a; }
.meter { position: absolute; z-index: 99999; height: 14px; background: var(--paper); box-shadow: 0 -2px 0 var(--ink), 0 2px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink); }
.meter i { display: block; height: 100%; width: calc(var(--f, 0) * 100%); background: var(--glow); transition: width 300ms steps(6); }

/* ---- cards ------------------------------------------------------------------------------------------------------ */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 30px 26px; margin: 26px 0 10px; }
.card { display: flex; flex-direction: column; min-width: 0; }
.card-art { position: relative; height: 170px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 14px; overflow: hidden; }
.sky-window { background: linear-gradient(var(--window-top), var(--window-bottom)); box-shadow: inset 0 calc(-1 * var(--b)) 0 var(--ink); }
.card-art img { position: relative; }
.flying { align-items: center; padding-bottom: 0; }
.flying > img, .flying > .beast { animation: bob 1.6s steps(2) infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .flying > img, .flying > .beast { animation: none; } }
/* A beast's loop of frames side by side, shown one at a time through a window its own size (guide.js steps through them). */
.beast { display: inline-block; position: relative; overflow: hidden; flex: none; }
.beast img { display: block; max-width: none; }
.flyer { left: 0; top: 0; overflow: hidden; }
.flyer img { display: block; max-width: none; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 0; flex: 1; }
.card h3 { margin: 0 0 4px; font-size: 22px; }
.card-meta { margin: 0 0 10px; color: var(--accent); }
.card-body > p { font-size: 15.5px; line-height: 1.55; margin: 0 0 10px; color: var(--ink-2); }
.card-level { color: var(--ink) !important; }
.card-level .px { color: var(--ink); }
.card-cost { font-family: var(--mono); font-size: 13.5px !important; color: var(--ink-3) !important; }

.stats { display: grid; gap: 7px; margin: 6px 0 12px; }
.stat { display: grid; grid-template-columns: 82px 1fr; align-items: center; gap: 10px; }
.stat dt { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.stat dd { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.stat b { font-family: var(--mono); font-weight: 400; font-size: 13.5px; color: var(--ink); min-width: 74px; text-align: right; }
.bar { display: block; height: 10px; background: var(--paper-2); box-shadow: 0 -2px 0 var(--ink), 0 2px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink); margin: 0 2px; }
.bar i { display: block; height: 100%; width: calc(var(--f) * 100%); background: var(--glow); transition: width 240ms steps(5); }
.stat[data-stat='toughness'] .bar i { background: #8fc6f2; }
.stat[data-stat='power'] .bar i { background: #ea6636; }
.stat[data-stat='trip'] .bar i, .stat[data-stat='train'] .bar i { background: #b9a8d8; }
.stat[data-stat='cost'] .bar i { background: #c9aea2; }

.relations { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; margin-top: auto; padding-top: 10px; border-top: 2px dashed var(--rule); }
.relations p { margin: 0; }
.rel-label { color: var(--ink-3); font-size: 22px; white-space: nowrap; }
.chips, .icons { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-block; padding: 0 8px 2px; background: var(--paper-2); box-shadow: 0 -2px 0 var(--ink), 0 2px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink); cursor: help; }
.mini { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; background: linear-gradient(var(--window-top), var(--window-bottom)); box-shadow: 0 -2px 0 var(--ink), 0 2px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink); margin: 2px; }
.none { font-size: 14px; color: var(--ink-3); }

.gifts, .glossary { display: grid; gap: 12px; margin: 12px 0 20px; }
.gifts div, .glossary div { display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: baseline; }
.gifts dd, .glossary dd { margin: 0; color: var(--ink-2); }
.glossary dt { font-weight: 600; }
@media (max-width: 520px) { .gifts div, .glossary div { grid-template-columns: 1fr; gap: 4px; } }

.stepper { display: inline-flex; align-items: center; gap: 14px; padding: 8px 12px; margin: 10px 0 4px; position: sticky; top: 12px; z-index: 5; }
.stepper .btn { min-height: 36px; min-width: 40px; padding: 0 0 4px; }
.stepper output { min-width: 34px; text-align: center; }
.stepper-label { color: var(--ink-2); }

/* ---- tables ----------------------------------------------------------------------------------------------------- */
.table-wrap { margin: 22px 0 26px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
caption { text-align: left; padding: 12px 14px 8px; color: var(--accent); }
th, td { padding: 8px 14px; text-align: left; vertical-align: middle; border-top: 2px solid var(--rule); }
thead th { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); border-top: 0; white-space: nowrap; }
tbody th { font-weight: 600; white-space: nowrap; }
td { font-family: var(--mono); font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
tbody tr:nth-child(even) { background: var(--paper-2); }
.compact th, .compact td { padding: 6px 12px; }
.row-art { display: inline-flex; width: 30px; justify-content: center; vertical-align: middle; }
.row-art img { max-height: 26px; width: auto; }
details.more { margin: 10px 0; }
details.more summary { cursor: pointer; padding: 8px 0; list-style: none; color: var(--ink); }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: '+'; display: inline-block; width: 22px; color: var(--accent-bright); }
details.more[open] summary::before { content: '-'; }
details.more .table-wrap { margin-top: 6px; }

/* ---- the battle theatre ----------------------------------------------------------------------------------------- */
.theatre .tabs { display: flex; flex-wrap: wrap; gap: 12px 14px; margin: 0 4px 18px; }
.theatre .tabs .btn { min-height: 38px; padding: 2px 12px 4px; }
.theatre-box { margin-top: 18px; padding: 18px 22px; background: var(--tip-bg); color: var(--tip-ink); }
.theatre-box .theatre-title { margin: 0 0 8px; color: var(--tip-title); }
.theatre-box p { margin: 0 0 10px; }
.theatre-line { color: #c9c0d6; font-size: 15px; }
.theatre-actions { display: flex; flex-wrap: wrap; gap: 12px 14px; margin-top: 6px; }
.theatre-actions .btn { min-height: 38px; padding: 2px 12px 4px; }

.pennants { display: flex; flex-wrap: wrap; gap: 18px 26px; margin: 18px 0 8px; }
.pennants figure { margin: 0; display: grid; justify-items: center; gap: 6px; }
.pennants figcaption { font-size: 13px; color: var(--ink-3); text-align: center; }
.looks { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 20px; margin: 18px 0 8px; }
.looks figure { margin: 0; display: grid; justify-items: center; gap: 6px; }
.looks figcaption { font-size: 13px; line-height: 1.35; color: var(--ink-3); text-align: center; }

.foot { text-align: center; padding: 30px var(--gutter) 160px; color: var(--ink); }
.foot p { margin: 6px 0; }
.foot .px { font-size: 22px; }

@media (prefers-reduced-motion: reduce) { .bar i, .meter i, .btn { transition: none; } }

/* ---- scenes drawn in the page's own type, not the world's pixels ---------------------------------------------------- */
.counter-unit { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 6px; margin: 0; cursor: pointer; color: var(--ink); z-index: 2; transition: opacity 200ms steps(3); }
.counter-unit img { image-rendering: pixelated; flex: none; }
.counter-unit.dim { opacity: 0.32; }
.counter-unit:hover .px { color: var(--accent); }
@media (max-width: 640px) { .counter-unit .px { display: none; } }
.lanes .label, .ladder .label { font-size: 22px; }
.ladder .px { font-size: 22px; }
@media (max-width: 600px) { .lanes .label.dim { font-size: 11px; padding: 1px 4px 2px; } }

/* Sprites: each rank's clothes in the ranks table, and real cards. */
.folk-frame { display: inline-block; width: calc(var(--w) * 3px); height: calc(var(--h) * 3px); overflow: hidden; vertical-align: middle; }
.folk-frame img { display: block; width: calc(var(--w) * var(--n) * 3px); height: calc(var(--h) * 3px); max-width: none; image-rendering: pixelated; image-rendering: crisp-edges; }
.table-wrap.ranks td:nth-child(2) { width: 44px; }
.table-wrap.ranks td { white-space: normal; }
.sprite-cards { display: flex; gap: 26px; margin: 22px 0 10px; padding: 4px 4px 14px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.sprite-cards:focus-visible { outline: var(--b) solid var(--accent); outline-offset: 4px; }
.sprite-cards figure { margin: 0; flex: none; width: 288px; max-width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; scroll-snap-align: start; }
.sprite-cards img { width: 288px; max-width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; }
.sprite-cards figcaption { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); text-align: center; max-width: 288px; }

/* All languages use one set of assets. Non-Latin headings use the device's own letters. */
.languages { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; padding: 14px var(--gutter); font: 14px/1.6 var(--sans); }
.languages a[aria-current='page'] { font-weight: 600; text-decoration-thickness: 3px; }
:root:lang(zh-Hans), :root:lang(th) { --pixel: var(--sans); }
:lang(zh-Hans) .px, :lang(th) .px, :lang(zh-Hans) .label, :lang(th) .label { -webkit-font-smoothing: auto; }
:lang(zh-Hans) .px { line-height: 1.5; }
:lang(th) body { line-height: 1.925; }
:lang(th) * { letter-spacing: 0 !important; }
:lang(th) .px { line-height: 1.52; }
:lang(th) .chapter h2, :lang(zh-Hans) .chapter h2 { line-height: 1.3; }
:lang(th) .card-body > p { line-height: 1.81; }
:lang(th) .toc li a, :lang(th) .looks figcaption { line-height: 1.575; }
:lang(th) .sprite-cards figcaption { line-height: 1.75; }
:root:not(:lang(en)) .label { max-width: calc(100% - 24px); white-space: normal; }
:lang(th) .label { line-height: 1.4; }

/* Each language's flag beside its name. Our own pixels (src/lib/flags.ts, written to /flags by scripts/flags-site.ts),
   not emoji: flag emoji differ from system to system and Windows has none. */
.languages a::before { content: ""; display: inline-block; width: 18px; height: 12px; margin-right: 6px; vertical-align: -1px; background: center / 100% 100% no-repeat; image-rendering: pixelated; }
.languages a[hreflang="en"]::before { background-image: url("/flags/en.svg"); }
.languages a[hreflang="es"]::before { background-image: url("/flags/es.svg"); }
.languages a[hreflang="de"]::before { background-image: url("/flags/de.svg"); }
.languages a[hreflang="fr"]::before { background-image: url("/flags/fr.svg"); }
.languages a[hreflang^="zh"]::before { background-image: url("/flags/zh.svg"); }
.languages a[hreflang="th"]::before { background-image: url("/flags/th.svg"); }
