/* Winthem base stylesheet.
   Tokens are the single source of truth; the brand is described in
   docs/brand/README.md.

   ── the brand: Owl ────────────────────────────────────────────────────────

   Winthem is a mechanical owl that keeps watch over your games at night while
   you sleep. The identity is night and the gold of the owl's eyes: a midnight
   ground, parchment ink, one gold accent; Rubik for display, Golos Text for
   text. The mark is the owl's face: the brows draw the W, the eyes are lit.
   Games are windows the owl looks into: each keeps its own art and colour.
   A game's own page keeps that game's look (asylum.css, whiteout.css), set on
   top of these tokens; so does Last Asylum's cabinet (cabinet-asylum.css).

   The accent tokens keep their old name, --ember*. They name the ROLE (the one
   accent), not the colour, and a rename would touch every sheet and both game
   looks for no change on screen.

   ── one ground ────────────────────────────────────────────────────────────

   The owl works at night and its art is drawn for a dark page, so the brand
   has ONE ground. Pages say so with <html data-ground="dark">: app.js and
   shell.js then stamp data-theme="dark" whatever the reader stored, and the
   theme switches hide. The Whiteout page alone keeps both grounds (it has no
   data-ground and whiteout.css sets its snow and night).

   The tokens are set once, for :root and for :root[data-theme="dark"] alike,
   so a rule written for the dark theme elsewhere still finds them.

   Radius system: buttons 14px, inputs 12px, panels 20px, game windows 30px+,
   pills round. */

@import url("/assets/fonts.css");

:root,:root[data-theme="dark"]{
  color-scheme:dark;

  /* ── night: the ground ── */
  --paper:#0E1322;      /* page: midnight */
  --surface:#151C2F;    /* panels: dusk */
  --raised:#1D2540;     /* inputs, the topmost layer */
  --sunk:#121829;       /* wells, tracks, inset areas */
  --line:#27304A;       /* structural 1px */
  --line-soft:#222A42;  /* hairlines inside panels; steps up from the surface */
  --paper-rgb:14,19,34; /* the page as parts, for scrims that dissolve into it */

  /* ── parchment: the ink ── */
  --ink:#F1ECE2;        /* primary text */
  --ink-2:#AEB5C7;      /* secondary text: mist */
  --ink-3:#8790A6;      /* metadata */
  --faint:#5D667D;      /* marks and rules only, never body text */

  /* ── gold: the owl's eyes, the only accent ── */
  --ember:#F0B54A;      /* fills, marks, active state */
  --ember-ink:#F4C46B;  /* the accent AS TEXT */
  --ember-wash:#221E17; /* the faintest lit surface */
  --ember-wash-2:#2C2618;
  --on-ember:#1A1206;   /* text on a gold fill */
  --ember-fill:#F0B54A;
  --ember-fill-hover:#F6C66A;
  --ember-shadow:rgba(240,181,74,.45);
  --ember-edge:rgba(240,181,74,.42);
  --ember-ring:rgba(240,181,74,.22);
  --ember-tint:rgba(240,181,74,.1);
  --ember-deep:#C98F2A;
  --ember-spark:#FFE6B0;
  /* The mark's eyes: the owl's gold on every page, a game's look included. */
  --brand-eye:#F0B54A;
  --brand-pupil:#0E1322;

  /* ── status ── */
  --ok:#58B08C;   --ok-wash:#0F2119;   --ok-edge:rgba(88,176,140,.34);
  --warn:#C9922F; --warn-wash:#221A0C; --warn-edge:rgba(201,146,47,.34);
  --bad:#D9584A;  --bad-wash:#25100E;  --bad-edge:rgba(217,88,74,.34);
  --bad-ring:rgba(217,88,74,.22);
  --warn-ink:#E0AE55;
  --bad-ink:#F08276;

  /* ── light and shadow ── */
  --glow-cold:rgba(80,100,170,.16);   /* moonlight in the page corner */
  --glow-warm:rgba(240,181,74,.06);   /* the desk lamp, far off */
  --sweep:rgba(241,236,226,.07);
  --knob:#F1ECE2;
  --knob-shade:0 1px 3px rgba(4,6,12,.5);
  --tick-ink:rgba(241,236,226,.2);
  --scrim:rgba(4,6,12,.62);
  --photo-bg:#151C2F;
  /* The brand art is drawn for night: nothing to dim. Game art keeps the
     filter its own look sets. */
  --art-dim:none;

  /* ── faces ──
     A game's look swaps the three faces; the stacks are built from them, so
     the CJK stacks further down keep working on every look. */
  --face-d:'Rubik';
  --face-t:'Golos Text';
  --face-m:'IBM Plex Mono';
  --f-display:var(--face-d),var(--face-t),'Segoe UI',system-ui,sans-serif;
  --f-text:var(--face-t),'Segoe UI',system-ui,sans-serif;
  --f-mono:var(--face-m),ui-monospace,Consolas,monospace;
  /* The wordmark is the brand's on every page, a game's look included. */
  --f-wordmark:'Rubik','Golos Text',system-ui,sans-serif;
  /* The display scale belongs to the face. */
  --t-d1:clamp(2.8rem,6.6vw,5.2rem); --t-d1-lh:.98; --t-d1-tr:-.03em;
  --t-d2:clamp(1.9rem,4vw,3rem);    --t-d2-tr:-.025em;
  --t-d3:clamp(1.25rem,2.2vw,1.6rem); --t-d3-tr:-.015em;
  /* Appended to the CJK stacks below. Empty for the scripts we ship fonts for. */
  --f-cjk:;

  /* soft corners: the owl's rounded windows */
  --r-btn:14px; --r-field:12px;

  --shell:1200px;
  --pad:clamp(20px,5vw,44px);
  --rhythm:clamp(4rem,10vw,8rem);
  --ease:cubic-bezier(.16,1,.3,1);

  --lift:0 1px 2px rgba(4,6,12,.5), 0 12px 28px -14px rgba(4,6,12,.72);
  --lift-2:0 2px 4px rgba(4,6,12,.55), 0 26px 50px -22px rgba(4,6,12,.8);
  --lift-toast:0 14px 40px rgba(4,6,12,.62);
  --lift-bar:0 -14px 34px -20px rgba(4,6,12,.85);
}

