/* laterro design system (RFC 0002 §5; the look: D1 "Morning road", owner's choice 2026-10-27): tokens and components
   shared by every surface. Ivory RO-style windows with a glossy blue title bar, an inner frame line and brass corner
   brackets; bevelled buttons; parchment pages. The painted art lives in site.css and play.css, never here.

   This file is THE source. Consumers:
     - laterro.com pages (Pages): <link rel="stylesheet" href="/assets/ui.css">, then site.css for page layouts
     - account.laterro.com (ro-gate): an embedded copy, server/ro-gate/assets/ui.css, served at /assets/ui.css?v=HASH.
       After editing this file run laterro/site/sync-ui.sh; server/ro-gate/ui_css_test.go fails while they differ.
     - /play/: same origin as the pages, with play.css on top.
   Files this stylesheet loads, by URLs relative to it, so both hosts serve them next to it (sync-ui.sh copies them,
   ro-gate embeds them; check-shared.mjs fails on a url() outside assets/ui/):
     ui/almendra-bold.woff2   the display face (Almendra Bold, SIL OFL 1.1, ui/OFL-almendra.txt; unmodified, as woff2)
     ui/corners.svg           the windows' brass corner brackets (border-image)
   Nothing page-specific goes here. The class names are a contract between the three consumers (RFC 0002 §5.2):
   rename one only together with every template that uses it. */

@font-face {
  font-family: "LaterRO Display"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(ui/almendra-bold.woff2) format("woff2");
}

