/* Shatranj Garden (working title): the design system.
   An app-like layout in the manner of the best chess sites: a slim sidebar with nested
   menus, the board first, one panel beside it, one main action per screen.
   Heritage shows in the content, the board, the chessmen and the owner's art.

   The colours of the controls come from the logo (the owner's choice, 26 Nov 2026: "Logo crimson"):
     --accent        the logo's crimson: the one main button of a screen, and the mark of where you are
     --accent-hover  the main button under the pointer; --accent-lo: the base under it; --accent-ink: text on it
     --accent-hi     the accent where it is read as text on the page's ground: links, the focus ring
     --gold          the small decorative accents (Arabic names, portrait rings): cream in the dark
                     theme, a warm gold in the light one (never crimson); --gold-ink is text set on it
     --btn-line      the outline of a quiet button
   Every pair of text and ground was measured at 4.5 to 1 or better. The board keeps its own colours. */

:root {
  --font: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  /* One scale of weights (the owner, 26 Nov 2026: Space Grotesk "everywhere but arrange the boldness
     through components"; docs/DESIGN-NOTES.md). Space Grotesk goes up to 700, and is loaded as one variable font
     (300..700), so the weights between the named ones are real. The owner, 28 Nov 2026, after a mockup of bolder
     text: "the texts can be in between": each weight below the display ones is halfway between the old one and the
     mockup's (400/500/600/600 -> 425/550/650/650). */
  --w-body: 425;        /* running text, descriptions */
  --w-meta: 550;        /* secondary lines, meta text, captions, the move list */
  --w-label: 650;       /* small-caps eyebrows, chips, the item you are on, quiet buttons */
  --w-title: 650;       /* card titles, masters' names, panel headings */
  --w-display: 700;     /* page titles, big numbers (a rating) */
  --w-action: 700;      /* the one crimson button */
  --w-nav: 600;         /* the sidebar and the phone's bottom bar, as in the owner's chosen mockup (28 Nov 2026) */
  --w-nav-on: 700;      /* the section you are in, there */
  --font-arabic: "Amiri", "Noto Naskh Arabic", serif;
  --radius: 12px;
  --radius-sm: 8px;
  --side-w: 208px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* dark (default): "garden green", the owner's choice of 26 Nov 2026 (version A of two): the page as a
     garden at night, deep green grounds and panels, cream text; crimson stays the only accent */
  --bg: #111915;
  --bg-side: #15201a;
  --panel: #1b2620;
  --panel-2: #233128;
  --panel-3: #2e3e34;
  --line: #2e3e34;
  --text: #eef2e9;
  --text-2: #c7d2c5;                 /* the greys of secondary text and captions: halfway to the mockup's darker ones (28 Nov) */
  --text-3: #abb9aa;
  --accent: #c51541;
  --accent-hover: #d32050;
  --accent-hi: #ff8da3;
  --accent-lo: #860b2a;
  --accent-ink: #ffffff;
  --gold: #efe6cc;
  --gold-ink: #1b1305;
  --btn-line: rgba(226, 238, 214, .5);
  --danger: #e9b38f;                 /* a warm earth: resign and delete, set apart from the crimson and from the Red men */
  --font-ui: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;   /* buttons and controls: Space Grotesk, the owner's pick (docs/BUTTONS.md) */
  /* the buttons are bigger inside the same boxes (the owner, 28 Nov 2026: "content inside could be bigger like buttons") */
  --btn-h: 46px; --btn-h-sm: 40px; --btn-r: 12px; --btn-size: 16px; --btn-weight: var(--w-label); --btn-spacing: 0;
  --tone-player: #ead9b0;
  --red: #f07158;                    /* lighter than before: 4.5 to 1 on the green panels */
  --ok: #3fbf7f;
  --primary: #6aa9ec;
  --secondary: #a3a8b8;
  --warn: #e6a23c;
  --shadow: 0 1px 2px rgba(0,0,0,.38), 0 8px 24px rgba(0,0,0,.34);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.42), 0 18px 48px rgba(0,0,0,.5);
  color-scheme: dark;
}
/* the light theme: warm paper instead of white on grey, and small text dark enough to read (4.5 to 1 or better) */
:root[data-theme="light"] {
  --bg: #f3efe6;
  --bg-side: #fbf8f1;
  /* the paper page and its paper tints: warm greys of the same paper (C21 of the site check, 30 Nov 2026: the green-grey
     tints of the owner's choice L3, 27 Nov, stay only inside the garden, below) */
  --panel: #fbfaf4;
  --panel-2: #efebe2;
  --panel-3: #e5e0d4;
  --line: #dcd6c9;
  --text: #1b1d22;
  --text-2: #3a4049;
  --text-3: #505662;
  --accent: #c51541;
  --accent-hover: #d32050;
  --accent-hi: #a80f36;
  --accent-lo: #860b2a;
  --accent-ink: #ffffff;
  --gold: #7a5418;                   /* a warm gold, not crimson (the owner, 29 Nov 2026): 5.1 to 6.5 to 1 on the light panels and tints */
  --gold-ink: #ffffff;
  --btn-line: rgba(27, 29, 34, .4);
  --danger: #8a3d1c;
  --tone-player: #7a6a45;
  --red: #c8442c;
  --ok: #23955c;
  --primary: #2f74c0;
  --secondary: #5a6072;
  --warn: #b97a12;
  --shadow: 0 1px 2px rgba(40,30,10,.08), 0 8px 24px rgba(40,30,10,.08);
  --shadow-lg: 0 2px 6px rgba(40,30,10,.1), 0 18px 48px rgba(40,30,10,.14);
  color-scheme: light;
}
/* the garden pages keep the day's green-grey tints (C21): Your garden and the example garden */
:root[data-theme="light"] .page:has(> .gd-head) { --panel-2: #edf1e4; --panel-3: #e2e7d6; --line: #d9dccb; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; border-radius: 4px; }
/* What has the keyboard always shows a clear ring, in day and night (the site check of 29 Nov 2026, T5); a pointer or a
   finger never brings it up (:focus-visible). Here are the controls whose own look had dropped it for something fainter. */
.search:has(input:focus-visible) { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.chip:focus-visible, .tl-dot:focus-visible, .tl-ev:focus-visible, .gd-m:focus-visible, .wm-btn:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; }
.acct-menu [role="menuitem"]:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-hi); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--bg-side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 10px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; text-decoration: none; }
.brand .mark { width: 48px; height: 48px; flex: none; }      /* the owner's logo tile brings its own rounded corners */
.brand .word { font: var(--w-display) 17px/1.1 var(--font-display); letter-spacing: .1px; }
.brand .word small { display: block; font: var(--w-meta) 10.5px/1.3 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); font-weight: var(--w-label); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { position: relative; }
/* the sidebar and the phone's bottom bar: as big and bold as the owner's chosen mockup (28 Nov 2026), whatever the text weights */
.nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-sm); text-decoration: none; font-weight: var(--w-nav); font-size: 16px; color: var(--text-2); transition: background .15s, color .15s; }
.nav-link .ico { width: 24px; height: 24px; flex: none; }
.nav-link:hover, .nav-item:focus-within > .nav-link { background: var(--panel-2); color: var(--text); }
.nav-link[aria-current="page"] { background: var(--panel-2); color: var(--text); font-weight: var(--w-nav-on); }
.nav-link[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.fly { position: absolute; left: calc(100% + 6px); top: -6px; min-width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; opacity: 0; visibility: hidden; transform: translateX(-4px); transition: opacity .15s var(--ease), transform .15s var(--ease), visibility .15s; z-index: 40; }
.fly::before { content: ""; position: absolute; left: -10px; top: 0; bottom: 0; width: 10px; }
/* open while the keyboard is in it, and for a pointer while js/app.js holds it (.fly-held: it stays 450 ms after the
   pointer leaves); a touch screen without a pointer keeps opening it on :hover, as before */
.nav-item.fly-held > .fly, .nav-item:focus-within > .fly { opacity: 1; visibility: visible; transform: none; }
@media (hover: none) { .nav-item:hover > .fly { opacity: 1; visibility: visible; transform: none; } }
.fly-title { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 6px 10px 4px; font-weight: var(--w-label); }
.fly a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none; font-size: 14px; font-weight: var(--w-meta); color: var(--text); }
.fly a:hover { background: var(--panel-2); }
.fly a .n { font-size: 12px; color: var(--text-3); font-weight: var(--w-meta); }
.fly a.soon { color: var(--text-3); pointer-events: none; }
.fly a.soon::after { content: "soon"; font-size: 10.5px; font-weight: var(--w-label); letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.side-foot .nav-link { font-size: 14px; font-weight: var(--w-nav); padding: 7px 10px; }
.side-foot .nav-link .ico { width: 20px; height: 20px; }
/* a guest's visit ends with the tab (the owner, 29 Nov 2026): one quiet line under Your garden, and one card the first
   time the visit holds something, at the top of a calm page (js/visit-warning.js) */
.side-visit { display: block; margin: -3px 0 3px 42px; font-size: 12px; line-height: 1.3; color: var(--text-3); }
.visit-card { max-width: 1240px; margin: 0 auto 16px; padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.visit-card p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--text); flex: 1 1 260px; }
.visit-btns { display: flex; gap: 8px; flex: none; }
.visit-btns .btn { min-width: 9.5em; }
/* one sign-up at a time (the owner, 30 Nov 2026): while the visit's card is on the page, its Create account is the one,
   and the account spot's Sign up steps aside; Not now (or the next page) brings it back (js/visit-warning.js) */