/* One ground: no switch to show. The Whiteout page keeps its own. */
:root[data-ground] .tsw,:root[data-ground] [data-theme-flip]{display:none !important}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

/* [hidden] must hide. The browser rule [hidden]{display:none} is an attribute
   selector, so any class of ours that sets display beats it: .field sets
   display:grid, which left hidden form blocks on screen. That is caught by eye
   only, so it is closed with a rule rather than with care. */
[hidden]{display:none !important}

body{
  background:var(--paper);
  color:var(--ink);
  font-family:var(--f-text);
  font-size:1rem;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
  position:relative;
}

/* Cold light on the page. Fixed and pointer-transparent so it never repaints
   on scroll, which is the usual reason such layers become a performance trap.
   It is also what keeps a light design from reading as flat CSS. */
body::before{
  content:"";position:fixed;inset:0;z-index:0;pointer-events:none;
  background-image:
    radial-gradient(80% 55% at 12% -5%, var(--glow-cold), transparent 60%),
    radial-gradient(60% 45% at 92% 0%, var(--glow-warm), transparent 60%);
}
body > *{position:relative;z-index:1}

img,svg{display:block;max-width:100%}
a{color:inherit;text-decoration:none}
:focus-visible{outline:2px solid var(--ember);outline-offset:3px;border-radius:4px}
::selection{background:var(--ember);color:var(--on-ember)}