:root {
  --l-bg: #e9e2cf;          /* the page: parchment */
  --l-bg-deep: #ddd3ba;     /* hover, insets */
  --l-paper: #f6f1e4;       /* window body */
  --l-row: #ede6d4;         /* shaded rows */
  --l-ink: #24303f;
  --l-muted: #535c69;
  --l-line: #d8cfba;        /* dividers inside a window */
  --l-frame: #7f8796;       /* a window's outer edge */
  --l-inner: #cdbf9c;       /* a window's inner frame line */
  --l-metal: #b98a3c;       /* brass: ornaments only, never text */
  --l-title-hi: #7fa2d4;    /* title bar: the gloss at the top edge */
  --l-title-a: #4a72ae;     /* title bar: upper half (text sits on a, mid and b) */
  --l-title-mid: #3b6093;
  --l-title-b: #284367;     /* title bar: lower half */
  --l-title-edge: #1e3352;
  --l-title-ink: #ffffff;
  --l-accent-hi: #6e95cf;   /* primary button (Register, Play, the one main action of a page): gloss */
  --l-accent: #3f67a3;
  --l-accent-mid: #30568f;
  --l-accent-deep: #22406f;
  --l-accent-edge: #162c4e;
  --l-accent-ink: #ffffff;
  --l-btn-hi: #ffffff;      /* secondary button */
  --l-btn-lo: #e2e7ef;
  --l-btn-edge: #8792a4;
  --l-btn-ink: #22303f;
  --l-sel: #dce6f3;         /* selected row, current nav item */
  --l-gold: #7e5a14;        /* brass as text: the current step */
  --l-link: #244a84;
  --l-focus: #1f5fbf;
  --l-ok: #2c7a33;
  --l-warn: #9a5b00;
  --l-down: #a3322a;
  --l-idle: #6f6a60;
  --l-input: #ffffff;
  --l-field: #7f8796;       /* form field borders (>= 3:1 on paper and input: WCAG 1.4.11) */
  --l-foot: #ede6d4;
  --l-bar-a: #33496b;       /* the dark band of the game's loading screen (/play/'s bar) */
  --l-bar-b: #1f2f4a;
  --l-bar-ink: #ffffff;
  --l-bar-muted: #c4d2e8;
  --l-sky-a: #b8dbf5;       /* the morning sky behind the account pages' windows (and under the hero art) */
  --l-sky-b: #d8ebf6;
  --l-art-dim: rgba(6,12,26,0);         /* over the painted art: nothing by day, a dusk veil in the dark theme */
  --l-art-wash: rgba(233,226,207,.84);  /* over the map under the landing's lower windows */
  --l-wordmark: #1e3352;
  --l-sunk: #fffdf6;        /* a sunken list panel inside a window (.sunken) and the current RO tab */
  --l-sunk-line: #a99c7c;   /* its edge (>= 3:1 on the paper: WCAG 1.4.11) */
  --l-tab-a: #d9dee8;       /* an RO tab button that is not current (.ro-tab): top, bottom, its text */
  --l-tab-b: #c3cad8;
  --l-tab-ink: #2c3a4e;
  --l-hilite: #f8e6b0;      /* a highlighted row (the top three of a ranking) */
  --l-gauge-ink: #1d2733;   /* a gauge bar (.gauge): its text, the empty track, the fills (HP, SP, base and job EXP) */
  --l-gauge-track: #e6decb;
  --l-hp: #93d487;
  --l-sp: #9dbdf0;
  --l-bexp: #efcd6c;
  --l-jexp: #e6add9;
  --l-shadow: 0 2px 0 rgba(30,51,82,.10), 0 16px 34px -16px rgba(20,34,60,.50);
  --l-float: 0 2px 0 rgba(30,51,82,.12), 0 22px 44px -16px rgba(20,34,60,.60);   /* a window over art */
  --l-display: "LaterRO Display", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --l-serif: var(--l-display);
  --l-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --l-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --l-s1: 4px; --l-s2: 8px; --l-s3: 12px; --l-s4: 16px; --l-s5: 20px; --l-s6: 28px; --l-s7: 48px;
  --l-ctl-h: 28px;        /* every header control's height: Sign in / My account, Play, the theme switch */
  --l-ctl-px: 11px;       /* its side padding (less on a phone, so the logo and the controls share one row) */
  --l-ctl-fs: .82rem;     /* its type size */
  --l-ctl-r: 5px;         /* its corner radius */
  --l-field-h: 44px;      /* a single-line form field and the form's submit button */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --l-bg: #12161e; --l-bg-deep: #0c0f15; --l-paper: #1c2230; --l-row: #232a3a; --l-ink: #eae5d8; --l-muted: #b3b9c6;
    --l-line: #343d52; --l-frame: #3a4560; --l-inner: #5a4f38; --l-metal: #c9a15a;
    --l-title-hi: #5b7fb8; --l-title-a: #3d5f96; --l-title-mid: #304e80; --l-title-b: #213b63; --l-title-edge: #121f38; --l-title-ink: #ffffff;
    --l-accent-hi: #6e95cf; --l-accent: #3f67a3; --l-accent-mid: #30568f; --l-accent-deep: #22406f; --l-accent-edge: #0e1c33; --l-accent-ink: #ffffff;
    --l-btn-hi: #3a4560; --l-btn-lo: #2a3247; --l-btn-edge: #5d6b88; --l-btn-ink: #eef2f8; --l-sel: #2a3a5a;
    --l-gold: #d8aa52; --l-link: #9ec1ff; --l-focus: #8ab8ff; --l-ok: #6cc574; --l-warn: #e6a94a; --l-down: #ef8476; --l-idle: #a39c8e;
    --l-input: #121722; --l-field: #6c7891; --l-foot: #232a3a;
    --l-bar-a: #33496b; --l-bar-b: #1f2f4a; --l-bar-ink: #ffffff; --l-bar-muted: #c4d2e8;
    --l-sky-a: #1b2a44; --l-sky-b: #22314c; --l-wordmark: #f2e9d2; --l-art-dim: rgba(6,12,26,.46); --l-art-wash: rgba(18,22,30,.88);
    --l-sunk: #141a26; --l-sunk-line: #5b6884; --l-tab-a: #2d3549; --l-tab-b: #242b3c; --l-tab-ink: #d3dbea; --l-hilite: #3a3320;
    --l-gauge-ink: #f4efe2; --l-gauge-track: #0f131b; --l-hp: #2a6b33; --l-sp: #2d5291; --l-bexp: #77591a; --l-jexp: #7a3a6b;
    --l-shadow: 0 2px 0 rgba(0,0,0,.25), 0 16px 34px -16px rgba(0,0,0,.75);
    --l-float: 0 0 0 1px rgba(255,214,140,.06), 0 24px 50px -18px rgba(0,0,0,.85);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --l-bg: #12161e; --l-bg-deep: #0c0f15; --l-paper: #1c2230; --l-row: #232a3a; --l-ink: #eae5d8; --l-muted: #b3b9c6;
  --l-line: #343d52; --l-frame: #3a4560; --l-inner: #5a4f38; --l-metal: #c9a15a;
  --l-title-hi: #5b7fb8; --l-title-a: #3d5f96; --l-title-mid: #304e80; --l-title-b: #213b63; --l-title-edge: #121f38; --l-title-ink: #ffffff;
  --l-accent-hi: #6e95cf; --l-accent: #3f67a3; --l-accent-mid: #30568f; --l-accent-deep: #22406f; --l-accent-edge: #0e1c33; --l-accent-ink: #ffffff;
  --l-btn-hi: #3a4560; --l-btn-lo: #2a3247; --l-btn-edge: #5d6b88; --l-btn-ink: #eef2f8; --l-sel: #2a3a5a;
  --l-gold: #d8aa52; --l-link: #9ec1ff; --l-focus: #8ab8ff; --l-ok: #6cc574; --l-warn: #e6a94a; --l-down: #ef8476; --l-idle: #a39c8e;
  --l-input: #121722; --l-field: #6c7891; --l-foot: #232a3a;
  --l-bar-a: #33496b; --l-bar-b: #1f2f4a; --l-bar-ink: #ffffff; --l-bar-muted: #c4d2e8;
  --l-sky-a: #1b2a44; --l-sky-b: #22314c; --l-wordmark: #f2e9d2; --l-art-dim: rgba(6,12,26,.46); --l-art-wash: rgba(18,22,30,.88);
  --l-sunk: #141a26; --l-sunk-line: #5b6884; --l-tab-a: #2d3549; --l-tab-b: #242b3c; --l-tab-ink: #d3dbea; --l-hilite: #3a3320;
  --l-gauge-ink: #f4efe2; --l-gauge-track: #0f131b; --l-hp: #2a6b33; --l-sp: #2d5291; --l-bexp: #77591a; --l-jexp: #7a3a6b;
  --l-shadow: 0 2px 0 rgba(0,0,0,.25), 0 16px 34px -16px rgba(0,0,0,.75);
  --l-float: 0 0 0 1px rgba(255,214,140,.06), 0 24px 50px -18px rgba(0,0,0,.85);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* the scrollbar's room is kept on every page, long or short: the centred header (and the page) then sits at the same x
   on laterro.com, account.laterro.com and the panel, instead of moving by half a scrollbar between a page that
   scrolls and one that does not. No effect with overlay scrollbars (phones, macOS). Not on /play/ (html[data-ro-phase]):
   its full-window game has no page scrollbar and must not lose a strip on the right. */
html:not([data-ro-phase]) { scrollbar-gutter: stable; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--l-ink);
  background: var(--l-bg);
  font: 16px/1.6 var(--l-sans);
}
main { flex: 1; }
.wrap {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1, h2 { font-family: var(--l-display); font-weight: 700; line-height: 1.15; text-wrap: balance; color: var(--l-wordmark); }
h3 { font-family: var(--l-sans); font-weight: 700; line-height: 1.3; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5vw, 2.8rem); margin: 0 0 .3em; }
h2 { font-size: 1.55rem; margin: 1.5em 0 .5em; }
h3 { font-size: 1.08rem; margin: 1.4em 0 .4em; }
p { margin: 0 0 1em; }
a { color: var(--l-link); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--l-focus); outline-offset: 2px; border-radius: 3px; }
code { font-family: var(--l-mono); font-size: .9em; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 40;
  background: var(--l-paper); color: var(--l-ink); padding: 8px 12px; border: 2px solid var(--l-focus); border-radius: 6px;
}
.skip:focus { top: 12px; }
/* the test server's line at the top of every page (RFC 0004 §6.6): only the staging build and staging's account
   pages have the element (laterro/pages.sh --env staging, ro-gate/ro-panel "banner"). White on a strong magenta that
   no other part of the look uses, the same in both themes. */