:root:has(.visit-card) .acct .acct-up { display: none; }
@media (max-width: 1100px) { .side-visit { display: none; } }
@media (max-width: 720px) { .visit-card { margin-bottom: 12px; } .visit-btns { width: 100%; } .visit-btns .btn { flex: 1 1 0; min-width: 0; } }
/* A guest at #/profile (js/pages/profile.js; the owner, 1 Dec 2026: guests have no profiles): one calm card. Its Sign up
   is the one on the page: the account spot's steps aside, as for the visit's card. */
.pf-none { max-width: 520px; margin: 24px auto 0; padding: 20px; display: grid; gap: 10px; }
.pf-none h1, .pf-none p { margin: 0; }
.pf-none p { color: var(--text-2); line-height: 1.5; }
.pf-none-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 6px; }
.pf-none-acts .btn, .pf-none-acts .link { min-height: 44px; display: inline-flex; align-items: center; }
:root:has(.pf-none) .acct .acct-up { display: none; }
.main { min-width: 0; padding: 22px 28px 24px; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.page { max-width: 1240px; margin: 0 auto; animation: page-in .28s var(--ease); }
/* A short page stands still (the owner, 4 Dec 2026, in place of "the footer is never on the first screen" of 30 Nov):
   when the page and the footer fit in the window, nothing scrolls and the footer sits at the bottom of the window; a
   taller page scrolls as before, the footer after it. The main column is a column at least the window's height (under
   the phone's top bar), and the page takes the room left above the footer. Only the page's box grows: what is in it (a
   board that fits the screen) keeps its size and gets no scroll of its own. (Each part keeps its 1240 px and its
   centring: in a column, auto side margins would shrink a part to its words, so each takes the full width first.)
   Under the footer, 24 px (it was 48): the footer of a short page sits near the window's foot, and a page that only
   just fits (Sign in at 1366x768) no longer scrolls by two pixels. */
#main > :is(.page, .visit-card, .site-foot) { width: 100%; }
#main > .page { flex: 1 0 auto; }
#route-say { top: 0; left: 0; }   /* (the spoken page name: in the window's corner, not a pixel under the page's end) */
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* compact sidebar, then a bottom bar on phones */
@media (max-width: 1100px) {
  :root { --side-w: 72px; }
  .brand .word, .nav-link .lbl { display: none; }
  .brand { justify-content: center; padding: 4px 0 16px; }
  .nav-link { justify-content: center; }
}
/* the compact sidebar keeps its words (the site check of 29 Nov 2026, C6: a tablet showed the icons alone; the owner's
   rule is clear icons with words): a short word under each icon, as the phone's bottom bar has, in the same 72 px, so
   no board loses a pixel and every page keeps its layout. (The phone's bottom bar at these widths would give the board
   about 60 px more, but it brings the phone's top bar and its layout with it: a question for the owner.) */
/* Only the rail's own items take this shape (the review of C6: the Settings menu's Dark mode row had turned into a
   centred column with an 11 px word); the menu's rows stay rows, as on a laptop. */
@media (min-width: 721px) and (max-width: 1100px) {
  .side { padding: 12px 4px; }
  .brand { padding-bottom: 12px; }
  .nav > .nav-item > .nav-link, .side-foot > .nav-link, .side-foot > .nav-item > .nav-link { flex-direction: column; gap: 3px; padding: 7px 1px 6px; font-size: 11.5px; line-height: 1.15; letter-spacing: -.01em; text-align: center; }
  /* a word never breaks inside itself (at a larger minimum font size "Mansubat" broke as "Mansuba / t"): it may run a
     few pixels past the item instead */
  .nav > .nav-item > .nav-link .lbl, .side-foot > .nav-link .lbl, .side-foot > .nav-item > .nav-link .lbl { display: block; max-width: 100%; overflow-wrap: normal; }
  .nav > .nav-item > .nav-link .ico { width: 23px; height: 23px; }
  .side-foot > .nav-link .ico, .side-foot > .nav-item > .nav-link .ico { width: 20px; height: 20px; }
  .side-foot > .nav-link .lbl, .side-foot > .nav-item > .nav-link .lbl { font-size: 11px; }
  /* "Your garden" reads "Garden" here; "Your " is hidden from the eye only, so a screen reader still says "Your garden"
     (display: none took it out of the name) */
  .lbl .lbl-you { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lbl:has(.lbl-you) { text-transform: capitalize; }
  .side-foot .bell-btn .lbl { font-size: 0; }               /* "Notifications" is too long under an icon: "Bell" (the button's name, "Notifications bell", holds it) */
  .side-foot .bell-btn .lbl::after { content: "Bell"; font-size: 11px; }
  .nav-link[aria-current="page"]::before { left: -4px; }
  .nav-badge, .side-foot .bell-count { position: absolute; top: 2px; right: calc(50% - 22px); margin: 0; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; }
}
/* a short window (a laptop at 125 % or more: about 1093 x 500): the words would push Settings and the bell below the
   window, so the rail goes back to its icons alone, which fit down to about 440 px (the review of C6) */
@media (min-width: 721px) and (max-width: 1100px) and (max-height: 640px) {
  .nav > .nav-item > .nav-link, .side-foot > .nav-link, .side-foot > .nav-item > .nav-link { gap: 0; padding: 9px 1px; }
  .nav > .nav-item > .nav-link .lbl, .side-foot > .nav-link .lbl, .side-foot > .nav-item > .nav-link .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); }
  .brand, .side-foot, .fly { display: none; }
  .nav { flex-direction: row; justify-content: space-around; width: 100%; }
  .nav-link { flex-direction: column; gap: 2px; padding: 6px 6px; font-size: 16px; font-weight: var(--w-nav); }
  .nav-link .lbl { display: block; }
  .nav-link[aria-current="page"]::before { left: 20%; right: 20%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .main { padding: 14px 16px calc(90px + env(safe-area-inset-bottom)); }   /* (the bar of sections grows by the safe area: so does the room kept for it) */
  .shell, .main { min-height: calc(100vh - var(--topbar-h)); min-height: calc(100dvh - var(--topbar-h)); }   /* (under the top bar) */
}
/* a phone held sideways: the bar of sections is slimmer (each icon beside its word), so a board and the game's controls
   fit between the top bar and it (the review of 29 Nov 2026: at 667x375 the controls were under it) */
@media (max-width: 720px) and (orientation: landscape) and (max-height: 600px) {
  .side { padding-top: 4px; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
  .nav-link { flex-direction: row; gap: 7px; padding: 5px 8px; }
  .nav-link[aria-current="page"]::before { top: -4px; }
  .main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
/* a short wide window (a phone held sideways, 200% zoom): the side rail fits the window's height, so Settings and Your
   games are in reach; the scroll pin, which had nowhere to stand there but over Learn or Play, is left out */
@media (min-width: 721px) and (max-height: 480px) {
  .brand { padding-bottom: 8px; }
  .brand .mark { width: 38px; height: 38px; }
  .nav-link { padding-top: 6px; padding-bottom: 6px; }
  .side-foot { padding-top: 6px; }
  .side-foot .nav-link { padding-top: 5px; padding-bottom: 5px; }
  /* (as strong as the compact rail's own rules above, which set 9 px round its icons in a short window) */
  .nav > .nav-item > .nav-link { padding-top: 6px; padding-bottom: 6px; }
  .side-foot > .nav-link, .side-foot > .nav-item > .nav-link { padding-top: 5px; padding-bottom: 5px; }
}

/* ---------- Type ---------- */
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
.h-page { font: var(--w-display) 34px/1.1 var(--font); letter-spacing: -.02em; }         /* the page titles: bigger (the owner, 28 Nov 2026) */
@media (max-width: 720px) { .h-page { font-size: 30px; } }
.h-display { font: var(--w-display) 40px/1.08 var(--font-display); letter-spacing: -.02em; }
.h-sec { font: var(--w-title) 18px/1.2 var(--font); letter-spacing: -.01em; }
.eyebrow { font-size: 12px; font-weight: var(--w-label); letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.ar { font-family: var(--font-arabic); font-weight: var(--w-body); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--text-2); max-width: 70ch; }

/* ---------- Buttons ---------- */
/* ---------- the buttons: four kinds, and one for icons (docs/BUTTONS.md) ----------
   primary    crimson, white words: the one main action of a screen
   secondary  a cream (in light: dark) outline: every other action that matters   (.btn)
   quiet      words only, a soft ground when pointed at: small, minor actions    (.btn.ghost)
   danger     resign, delete, start again: a warm earth outline with its own colour, never red on red
   icon       a square of the same height, for arrows, flip, close              (.btn.icon, with any kind)
   All share one height, one padding, one corner and one font (--font-ui), and the same states:
   pointed at, pressed (a step down; the crimson one stays still), keyboard focus (a ring) and disabled (faded, takes no clicks).
   .big makes any kind taller, for the one main action of a large panel. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--btn-h); padding: 0 16px; border-radius: var(--btn-r); border: 0; background: transparent; color: var(--text);
  font: var(--btn-weight) var(--btn-size)/1.15 var(--font-ui); letter-spacing: var(--btn-spacing); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s, transform .08s, box-shadow .15s; box-shadow: inset 0 0 0 1.5px var(--btn-line); }
.btn:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; border-radius: var(--btn-r); }
.btn .ico { width: 20px; height: 20px; flex: none; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn.primary { font-weight: var(--w-action); font-size: 16.5px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 0 var(--accent-lo); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary:active { transform: none; }   /* no press animation on the crimson button (the owner, 4 Dec 2026): its hover and its ring stay */
.btn.ghost { background: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--danger) 70%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn.big { min-height: 52px; padding: 0 24px; font-size: 17px; border-radius: var(--radius); width: 100%; }
.btn.primary.big { box-shadow: 0 4px 0 var(--accent-lo); }
.btn.icon { width: var(--btn-h); padding: 0; }
/* .small: the same kinds, smaller, for controls inside a card or a bar (a back link, Again, an arrangement) */
.btn.small, .arch-back .btn, .gd-arrange .btn, .viewing .btn, .st-onboard .btn, .hc-again { min-height: var(--btn-h-sm); padding: 0 13px; font-size: 14.5px; gap: 6px; }
.btn.small .ico, .viewing .btn .ico { width: 18px; height: 18px; }
.btn.icon.small, .jm-ctrl .btn { width: var(--btn-h-sm); min-height: var(--btn-h-sm); padding: 0; }
/* a short question with its two answers side by side (resign, a new game): ordinary buttons, never the tool tiles */
.ask-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ask-row .btn { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* a link in the text: the text's own colour, underlined in the section's colour (crimson is only for the one main
   button of a screen: the site check of 29 Nov 2026, C7) */
.link { color: var(--text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--sec, var(--text-2)) 70%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; font-weight: var(--w-label); }
.link:hover { text-decoration-color: currentColor; }
/* a back link names the page the visitor came from (js/nav-back.js): a long name is cut short, never wider than its row;
   the usual list, when the back link leads elsewhere, stays as one quiet link at the page's foot */
a[data-back] { max-width: 100%; min-width: 0; }
a[data-back] > .back-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-list { margin: 18px 0 0; font-size: 14.5px; color: var(--text-2); }
/* by day the section's colour in full: at 70 % the line was under 3:1 on Learn's and History's grounds (2.65 to 2.96:1),
   and the line is what marks a link now that its words are the text's colour (the review of C7) */
:root[data-theme="light"] .link, :root[data-theme="light"] .cp-small a, :root[data-theme="light"] .cp-lead a { text-decoration-color: var(--sec, var(--text-2)); }

/* ---------- Cards and panels ---------- */
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { background: var(--panel); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; overflow: hidden; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 16px; font-weight: var(--w-label); font-size: 16px; border-bottom: 1px solid var(--line); position: relative; }
.panel-head .ico { width: 20px; height: 20px; color: var(--text-2); }
.panel-head .badge { position: absolute; right: 12px; }
.panel-body { padding: 14px 16px; overflow: auto; min-height: 0; flex: 1; }
.panel-foot { padding: 12px 14px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; background: color-mix(in srgb, var(--panel) 92%, black 8%); }
:root[data-theme="light"] .panel-foot { background: var(--panel-2); }

/* ---------- Cards side by side: one axis ----------
   The owner, 3 Dec 2026: "The repeating buttons and windows next to each other should have the same placements of the
   components. They should be on the same axis." Cards in one row stretch to the tallest; in each, the text column runs
   from the card's top to its foot, so the title starts on one line and the foot (the button, the source, More, the
   meta line) sits on the card's last line whatever the text above: a card with less text gets room above its foot.
   A picture or board beside the text stays where its card puts it. tests/card-axis.mjs walks every page for this.
   (Each list's own stylesheet lays its cards out; these rules only add the axis, so they name the row to outrank it.) */
/* 1. the row: its cards stretch to one height */
.arch-panel :is(.rec-list, .unc-list) { align-items: stretch; }
/* 2. the text column fills its card, top to foot */
:is(.rec-list > .rec, .unc-list > .unc):not(.has-media, .has-board) { display: flex; flex-direction: column; }
:is(.rec-list > .rec, .unc-list > .unc) > :is(.rec-main, .unc-main) { flex: 1 0 auto; align-self: stretch; }
:is(.dg-list > .dg-card > .dg-t, .al-books > .al-book > .al-book-text) { display: flex; flex-direction: column; align-self: stretch; }
.tale-grid > .tale-card > .tale-card-t { align-self: stretch; }
.op-list > .op-item .op-item-t { align-self: start; }                       /* (no foot: the name on the board's top line) */
.hc-grid > .hc:not(.has-board, .hc-task) { display: flex; flex-direction: column; }
/* (a card with a board to try: its four parts, the name, the board, what to do and the words, each on one line across
   the row, so a longer "Your move" in one card does not lower the words under it) */
.hc-grid > .hc-task { grid-row: span 4; display: grid; grid-template-rows: subgrid; row-gap: 12px; }
.hc-grid > .hc-task > .hc-do { align-content: start; }
.hc-grid > .hc.has-board { align-content: stretch; }
.hc-grid > .hc > .hc-tx { display: flex; flex-direction: column; flex: 1 0 auto; }
.ho-prev > .ho-pv { align-content: start; }                                 /* (the room left goes under the words, not into the picture's row) */
.hx-things-row > .hx-thing > .hx-thing-top { align-items: flex-start; }    /* (a portrait beside the words no longer lowers them) */
/* pictures side by side (a chapter's pictures, under its text on a tablet): one row for the pictures, as tall as the
   tallest, and one for the captions, so the captions start on one line */
@media (max-width: 980px) {
  .ch-grid > .ch-pics > .fig { grid-row: span 2; display: grid; grid-template-rows: subgrid; row-gap: 0; }
  .ch-grid > .ch-pics > .fig > .fig-img { display: grid; place-items: center; }
}
/* 3. the foot: the first of a card's closing parts takes the free room above it (in the glossary's small cards the
   kind of word, "Piece", goes with it) */
:is(.rec-main, .unc-main) > :is(.more, .credit, .foot):not(:is(.more, .credit, .foot) ~ *),
.rec-list.compact .rec-main > :is(.tags, .more, .credit, .foot):not(:is(.tags, .more, .credit, .foot) ~ *),
.dg-t > :is(.dg-tag, .dg-foot):not(.dg-tag ~ *), .tale-card-t > .tale-card-meta, .al-book-text > .al-book-go, .hc-tx > .ht-src { margin-top: auto; }
.rec-list.compact .rec-main > .tags ~ :is(.more, .credit, .foot) { margin-top: 0; }
.rec-list.compact .rec-main:not(:has(> .more)) > .tags ~ .foot { margin-top: calc(24px + 5px); }   /* (a card with no More keeps its line: 24 px and the gap) */

/* ---------- Tabs ---------- */
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 6px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; flex: 1; min-width: max-content; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 10px 9px; background: none; border: 0; cursor: pointer; color: var(--text-3); font-size: 12.5px; font-weight: var(--w-meta); font-family: var(--font-ui); }
.tab .ico { width: 20px; height: 20px; }
.tab:hover { color: var(--text-2); }
.tab[aria-selected="true"] { color: var(--text); font-weight: var(--w-label); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--sec, var(--text-2)); }

/* ---------- Disclosure groups (nested choices) ---------- */
.group { border-radius: var(--radius-sm); background: var(--panel-2); overflow: hidden; }
.group + .group { margin-top: 6px; }
.group > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; font-weight: var(--w-label); }
.group > summary::-webkit-details-marker { display: none; }
.group > summary .count { margin-left: auto; font-size: 12.5px; color: var(--text-3); font-weight: var(--w-meta); }
.group > summary .chev { width: 16px; height: 16px; color: var(--text-3); transition: transform .2s var(--ease); }
.group[open] > summary .chev { transform: rotate(90deg); }
.group > .group-body { padding: 4px 12px 12px; }

/* ---------- Menus (dropdowns) ---------- */
.menu-wrap { position: relative; }
.menu { position: absolute; z-index: 50; min-width: 240px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; }
.menu.up { bottom: calc(100% + 6px); left: 0; }
.menu.down { top: calc(100% + 6px); right: 0; }
.menu h5 { margin: 6px 8px 4px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); font-weight: var(--w-label); }
.menu .opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: var(--radius-sm); cursor: pointer; text-align: left; font-size: 14px; }
.menu .opt:hover { background: var(--panel-2); }
.menu .opt[aria-checked="true"]::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sec, var(--text)); }
.seg { display: flex; background: var(--panel-2); border-radius: var(--radius-sm); padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; padding: 6px 8px; border-radius: 6px; cursor: pointer; font: var(--w-label) 13px/1.2 var(--font-ui); letter-spacing: var(--btn-spacing); color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25); }