/* ── type ──────────────────────────────────────────────────────────────── */
.d1{font-family:var(--f-display);font-weight:700;font-size:var(--t-d1);line-height:var(--t-d1-lh);letter-spacing:var(--t-d1-tr)}
.d2{font-family:var(--f-display);font-weight:700;font-size:var(--t-d2);line-height:1.04;letter-spacing:var(--t-d2-tr)}
.d3{font-family:var(--f-display);font-weight:700;font-size:var(--t-d3);line-height:1.16;letter-spacing:var(--t-d3-tr)}
.t1{font-size:1.125rem;line-height:1.6;color:var(--ink-2)}
.sm{font-size:.875rem;line-height:1.55;color:var(--ink-2)}
.mono{font-family:var(--f-mono);font-size:.8125rem;letter-spacing:.02em}
.eyebrow{
  font-family:var(--f-mono);font-size:.6875rem;letter-spacing:.16em;
  text-transform:uppercase;color:var(--ember-ink);margin-bottom:16px;
}
/* Two gold dots before the line: the owl's eyes, on brand pages only. */
.eyebrow.eyes::before{content:"";display:inline-block;width:20px;height:8px;margin-right:10px;vertical-align:1px;
  background:radial-gradient(circle at 4px 4px,var(--brand-eye) 3.2px,transparent 3.6px),radial-gradient(circle at 16px 4px,var(--brand-eye) 3.2px,transparent 3.6px)}
.prose{max-width:62ch}
.ember{color:var(--ember-ink)}

/* A word marked as lit: the accent sits under the baseline instead of on the
   glyph, so the headline keeps full contrast and still carries brand colour. */
.lit{position:relative;white-space:nowrap}
.lit::after{
  content:"";position:absolute;left:0;right:0;bottom:.06em;height:.13em;
  background:var(--ember);border-radius:2px;
}

/* ── shell ─────────────────────────────────────────────────────────────── */
/* max(), not the bare token: every page now asks for viewport-fit=cover, so a
   phone held sideways lets the notch eat into the side the text starts at. On
   a screen without insets env() is 0 and this is --pad, unchanged. The cabinet
   makes the same call for .work in cabinet.css. */
.shell{
  max-width:var(--shell);margin-inline:auto;
  padding-inline:max(var(--pad), env(safe-area-inset-left,0px), env(safe-area-inset-right,0px));
}
section{padding-block:var(--rhythm)}
.rule{height:1px;background:var(--line);border:0}

/* ── nav ───────────────────────────────────────────────────────────────── */
/* ── the bot bar ────────────────────────────────────────────────────────
   Full-bleed and filled with the accent: it is the first thing on the page and
   it is meant to be. The whole strip is the link, not the words at its end — a
   44px target the width of the viewport.

   It scrolls away while the header stays: the reason ("not open yet") is worth
   reading once, the action stays in the header for the rest of the page. */
.tgbar{background:var(--ember-fill);color:var(--on-ember)}
.tgbar a{
  display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;
  min-height:46px;padding:7px max(var(--pad),12px);
  color:inherit;font-size:.9375rem;line-height:1.35;text-align:center;
}
.tgbar a:hover{background:var(--ember-fill-hover)}
.tgbar .i{flex:none}
.tgbar .go{font-weight:600;text-decoration:underline;text-underline-offset:3px}
/* The explanation is the part that goes when there is no room: the action has
   to survive at every width, the reason does not. */
@media (max-width:560px){.tgbar .what{display:none}}

/* ── the bot button in the header ──────────────────────────────────────── */
.nav .tgcta{
  display:inline-flex;align-items:center;gap:8px;flex:none;
  min-height:40px;padding:0 15px;border-radius:8px;
  background:var(--ember-fill);color:var(--on-ember);
  font-family:var(--f-text);font-weight:600;font-size:.875rem;white-space:nowrap;
  box-shadow:0 8px 20px -12px var(--ember-shadow);
  transition:background-color .2s var(--ease);
}
.nav .tgcta:hover{background:var(--ember-fill-hover);color:var(--on-ember)}
.nav .tgcta:active{transform:translateY(1px)}
/* On a narrow phone the mark, this button and two switches share one row: the
   label drops and the icon carries it, rather than the row wrapping into a
   second line that pushes the page down. */
@media (max-width:560px){
  .nav .tgcta{padding:0 11px}
  .nav .tgcta .lbl{display:none}
  /* On a phone the header fits ONE action. Before launch that is the bot:
     there is almost no one to sign in yet, and the "Sign in" link stays in
     the footer. The rule lifts itself after launch: the bot button is gone
     from the markup and :has() stops matching. A browser without :has()
     just wraps the links to a second line (flex-wrap above) - worse, but
     not broken. */
  .nav .row:has(.tgcta) .links{display:none}
}