.test-banner {
  position: sticky; top: 0; z-index: 60;
  margin: 0; padding: 5px 12px; background: #a1005f; color: #fff;
  font-weight: 700; font-size: .9rem; line-height: 1.3; letter-spacing: .02em; text-align: center;
}
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.muted { color: var(--l-muted); }

/* ---------- header (RFC 0002 §4.2: the same markup on every page of both hosts) ---------- */
.site-header {
  position: relative; z-index: 10;
  background: color-mix(in srgb, var(--l-paper) 95%, transparent);
  border-bottom: 1px solid var(--l-inner);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--l-metal) 35%, transparent);
}
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  padding-top: 8px; padding-bottom: 8px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font: 700 1.45rem/1 var(--l-display); color: var(--l-wordmark); text-decoration: none;
}
.brand svg, .brand img { width: 26px; height: 26px; flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; margin-right: auto; }
.nav a {
  color: var(--l-ink); text-decoration: none; padding: 4px 10px; border-radius: 4px; font-size: .95rem;
}
.nav a:hover { background: var(--l-bg-deep); }
.nav a[aria-current="page"] { background: var(--l-sel); box-shadow: inset 0 -2px 0 var(--l-metal); }
.header-tools { display: flex; align-items: center; gap: 8px; }
/* ONE header control: the account link (Sign in / My account), Play and the theme switch share one box: the same
   height, side padding, type size, corner and centred baseline, so the row reads as one line. Play keeps the page's
   primary tier (.btn.play, the blue); the account link and the theme switch are the secondary tier. The server status
   is not in the header (owner, 2026-11-17): it is a row of the home page's Server window. */
.site-header .header-tools > :is(.who, .btn, .theme-btn), .site-header .you > summary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--l-ctl-h); padding: 0 var(--l-ctl-px); border-radius: var(--l-ctl-r);
  font-size: var(--l-ctl-fs); line-height: 1; white-space: nowrap;
}
/* the secondary tier: .who and the theme switch, one hover and one press */
.who, .theme-btn {
  font-weight: 700; color: var(--l-btn-ink); border: 1px solid var(--l-btn-edge);
  cursor: pointer; text-decoration: none;
  background: linear-gradient(180deg, var(--l-btn-hi), var(--l-btn-lo));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 2px 0 rgba(0,0,0,.14);
}
.who:hover, .theme-btn:hover { background: var(--l-btn-hi); }
.who:active, .theme-btn:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 1px 0 rgba(0,0,0,.14); }
.who[aria-current] { box-shadow: inset 0 -2px 0 var(--l-metal), 0 2px 0 rgba(0,0,0,.14); }
/* the theme switch is a square icon button: the label stays for screen readers (site.js keeps its aria-label current) */
.site-header .header-tools > .theme-btn { width: var(--l-ctl-h); padding: 0; }
.theme-btn .theme-label { display: none; }