/* ---------- Source badge ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 7px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); font-size: 12px; font-weight: var(--w-label); color: var(--text-2); cursor: pointer; white-space: nowrap; transition: border-color .15s; vertical-align: middle; }
.badge:hover { border-color: var(--text-3); color: var(--text); }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--secondary); flex: none; }
.badge.ok .dot { background: var(--ok); }
.badge.primary .dot { background: var(--primary); }
.badge.warn .dot { background: var(--warn); }
.badge.mini { height: 20px; padding: 0 6px; font-size: 10.5px; font-weight: var(--w-label); }
/* A finger's room (the site check of 29 Nov 2026, T6): on a touch screen every control takes a tap of at least 44 x 44 px,
   and keeps its look. An invisible place to tap reaches past a small control, to 44 px each way, never less than the
   control itself (::after; ::before where ::after already draws something: a current tab's line, a switch's knob). The
   place is set relative to the control (:where: a control placed by its own rule keeps its place). Controls that stand
   close together are spaced so that their places do not overlap (the footer's links, a row of chips). Boards, the garden's
   picture and the move strip's chips side by side are left out: a square is an eighth of the board, the garden can be
   brought closer, and the strip slides. (The walkthrough of 27 Nov 2026 first gave the badges and the timeline's marks
   36 px; pages-history.css still gives the timeline its own.) */