.nav{position:sticky;top:0;z-index:20;background:rgba(var(--paper-rgb),.88);border-bottom:1px solid var(--line-soft)}
@supports (backdrop-filter:blur(1px)){
  /* Blur repaints the viewport on every scroll frame on phones: desktop only. */
  @media (min-width:901px){.nav{backdrop-filter:blur(12px)}}
}
.nav .row{
  /* min-height, not height: 66px is the bar's floor, not its ceiling. The
     header row is built from translated text (link lengths vary up to 2x
     between languages); when it stops fitting, the bar must grow taller.
     With a fixed height the content spilled out and printed over its
     neighbours instead. */
  /* wrap, not nowrap: the row is built from translated text and a few
     controls; when they stop fitting they must move to a second line rather
     than overlap - without this the bot button printed over the "Sign in"
     link on a narrow screen. */
  display:flex;align-items:center;flex-wrap:wrap;gap:20px;min-height:66px;min-width:0;
  max-width:var(--shell);margin-inline:auto;
  padding-inline:max(var(--pad), env(safe-area-inset-left,0px), env(safe-area-inset-right,0px));
}
/* min-height, not an ::after like the controls beside it: the mark is a LINK
   home and the widest thing in the bar, so its target is the one that must not
   overlap the row under it on a phone. 44px of its own box cannot. */
.brand{display:flex;align-items:center;gap:10px;flex:none;min-height:44px}
.brand .name{font-family:var(--f-wordmark);font-weight:800;font-size:1.22rem;letter-spacing:-.02em}
.nav .spacer{flex:1;min-width:0}
.nav .links{display:flex;align-items:center;gap:24px;min-width:0}
/* A line of 15px text is 23px tall, and 23px is not a target — DESIGN.md §6
   asks for 44px anywhere a thumb lands, which is what the footer's own links
   already carry (.fnav a). The box grows, not the type: inside a 66px bar the
   extra height is invisible, and on a phone, where these links become the
   header's second row, it is the whole point. */
.nav .links a{
  display:inline-flex;align-items:center;min-height:44px;
  font-size:.9375rem;color:var(--ink-2);white-space:nowrap;
}
.nav .links a:hover{color:var(--ink)}
@media (max-width:720px){.nav .links a.opt{display:none}}
/* The wordmark is set in a wide face: on the narrowest phones the row tightens
   so the mark, sign-in and both switches still share one line. */
@media (max-width:420px){.nav .row{gap:12px}.brand .name{font-size:1rem}}

/* ── theme switch ──────────────────────────────────────────────────────── */
/* One button, one icon: the ground you are NOT on. Two icons ship in the
   markup and CSS picks between them, rather than a script swapping an href —
   the state is already on <html>, so nothing has to run for the right one to
   be showing, and it cannot be briefly wrong on a slow load.

   It is a control, not navigation, so it sits outside .links and keeps its
   place at every width. There is nothing to hide on a phone: a reader on a
   phone at night is exactly who this is for. */
.tsw{
  flex:none;display:inline-grid;place-items:center;position:relative;
  width:38px;height:38px;border-radius:8px;cursor:pointer;
  border:1px solid var(--line);background:var(--raised);color:var(--ink-2);
  transition:color .18s var(--ease),border-color .18s var(--ease),
             background-color .18s var(--ease);
}
.tsw:hover{color:var(--ink);border-color:var(--faint)}
.tsw:active{transform:translateY(1px)}
/* The visible box is 38px: the nav bar is 66px tall, and a 44px square beside
   a 26px logotype reads as a second mark rather than as a control. The TARGET
   is 44px all the same — an unpainted ::after carries the extra 3px on every
   side, which is what a thumb lands on and what DESIGN.md §6 asks for. */
.tsw::after{content:"";position:absolute;inset:-3px;border-radius:11px}
.tsw svg{width:17px;height:17px}
/* Snow shows the moon, because pressing it is what gets you the night. */
.tsw .to-light{display:none}
:root[data-theme="dark"] .tsw .to-light{display:block}
:root[data-theme="dark"] .tsw .to-dark{display:none}