/* ---------- the My account menu (RFC 0035): a details element, so it opens without script (the account host runs
   none); its summary is the header's account control (.who), the menu a small window of .side-list entries ---------- */
.you { position: relative; }
.you > summary { list-style: none; }
.you > summary::-webkit-details-marker { display: none; }
.site-header .you-menu { position: absolute; right: 0; top: calc(100% + var(--l-s2)); z-index: 30; width: 220px; }
.you-menu.win { box-shadow: var(--l-float); }
.you-menu .win-body { padding: var(--l-s1); }
/* the caret of a menu or a folded side window: drawn, not a glyph (player-visible text stays ASCII); it turns when open */
.caret {
  display: inline-block; flex: none; width: 0; height: 0; margin-left: 2px;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor;
}
[open] > summary .caret { transform: rotate(180deg); }

/* ---------- a list of section links (the My account menu, the side windows): the Rankings class list's look ---------- */
.side-list { list-style: none; margin: 0; padding: var(--l-s1); }
.side-list a {
  display: flex; align-items: center; gap: 9px; min-height: 34px; padding: var(--l-s1) 10px; border-radius: 3px;
  text-decoration: none; color: var(--l-ink); font-size: .93rem;
}
.side-list a:hover { background: var(--l-bg-deep); }
.side-list a[aria-current] { background: var(--l-sel); box-shadow: inset 3px 0 0 var(--l-link); }
.side-list a[aria-current="page"] { font-weight: 700; }
.side-list a:focus-visible { outline-offset: -3px; }
/* a second group under a rule (Sign out) */
.side-list.side-sep { margin-top: var(--l-s1); border-top: 1px solid var(--l-line); }

/* ---------- a section with a side window (RFC 0035: the Database, My account): the window beside the page in the
   header's column, so the logo, the window and the page share one left edge; on a phone it folds into one bar above
   the page (.sect-pick, a details element), and a search in the window (.with-search) stays open above it ---------- */
.sect { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--l-s6); align-items: start; }
.sect-nav { position: sticky; top: var(--l-s4); }
.sect-nav .win-body { margin: 5px; padding: var(--l-s1); }
.sect-pick { display: none; }
.sect-pick > summary { list-style: none; cursor: pointer; }
.sect-pick > summary::-webkit-details-marker { display: none; }
.sect-pick > summary .caret { margin-left: auto; }
.sect-pick .win-body { padding: var(--l-s1); }
/* the page beside the window sizes its own grids from its width (container queries in the page stylesheets) */
.sect-content { min-width: 0; container-type: inline-size; }
.sect-content > :is(.win, .split, .actions) + :is(.win, .split) { margin-top: 20px; }

/* ---------- status pill (the home page's Server window): driven by html[data-server] (status.js) or .status[data-state] ---------- */
.status {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .88rem; color: var(--l-ink); white-space: nowrap;
}
.dot {
  position: relative; width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--l-idle); box-shadow: 0 0 0 2px color-mix(in srgb, var(--l-idle) 25%, transparent);
}
[data-server="online"] .dot, .status[data-state="online"] .dot { background: var(--l-ok); box-shadow: 0 0 0 2px color-mix(in srgb, var(--l-ok) 25%, transparent); }
/* online: a ring that grows and fades (transform and opacity only) */
[data-server="online"] .dot::after, .status[data-state="online"] .dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--l-ok); opacity: 0;
  animation: ping 2.6s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.5); opacity: .7; } 80%, 100% { transform: scale(1.4); opacity: 0; } }
[data-server="maintenance"] .dot, .status[data-state="maintenance"] .dot {
  background: var(--l-warn); box-shadow: 0 0 0 2px color-mix(in srgb, var(--l-warn) 25%, transparent);
}
[data-server="offline"] .dot, .status[data-state="offline"] .dot {
  background: var(--l-down); box-shadow: 0 0 0 2px color-mix(in srgb, var(--l-down) 25%, transparent);
}