@media (pointer: coarse), (max-width: 720px) {
  :where(button.badge, .jm-where, .pick-more-btn, .site-foot .link, button.link.btn-reset, a.link, a.h-page, .tr-check,
    .chip, .ln-chip, .pr-mode, .mb-seg-btn, .arch-sw, .swatch, .toggle, .ps-garden, .ps-quiet, .st-back, .tale-f-all, .mb-path, .hint-x, .sp-chip, .sp-btn,
    .jm-seg, .mp-task, .hx-strip, summary, .btn, .seg button, .opt, .ho-q, .s-link, .cp-evlink, .hx-thing-t, .gd-turn-b, .gd-hour, .ed-man, .jm-range, .gd-won-row button) { position: relative; }
  :where(button.badge, .jm-where, .pick-more-btn, .site-foot .link, button.link.btn-reset, a.link, a.h-page, .tr-check,
    .chip, .ln-chip, .pr-mode, .mb-seg-btn, .arch-sw, .swatch, .toggle, .ps-garden, .ps-quiet, .st-back, .tale-f-all, .mb-path, .hint-x, .sp-chip, .sp-btn,
    .jm-seg, .mp-task, .hx-strip, summary, .btn, .seg button, .ho-q, .s-link, .cp-evlink, .hx-thing-t, .gd-turn-b, .gd-hour, .ed-man, .gd-won-row button,
    button.tl-dot:not(.hx-mk), button.tl-ev, .side .nav-link)::after,
  :where(.sec-tab, .gh-top, .opt)::before {
    content: ""; position: absolute; top: min(0px, calc(50% - 22px)); bottom: min(0px, calc(50% - 22px)); left: min(0px, calc(50% - 22px)); right: min(0px, calc(50% - 22px));
  }
  /* where controls stand in rows, or in a box that cuts off what reaches past it (a fold's head, the move strip), the
     room is made in the layout: a little more space between the rows, the same controls */
  :root .site-foot .foot-links { row-gap: 26px; }
  :root .site-foot .foot-set, :root .toggles { row-gap: 8px; }
  :root .toggles .toggle { min-height: 36px; }
  :root :is(.chips, .pr-modes, .board-pick, .ln-chips) { row-gap: 16px; }
  :root :is(.group, .fold) > summary { min-height: 44px; }
  :root .sp-track { padding-top: 6px; padding-bottom: 6px; }
  :root .stepper { padding-top: 2px; padding-bottom: 2px; }
  :root .jm-range { height: 44px; margin: -8px 0 -10px; }
  :root :is(.tr-pick) > summary { min-height: 44px; }
  :root .tr-heads button { min-height: 44px; }        /* (Endgames' head switch stands inside the fold, which cuts off a larger place to tap) */
  :root .op-feat-name .op-link { display: flex; align-items: center; min-height: 44px; }   /* (today's ta'biya's name: a 44 px tap of its own line, the Arabic under it) */
  :root .al-range { display: inline-flex; align-items: center; min-height: 44px; } :root .al-ranges { row-gap: 4px; }   /* (the album's number ranges) */
  :root details.more > summary { padding-top: 12px; padding-bottom: 12px; }
  :root details.more { margin-bottom: 12px; }
  :root .ch-src { row-gap: 23px; }
  :root .ho-quiet { margin-top: 4px; }        /* (the grid's 8 px and these 4: the links' room ends where the Play button begins) */
  :root .tr-check { margin-top: 20px; }
  :root .jm-tools { row-gap: 10px; }
  :root .gd-counts > :is(a, button) { min-height: 44px; }
  :root .gd-won-row { gap: 6px; }
  :root .pick-other { margin-top: 26px; }
  :root .an-tools .btn { min-height: 44px; }          /* (they cut their words short, and so would cut off a larger place to tap) */
  :root .ed-select { min-height: 44px; }
  :root .search { height: 44px; } .search input { align-self: stretch; }     /* (the box is the field: a tap anywhere in it lands in the text) */
}
.pop { position: fixed; z-index: 100; width: min(380px, calc(100vw - 24px)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px 16px; font-size: 13.5px; animation: pop-in .14s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
.pop h6 { margin: 0 0 2px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.pop .why { color: var(--text-2); margin: 0 0 10px; font-size: 12.5px; font-weight: var(--w-meta); }
.pop .src { margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.pop .src li { margin: 0 0 6px; }
.pop ul { margin: 0; padding-left: 18px; }
.pop details { margin-top: 8px; }
.pop summary { cursor: pointer; color: var(--text-2); font-weight: var(--w-meta); font-size: 12.5px; }
.pop .x { position: absolute; right: 8px; top: 8px; }

/* ---------- Lists, chips, misc ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid transparent; font: var(--w-label) 13px/1 var(--font-ui); font-weight: var(--w-meta); color: var(--text-2); cursor: pointer; }
.chip[aria-pressed="true"] { background: color-mix(in srgb, var(--sec, var(--text-2)) 16%, var(--panel)); border-color: var(--sec, var(--text-2)); color: var(--text); }   /* chosen: the section's colour, not the action's crimson */
.search { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 12px; height: 40px; min-width: 240px; }
.search input { border: 0; background: none; outline: 0; color: var(--text); font: inherit; width: 100%; }   /* (the ring is round the whole box: above) */
.search .ico { width: 18px; height: 18px; color: var(--text-3); }
.empty { padding: 30px; text-align: center; color: var(--text-3); }
.loading { padding: 60px 0; text-align: center; color: var(--text-3); }
/* the router's fountain while a page is on its way (js/app.js WAITING): gone the moment the page draws anything */
#main > .page:not(:empty) ~ .page-wait { display: none; }
.error { padding: 20px; border-radius: var(--radius); background: color-mix(in srgb, var(--red) 15%, var(--panel)); }
.kbd { font: var(--w-meta) 11px/1 var(--font); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; color: var(--text-2); font-weight: var(--w-label); }
.note { font-size: 13px; color: var(--text-2); }
.prose { max-width: 68ch; }
.prose p { margin: 0 0 12px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* Less motion: nothing moves. No transitions at all, and every CSS animation takes no time: it shows its end at once,
   so one that leaves its end state behind ("forwards", "both": a thing grown in, a card faded up) still leaves it, and
   one that repeats ends at once instead of running round again and again. (It was 0.01 ms for both: a transition time
   set on every element, even 0 s, makes the browser look for transitions on all of them at every change, and a full
   garden took about four times as long to restyle; transition: none and a zero animation time cost what no rule costs.
   animation: none would be as quick but would drop those end states.) Pages keep their own still versions too
   (css/garden-motion.css and the rest). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition: none !important; }
}

/* ---------- the footer: About, credits and licences one click away ---------- */
.site-foot { max-width: 1240px; margin: 34px auto 0; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 18px; font-size: 13px; color: var(--text-3); }
.nav-link .lbl-short { display: none; }
@media (max-width: 720px) { .nav-link .lbl-long { display: none; } .nav-link .lbl-short { display: inline; } .nav-link { padding: 6px 4px; } }

/* ---------- an old term, explained where it first appears ---------- */
.term { border-bottom: 1.5px dotted color-mix(in srgb, var(--sec, var(--text-2)) 80%, transparent); cursor: help; }
/* its meaning, for a screen reader only, right after the word (js/terms.js): not a stop of Tab, and not in the page's text */
.term[data-said]::after { content: " " attr(data-said); position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.term-tip { position: fixed; z-index: 120; max-width: min(320px, calc(100vw - 16px)); padding: 8px 12px; border-radius: 8px; background: var(--panel-3); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 13px; line-height: 1.4; pointer-events: none; }
.term-tip b { color: var(--text); margin-right: 4px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.foot-links button.link { font: inherit; font-weight: var(--w-label); cursor: pointer; padding: 0; text-align: left; }
.phone-only { display: none; }
@media (max-width: 720px) { .phone-only { display: inline; } }
/* a phone's Settings (the sidebar's foot is hidden there): a small panel under the footer's links (js/app.js FOOT) */
.foot-set { flex: 1 1 100%; max-width: 420px; display: grid; gap: 6px; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); }
.foot-set[hidden] { display: none; }
@media (min-width: 721px) { .foot-set { display: none; } }
.foot-c { flex: 1 1 100%; }   /* the © line: the footer's last row, by itself, on every screen (the rights are on About and in LICENSE) */
.foot-theme { display: flex; align-items: center; gap: 8px; min-height: 40px; font: inherit; font-size: 14px; font-weight: var(--w-label); color: var(--text); cursor: pointer; text-align: left; }
.foot-theme .ico, .foot-theme svg { width: 20px; height: 20px; flex: none; }
.foot-set-h { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); font-weight: var(--w-label); padding-top: 4px; }
.foot-set .toggle { min-height: 36px; }

/* ---------- phone: a slim top bar with the site's name ----------
   It stays at the top of the window however long the page is. For that the body must grow with the
   page: a sticky bar leaves the screen with its parent, and the body was fixed at one screen's height.
   --topbar-h is the room it takes, for anything else that sticks to the top or is scrolled to. */
.topbar { display: none; }
/* The phone's top-bar controls that the scripts add to the page (the garden pill, js/garden-highlight.js; the
   bell, js/bell.js) are hidden here too, in the one stylesheet every page needs, and not only in their own
   (garden-highlight.css, social.css), which show them on a phone. If one of those does not arrive (a dropped
   request), a control is never drawn across the whole desktop page. */
.gh-top, .top-bell { display: none; }
@media (max-width: 720px) {
  body { height: auto; min-height: 100%; }
  :root { --topbar-h: calc(49px + env(safe-area-inset-top)); scroll-padding-top: calc(var(--topbar-h) + 8px); }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30; padding: 8px max(16px, env(safe-area-inset-left)); padding-top: calc(8px + env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: var(--w-title); font-size: 15px; }
  .topbar svg, .topbar img { width: 32px; height: 32px; border-radius: 8px; }
}

/* A term inside a button, fold header or menu item: explained on pointing, the click stays the control's. */
.term.in-control { cursor: inherit; border-bottom-style: dotted; border-bottom-width: 1px; }

/* ---------- the moving background: flowing lines behind the pages (js/ambient.js) ---------- */
.ambient { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }   /* 100%, not 100vw: the page's scrollbar is not part of it */
:root[data-ambient="on"] .shell { position: relative; z-index: 1; }
/* the leaves and petals a breeze carries: a few faint shapes floating over the page, never in the way (js/ambient.js) */
.ambient-air { position: fixed; inset: 0; z-index: 35; overflow: hidden; pointer-events: none; }
.ambient-leaf { position: absolute; left: 0; top: 0; display: block; opacity: 0; will-change: transform, opacity; transform-origin: 0 50%; }
.ambient-leaf svg { display: block; width: 100%; height: auto; overflow: visible; fill: var(--leaf, #7db36d); opacity: .38; }
.ambient-leaf.petal svg { fill: var(--rose, #e58f9d); }

/* a man's name in the other set, where he is first introduced: "firzan (Persian farzin)" */
.alt-name { color: var(--text-3); font-weight: var(--w-meta); white-space: nowrap; }

/* ---------- no italics anywhere (the owner's rule, 26 Nov 2026): emphasis is weight or colour ---------- */
em, i, cite, dfn, address, blockquote, q { font-style: normal; }

/* ---------- the sidebar stays in the background: the page leads, the accent marks only where you are ---------- */
.side { background: color-mix(in srgb, var(--bg-side) 55%, var(--bg)); border-right-color: color-mix(in srgb, var(--line) 55%, transparent); }
.nav-link { color: var(--text-3); }
.nav-link .ico { opacity: .85; }
.nav-link[aria-current="page"] .ico, .nav-link:hover .ico { opacity: 1; }
.nav-link[aria-current="page"] { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }

/* ---------- the one divider of the site: the arcade (the owner's choice, 26 Nov 2026) ----------
   Eight pointed arches on a line, as in the arcade of a courtyard. They light up one by one as the
   page is scrolled: the first at the top, all eight at the foot (js/arcade.js sets --arc, 1 to 8).
   It stands under every page title; above the footer all eight are lit, since that is the end of
   the page; and once the title is out of sight a small copy is pinned at the top right of the window,
   which is also the way back to the top. With reduced motion, and on a page too short to scroll,
   all eight are simply lit.
   The grey arches are a mask, so they take the theme's own colour; the lit ones are the accent. */
:root {
  --arc: 1;
  --arcade-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 144 20'%3E%3Cg fill='none' stroke='%23000' stroke-linejoin='round'%3E%3Cpath d='M1 17V9C1 5 5 3 8 1C11 3 15 5 15 9V17' stroke-width='1.6'/%3E%3Cpath d='M19 17V9C19 5 23 3 26 1C29 3 33 5 33 9V17' stroke-width='1.6'/%3E%3Cpath d='M37 17V9C37 5 41 3 44 1C47 3 51 5 51 9V17' stroke-width='1.6'/%3E%3Cpath d='M55 17V9C55 5 59 3 62 1C65 3 69 5 69 9V17' stroke-width='1.6'/%3E%3Cpath d='M73 17V9C73 5 77 3 80 1C83 3 87 5 87 9V17' stroke-width='1.6'/%3E%3Cpath d='M91 17V9C91 5 95 3 98 1C101 3 105 5 105 9V17' stroke-width='1.6'/%3E%3Cpath d='M109 17V9C109 5 113 3 116 1C119 3 123 5 123 9V17' stroke-width='1.6'/%3E%3Cpath d='M127 17V9C127 5 131 3 134 1C137 3 141 5 141 9V17' stroke-width='1.6'/%3E%3Cpath d='M0 18.4H144' stroke-width='1.2'/%3E%3C/g%3E%3C/svg%3E");
  --arcade-lit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 144 20'%3E%3Cg fill='%23c51541' fill-opacity='.18' stroke='%23c51541' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M1 17V9C1 5 5 3 8 1C11 3 15 5 15 9V17'/%3E%3Cpath d='M19 17V9C19 5 23 3 26 1C29 3 33 5 33 9V17'/%3E%3Cpath d='M37 17V9C37 5 41 3 44 1C47 3 51 5 51 9V17'/%3E%3Cpath d='M55 17V9C55 5 59 3 62 1C65 3 69 5 69 9V17'/%3E%3Cpath d='M73 17V9C73 5 77 3 80 1C83 3 87 5 87 9V17'/%3E%3Cpath d='M91 17V9C91 5 95 3 98 1C101 3 105 5 105 9V17'/%3E%3Cpath d='M109 17V9C109 5 113 3 116 1C119 3 123 5 123 9V17'/%3E%3Cpath d='M127 17V9C127 5 131 3 134 1C137 3 141 5 141 9V17'/%3E%3C/g%3E%3C/svg%3E");
}
.page-head { position: relative; }
.page-head::after, .site-foot::before, .arcade {
  content: ""; height: 20px;
  /* grey: the line under all eight, and the arches not yet lit (none is drawn under a lit one, which would dull it) */
  --arcade-grey: color-mix(in srgb, var(--text-3) 70%, transparent);
  background: linear-gradient(var(--arcade-grey), var(--arcade-grey)) left bottom / 144px 2.4px no-repeat,
    linear-gradient(90deg, transparent calc(var(--arc) * 18px - 1px), var(--arcade-grey) 0) left center / 144px 20px no-repeat;
  -webkit-mask: var(--arcade-mask) left center / 144px 20px no-repeat;
  mask: var(--arcade-mask) left center / 144px 20px no-repeat;
}
.page-head::after { flex: 0 0 100%; order: 99; margin-top: -4px; }
.page-head::before, .site-foot::after, .arcade-lit {
  content: ""; position: absolute; left: 0; bottom: 0; height: 20px; width: calc(var(--arc) * 18px - 1px); max-width: 100%;
  background: var(--arcade-lit) left center / 144px 20px no-repeat;
  transition: width .3s var(--ease);
}
.arcade { display: block; width: 144px; }
/* the small copy pinned at the top of the window: it shows how far down the page is, and leads back up */
.arc-pin { position: fixed; z-index: 40; top: 12px; right: 18px; display: block; padding: 7px 12px 8px; border: 0; border-radius: 999px; background: var(--panel-3); box-shadow: 0 0 0 1px var(--line), var(--shadow-lg); cursor: pointer; animation: arc-in .25s var(--ease); }
.arc-pin[hidden] { display: none; }
.arc-pin:hover { background: color-mix(in srgb, var(--panel-3) 82%, var(--text)); }
.arc-pin:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.arc-pin-art { position: relative; display: block; width: 144px; height: 20px; transform-origin: right center; }
.arc-pin .arcade-lit { top: 0; bottom: auto; }
@keyframes arc-in { from { transform: translateY(-10px); } }
@media (max-width: 720px) {
  .arc-pin { top: calc(8px + env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); padding: 5px 10px 6px; }
}
/* on a wide screen the copy has a place of its own: the empty stretch of the sidebar above its foot, so it never
   covers the page (a panel's head, a button, the board); on a phone it sits in the top bar, as above */
@media (min-width: 721px) {
  .arc-pin { top: auto; right: auto; left: calc(var(--side-w) / 2); bottom: 196px; transform: translateX(-50%); animation-name: arc-fade; }
  @keyframes arc-fade { from { opacity: 0; } }
}
@media (min-width: 721px) and (max-width: 1100px) {      /* the compact sidebar: a small copy that fits its width, over its taller foot (with words) */
  .arc-pin { width: 58px; padding: 7px 5px; overflow: hidden; bottom: 236px; }
  .arc-pin-art { transform: scale(.333); transform-origin: left center; }
}
/* a short window: the compact rail has no empty stretch to spare (the copy covered Learn, Mansubat or History from 460
   to 615 px tall, and took their clicks), and the top right holds Sign in and Sign up, so the copy is not shown there
   (the footer's arches still show how far down the page is; Home and the keyboard still lead back up) */
@media (min-width: 721px) and (max-width: 1100px) and (max-height: 640px), (min-width: 1101px) and (max-height: 540px) {
  .arc-pin { display: none !important; }      /* (the full sidebar: below about 530 px tall the copy covered History) */
}
@media (prefers-reduced-motion: reduce) { .page-head::before, .site-foot::after, .arcade-lit { transition: none; } .arc-pin { animation: none; } }
@media (min-width: 721px) and (max-height: 540px) { .arc-pin { display: none; } }   /* a short wide window: no room in the rail (see the rail above) */

/* ---------- the side panel: details open beside the page (js/sheet.js); a bottom sheet on a phone ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 60; background: rgba(6, 12, 9, .5); animation: sheet-fade .2s var(--ease); }
.sheet { position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: min(440px, 92vw); display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); outline: none; animation: sheet-in .24s var(--ease); }
@keyframes sheet-in { from { transform: translateX(40px); } }
@keyframes sheet-up { from { transform: translateY(40px); } }
@keyframes sheet-fade { from { opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 10px 10px 20px; border-bottom: 1px solid var(--line); }
.sheet-body { padding: 20px; overflow: auto; overscroll-behavior: contain; min-height: 0; }
@media (max-width: 720px) {
  .sheet { top: auto; left: 0; width: auto; max-height: 86vh; max-height: 86dvh; border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); animation-name: sheet-up; }
  .sheet-head { padding: 8px 8px 8px 16px; }
  .sheet-body { padding: 16px; }
}
/* a master's story in the side panel (js/master-sheet.js) */
.ms-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; margin-bottom: 14px; }
.ms-face { margin: 0; width: 112px; text-align: center; }
.ms-face img { width: 112px; height: 112px; border-radius: 14px; box-shadow: 0 0 0 2px var(--gold); }
.ms-face figcaption { margin-top: 6px; font-size: 12px; color: var(--text-3); font-weight: var(--w-meta); }
.ms-medal { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--panel-3); font: var(--w-title) 26px/1 var(--font-display); color: var(--text-2); }
.ms-name { font: var(--w-title) 24px/1.15 var(--font-display); }
.ms-ar { margin-top: 4px; font-size: 17px; color: var(--gold); text-align: left; }
.ms-known { margin: 0 0 14px; font-size: 16px; line-height: 1.5; }
.ms-h { margin: 18px 0 6px; }
.ms-tales { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.ms-tales li + li { margin-top: 6px; }
.ms-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
/* a ladder master's game outside Play (js/master-sheet.js offerHTML; the site check of 29 Nov 2026, F8): on a History
   record a quiet button in Play's lapis (crimson only in the side panel, where it is the one main action); when he is
   locked, one quiet line that says where he stands and leads to the ladder */
.btn.ms-play { background: color-mix(in srgb, var(--sec-play) 10%, var(--panel)); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sec-play) 55%, transparent); font-weight: var(--w-label); }
.btn.ms-play:hover { background: color-mix(in srgb, var(--sec-play) 18%, var(--panel)); }
.btn.ms-play .ico { color: var(--sec-play); }
.ms-bot { font-weight: var(--w-meta); opacity: .8; }
.btn.primary .ms-bot { opacity: 1; }   /* on the crimson the lighter weight sets it apart; .8 was 4.2:1 (the review of F8) */
.ms-terms { flex-basis: 100%; order: 9; font-size: 14px; font-weight: var(--w-label); color: var(--text-2); }
.ms-ladder { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: var(--w-label); color: var(--text-2); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
.ms-ladder:hover { color: var(--text); text-decoration-color: currentColor; }
.ms-ladder .ico { width: 16px; height: 16px; flex: none; }


/* daily games waiting for your move: a small count on Play (js/app.js, js/daily-local.js) */
.nav-link { position: relative; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: var(--w-title); display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
@media (max-width: 720px) { .nav-badge { position: absolute; top: 2px; right: calc(50% - 22px); margin: 0; min-width: 18px; height: 18px; font-size: 11px; } }

/* When it does not fit (js/more.js, docs/DESIGN-NOTES.md): the one summary row that opens the rest in
   the side panel. A few small pictures, a few words, "+N", and an arrow; the height of one button. */
.more-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 5px 10px 5px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--panel-2) 80%, transparent); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.more-row:hover { border-color: var(--sec, var(--text-2)); }
.more-row:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.more-pics { display: flex; flex: none; }
.more-pics > i { display: grid; place-items: center; width: 28px; height: 28px; margin-right: -6px; border-radius: 50%; background: var(--panel); box-shadow: 0 0 0 2px var(--panel-2); font-style: normal; }
.more-pics > i:last-child { margin-right: 0; }
.more-pics > i > * { width: 26px; height: 26px; }
.more-pics .more-n { font-size: 11.5px; font-weight: var(--w-title); color: var(--text-2); }
.more-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.more-text b { font-size: 14px; font-weight: var(--w-title); }
.more-text small { font-size: 12px; color: var(--text-2); font-weight: var(--w-meta); }
.more-go { width: 16px; height: 16px; flex: none; color: var(--text-3); }

/* The sidebar stands in front of the page, in both themes (the owner, 27 Nov 2026, "S5": a darker tone and a
   soft shadow). By day a parchment tone; at night a green a little lighter than the page. On a phone the
   top bar and the bar of sections at the foot get the same, with the shadow towards the page. */
:root[data-theme="light"] .side { background: #e9e2d1; border-right: 0; box-shadow: 1px 0 0 rgba(60, 50, 30, .06), 10px 0 26px -12px rgba(60, 50, 30, .30); }
:root[data-theme="light"] .nav-link:hover, :root[data-theme="light"] .nav-item:focus-within > .nav-link,
:root[data-theme="light"] .nav-link[aria-current="page"] { background: #ddd5c1; color: var(--text); }
:root[data-theme="light"] .side-foot { border-top-color: rgba(60, 50, 30, .14); }
:root:not([data-theme="light"]) .side { border-right: 0; box-shadow: 1px 0 0 rgba(0, 0, 0, .28), 10px 0 26px -12px rgba(0, 0, 0, .62); }
@media (max-width: 720px) {
  :root[data-theme="light"] .side { border-top: 0; box-shadow: 0 -1px 0 rgba(60, 50, 30, .06), 0 -10px 26px -12px rgba(60, 50, 30, .30); }
  :root[data-theme="light"] .topbar { background: #e9e2d1; border-bottom: 0; box-shadow: 0 1px 0 rgba(60, 50, 30, .06), 0 10px 26px -12px rgba(60, 50, 30, .30); }
  :root:not([data-theme="light"]) .side { border-top: 0; box-shadow: 0 -1px 0 rgba(0, 0, 0, .28), 0 -10px 26px -12px rgba(0, 0, 0, .62); }
  :root:not([data-theme="light"]) .topbar { background: var(--bg-side); border-bottom: 0; box-shadow: 0 1px 0 rgba(0, 0, 0, .28), 0 10px 26px -12px rgba(0, 0, 0, .62); }
}
/* A holder with nothing in it takes no room: the foot of a panel with no buttons, the row of a "Show more"
   button that is hidden because everything is shown (the walkthrough, 27 Nov 2026: empty pale boxes). */
.panel-foot:empty, .more-row:not(:has(> :not([hidden]))) { display: none; }
/* the hint inside an empty field reads in both themes (at night it was nearly the field's own colour) */
::placeholder { color: var(--text-3); opacity: 1; }
/* a tick box or a round choice in the site's colour, not the browser's blue */
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
/* Titles and the small capital lines above them break into even lines, and a paragraph does not leave one word
   alone on its last line (the walkthrough, 27 Nov 2026: "POSITION", "it is", "done" alone on a line). */
h1, h2, h3, .eyebrow, .h-page, .h-display, .h-sec { text-wrap: balance; }
p, li, figcaption, small { text-wrap: pretty; }
/* the page that is not there: its title as dark as any other page's */
.empty.lost .h-page { color: var(--text); }
/* At night a black man drawn small on a dark ground (a move in the strip or the list, an engine tip, a tile of
   Train) was only its thin white lines: its pale edge was too faint to see. It is firmer now, and it is on every
   small black man, wherever he is drawn; not on a light ground (a board, a portrait tile, the current move's
   cream chip, the garden's own sheet), where he needs none. */
:root:not([data-theme="light"]) svg.man.black { filter: drop-shadow(0 0 .8px #fff) drop-shadow(0 0 1.2px rgba(255, 255, 255, .75)); }
:root:not([data-theme="light"]) :is(.tile-av, .sp-chip.cur, .gd-map, .gh-map, .hm-thumb, .face-av, .cb, svg.mini, .wm-board, .rec-board) svg.man.black { filter: none; }
/* a chip that is a link looks as a chip that is a button does: no underline */
a.chip { text-decoration: none; }
/* The keyboard's way in (the keyboard pass, 27 Nov 2026). The first Tab of a page is "Skip to the page": it is off
   the screen until the keyboard is on it. After going to another page the keyboard is put at that page's start
   (js/app.js), which shows no ring of its own: the page is the whole window. */
.skip { position: fixed; left: 10px; top: 10px; z-index: 200; transform: translateY(-200%); padding: 10px 16px; border: 0; border-radius: var(--btn-r); background: var(--accent); color: var(--accent-ink); font: var(--w-action) 15px/1 var(--font-ui, var(--font)); cursor: pointer; box-shadow: var(--shadow-lg); }
.skip:focus-visible { transform: none; outline: 2px solid var(--accent-hi); outline-offset: 2px; }
#main:focus { outline: none; }
/* A button never runs past the box it is in (the owner, 27 Nov 2026, of Home at about 1100 px wide: "a thing that I
   dont want to see even if it is not full screen"). It is never wider than its box, and a name too long for one
   line (Play Muhammad b. 'Aqil al-Khaimi) breaks onto a second line inside the button. */
.btn { max-width: 100%; white-space: normal; text-align: center; text-wrap: balance; }
/* a hyphenated name kept whole (js/data.js escName): a line breaks at a space, never at the hyphen of al-Khaimi */
.nw { white-space: nowrap; }
/* " · bot" kept on the line of the name's last word (white-space: pre: with nowrap the line could still break at the
   space before the dot, leaving "· bot" alone on a line) */
.glue, .ms-bot { white-space: pre; }

/* ---------- the account's place, top right of every page (js/account-spot.js; the owner, 28 Nov 2026) ----------
   A guest: "Sign in" as a quiet link and "Sign up" as a crimson outline (each page's own crimson button stays its
   main action). Signed in: the player's picture, which opens a small menu. On a desktop it stands in a slim strip
   above the page: the page starts --acct-h lower, so the spot never lies over a board, a title or a button, and the
   boards measured on the window's height give that room back (the side panels keep their height: their content
   needs it, tests/overflow.mjs). On a phone it sits in the top bar. */
:root { --acct-h: 34px; }
:root[data-acct="off"] { --acct-h: 0px; }   /* no accounts yet: the spot is empty and hidden (F10), so its strip gives the room back */
.acct { position: absolute; z-index: 25; top: 12px; right: 28px; display: flex; align-items: center; gap: 16px; height: 36px; }
.acct-in { color: var(--text-2); font-size: 14px; font-weight: var(--w-label); text-decoration: none; }
.acct-in:hover { color: var(--text); text-decoration: underline; }
.btn.acct-up { min-height: 34px; padding: 0 14px; border-radius: 999px; color: var(--accent-hi); box-shadow: inset 0 0 0 1.5px var(--accent-hi); font-weight: var(--w-label); text-decoration: none; }
.btn.acct-up:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
/* signed in: the picture and the username as one chip (the owner, 30 Nov 2026); on a phone the picture alone */
.acct-me { display: inline-flex; align-items: center; gap: 8px; height: 36px; max-width: 240px; padding: 0 10px 0 2px; border: 0; border-radius: 999px; cursor: pointer; background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--line); font: var(--w-label) 14px/1 var(--font); }
.acct-me:hover, .acct-me[aria-expanded="true"] { box-shadow: 0 0 0 1.5px var(--accent-hi); }
.acct-me > .tile-av { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; }
.acct-me .tile-av svg, .acct-me .tile-av img { width: 88%; height: 88%; }
.acct-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-caret { flex: none; width: 14px; height: 14px; color: var(--text-3); transition: transform .15s; }
.acct-me[aria-expanded="true"] .acct-caret { transform: rotate(180deg); }
/* "Sign out?" in the side panel (js/account-spot.js): what would be lost, and the two ways out */
.so-ask { display: grid; gap: 12px; }
.so-ask > p, .so-ask .h-sec { margin: 0; }
.so-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--text-2); }
.so-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.so-acts .btn { min-height: 46px; flex: 1 1 190px; box-shadow: inset 0 0 0 1.5px var(--line); }
.acct-menu { position: absolute; top: calc(100% + 8px); right: 0; width: 260px; padding: 6px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: grid; gap: 2px; z-index: 45; }
.acct-menu [role="menuitem"] { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font-size: 14px; font-weight: var(--w-meta); text-align: left; text-decoration: none; cursor: pointer; }
.acct-menu [role="menuitem"]:hover, .acct-menu [role="menuitem"]:focus-visible { background: var(--panel-2); outline: none; }
.acct-menu [role="menuitem"] .ico { width: 18px; height: 18px; color: var(--text-2); flex: none; }
.acct-menu [role="menuitem"] > span:not(.acct-pic):not(.acct-head-t):not(.acct-count) { flex: 1; min-width: 0; }
/* the head: the profile, with the name and the class reached */
.acct-menu .acct-head { gap: 12px; padding: 10px; margin-bottom: 2px; }
.acct-pic .tile-av { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.acct-pic .tile-av svg, .acct-pic .tile-av img { width: 88%; height: 88%; }
.acct-head-t { display: grid; flex: 1; gap: 2px; min-width: 0; }
.acct-menu .acct-head .acct-go { width: 16px; height: 16px; color: var(--text-3); }
.acct-head-t b { font: var(--w-title) 16px/1.2 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-head-t small { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-count { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: var(--w-title); line-height: 20px; text-align: center; }
.acct-val { flex: none; font-size: 12.5px; color: var(--text-3); }
.acct-sep { height: 1px; margin: 4px 6px; background: var(--line); }
@media (min-width: 721px) { .main { padding-top: calc(22px + var(--acct-h)); } }
@media (min-width: 981px) {
  :root .play-board { max-width: calc(100vh - 150px - var(--acct-h)); }
  :root .learn .play-board { max-width: calc(100vh - 215px - var(--acct-h)); }
}
@media (max-width: 980px) and (min-width: 721px) {
  :root .play-board { max-width: min(100%, calc(100vh - 220px - var(--acct-h))); }
  :root .learn .play-board { max-width: min(100%, calc(100vh - 300px - var(--acct-h))); }
}
@media (max-width: 720px) {
  .acct { position: fixed; z-index: 31; top: calc(8px + env(safe-area-inset-top)); right: 110px; height: 33px; gap: 0; }
  .acct-in { display: none; }
  .btn.acct-up { min-height: 33px; padding: 0 12px; font-size: 13.5px; }
  .acct-me { width: 33px; height: 33px; padding: 0; gap: 0; justify-content: center; }
  .acct-me > .tile-av { width: 33px; height: 33px; }
  .acct-who, .acct-caret { display: none; }
  .acct-menu { position: fixed; top: calc(50px + env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); width: min(280px, calc(100vw - 24px)); }   /* (the spot sits left of the pill: the menu keeps to the screen) */
  /* a guest's phone: the bell has nothing in it, and Sign up takes its place */
  :root[data-acct="out"] .top-bell, :root[data-acct="off"] .top-bell { display: none; }
  .topbar.tb-tight span { visibility: hidden; }        /* (js/account-spot.js: the name steps aside for it) */
}

/* A page that did not load (js/fail.js): one calm card, Try again and Home; a line of the same inside a page */
.fail-card { max-width: 460px; margin: 48px auto; padding: 28px 28px 24px; text-align: center; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.fail-card .h-page { margin: 0 0 8px; font-size: clamp(24px, 4vw, 30px); }
.fail-card p { margin: 0 0 18px; color: var(--text-2); }
.fail-card .btn-row { justify-content: center; margin: 0; }
.fail-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel-2); color: var(--text-2); }

/* ---------- learn first (js/learn-first.js; the owner, 30 Nov 2026) ----------
   The small tag on the first lesson until it is finished (Home's lesson card, the welcome page): calm, in Learn's
   gold, never crimson. The one-time note when Play is pressed on a master before any lesson: a small card in the
   middle of the screen, two buttons (Start the lesson, the crimson one; Play anyway, quiet). */
.lf-tag { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--sec, var(--sec-learn)) 16%, var(--panel)); box-shadow: inset 0 0 0 1px var(--sec-edge, var(--line));
  font: var(--w-label) 12.5px/1.25 var(--font-ui); color: var(--text); }
.ho-acts .lf-tag { margin-bottom: -4px; font-size: 13.5px; }
/* a phone held upright: the tag takes a line over the button, so the board gives up that line on a short screen (430 x 700),
   and the button and the quiet links stay above the bottom bar (css/home.css .ho, the review of F1) */
@media (max-width: 720px) and (max-aspect-ratio: 3/2) { .ho:has(.ho-acts > .lf-tag) { --bd: min(100%, max(240px, calc(100dvh - 352px))); } }
.btn.lf-second { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); font-weight: var(--w-label); }
.btn.lf-second:hover { background: color-mix(in srgb, var(--text) 10%, var(--panel-2)); }
.lf-note { width: min(380px, calc(100vw - 32px)); margin: auto; padding: 20px 20px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--text); box-shadow: var(--shadow-lg); animation: pop-in .14s var(--ease); }
.lf-note::backdrop { background: rgba(10, 12, 10, .38); }
.lf-note-t { margin: 0 0 4px; font: var(--w-title) 18px/1.25 var(--font-display); }
.lf-note-s { margin: 0 0 16px; font-size: 15px; line-height: 1.4; color: var(--text-2); }
.lf-note-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.lf-note-acts .btn { flex: 1 1 auto; min-height: 44px; white-space: nowrap; }   /* (side by side when both fit, else one under the other) */
@media (prefers-reduced-motion: reduce) { .lf-note { animation: none; } }

/* ---------- from css/pages-garden.css (the owner's checklist T3, docs/T3-SPEED.md): what every page needs of it, here so ----------
   that the garden's own stylesheet comes only with the pages that show a garden. The same rules, in the same order after the
   ones above that they override (no stylesheet between the two set them). */
/* the garden's own colours: water, leaf and rose (after the colours in docs/ART-KIT.md) */
:root {
  --water: #46b6a9;
  --water-hi: #9be5db;
  --water-lo: #237f75;
  --leaf: #7db36d;
  --leaf-lo: #4d8853;
  --rose: #e58f9d;
  --garden-sand: #efe3c6;      /* the ground of the garden plan, the same in both themes */
}
:root[data-theme="light"] {
  --water: #2a9d8f;
  --water-hi: #74cfc3;
  --water-lo: #1c7268;
  --leaf: #5f8f5a;
  --leaf-lo: #3f6b3c;
  --rose: #c8697a;
}

/* the site's one divider (the arcade, css/app.css) above the footer: at the foot of a page all eight arches are lit */
.site-foot { position: relative; border-top: 0; padding-top: 22px; }
.site-foot::before { position: absolute; left: 0; top: -4px; width: 144px; --arc: 8; }
.site-foot::after { top: -4px; bottom: auto; width: 143px; }
/* the arches are drawing only: a tap on them goes to the link under them (with the motto gone, the first link stands right below) */
.site-foot::before, .site-foot::after { pointer-events: none; }

/* the line of a doubtful story (js/doubtful.js; from css/pages-archive.css, T3): the Archive, the story, a mansuba and the master's panel */
.warn-line { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warn) 16%, var(--panel)); font-size: 14px; }
.warn-line .ico { width: 20px; height: 20px; flex: none; color: var(--warn); }
/* a doubtful story in a list row or a tale (js/doubtful.js): the same line, smaller */
.warn-line.mini { margin: 6px 0 8px; padding: 6px 10px; gap: 8px; font-size: 13px; line-height: 1.4; }
.warn-line.mini .ico { width: 16px; height: 16px; margin-top: 1px; }