/* ── scripts we do not ship fonts for ───────────────────────────────────────

   Japanese, Korean and Traditional Chinese are drawn with the reader's system
   fonts. That is a decision, not an omission: a subsetted CJK face is 4-6 MB
   per language even before the weights, and paying it on a landing page costs
   more than the typography it buys.

   The brand faces stay FIRST in every stack. Font matching is per glyph, so a
   Japanese page still sets its numbers, its prices and the word Winthem in
   the brand faces, and only the kana and kanji fall through.

   The display sizes need their own treatment. -.04em tracking and a .92 line
   are drawn for tall Latin caps; on square CJK glyphs the same numbers collide
   the columns and clip the ascenders. Both are neutralised here rather than in
   the type scale, so the Latin pages are untouched. */
:root[data-script="jp"]{
  --f-cjk:'Hiragino Kaku Gothic ProN','Hiragino Sans','Yu Gothic UI','Yu Gothic','Noto Sans JP','Meiryo';
}
:root[data-script="kr"]{
  --f-cjk:'Apple SD Gothic Neo','Pretendard','Malgun Gothic','Noto Sans KR','Nanum Gothic';
}
:root[data-script="zh"]{
  --f-cjk:'PingFang TC','Hiragino Sans CNS','Microsoft JhengHei UI','Microsoft JhengHei','Noto Sans TC';
}
:root[data-script="jp"],:root[data-script="kr"],:root[data-script="zh"]{
  --f-display:var(--face-d),var(--face-t),var(--f-cjk),system-ui,sans-serif;
  --f-text:var(--face-t),var(--f-cjk),system-ui,sans-serif;
  --f-mono:var(--face-m),var(--f-cjk),ui-monospace,Consolas,monospace;
}
:root[data-script="jp"] .d1,:root[data-script="kr"] .d1,:root[data-script="zh"] .d1{
  letter-spacing:0;line-height:1.18;font-size:clamp(2.4rem,5.6vw,4.2rem);
}
:root[data-script="jp"] .d2,:root[data-script="kr"] .d2,:root[data-script="zh"] .d2{
  letter-spacing:0;line-height:1.28;
}
:root[data-script="jp"] .d3,:root[data-script="kr"] .d3,:root[data-script="zh"] .d3{
  letter-spacing:0;line-height:1.35;
}
/* The eyebrow is .16em of tracking across small caps. On CJK that is not a
   style, it is a spaced-out word. */
:root[data-script="jp"] .eyebrow,:root[data-script="kr"] .eyebrow,:root[data-script="zh"] .eyebrow{
  letter-spacing:.04em;
}

/* ── language picker ───────────────────────────────────────────────────────

   A <details>, so it opens, closes and takes the keyboard with nothing loaded.
   On a public page the entries inside are real links, which is also what a
   crawler follows; behind the login they are buttons, because those pages have
   one address for every language.

   Sized and shaped as the sibling of the ground switch: same 38px box, same
   border, same radius. Two controls that do the same kind of job standing side
   by side have to look like one pair. */
.lang{position:relative;flex:none}
.lang>summary{
  position:relative;
  display:inline-flex;align-items:center;gap:7px;height:38px;padding-inline:11px;
  border:1px solid var(--line);border-radius:8px;background:var(--raised);
  color:var(--ink-2);cursor:pointer;list-style:none;user-select:none;
  transition:color .18s var(--ease),border-color .18s var(--ease);
}
/* The pair rule cuts both ways: standing beside the ground switch, this box is
   38px because that one is. So it borrows the same unpainted ::after and gets
   the 44px target DESIGN.md §6 asks for without growing by a pixel. */
.lang>summary::after{content:"";position:absolute;inset:-3px;border-radius:11px}
.lang>summary::-webkit-details-marker{display:none}
.lang>summary::marker{content:""}
.lang>summary:hover{color:var(--ink);border-color:var(--faint)}
.lang[open]>summary{color:var(--ink);border-color:var(--faint)}
.lang .ic{width:17px;height:17px;flex:none}
.lang .cur{font-size:.6875rem;letter-spacing:.08em}