/* ---------- buttons: bevelled, a glossy top, a pressed edge ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 .95rem/1.2 var(--l-sans); text-decoration: none; cursor: pointer;
  border-radius: 5px; padding: 8px 16px; border: 1px solid var(--l-btn-edge);
  color: var(--l-btn-ink); background: linear-gradient(180deg, var(--l-btn-hi), var(--l-btn-lo));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 2px 0 rgba(0,0,0,.16);
}
.btn:hover { background: linear-gradient(180deg, var(--l-btn-hi), color-mix(in srgb, var(--l-btn-lo) 55%, var(--l-btn-hi))); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 1px 0 rgba(0,0,0,.16); }
.btn .ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* the one primary action of a page, and Play */
.btn.play {
  color: var(--l-accent-ink); border-color: var(--l-accent-edge);
  background: linear-gradient(180deg, var(--l-accent-hi) 0, var(--l-accent) 30%, var(--l-accent) 49%, var(--l-accent-mid) 51%, var(--l-accent-deep) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 0 0 1px rgba(255,255,255,.1), 0 2px 0 var(--l-accent-edge), 0 10px 22px -10px var(--l-accent-deep);
  text-shadow: 0 1px 0 rgba(0,0,0,.3);
}
.btn.play:hover { background: linear-gradient(180deg, var(--l-accent-hi) 0, color-mix(in srgb, var(--l-accent) 88%, white) 30%, var(--l-accent) 49%, var(--l-accent-mid) 51%, var(--l-accent-deep) 100%); }
.btn.play:active { box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 1px 0 var(--l-accent-edge); }
.btn.big { font-size: 1.12rem; padding: 12px 24px; border-radius: 6px; }
.btn.big .ic { width: 22px; height: 22px; }
.btn[aria-disabled="true"], .btn.play[aria-disabled="true"] {
  cursor: not-allowed; color: var(--l-muted); text-shadow: none; transform: none;
  background: var(--l-bg-deep); border-color: var(--l-line); box-shadow: none;
}
.btn.sm { font-size: .82rem; padding: 4px 11px; }
.btn.full { width: 100%; }
button.btn { margin: 0; }
.btn.danger { color: var(--l-down); }
/* RO's small in-window buttons (window footers, /play/) */
.ro-btn {
  font: 700 .85rem/1.4 var(--l-sans); padding: 4px 16px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--l-btn-edge); border-radius: 4px; color: var(--l-btn-ink);
  background: linear-gradient(180deg, var(--l-btn-hi), var(--l-btn-lo));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 2px 0 rgba(0,0,0,.14);
}
.ro-btn:hover { background: var(--l-btn-hi); }
.ro-btn.primary {
  color: var(--l-accent-ink); border-color: var(--l-accent-edge); text-shadow: 0 1px 0 rgba(0,0,0,.3);
  background: linear-gradient(180deg, var(--l-accent-hi) 0, var(--l-accent) 30%, var(--l-accent) 49%, var(--l-accent-mid) 51%, var(--l-accent-deep) 100%);
}
.ro-btn.primary:hover { background: linear-gradient(180deg, var(--l-accent-hi) 0, var(--l-accent) 49%, var(--l-accent-mid) 51%, var(--l-accent-mid) 100%); }
.ro-btn:disabled { cursor: not-allowed; opacity: .55; }

/* ---------- RO-style window ----------
   Outer edge, glossy title bar (no dead buttons in it), an inner frame line around the body and the foot, brass
   corner brackets (::after, border-image over ui/corners.svg), a shadow. */
.win {
  position: relative;
  background: var(--l-paper);
  border: 1px solid var(--l-frame);
  border-radius: 7px;
  box-shadow: var(--l-shadow);
}
.win::after {
  content: ""; position: absolute; inset: 1px; z-index: 1; pointer-events: none;
  border: 18px solid transparent; border-image: url(ui/corners.svg) 18 / 18px stretch;
}
.win-title {
  display: flex; align-items: center; gap: 9px;
  margin: 0; padding: 6px 28px 6px 22px; border-radius: 6px 6px 0 0;
  font: 700 .86rem/1.35 var(--l-sans); letter-spacing: .02em; text-transform: none;
  color: var(--l-title-ink);
  background: linear-gradient(180deg, var(--l-title-hi) 0, var(--l-title-a) 30%, var(--l-title-a) 48%, var(--l-title-mid) 52%, var(--l-title-b) 100%);
  border-bottom: 1px solid var(--l-title-edge);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 -1px 0 rgba(0,0,0,.18);
  text-shadow: 0 1px 1px rgba(0,0,0,.45);
}
.win-title::before {   /* a small brass diamond, the brand mark's shape */
  content: ""; flex: none; width: 7px; height: 7px; margin: 0 2px 0 4px; transform: rotate(45deg);
  background: var(--l-metal); box-shadow: 0 0 0 1px rgba(0,0,0,.35);
}
.win-body {
  position: relative; margin: 5px; padding: 14px 16px 16px;
  border: 1px solid var(--l-inner); border-radius: 3px;
}
.win-body > :last-child { margin-bottom: 0; }
.win-body > :first-child { margin-top: 0; }
.win-foot {
  display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px;
  margin: -6px 5px 5px; padding: 8px 10px; background: var(--l-foot);
  border: 1px solid var(--l-inner); border-top-color: var(--l-line); border-radius: 0 0 3px 3px;
}
.win-foot > .foot-note { margin: 0 auto 0 0; font-size: .86rem; color: var(--l-muted); }
.win.narrow { max-width: 470px; margin-left: auto; margin-right: auto; }
.win.wide { max-width: 760px; margin-left: auto; margin-right: auto; }

/* ---------- forms ---------- */
.win label, .form label { display: block; font-size: .88rem; font-weight: 700; margin: 14px 0 4px; }
.win label.inline, .form label.inline { display: inline; font-weight: 400; margin: 0 0 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  font: inherit; width: 100%; padding: 8px 10px; color: var(--l-ink);
  background: var(--l-input); border: 1px solid var(--l-field); border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.12);
  /* a single-line field and the form's submit button are one height: the row reads level, and the date control's
     native box no longer comes out taller than the rest (textarea overrides this below) */
  height: var(--l-field-h);
}
input[readonly] { color: var(--l-muted); background: transparent; box-shadow: none; }
textarea { height: auto; min-height: 84px; resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--l-accent); width: 1.05em; height: 1.05em; vertical-align: -2px; }
fieldset { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
legend { padding: 0; margin: 0 0 4px; font-size: .88rem; font-weight: 700; }
.choices { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.check { margin: 14px 0 0; }
.field-note { margin: 8px 0 0; font-size: .86rem; color: var(--l-muted); }
/* a field's focus ring stays inside the gap above its note (3px ring, 1px offset < the note's 8px) */
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; }
/* "LaterRO is played on a computer": shown only on touch-only devices (a coarse pointer and no fine one: phones,
   tablets); a laptop with a touch screen has a fine pointer too and does not see it. No script: media queries. */
.touch-note { display: none; }
@media (any-pointer: coarse) {
  .touch-note {
    display: block; margin: 14px 0 0; max-width: 46ch; padding: 8px 12px; font-size: .95rem; color: var(--l-ink);
    border-left: 3px solid var(--l-warn); border-radius: 0 4px 4px 0; background: color-mix(in srgb, var(--l-warn) 10%, var(--l-paper));
  }
}
@media (any-pointer: fine) { .touch-note { display: none; } }
/* optional fields folded away in a form ("More options") */
details.more { margin: 14px 0 0; }
details.more summary { cursor: pointer; color: var(--l-link); font-size: .95rem; }
.form-actions { margin: 20px 0 0; }
.form-actions .btn { margin: 0; min-height: var(--l-field-h); }
/* the Turnstile widget's reserved slot (65 px), so the button below does not jump when it loads */
.ts-slot { min-height: 65px; margin: 16px 0 0; }
.error, .notice {
  margin: 0 0 16px; padding: 8px 12px; border-left: 3px solid var(--l-down); border-radius: 0 4px 4px 0;
  background: color-mix(in srgb, var(--l-down) 8%, var(--l-paper)); color: var(--l-ink);
}
.notice { border-left-color: var(--l-ok); background: color-mix(in srgb, var(--l-ok) 8%, var(--l-paper)); }
/* the admin's maintenance note (/status "note"; RFC 0002 §7.5): My account, the home page */
.server-note {
  margin: 0 0 16px; padding: 8px 12px; border-left: 3px solid var(--l-warn); border-radius: 0 4px 4px 0;
  background: color-mix(in srgb, var(--l-warn) 9%, var(--l-paper)); color: var(--l-ink); overflow-wrap: anywhere;
}
.win-body > .error:last-child, .win-body > .notice:last-child { margin-bottom: 0; }
.aside { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--l-line); font-size: .92rem; color: var(--l-muted); }
.rules-list { margin: 6px 0 0; padding-left: 20px; }
.inline-form { display: inline; margin: 0 8px 0 0; }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- steps: the request flow (ol.quest): blue medallions with a brass ring ---------- */
.quest { list-style: none; counter-reset: q; margin: 0; padding: 0; display: grid; gap: 12px; }
.quest li { counter-increment: q; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.quest li::before {
  content: counter(q); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  font: 700 .9rem/1 var(--l-sans); color: var(--l-title-ink); text-shadow: 0 1px 0 rgba(0,0,0,.35);
  background: radial-gradient(circle at 35% 30%, var(--l-title-a), var(--l-title-mid) 60%, var(--l-title-b));
  border: 2px solid var(--l-metal); box-shadow: 0 2px 0 rgba(0,0,0,.18);
}
.quest strong { display: block; font-size: 1rem; }
.quest p { margin: 2px 0 0; color: var(--l-muted); font-size: .94rem; }
.quest li.done { position: relative; }
.quest li.done::before { content: ""; background: var(--l-ok); border-color: color-mix(in srgb, var(--l-ok) 60%, var(--l-metal)); }
/* the done mark: a check drawn with two borders (no glyph: player-visible text stays ASCII) */
.quest li.done::after {
  content: ""; position: absolute; left: 11px; top: 7px; width: 7px; height: 13px;
  border: solid #ffffff; border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.quest li.now::before { box-shadow: 0 0 0 3px color-mix(in srgb, var(--l-metal) 35%, transparent), 0 2px 0 rgba(0,0,0,.18); }
.quest li.now strong { color: var(--l-ink); }
.quest li.todo { color: var(--l-muted); }
.quest li.todo::before { background: var(--l-paper); color: var(--l-muted); text-shadow: none; border-color: var(--l-line); box-shadow: none; }
.quest li.todo strong { font-weight: 400; }

/* ---------- tables: game accounts (My account) ---------- */
.accts { width: 100%; border-collapse: collapse; font-size: .95rem; border: 1px solid var(--l-line); margin: 0 0 1em; }
.accts th { text-align: left; font-weight: 700; color: var(--l-muted); font-size: .84rem; padding: 5px 10px; background: var(--l-row); border-bottom: 1px solid var(--l-line); }
.accts td { padding: 8px 10px; border-bottom: 1px solid var(--l-line); vertical-align: baseline; }
.accts tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--l-row) 55%, transparent); }
.accts .acct-name { font-weight: 700; font-size: 1.04rem; overflow-wrap: break-word; }   /* not anywhere: it would let the table squeeze the name */
.accts .num { text-align: right; font-variant-numeric: tabular-nums; }
.accts .ingame { color: var(--l-warn); font-weight: 700; }
.accts tr.acct-more td { color: var(--l-muted); background: transparent; border-bottom: 0; }
.accts .ingame { white-space: nowrap; }
@media (max-width: 760px) { .accts th, .accts td { padding-left: 7px; padding-right: 7px; } }