.lang .menu{
  position:absolute;z-index:40;top:calc(100% + 8px);right:0;min-width:190px;
  padding:6px;border:1px solid var(--line);border-radius:12px;
  background:var(--raised);box-shadow:var(--lift-2);
  max-height:min(70vh,420px);overflow-y:auto;overscroll-behavior:contain;
}
.lang .li{
  display:flex;align-items:center;gap:10px;width:100%;
  padding:8px 10px;border:0;border-radius:8px;background:none;cursor:pointer;
  font-family:var(--f-text);font-size:.9375rem;color:var(--ink-2);text-align:start;
}
.lang .li:hover{background:var(--sunk);color:var(--ink)}
.lang .li .nm{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lang .li .ok{width:15px;height:15px;flex:none;opacity:0;color:var(--ember-ink)}
.lang .li.on{color:var(--ink);font-weight:600}
.lang .li.on .ok{opacity:1}
.lang .li[disabled]{opacity:.5;cursor:default}
/* The picker is a control, not a link in the bar: at phone widths the nav
   drops its optional links and this stays, because a reader on the wrong
   language has nothing else to do on the page. */
@media (max-width:520px){
  .lang .menu{position:fixed;top:auto;bottom:12px;left:12px;right:12px;min-width:0}
}

/* ── the offer to switch ───────────────────────────────────────────────────

   A strip under the header, not a modal and not a full-page interstitial: the
   reader landed on a page they can read: they just might prefer another one.
   Shown by script, once, and only when the browser asked for a language this
   page is not in. */
.langhint{border-bottom:1px solid var(--line-soft);background:var(--sunk)}
.langhint .row{
  display:flex;align-items:center;gap:12px;min-height:48px;
  max-width:var(--shell);margin-inline:auto;padding-block:8px;padding-inline:var(--pad);
}
.langhint .ic{width:17px;height:17px;flex:none;color:var(--faint)}
.langhint .txt{flex:1;min-width:0;font-size:.9375rem;color:var(--ink-2)}
.langhint .go{
  display:inline-flex;align-items:center;min-height:44px;
  font-size:.9375rem;font-weight:600;color:var(--ember-ink);white-space:nowrap;
}
.langhint .x{
  position:relative;
  flex:none;width:28px;height:28px;border:0;border-radius:6px;background:none;
  color:var(--faint);font-size:1.25rem;line-height:1;cursor:pointer;
}
/* Same unpainted extension as the two controls in the bar: a 28px glyph is the
   right weight for a dismissal and the wrong size for a thumb. */
.langhint .x::after{content:"";position:absolute;inset:-8px;border-radius:12px}
.langhint .x:hover{color:var(--ink);background:var(--raised)}

/* On a phone the strip is three things fighting over 360px: the sentence gets
   squeezed into a 130px column and breaks into three lines beside a nowrap
   link. The offer becomes two lines instead — what is available, then the way
   to take it — and the dismissal keeps the end of the first one. `order` moves
   the link past the × in the LAYOUT only, so the reading and tab order still
   run sentence, offer, dismiss. */
@media (max-width:640px){
  .langhint .row{flex-wrap:wrap;gap:0 10px;padding-block:9px;min-height:0}
  .langhint .txt{flex:1 1 auto}
  .langhint .go{order:1;flex-basis:100%;padding-inline-start:27px}
}

/* ── buttons ───────────────────────────────────────────────────────────── */
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:46px;padding:0 22px;border-radius:var(--r-btn,8px);border:1px solid transparent;
  font-family:var(--f-text);font-weight:600;font-size:.9375rem;white-space:nowrap;
  cursor:pointer;
  transition:transform .12s var(--ease),background-color .2s var(--ease),
             border-color .2s var(--ease),box-shadow .2s var(--ease);
}
.btn:active{transform:translateY(1px)}
/* An icon inside a button needs air the padding alone does not give it. */
.btn svg{flex:none;margin-inline-end:9px}
/* One size up for the single action a prelaunch page has. Not a new button —
   the same one with more presence, because there is nothing to weigh it
   against on the page. */