/* ---------- the player panel (RFC 0003 §6.9): tabs, data tables (both additive: tokens only) ---------- */
/* .tabs: a row of links styled as window tabs; the current one has aria-current="page" */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.page-head .tabs { margin: 10px 0 0; }
/* the Server hub's tab row (RFC 0035: /server/, /rules/, /faq/, /news/), above each page's heading */
.tabs.hub-tabs { margin: 0 0 18px; }
.tabs a {
  padding: 3px 11px; border: 1px solid var(--l-line); border-radius: 5px; background: var(--l-paper);
  color: var(--l-ink); text-decoration: none; font-size: .92rem; white-space: nowrap;
}
.tabs a:hover { background: var(--l-bg-deep); }
.tabs a[aria-current="page"] { background: var(--l-sel); border-color: var(--l-metal); box-shadow: inset 0 -2px 0 var(--l-metal); font-weight: 700; }
/* .data-table (on an .accts table): on a narrow screen every row is a small card, each cell under its column's label
   (the cell's data-label); empty cells drop out */
@media (max-width: 560px) {
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; }
  .data-table tr { padding: 6px 0; border-bottom: 1px solid var(--l-line); }
  .data-table tr:last-child { border-bottom: 0; }
  .data-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--l-row) 55%, transparent); }
  .data-table td, .data-table tbody tr:nth-child(even) td { display: flex; gap: 10px; align-items: baseline; padding: 2px 10px; border: 0; background: transparent; }
  .data-table td[data-label]::before { content: attr(data-label); flex: 0 0 6.5em; color: var(--l-muted); font-size: .84rem; font-weight: 700; }
  .data-table .num { text-align: left; }
  .data-table tbody tr td:empty, .data-table tbody tr:nth-child(even) td:empty { display: none; }
}
/* ---------- RO window parts (the player panel's game windows; tokens only, so they follow the theme) ---------- */
/* .sunken: a sunken panel inside a window body (a list, a table, an equipment slot), as the game's own lists */
.sunken {
  background: var(--l-sunk); border: 1px solid var(--l-sunk-line); border-radius: 3px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.14);
}
/* .ro-tabs: RO's tab buttons, raised tabs standing on the .sunken panel right under them (links or buttons; the
   current one, aria-current="page" or aria-selected="true", joins the panel) */
.ro-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0 0 0 6px; position: relative; z-index: 1; }
.ro-tab {
  display: inline-flex; align-items: center; min-height: 32px; margin-top: 4px; padding: 3px 16px 2px;
  font: 700 .86rem/1.3 var(--l-sans); color: var(--l-tab-ink); text-decoration: none; cursor: pointer;
  border: 1px solid var(--l-sunk-line); border-bottom: 0; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--l-tab-a), var(--l-tab-b));
}
.ro-tab:hover { color: var(--l-ink); background: var(--l-tab-a); }
.ro-tab[aria-current="page"], .ro-tab[aria-selected="true"] {
  margin-top: 0; margin-bottom: -1px; padding-bottom: 7px; color: var(--l-ink); background: var(--l-sunk);
  box-shadow: inset 0 3px 0 var(--l-link);
}
.ro-tab:focus-visible { outline-offset: -3px; }
/* .gauge: a status bar with its value written on it (HP, SP, EXP), so the colour is never the only signal:
   <div class="gauge sp"><progress max="112" value="87" aria-hidden="true"></progress><span class="gauge-text">87 / 112</span></div> */
.gauge { position: relative; display: block; height: 18px; min-width: 0; }
.gauge progress {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 100%; margin: 0;
  border: 1px solid var(--l-sunk-line); border-radius: 3px; overflow: hidden;
  background: var(--l-gauge-track); color: var(--l-hp);
}
.gauge progress::-webkit-progress-bar { background: var(--l-gauge-track); }
.gauge progress::-webkit-progress-value { background: linear-gradient(180deg, color-mix(in srgb, currentColor 65%, #ffffff) 0 3px, currentColor 3px); }
.gauge progress::-moz-progress-bar { background: linear-gradient(180deg, color-mix(in srgb, currentColor 65%, #ffffff) 0 3px, currentColor 3px); }
.gauge.sp progress { color: var(--l-sp); }
.gauge.bexp progress { color: var(--l-bexp); }
.gauge.jexp progress { color: var(--l-jexp); }
.gauge-text {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 .76rem/1 var(--l-sans); color: var(--l-gauge-ink); font-variant-numeric: tabular-nums; white-space: nowrap;
  text-shadow: 0 0 2px var(--l-gauge-track), 0 0 3px var(--l-gauge-track);
}

/* a player's character name as a page heading: the plain face (the display face's digits read as letters) */
.page-head h1.char-name { font-family: var(--l-sans); font-size: 1.9rem; overflow-wrap: anywhere; }

/* ---------- the account pages' shell (account.laterro.com: one window or a pair per page, under a morning sky) ---------- */
.shell-main {
  padding: clamp(24px, 5vw, 48px) 0 32px;
  background: linear-gradient(180deg, var(--l-sky-a) 0, var(--l-sky-b) 240px, var(--l-bg) 520px);
}
.shell-main .win { box-shadow: var(--l-float); }
.page-head { margin: 0 0 18px; }
.page-head h1 { font-size: 2.1rem; margin: 0 0 2px; }
.page-head p { margin: 0; overflow-wrap: anywhere; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@container (max-width: 640px) { .split { grid-template-columns: 1fr; } }
.actions { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.actions .inline-form { margin: 0; }
/* the admin page's request rows */
.box {
  background: var(--l-paper); border: 1px solid var(--l-line); border-left: 3px solid var(--l-metal); border-radius: 5px;
  padding: 10px 14px; margin: 0 0 10px; overflow-wrap: anywhere; box-shadow: 0 1px 0 rgba(0,0,0,.06);
}
.box-actions { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.box-actions .inline-form { margin: 0; }
.admin h2 { font-size: 1.3rem; margin: 1.4em 0 .5em; }
.admin .row .inline-form { margin-right: 14px; }
.admin .note-form label { margin-top: 0; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 40px; border-top: 1px solid var(--l-inner); padding: 18px 0 26px; color: var(--l-muted); font-size: .86rem;
  background: var(--l-bg);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--l-muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* ---------- small screens: the header is two rows: the brand with the controls, then the nav ---------- */
@media (max-width: 760px) {
  /* the nav on its own row, one line: tighter links with 40 px tap targets; if a narrow phone still cannot fit them,
     the row scrolls sideways (no visible scrollbar; every link stays in the tab order and scrolls into view on focus) */
  .nav {
    order: 3; width: calc(100% + 12px); margin: 0 -6px; flex-wrap: nowrap; gap: 0;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { display: inline-flex; align-items: center; flex: none; min-height: 40px; padding: 0 6px; white-space: nowrap; }
  .nav a:focus-visible { outline-offset: -3px; }
  .header-tools { margin-left: auto; }
  .split { grid-template-columns: 1fr; }
  /* the menu: a sheet under the header, as wide as the page */
  .you { position: static; }
  .site-header .you-menu { left: var(--l-s2); right: var(--l-s2); width: auto; top: calc(100% - 2px); }
  .side-list a { min-height: 40px; }
  .tabs.hub-tabs a { display: inline-flex; align-items: center; min-height: 40px; }
  /* a side window: folded into one bar above the page; a search in it stays, open, above the bar */
  .sect { display: block; }
  .sect-nav { display: none; position: static; }
  .sect-nav.with-search { display: block; margin: 0 0 var(--l-s3); background: none; border: 0; box-shadow: none; }
  .sect-nav.with-search::after, .sect-nav.with-search .win-title, .sect-nav.with-search .side-list { display: none; }
  .sect-nav.with-search .win-body { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
  .sect-pick { display: block; margin: 0 0 14px; }
  .sect-pick > summary { min-height: 40px; }
  .sect-pick:not([open]) > summary { border-radius: 6px; border-bottom: 0; }
}
@media (max-width: 420px) {
  /* row 1 (brand, account, Play, theme) must fit a 390 px phone (375 px with classic scrollbars, 343 px of content):
     7 px side padding on the buttons and 6 px gaps keep it on one line. The nav is the second row. */
  .site-header .wrap { gap: 8px; }
  .site-header .header-tools { gap: 6px; }
  .site-header .header-tools > :is(.who, .btn, .theme-btn), .site-header .you > summary { padding: 0 7px; }
  .site-header .header-tools > .theme-btn { padding: 0; }
}
@media (max-width: 380px) {
  /* a 360 px phone: the My account menu's caret makes row 1 a few pixels wider than Sign in did */
  .site-header .header-tools { gap: 4px; }
  .site-header .you > summary { padding: 0 5px; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .btn:active { transform: none; }
}

/* ---------- print ---------- */
@media print {
  body { background: #fff; }
  .site-header .header-tools, .skip, .sect-nav, .sect-pick { display: none; }
  .sect { display: block; }
  .win { box-shadow: none; }
}