.btn-lg{min-height:54px;padding:0 30px;font-size:1rem}
/* --ember-fill, which on snow is the deep tone rather than the raw accent: on
   the raw accent --on-ember lands at 3.34:1, which fails AA for 15px text,
   and the deeper tone of the same hue reads at 5.11:1. On night the token
   goes the other way — raw ember, near-black label, 5.05:1 — and the button
   itself does not know which, which is the point of the token. Owner-approved,
   and it applies to every primary in the product, because the token is one. */
.btn-primary{background:var(--ember-fill);color:var(--on-ember);box-shadow:0 8px 20px -10px var(--ember-shadow)}
.btn-primary:hover{background:var(--ember-fill-hover)}
.btn-ghost{border-color:var(--line);color:var(--ink);background:var(--raised)}
.btn-ghost:hover{border-color:var(--faint)}
.btn-block{width:100%}
.btn[disabled]{opacity:.5;cursor:not-allowed;box-shadow:none}

/* ── panels ────────────────────────────────────────────────────────────── */
.panel{
  border:1px solid var(--line);border-radius:12px;background:var(--surface);
  overflow:hidden;box-shadow:var(--lift);
}
.panel .head{
  display:flex;align-items:center;gap:14px;padding:16px 18px;
  border-bottom:1px solid var(--line-soft);background:var(--raised);
}
.panel .head h2{font-family:var(--f-display);font-weight:700;font-size:1rem;letter-spacing:-.02em}
.row-item{display:flex;align-items:center;gap:14px;padding:14px 18px;border-bottom:1px solid var(--line-soft)}
.row-item:last-child{border-bottom:0}

/* ── pills ─────────────────────────────────────────────────────────────── */
.pill{
  display:inline-flex;align-items:center;gap:6px;border-radius:999px;
  padding:5px 12px;font-family:var(--f-mono);font-size:.6875rem;letter-spacing:.05em;
  border:1px solid var(--line);color:var(--ink-2);background:var(--raised);
}
.pill.ok{border-color:var(--ok-edge);color:var(--ok);background:var(--ok-wash)}
.pill.warn{border-color:var(--warn-edge);color:var(--warn);background:var(--warn-wash)}
.pill.hot{border-color:var(--ember-edge);color:var(--ember-ink);background:var(--ember-wash)}

/* ── forms ─────────────────────────────────────────────────────────────── */
.field{display:grid;gap:7px;margin-bottom:18px}
.field label{font-size:.875rem;color:var(--ink);font-weight:500}
.field input{
  width:100%;min-height:46px;padding:0 14px;border-radius:var(--r-field,8px);
  background:var(--raised);border:1px solid var(--line);color:var(--ink);
  font-family:var(--f-text);font-size:1rem;
  transition:border-color .18s var(--ease),box-shadow .18s var(--ease);
}
.field input::placeholder{color:var(--faint)}
.field input:focus{outline:none;border-color:var(--ember);box-shadow:0 0 0 3px var(--ember-ring)}
.field .hint{font-size:.8125rem;color:var(--ink-3)}
.tabs{display:flex;gap:4px;background:var(--sunk);border-radius:9px;padding:4px;margin-bottom:24px}
.tabs button{
  flex:1;min-height:38px;border:0;border-radius:6px;background:transparent;cursor:pointer;
  font-family:var(--f-text);font-weight:600;font-size:.9375rem;color:var(--ink-2);
  transition:background-color .18s var(--ease),color .18s var(--ease),box-shadow .18s var(--ease);
}
.tabs button[aria-selected="true"]{background:var(--raised);color:var(--ink);box-shadow:var(--lift)}
.formbox{
  width:100%;max-width:430px;
  border:1px solid var(--line);border-radius:12px;padding:clamp(24px,4vw,36px);
  background:var(--surface);box-shadow:var(--lift-2);
}
.notice{
  border-radius:8px;padding:11px 13px;font-size:.875rem;margin-bottom:18px;
  border:1px solid var(--line);color:var(--ink-2);background:var(--raised);
}
.notice.bad{border-color:var(--bad-edge);color:var(--bad);background:var(--bad-wash)}
.notice.ok{border-color:var(--ok-edge);color:var(--ok);background:var(--ok-wash)}

/* ── game picker ───────────────────────────────────────────────────────── */
.games{display:grid;gap:8px}
.game{
  text-align:left;cursor:pointer;display:grid;gap:3px;position:relative;
  padding:14px 15px;border-radius:9px;border:1px solid var(--line);
  background:var(--raised);color:var(--ink);font-family:var(--f-text);
  transition:border-color .18s var(--ease),background-color .18s var(--ease),box-shadow .18s var(--ease);
}
.game:hover:not([disabled]){border-color:var(--faint)}
.game .t{font-weight:600;font-size:.9375rem}
.game .n{font-size:.8125rem;color:var(--ink-3);line-height:1.45}
.game[aria-pressed="true"]{
  border-color:var(--ember);background:var(--ember-wash);
  box-shadow:0 0 0 1px var(--ember) inset;
}
.game[disabled]{opacity:.55;cursor:not-allowed}
.game .soon{
  position:absolute;top:13px;right:14px;font-family:var(--f-mono);
  font-size:.625rem;letter-spacing:.08em;text-transform:uppercase;color:var(--faint);
}

/* ── tables ────────────────────────────────────────────────────────────── */
.tbl{width:100%;border-collapse:collapse;font-size:.875rem}
/* --ink-2, not --ink-3: a column header is text that gets read, and --ink-3
   measures 4.01:1 on --raised — under AA at this size. .tbl and .grid-stats
   below are the admin surface only, so this is a fix at the source rather than
   an override in one page. */
.tbl th{
  text-align:left;padding:11px 14px;white-space:nowrap;
  font-family:var(--f-mono);font-size:.6875rem;letter-spacing:.08em;
  text-transform:uppercase;color:var(--ink-2);
  border-bottom:1px solid var(--line);background:var(--raised);
}
.tbl td{padding:12px 14px;border-bottom:1px solid var(--line-soft);white-space:nowrap}
.tbl tr:last-child td{border-bottom:0}
.tbl td.num{font-family:var(--f-mono);text-align:right}
.tbl td.who{font-weight:500}
.tbl tr:hover td{background:var(--raised)}
.search{
  min-height:40px;padding:0 13px;border-radius:8px;background:var(--raised);
  border:1px solid var(--line);color:var(--ink);font-family:var(--f-text);font-size:.9375rem;
  min-width:0;max-width:260px;
}
.search:focus{outline:none;border-color:var(--ember);box-shadow:0 0 0 3px var(--ember-ring)}
.scroll-x{overflow-x:auto}

/* ── stats strip ───────────────────────────────────────────────────────── */
.grid-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1px;background:var(--line-soft)}
.grid-stats > div{background:var(--surface);padding:18px}
.stat{display:grid;gap:3px}
.stat .v{font-family:var(--f-mono);font-size:1.4rem;letter-spacing:-.02em}
.stat .k{font-size:.8125rem;color:var(--ink-2)}

/* ── states ────────────────────────────────────────────────────────────── */
.empty{padding:48px 24px;text-align:center;display:grid;gap:16px;justify-items:center}
.empty p{color:var(--ink-2);font-size:.9375rem;max-width:44ch}
.skel{border-radius:6px;background:var(--sunk);position:relative;overflow:hidden}
.skel::after{
  content:"";position:absolute;inset:0;transform:translateX(-100%);
  background:linear-gradient(90deg,transparent,var(--sweep),transparent);
}
@media (prefers-reduced-motion:no-preference){
  .skel::after{animation:sweep 1.35s var(--ease) infinite}
}
@keyframes sweep{to{transform:translateX(100%)}}

/* ── reveal: transform and opacity only ────────────────────────────────── */
.reveal{opacity:0;transform:translate3d(0,20px,0)}
@media (prefers-reduced-motion:no-preference){
  .reveal{transition:opacity .55s var(--ease),transform .55s var(--ease)}
}
.reveal.seen{opacity:1;transform:none}
@media (prefers-reduced-motion:reduce){
  .reveal{opacity:1;transform:none}
  *,*::before,*::after{animation-duration:.001ms !important;transition-duration:.001ms !important}
}
