/* Hexplorers: the interface (04/10 overhaul). One layout for every skin: the
   skins (skins.css) only set the custom properties the tokens below read.
   Mobile first: players on top, the board in the middle, everything you do in
   the bottom third, where the thumb is. Fallbacks are the Velvet Noir values.
   The sections follow the scripts: shared pieces (ui.js), the start screen and
   setup (ui-menu.js), the game screen (ui-game.js), what a tap opens
   (ui-sheets.js), the end (ui-end.js), the board's cues (ui-board.js). */

/* =====================================================================
   TOKENS: every colour, radius, shadow and font below goes through these
   ===================================================================== */
:root {
  --ui-bg: var(--bg, #0c0a10); --ui-panel: var(--panel, #17111e); --ui-panel-2: var(--panel-2, #211829);
  --ui-line: var(--line, #3a2c44); --ui-text: var(--text, #ece3d6); --ui-muted: var(--muted, #9d8fa6);
  --ui-accent: var(--accent, #d9a441); --ui-accent-ink: var(--accent-ink, #120d17); --ui-accent-2: var(--accent-2, #3ee6c8);
  --ui-danger: var(--danger, #e2607a); --ui-good: var(--good, #3ee68a); --ui-good-ink: #0b1a10;
  --ui-stage: var(--stage, radial-gradient(ellipse at 50% 45%, #1d1526, #0c0a10 80%));
  /* ink on a player's colour: dark on the light ones, light on the dark ones */
  --ui-ink-dark: #1c1420; --ui-ink-light: #fff;
  /* a hairline round a player's colour, in the skin's text colour: black and white seats read on every ground */
  --ui-edge: color-mix(in srgb, var(--ui-text) 60%, transparent);
  /* black for shadows, as rgb(var(--ui-shade) / alpha) */
  --ui-shade: 0 0 0;
  --ui-r: var(--radius, 0px); --ui-r-lg: var(--radius-lg, 0px); --ui-pill: var(--pill, 999px);   /* chips and switches: a capsule, square in the pixel skin */
  --ui-shadow: var(--shadow, 0 8px 22px rgb(var(--ui-shade) / .55));
  /* text laid straight on the board: a dark halo on the night skins, a paper lift on the atlas */
  --ui-lift: var(--hud-lift, 0 1px 3px rgb(var(--ui-shade) / .7));
  --ui-head: var(--font-head, 'Limelight', serif); --ui-body: var(--font-body, 'Barlow', system-ui, sans-serif);
  --ui-label: var(--font-ui, 'VT323', monospace); --ui-num: var(--font-num, 'VT323', monospace);
  --ui-tap: 44px;              /* the smallest thing a thumb has to hit */
  --tap: var(--ui-tap);        /* the older stylesheet's name for it */
}
/* (the older stylesheets' names, --brass, --teal and the rest, follow the skin through skins.css's token bridge) */
body.hx { background: var(--ui-bg); color: var(--ui-text); }

/* =====================================================================
   SHARED PIECES (ui.js): buttons, chips, switches, segmented rows, sheets
   ===================================================================== */
/* the keyboard's focus, in every skin: the skin's focus colour, outside the edge so it shows on any button */
.hx :is(button, a[href], summary, select, [role=tab], [tabindex]):focus-visible { outline: 2px solid var(--focus, var(--ui-accent-2)); outline-offset: 2px; }
/* something broke: a small note with a Reload (ui.js oops), above everything, never a dead screen */
.oops { position: fixed; left: 50%; top: max(.5rem, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: .5rem;
  max-width: calc(100% - 1rem); padding: .3rem .3rem .3rem .8rem; background: var(--ui-panel); color: var(--ui-text); border: 1px solid var(--ui-danger); border-radius: var(--ui-r-lg);
  box-shadow: var(--ui-shadow); font: 500 14px/1.2 var(--ui-body); white-space: nowrap; }
.hx .oops .icon { min-width: 36px; min-height: 36px; font-size: 14px; color: var(--ui-muted); }
/* a button that is only an icon */
.hx .icon { min-width: var(--ui-tap); min-height: var(--ui-tap); padding: 0; display: grid; place-items: center; border: 1px solid transparent; box-shadow: none; background: transparent; color: var(--ui-text); border-radius: var(--ui-r); position: relative; }
.hx .icon svg { width: 26px; height: 26px; }
.hx .icon.on { color: var(--ui-accent-2); border-color: var(--ui-accent-2); }
.hx .icon .badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--ui-accent-2); color: var(--ui-accent-ink); font: 700 11px/16px var(--ui-body); }
/* the one big button of a screen: New game, Start, Rematch */
.hx .primary.big { width: 100%; min-height: 64px; flex-direction: column; gap: .15rem; font: 600 20px/1.1 var(--ui-body); border-radius: var(--ui-r-lg); background: var(--ui-accent); color: var(--ui-accent-ink); border: 0; }
.hx .primary.big small { font: 400 13px/1.2 var(--ui-body); opacity: .85; text-transform: none; letter-spacing: 0; }
.hx .primary.big:disabled { background: var(--ui-panel-2); color: var(--ui-muted); }
/* chips: the rounded buttons for everything else on a screen */
.hx button.chipb { min-height: 40px; padding: .2rem .9rem; gap: .35rem; border-radius: var(--ui-pill); font: 500 14px/1 var(--ui-body); text-transform: none; letter-spacing: 0; }
/* a switch, drawn from the checkbox itself */
.hx .switch { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; min-width: 0; min-height: 0; margin: 0; padding: 0; box-shadow: none; border-radius: var(--ui-pill); background: color-mix(in srgb, var(--ui-text) 22%, transparent); position: relative; cursor: pointer; border: 0; transition: background .2s; }
.hx .switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: var(--ui-pill); background: var(--ui-panel); box-shadow: 0 1px 3px rgb(var(--ui-shade) / .4); transition: transform .2s; }
.hx .switch:checked { background: var(--ui-accent); }
.hx .switch:checked::after { transform: translateX(18px); background: var(--ui-accent-ink); }
.hx .switch:focus-visible { outline: 2px solid var(--ui-accent-2); outline-offset: 2px; }
/* a segmented row: the results' tabs, the replay's speeds */
.r-tabs, .rp-speed { display: flex; gap: 2px; padding: 2px; background: var(--ui-panel-2); border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); }
.hx .r-tabs button, .hx .rp-speed button { flex: 1; min-width: 0; border: 0; border-radius: calc(var(--ui-r-lg) - 2px); background: transparent; color: var(--ui-muted); box-shadow: none; }
.hx .r-tabs button.on, .hx .rp-speed button.on { background: var(--ui-accent); color: var(--ui-accent-ink); }
/* sheets: the same bottom sheet everywhere, over a dimmed page */
.hx-modal { position: fixed; inset: 0; z-index: 30; display: flex; justify-content: center; align-items: flex-end; background: rgb(var(--ui-shade) / .72); }
.hx-modal .hx-panel { width: 100%; max-width: 36rem; max-height: 82dvh; overflow: auto; margin: 0; border-radius: var(--ui-r-lg) var(--ui-r-lg) 0 0; background: var(--ui-panel); border: var(--border-w, 1px) solid var(--ui-line);
  box-shadow: inset 0 3px 0 var(--ui-accent); padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
@media (prefers-reduced-motion: no-preference) {
  .hx-modal { animation: fade-in .18s ease-out; }
  .hx-modal .hx-panel { animation: rise-in .26s cubic-bezier(.2,.9,.3,1.1); }
}
@media (min-width: 60em) { .hx-modal { padding: 1rem; } }
.row.end { justify-content: flex-end; flex-wrap: wrap; }
/* a sheet's own buttons (Close, Done) stay on screen however long it is: a phone has no Escape, an iPhone no Back (14/10);
   not on a phone held sideways, where the row would take a fifth of what little height there is */
@media (min-height: 500px) {
  .hx-modal .hx-panel > .row.end:last-child { position: sticky; z-index: 2; bottom: calc(-1 * max(1rem, env(safe-area-inset-bottom)));
    margin: .4rem -1rem calc(-1 * max(1rem, env(safe-area-inset-bottom))); padding: .6rem 1rem max(1rem, env(safe-area-inset-bottom)); background: var(--ui-panel); border-top: 1px solid var(--ui-line); }
}
.center { text-align: center; }
.ask-sheet p { margin-top: 0; }
/* a choice with a line under it: bots, lengths, timers, menu entries */
.bot-list, .choices { display: flex; flex-direction: column; gap: .3rem; }
.hx .bot-list button, .hx .choices button, .hx .add-sheet .menu-list button { flex-direction: column; align-items: flex-start; gap: .1rem; padding: .45rem .7rem; text-align: left; text-transform: none; letter-spacing: 0; border-radius: var(--ui-r-lg); }
.bot-list b, .choices b { font: 600 15px/1.2 var(--ui-body); }
.bot-list small, .choices small, .add-sheet .menu-list small { font: 12.5px/1.3 var(--ui-body); color: var(--ui-muted); }
.hx .choices small .warn { color: var(--ui-danger); display: block; }
.hx .choices button.on { border-color: var(--ui-accent); box-shadow: inset 0 0 0 1px var(--ui-accent); }
/* the game lengths, each with its board beside it (ui-menu.js lengthPreview): the Bank, the start ring, the tiles to explore */
.hx .choices button.has-prev { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .75rem; align-content: center; }
.choices .has-prev .len-prev { grid-row: span 2; width: 62px; height: 56px; }
.len-prev polygon { stroke-width: 7; stroke: var(--ui-muted); fill: none; }
.len-prev .lp-bank { fill: var(--ui-accent); stroke: var(--ui-accent); }
.len-prev .lp-ring { fill: color-mix(in srgb, var(--ui-accent-2) 45%, transparent); stroke: var(--ui-accent-2); }
.len-prev .lp-box { fill: color-mix(in srgb, var(--ui-text) 8%, transparent); }
/* a row of resources, each a tinted cell (the dock's storage, a player's card) */
.rc { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: .15rem; padding: .2rem .1rem; border-radius: var(--ui-r); background: color-mix(in srgb, var(--res) 14%, transparent); position: relative; }
.rc svg { width: 20px; height: 20px; flex: none; }
.rc b { font: 21px/1 var(--ui-num); color: var(--ui-text); }

/* =====================================================================
   THE START SCREEN AND THE MATCH SETUP (ui-menu.js)
   ===================================================================== */
/* ---- the start screen: one screen, no scrolling ---- */
.home { min-height: 100dvh; max-width: 30rem; margin: 0 auto; display: flex; flex-direction: column; padding: max(.5rem, env(safe-area-inset-top)) 1rem max(.8rem, env(safe-area-inset-bottom)); gap: .5rem; }
@media (min-height: 760px) { .home { gap: .7rem; } }
.home-top { display: flex; align-items: center; gap: .2rem; }
.home-top .sp { flex: 1; }
.home-top .mark { white-space: nowrap; flex-wrap: nowrap; font-size: 13px; min-width: 0; overflow: hidden; }
.home-top .mark b, .home-top .mark span { white-space: nowrap; }
.home-hero { position: relative; flex: 1 1 auto; min-height: 150px; max-height: 42dvh; display: grid; place-items: center; overflow: hidden; }
.home-hero > svg { width: 100%; height: 100%; max-height: 42dvh; }
.home-hero .hx-title { position: absolute; bottom: .2rem; left: 0; right: 0; margin: 0; text-align: center; font: 400 clamp(40px, 13vw, 60px)/1 var(--ui-head); color: var(--ui-accent); text-shadow: 0 2px 0 rgb(var(--ui-shade) / .4); }
.home-act { display: flex; flex-direction: column; gap: .5rem; }
.home .cont { display: flex; align-items: center; gap: .4rem; padding: .35rem .35rem .35rem .7rem; background: var(--ui-panel-2); border: 1px solid var(--ui-accent); border-radius: var(--ui-r-lg); }
.home .cont span { flex: 1; font: 15px/1.2 var(--ui-body); }
.home .name { font: 600 17px/1.2 var(--ui-body); text-align: center; min-height: var(--ui-tap); }
.home .join { display: flex; gap: .4rem; }
.home .join input { flex: 1; min-width: 0; min-height: var(--ui-tap); text-transform: uppercase; letter-spacing: .3em; text-align: center; font: 22px/1 var(--ui-num); }
.home .join.lit input { border-color: var(--ui-accent); }
.home-chips { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; }
.hx .home-chips .chipb { min-height: 38px; padding: .2rem .8rem; }
.home-chips .badge, .home-chips .n { min-width: 18px; height: 18px; border-radius: 9px; display: inline-grid; place-items: center; font: 700 11px/1 var(--ui-body); }
.home-chips .badge { background: var(--ui-accent-2); color: var(--ui-accent-ink); }
.home-chips .n { background: var(--ui-panel-2); color: var(--ui-muted); }
/* joining a game: the one panel while it connects */
.connecting { text-align: center; margin-top: 1.5rem; }
.connecting .row { justify-content: center; }
.connecting .forget { margin: .8rem 0 0; }

/* ---- the match setup: one screen; seats, three chips, Start ---- */
.setup { min-height: 100dvh; max-width: 30rem; margin: 0 auto; display: flex; flex-direction: column; gap: .6rem; padding: max(.5rem, env(safe-area-inset-top)) 1rem max(.8rem, env(safe-area-inset-bottom)); }
.setup-top { display: flex; align-items: center; gap: .3rem; }
.setup-top .icon:first-child { font-size: 28px; }
.setup-top .code { flex: 1; text-align: center; line-height: 1; }
.setup-top .code small { display: block; font: 14px/1 var(--ui-label); color: var(--ui-muted); text-transform: uppercase; letter-spacing: .1em; }
.setup-top .code b { font: 44px/1 var(--ui-num); letter-spacing: .25em; color: var(--ui-accent); padding-left: .25em; }
.setup .net { margin: 0; text-align: center; font-size: 13px; color: var(--ui-muted); min-height: 1.2em; }
.seats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .45rem; }   /* (minmax: a long name can't widen its column off the phone) */
.seat { position: relative; display: flex; align-items: stretch; min-height: 64px; border-radius: var(--ui-r-lg); background: var(--ui-panel); border: 1px solid var(--ui-line); box-shadow: inset 4px 0 0 var(--c, transparent), inset 5px 0 0 color-mix(in srgb, var(--ui-text) 25%, transparent); }
.seat.me { border-color: var(--c); }
.seat.off { opacity: .55; }
.seat.ghost { background: transparent; border-style: dashed; opacity: .35; box-shadow: none; }
.hx .seat .seat-main, .hx button.seat.empty { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem; background: transparent; border: 0; box-shadow: none; color: var(--ui-text); text-align: left; text-transform: none; letter-spacing: 0; justify-content: flex-start; }
.hx .seat .seat-main:disabled { opacity: 1; }
.hx button.seat.empty { border: 1px dashed var(--ui-accent-2); box-shadow: none; }
.seat .disc { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--c, var(--ui-panel-2)); color: var(--ci, var(--ui-ink-dark)); font: 700 16px/1 var(--ui-body); box-shadow: inset 0 0 0 2px rgb(var(--ui-shade) / .25), 0 0 0 1px var(--ui-edge); }
.seat.empty .disc { box-shadow: none; }
.seat.empty .disc { background: transparent; border: 2px dashed var(--ui-accent-2); color: var(--ui-accent-2); font-size: 22px; }
.seat .who { min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.seat .who b { font: 600 15px/1.15 var(--ui-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .who small { font: 12.5px/1.15 var(--ui-body); color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx .seat .seat-x { min-width: 36px; min-height: 36px; align-self: center; font-size: 14px; color: var(--ui-muted); }
/* teams (05/10): the seat wraps, its team chip a row of its own under the name; a shared colour's number on the disc */
.seat { flex-wrap: wrap; }
.seat .disc { position: relative; }
.seat .disc .mk, .chip .ring .mk { position: absolute; right: -5px; bottom: -4px; min-width: 17px; height: 17px; padding: 0 3px; border-radius: 9px; display: grid; place-items: center;
  background: var(--ui-panel); color: var(--ui-text); border: 1.5px solid var(--c); font: 700 11px/1 var(--ui-body); font-style: normal; }
.hx .seat .seat-team { flex: none; box-sizing: border-box; width: calc(100% - 3.5rem); display: flex; align-items: center; gap: .4rem; min-height: 34px; margin: 0 .45rem .45rem 3.05rem; padding: 0 .55rem 0 .25rem;
  border-radius: var(--ui-pill); background: var(--ui-panel-2); border: 1px solid var(--ui-line); box-shadow: none; color: var(--ui-muted); font: 500 13px/1 var(--ui-body); text-transform: none; letter-spacing: 0; justify-content: flex-start; }
.hx .seat .seat-team:disabled { opacity: 1; background: transparent; }
.hx .seat.teamed .seat-team { color: var(--ui-text); border-color: var(--ui-accent-2); }
.seat-team .caret { margin-left: auto; font-size: 11px; color: var(--ui-muted); }
.tm-badge { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: var(--ui-r, 4px); background: color-mix(in srgb, var(--ui-text) 10%, transparent);
  font: 16px/1 var(--ui-num); color: var(--ui-muted); }
.teamed .tm-badge, .r-team .tm-badge { background: var(--ui-accent-2); color: var(--ui-accent-ink); }
/* the colour sheet: who else has each colour, under it */
.swatches.big .sw { display: flex; flex-direction: column; align-items: center; gap: .2rem; width: 56px; }
.swatches.big .sw small { font: 11px/1.1 var(--ui-body); color: var(--ui-muted); text-align: center; overflow-wrap: anywhere; min-height: 1.1em; }
.opts { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; }
.opts p { margin: 0; text-align: center; }
.setup-go { margin-top: auto; }
/* the invite: the QR, and the room code big enough to read across a room */
.hx .invite-sheet .hx-qr { width: min(15rem, 70vw); margin: .5rem auto; background: #fff; border-radius: var(--ui-r); }
.inv-code { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; margin-bottom: .6rem; }
.inv-code small { font: 13px/1.3 var(--ui-body); color: var(--ui-muted); }
.inv-code b { font: 52px/1 var(--ui-num); letter-spacing: .25em; padding-left: .25em; color: var(--ui-accent); }
.inv-code a { font: 13px/1.3 var(--ui-body); overflow-wrap: anywhere; }
@media (min-width: 60em) {
  .invite-sheet { align-items: center; }
  .invite-sheet .hx-panel { max-width: 46rem; border-radius: var(--ui-r-lg); }
  .inv-body { display: flex; align-items: center; gap: 2rem; padding: .5rem 1rem; }
  .hx .invite-sheet .hx-qr { width: 20rem; flex: none; margin: 0; }
  .inv-code b { font-size: 84px; }
}
/* your colour */
.swatches.big { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin: .6rem 0; }
.hx .swatches.big button { width: 48px; height: 48px; min-height: 0; padding: 0; border-radius: 50%; background: var(--c); border: 2px solid transparent; color: var(--ci, var(--ui-ink-dark)); font-size: 16px; box-shadow: 0 0 0 1px var(--ui-edge); }
.hx .swatches.big button.on { border-color: var(--ui-text); box-shadow: 0 0 0 2px var(--ui-accent); }
.hx .swatches.big button.locked { opacity: .6; }

/* ---- consolidation (05/10 night): one pattern for each kind of thing in the menus ---- */
/* the lobby's settings: every chip "Label value", the label small; read-only (dashed) for whoever doesn't run the table */
.opts .ol { font: 400 12.5px/1 var(--ui-body); color: var(--ui-muted); margin-right: .1rem; }
.hx .chipb.ro { display: inline-flex; align-items: center; gap: .35rem; min-height: 34px; padding: .2rem .8rem; border-radius: var(--ui-pill); border: 1px dashed var(--ui-line);
  color: var(--ui-text); font: 500 14px/1 var(--ui-body); }
/* a seat's disc: their raccoon in their colour, as on the game's chips */
.seat .disc.av svg.avatar { width: 30px; height: 30px; border-radius: 50%; clip-path: circle(50%); background: var(--ui-panel-2); }
/* a shared colour's number: a disc in the player's own colour and ink, as on the game's chips */
.seat .disc .mk { background: var(--c); color: var(--ci, var(--ui-ink-dark)); border-color: var(--ui-edge); }
/* a seat you can't change: its team as plain text, not a control */
.hx .seat .seat-team:disabled { border-color: transparent; padding-left: 0; }
.hx .seat.teamed .seat-team:disabled { border-color: transparent; }
/* anything not yet yours: a lock and its price (ui-menu.js lockTag), the same in the lobby, the colours and the You sheet */
.lock-tag { display: inline-flex; align-items: center; gap: .2em; white-space: nowrap; font: 500 12px/1 var(--ui-body); color: var(--ui-muted); }
.lock-tag svg.lock { width: 9px; height: 11px; flex: none; }
.choices b .lock-tag { margin-left: .4em; vertical-align: 1px; }
.hx .choices button.locked { border-style: dashed; }
.hx .choices button.locked b, .hx .choices button.locked small { opacity: .75; }
.swatches.big .sw small .lock-tag { font-size: 11px; }
/* a switch row with a line under its name (Start's balanced starts) */
.srow span small { display: block; margin-top: .15rem; font: 12.5px/1.3 var(--ui-body); color: var(--ui-muted); }
.choice-sheet h3 { margin: .9rem 0 .35rem; }
.add-sheet h3 { margin: .9rem 0 .35rem; }
/* the start screen's lockup: tighter on a phone, so a wide skin font never clips "presents" beside the You button */
@media (max-width: 420px) { .home-top .mark { gap: 6px; } .home-top .mark span { font-size: 12px; letter-spacing: .04em; } }
/* a phone held sideways: the board and the title on the left, everything to do on the right; the lobby's seats beside its settings */
@media (orientation: landscape) and (max-height: 540px) {
  .home { max-width: 52rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); grid-template-rows: auto minmax(0, 1fr); column-gap: 1.2rem; row-gap: .3rem; min-height: 100dvh; }
  .home-top { grid-column: 1 / -1; }
  .home-hero { min-height: 0; max-height: none; align-self: stretch; }
  .home-hero > svg { max-height: calc(100dvh - 7rem); }
  .home-hero .hx-title, :root[data-skin] .home-hero .hx-title { font-size: clamp(30px, 11vh, 46px); }   /* (over the skins' own sizes) */
  .home-act { align-self: center; gap: .4rem; }
  .setup { max-width: 52rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 18rem); grid-template-rows: auto auto 1fr auto; column-gap: 1rem; row-gap: .4rem; }
  .setup-top, .setup .net { grid-column: 1 / -1; }
  .setup .seats { grid-column: 1; grid-row: 3 / 5; align-content: start; }
  .setup .opts, .setup .beta-note { grid-column: 2; align-self: start; justify-content: flex-start; }
  .setup-go { grid-column: 2; grid-row: 4; }
  .setup-top .code small { display: inline; margin-right: .6em; }
  .setup-top .code b { font-size: 30px; }
  .hx .setup .opts .chipb { min-height: 32px; padding: .15rem .65rem; font-size: 13px; }
  .hx .setup .primary.big { min-height: 52px; }
}

/* =====================================================================
   THE GAME SCREEN (ui-game.js)
   ===================================================================== */
/* ---- the frame: bar, board, ticker, dock ---- */
#game { position: relative; display: grid; height: 100dvh; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "bar" "board" "line" "dock"; background: var(--ui-bg); }
#bar { grid-area: bar; display: flex; align-items: center; gap: .3rem; padding: max(.3rem, env(safe-area-inset-top)) .4rem .3rem; background: var(--ui-panel); border-bottom: 1px solid var(--ui-line); }
#boardwrap { grid-area: board; position: relative; overflow: hidden; background: var(--ui-stage); isolation: isolate; }
#line { grid-area: line; display: flex; align-items: center; background: var(--ui-panel); border-top: 1px solid var(--ui-line); }
#line #tools { flex: none; display: flex; padding-right: .2rem; }
#tools:empty { display: none; }
#dock { grid-area: dock; height: auto; min-height: 0; max-height: none; background: var(--ui-panel); border-top: 1px solid var(--ui-line); padding: .35rem .5rem max(.45rem, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: .35rem; }

/* ---- the players: chips; the active one's ring is the turn clock ---- */
#chips { flex: 1; display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; min-width: 0; }
#chips::-webkit-scrollbar { display: none; }
/* more chips to scroll to (ui-game.js chipsFit): the strip fades at that edge */
#chips:is(.more, .less) { --m: linear-gradient(90deg, transparent, #000 var(--fl, 0px), #000 calc(100% - var(--fr, 0px)), transparent); mask-image: var(--m); -webkit-mask-image: var(--m); }
#chips.more { --fr: 1.5rem; } #chips.less { --fl: 1.5rem; }
/* You, How to play and Settings, in every screen's top bar (ui.js lookBar); the results open below it, so it stays in reach */
.look-bar { flex: none; display: flex; align-items: center; gap: .1rem; }
@media (max-width: 30em) { #bar .look-bar .icon, #bar #menub { min-width: 34px; } #bar .you-btn svg.avatar { width: 30px; height: 30px; }
  /* five or six at the table: the chips pack tighter */
  #game[data-n="5"] .chip, #game[data-n="6"] .chip { padding-left: .1rem; padding-right: .25rem; gap: .2rem; }
  #game[data-n="5"] #chips, #game[data-n="6"] #chips { gap: .15rem; } }
body:has(#game) .results-sheet { top: var(--barh, 0px); }
body:has(#game) .results-sheet .hx-panel { max-height: calc(100dvh - var(--barh, 0px) - .4rem); }
.hx .chip { flex: none; display: flex; align-items: center; gap: .3rem; min-height: var(--ui-tap); padding: .15rem .45rem .15rem .2rem; border: 1px solid transparent; border-radius: var(--ui-r-lg);
  background: transparent; color: var(--ui-text); font: 500 13px/1 var(--ui-body); position: relative; }
.hx .chip.active { background: var(--ui-panel-2); border-color: var(--c); }
.hx .chip.off { opacity: .5; }
.chip.emoting { border-color: var(--ui-accent-2); }
/* the ring is the player's colour; on the player in turn it drains as their time runs down */
.chip .ring { position: relative; width: 34px; height: 34px; flex: none; display: grid; place-items: center; --left: 1; --ring: var(--c); border-radius: 50%;
  /* hairlines inside and outside the coloured band, so a black or white ring shows on any skin */
  box-shadow: 0 0 0 1px var(--ui-edge); background: radial-gradient(circle, transparent 11.5px, var(--ui-edge) 12px 13px, transparent 13.5px); }
.chip.low .ring { --ring: var(--ui-danger); }
.chip .ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--ring) calc(var(--left) * 360deg), color-mix(in srgb, var(--ui-text) 14%, transparent) 0);
  -webkit-mask: radial-gradient(circle, transparent 12.5px, #000 13px); mask: radial-gradient(circle, transparent 12.5px, #000 13px); }
.chip .ring b { position: relative; font: 18px/1 var(--ui-num); color: var(--ui-text); }
.chip .nm { max-width: 6.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:not(.active) .nm { display: none; }                      /* only the player in turn shows a name: six fit on a phone */
.chip .nm i { font: 13px/1 var(--ui-label); font-style: normal; color: var(--ui-muted); text-transform: uppercase; }
.chip .ans { position: absolute; top: 0; right: -2px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; font: 700 12px/1 var(--ui-body); background: var(--ui-panel-2); border: 1px solid var(--ui-line); }
.chip .ans.yes { background: var(--ui-good); color: var(--ui-good-ink); border-color: var(--ui-good); }
.chip .ans.no { color: var(--ui-danger); }
/* symbols on player colours: the colour's symbol tucked into the ring */
/* a board piece of a player who shares their colour: their number beside it (ui-board.js pieceMark) */
.pc-mark circle { fill: var(--c); stroke: var(--ui-edge); stroke-width: 1.5; }
.pc-mark text { fill: var(--ci, var(--ui-ink-dark)); font: 700 12px/1 system-ui, sans-serif; }
/* teams (05/10): a shared colour's number bottom left (the colour-blind symbol has the right), the team top left */
.chip .ring .mk { right: auto; left: -5px; }
.chip .ring .tmk, .pl-top .ring .tmk { position: absolute; left: -6px; top: -5px; height: 15px; padding: 0 7px 0 4px; display: grid; place-items: center;
  /* a team is a pennant ("T1", a notched flag with a band down its mast): never the round, colour-filled disc of a shared colour's number */
  clip-path: polygon(0 0, 100% 0, 78% 50%, 100% 100%, 0 100%); background: var(--ui-text); color: var(--ui-bg); box-shadow: inset 3px 0 0 var(--ui-accent-2);
  font: 700 10px/1 var(--ui-body); font-style: normal; letter-spacing: .02em; }
body.cb .chip .ring::after { content: attr(data-sym); position: absolute; right: -3px; bottom: -3px; font: 11px/1 system-ui, sans-serif; color: var(--c); text-shadow: 0 0 2px var(--ui-bg), 0 0 2px var(--ui-bg); }

/* ---- over the board: the round, the view buttons, trade offers ---- */
.hud { position: absolute; left: .6rem; right: 3.4rem; top: .45rem; z-index: 2; font: 18px/1.05 var(--ui-label); color: var(--ui-accent); text-transform: var(--caps, uppercase); letter-spacing: .04em; pointer-events: none; text-shadow: var(--ui-lift); }
.hud small { display: block; font-size: 15px; color: var(--ui-text); opacity: .8; }
/* a soft patch of the skin's ground behind the text: the sky's sun and moon pass under it without crossing the words */
.hud::before { content: ""; position: absolute; inset: -.15rem -.5rem -.1rem -.4rem; z-index: -1; border-radius: .8rem; background: color-mix(in srgb, var(--ui-bg) 86%, transparent); filter: blur(6px); }
.view-btns { position: absolute; right: .4rem; top: .35rem; z-index: 2; display: flex; flex-direction: column; gap: .3rem; }
.view-btns .icon { background: color-mix(in srgb, var(--ui-panel) 80%, transparent); border-color: var(--ui-line); min-width: 38px; min-height: 38px; }
.view-btns .icon svg { width: 20px; height: 20px; }
#tradepops { position: absolute; left: 50%; bottom: .5rem; top: auto !important; transform: translateX(-50%); z-index: 4; width: min(26rem, calc(100% - 1rem)); max-height: 55%; overflow: auto; display: flex; flex-direction: column-reverse; gap: .4rem; pointer-events: none; }
#tradepops .tp { border-radius: var(--ui-r-lg); background: color-mix(in srgb, var(--ui-panel) 95%, transparent); }

/* ---- the ticker: the latest move in one line ---- */
#ticker { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5rem; min-height: var(--ui-tap); padding: 0 .75rem; border: 0; border-radius: 0; box-shadow: none;
  background: var(--ui-panel); color: var(--ui-muted); font: 14px/1.2 var(--ui-body); text-align: left; justify-content: flex-start; }
#ticker span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* a player's colour before their name in the log (ui-game.js logHtml) */
.pdot { display: inline-block; width: .55em; height: .55em; margin: 0 .25em .08em 0; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px var(--ui-edge, rgb(0 0 0 / .4)); vertical-align: middle; }
#ticker i.badge { flex: none; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; display: grid; place-items: center; font: 700 11px/1 var(--ui-body); font-style: normal;
  background: var(--ui-accent-2); color: var(--ui-accent-ink); }
#ticker .tk-all { display: none; }
/* the feed: the last moves in the dock's spare height, on a wide screen only */
#feed { display: none; }

/* ---- the dock: the tray, your storage, the primary button ---- */
/* the tray keeps one height in every context, so the board never resizes as turns change */
#tray { height: 124px; flex: none; }
#tray:empty { visibility: hidden; }
#tray.items:has(> :nth-child(13)), #tray.tall { height: 184px; }   /* a third row (road pieces, 07/10): as tall as the two, not squeezed into them */
#tray.tall { box-sizing: border-box; }   /* (V2: three rows in every context, a note's padding inside it, so the board never jumps) */
.hx.big #tray.items:has(> :nth-child(13)) { height: auto; }
/* everything you can explore or build, at once: two rows of six, no scrolling (his, 04/10) */
#tray.items { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: .25rem; }
.hx #tray .item { position: relative; min-width: 0; min-height: 0; height: auto; padding: .2rem .1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .05rem;
  background: var(--ui-panel-2); border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); color: var(--ui-text); touch-action: none; user-select: none; -webkit-user-select: none; }
.hx #tray .item.explore { border-style: dashed; }
.hx #tray .item.on { border-color: var(--ui-accent-2); box-shadow: inset 0 0 0 1px var(--ui-accent-2); }
.hx #tray .item.off { opacity: .55; }   /* (.38 left the cost unreadable) */
.hx #tray .item svg { width: 20px; height: 20px; flex: none; }
.hx #tray .item span { font: 11.5px/1.35 var(--ui-body); text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 1px; flex: none; }
.hx #tray .item small { font: 12px/1.2 var(--ui-num); color: var(--ui-muted); white-space: nowrap; display: flex; align-items: center; flex: none; }
.hx #tray .item small .cost { gap: 0; flex-wrap: nowrap; }   /* a two-part cost on one line: wrapped, it pushed the icon out of the card's top (desktop dock, 1px narrower) */
.hx #tray .item small svg { width: 12px; height: 12px; }
.hx #tray .item .left { position: absolute; top: 2px; right: 3px; font: 11px/1 var(--ui-num); font-style: normal; color: var(--ui-muted); }
.hx #tray .item .left.travel { display: flex; align-items: center; color: var(--ui-text); }
.hx #tray .item .left.travel svg { width: 10px; height: 10px; }
/* someone else's turn: the same tray, greyed and priced for your next turn; a tap says why it can't be bought (his, 05/10) */
.hx #tray.offturn .item { filter: saturate(.35); opacity: .7; border-style: dotted; cursor: help; }
.hx #tray.offturn .item.off { opacity: .4; }
.hx #tray.offturn .tray-status { filter: none; opacity: 1; border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 14%, var(--ui-panel-2)); cursor: default; gap: 0; }
.hx #tray .tray-status b { font: 12px/1.2 var(--ui-label); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ui-text); }
.hx #tray .tray-status span { font-size: 10px; color: var(--ui-text); }
/* Sugar Blossom's rounded face runs wide: a touch smaller in the tray, so 'Mountain' and 'Barricade' stay whole */
html[data-skin="blossom"] .hx #tray .item span { font-size: 10.5px; letter-spacing: -.02em; }
@media (max-width: 400px) { html[data-skin="blossom"] .hx #tray .item span { font-size: 10px; } }
.hx #tray .tray-status small { font: 9.5px/1.1 var(--ui-body); white-space: normal; text-align: center; margin-top: .1rem; }
/* Bigger text zooms the dock by 1.15: the tray's rows may grow, and each card keeps its label and costs on one line */
.hx.big #tray { height: auto; min-height: 124px; }
.hx.big #tray .item span { font-size: 10.5px; padding: 0; }   /* the 1px sides cost 'Barricade' its last letter in the zoomed desktop dock */
.hx.big #tray .item small .cost svg { width: 13px !important; height: 13px !important; }
/* a narrow phone (320 to 400 wide): tighter gaps and a smaller label and cost, so 'Barricade', 'Mountain' and a two-part cost fit whole */
@media (max-width: 400px) {
  .hx #tray.items { gap: .15rem; }
  .hx #tray .item { padding-left: 0; padding-right: 0; }
  .hx #tray .item span { font-size: 10.5px; }
  .hx.big #tray .item span { font-size: 9.5px; }   /* x1.15 zoom: still bigger on screen than the plain 10.5 */
  .hx #tray .item small .cost svg { width: 12px !important; height: 12px !important; }
  .hx #tray .item small .cost .c { font-size: 14px; gap: 0; }
}
/* the smallest phones held upright (320 wide, 568 tall): the piece cards drop their names, icon and price only (an action card, Adapt or Relic, keeps its word) (the name is
   in each card's label, and a long press shows its whole card), so the three-row tray, and the drawn tiles in its place,
   give the board back about 30px in every step alike */
@media (orientation: portrait) and (max-width: 340px) and (max-height: 640px) {
  #tray.items:has(> :nth-child(13)), #tray.tall { height: 150px; }
  #tray.items:not(.draft-tray) .item[data-mode] > span:not(.tray-group) { display: none; }
}
/* 320 wide: 10px labels; with Bigger text there is no room for a bigger tray, so it stays the plain size (the rest of the dock keeps the zoom) */
@media (max-width: 340px) { body.big #tray { zoom: .9; } .hx #tray .item span, .hx.big #tray .item span { font-size: 10px; } }
/* placing a piece, or a note on what's happening: one framed line */
#tray.placing, #tray.note { display: flex; align-items: center; gap: .55rem; padding: .25rem .5rem; background: var(--ui-panel-2); border: 1px solid var(--ui-accent-2); border-radius: var(--ui-r-lg); font: 14px/1.3 var(--ui-body); }
#tray.note { border-color: var(--ui-line); color: var(--ui-muted); }
#tray.placing > svg { width: 32px; height: 32px; flex: none; }
#tray.placing span { flex: 1; }
#tray.placing small { display: block; color: var(--ui-muted); }
/* a piece dragged from the tray */
.drag-ghost { position: fixed; left: -24px; top: -24px; z-index: 60; width: 48px; height: 48px; pointer-events: none; filter: drop-shadow(0 6px 10px rgb(var(--ui-shade) / .6)); }
.drag-ghost svg { width: 100%; height: 100%; }
/* the storage always keeps room for its counts: the button takes what is left, wraps its words, and only when even that won't fit takes a line of its own */
#hudrow { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
#res { flex: 1 0 auto; display: flex; gap: .2rem; }
#res .muted { font: 15px/1 var(--ui-label); text-transform: uppercase; }
/* what just changed: up, down, or about to be gathered */
#res .rc i { position: absolute; top: -11px; right: 0; font: 13px/1 var(--ui-num); font-style: normal; padding: 1px 3px; border-radius: 3px; background: var(--ui-panel); }
#res .rc i.up, #res .rc i.pend { color: var(--ui-good); }
#res .rc i.down { color: var(--ui-danger); }
@media (prefers-reduced-motion: no-preference) { .rc.bump b { animation: bump .5s ease-out; } }
@keyframes bump { 40% { transform: scale(1.3); } }
.hx #primary { flex: 1 1 7.2rem; min-width: 7.2rem; max-width: 100%; white-space: normal; text-align: center; min-height: 52px; padding: .3rem .8rem; flex-direction: column; gap: 0; border-radius: var(--ui-r-lg);
  background: var(--ui-accent); color: var(--ui-accent-ink); border: 0; font: 600 16px/1.1 var(--ui-body); }
.hx #primary small { font: 13px/1.1 var(--ui-num); opacity: .85; display: flex; gap: .15rem; align-items: center; }
.hx #primary small svg { width: 15px; height: 15px; }
.hx #primary.waiting { background: var(--ui-panel-2); color: var(--ui-text); border: 1px solid var(--ui-line); }
.hx #primary.waiting small { color: var(--ui-muted); }

/* ---- a phone held sideways: the dock becomes a side column ---- */
@media (orientation: landscape) and (max-height: 540px) {
  #game { grid-template-columns: minmax(0, 1fr) min(20rem, 40vw); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "bar dock" "board dock" "line dock"; }
  #dock { border-top: 0; border-left: 1px solid var(--ui-line); justify-content: flex-end; }
  /* the column is narrow but tall: four to a row, each as tall as its label and cost need */
  #tray { height: auto; min-height: 124px; }
  #tray.items { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(54px, auto); }
}
/* ---- a wide screen: the same, with room; the dock's spare height shows the last moves ---- */
@media (min-width: 60em) {
  #game { grid-template-columns: minmax(0, 1fr) 24rem; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "bar bar" "board dock" "board line"; }
  #dock { border-top: 0; border-left: 1px solid var(--ui-line); justify-content: flex-end; }
  #line { border-left: 1px solid var(--ui-line); }
  .chip .nm { display: inline !important; }
  #feed { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: .2rem; overflow: hidden; padding: .2rem .25rem;
    font: 14px/1.35 var(--ui-body); color: var(--ui-muted); cursor: pointer;
    -webkit-mask: linear-gradient(transparent, #000 4rem); mask: linear-gradient(transparent, #000 4rem); }
  #feed div:last-child { color: var(--ui-text); }
  #feed .chat { color: var(--ui-accent-2); }
  /* the feed shows the latest move, so the ticker only opens the log */
  #ticker span { display: none; }
  #ticker .tk-all { display: block; flex: 1; font: 15px/1 var(--ui-label); letter-spacing: .06em; text-transform: var(--caps, uppercase); }
  /* the tray at a mouse's reading size: the column has the height (the log takes what's left), so its rows grow
     instead of a phone's 124px, and the names, prices and icons are bigger; the board beside it never moves */
  #tray, #tray.tall, #tray.items:has(> :nth-child(13)) { height: auto; min-height: 124px; }
  #tray.items { grid-auto-rows: minmax(84px, auto); gap: .35rem; }
  .hx #tray .item { gap: .2rem; padding: 1.15rem .15rem .35rem; }   /* (the top clear of a group's label) */
  .hx #tray .item svg { width: 28px; height: 28px; }
  .hx #tray .item span:not(.tray-group) { font-size: 13.5px; }
  .hx #tray .item small { font-size: 14px; }
  .hx #tray .item small svg, .hx #tray .item small .cost svg { width: 15px !important; height: 15px !important; }
}

/* ---- one look for a player everywhere in a game (05/10 night): the chip's ring, avatar and badges ---- */
/* a shared colour's number: the player's own colour with its ink (the points badge is the panel's), as beside their settlements */
.chip .ring .mk, .pl-top .ring .mk { background: var(--c); color: var(--ci, var(--ui-ink-dark)); border-color: var(--ui-edge); }
/* the seat draw: each player as on their chip */
.seat-draw li .ring { flex: none; width: 30px; height: 30px; padding: 3px; box-sizing: border-box; border-radius: 50%; background: var(--cf, var(--c)); box-shadow: 0 0 0 1px var(--ui-edge); }
.seat-draw li .ring svg.avatar { width: 100%; height: 100%; border-radius: 50%; clip-path: circle(50%); background: var(--ui-panel-2); }
/* a player's sheet: the chip, bigger, beside the name */
.pl-top { display: flex; align-items: center; gap: .8rem; margin-bottom: .1rem; }
.pl-top h2 { margin: 0; overflow-wrap: anywhere; }
.pl-top .pl-bot { display: block; margin-top: .15rem; font: 13px/1 var(--ui-label); text-transform: uppercase; letter-spacing: .06em; color: var(--ui-muted); }
.pl-top .ring { position: relative; flex: none; width: 56px; height: 56px; padding: 4px; box-sizing: border-box; border-radius: 50%; background: var(--cf, var(--c)); box-shadow: 0 0 0 1px var(--ui-edge); }
.pl-top .ring svg.avatar { width: 100%; height: 100%; border-radius: 50%; clip-path: circle(50%); background: var(--ui-panel-2); }
.pl-top .ring .pts { position: absolute; right: -6px; bottom: -4px; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px; display: grid; place-items: center;
  background: var(--ui-panel); border: 1.5px solid var(--c); font: 17px/1 var(--ui-num); color: var(--ui-text); }
.pl-top .ring .mk { position: absolute; left: -5px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 3px; border-radius: 9px; display: grid; place-items: center; border: 1.5px solid; font: 700 11px/1 var(--ui-body); font-style: normal; }
.pl-top .ring .tmk { height: 17px; font-size: 11px; }
body.cb .pl-top .ring::after { content: attr(data-sym); position: absolute; right: -4px; top: -4px; font: 13px/1 system-ui, sans-serif; color: var(--c); text-shadow: 0 0 2px var(--ui-bg), 0 0 2px var(--ui-bg); }
/* their profile under it (account.js) needn't draw them and their name a second time */
.player-sheet .acct-prof .you-top > svg.you-av, .player-sheet .acct-prof .you-top h3 { display: none; }
/* the in-game menu: leaving for good sits apart, in the danger colour */
.hx .menu-sheet .menu-list .m-bye { color: var(--ui-danger); margin-top: .35rem; }
.emote-sheet h3 { margin: .9rem 0 .35rem; }
/* a phone held sideways: the dock column's spare height shows the last moves, as on a wide screen */
@media (orientation: landscape) and (max-height: 540px) {
  #feed { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: .15rem; overflow: hidden; padding: 0 .25rem;
    font: 13px/1.3 var(--ui-body); color: var(--ui-muted); cursor: pointer; -webkit-mask: linear-gradient(transparent, #000 2.5rem); mask: linear-gradient(transparent, #000 2.5rem); }
  #feed div:last-child { color: var(--ui-text); }
  #feed .chat { color: var(--ui-accent-2); }
  #ticker span { display: none; }
  #ticker .tk-all { display: block; flex: 1; font: 15px/1 var(--ui-label); letter-spacing: .06em; text-transform: var(--caps, uppercase); }
  .hx #primary { line-height: 1.05; }
  #res .rc { padding-left: 0; padding-right: 0; }
}

/* =====================================================================
   WHAT A TAP OPENS (ui-sheets.js): cards over the board, and sheets
   ===================================================================== */
/* ---- a card over the board: a tile or a piece ---- */
.pop { position: absolute; z-index: 5; width: min(17rem, calc(100% - 1rem)); padding: .6rem .7rem .6rem; background: var(--ui-panel); border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); box-shadow: var(--ui-shadow); font: 14px/1.35 var(--ui-body); animation: fade-in .16s ease-out; }
@media (prefers-reduced-motion: no-preference) { .pop { animation-name: rise-in; } }
.pop b { font: 600 15px/1.2 var(--ui-body); display: block; padding-right: 2rem; }
.pop p { margin: .25rem 0 .45rem; color: var(--ui-muted); }
.pop button.small { width: 100%; justify-content: space-between; margin-top: .25rem; }
.pop small.muted { display: block; font-size: 12px; margin-top: .15rem; }
.pop .pop-x { position: absolute; top: .1rem; right: .1rem; min-width: 36px; min-height: 36px; font-size: 14px; color: var(--ui-muted); }
.pop .react { display: flex; flex-wrap: wrap; gap: .15rem; margin-top: .45rem; padding-top: .4rem; border-top: 1px solid var(--ui-line); }
.pop .react .icon { min-width: 40px; min-height: 40px; padding: .1rem; }
.pop .react svg.emote { width: 30px; height: 30px; }
/* ---- a player's card: their storage ---- */
.res-row { display: flex; gap: .3rem; margin: .4rem 0; }
.res-row .rc { padding: .35rem .2rem; }
/* ---- trading and countering ---- */
.trade-sheet .trade-grid .r { display: flex; align-items: center; gap: .25rem; }
.trade-sheet .trade-grid .r small { font: 15px/1 var(--ui-num); color: var(--ui-muted); }
.trade-sheet .trade-grid .r svg { width: 22px; height: 22px; }
/* ---- the log ---- */
.log-sheet .log { max-height: 46dvh; overflow: auto; font: 14px/1.4 var(--ui-body); margin-bottom: .5rem; }
.log-sheet .log .chat { color: var(--ui-accent-2); }
/* ---- settings: the skins as little boards, then grouped rows with switches ---- */
.settings-sheet .hx-panel { max-height: 88dvh; }
.s-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .2rem; }
.s-head h2 { margin: 0; }
.settings-sheet h3 { margin: .9rem 0 .35rem; }
.skins { display: grid; grid-template-columns: repeat(2, 1fr); gap: .45rem; }     /* four skins: two by two on a phone, one row when wide */
@media (min-width: 560px) { .skins { grid-template-columns: repeat(4, 1fr); } }
.hx .skins .skin { flex-direction: column; align-items: stretch; gap: .3rem; min-height: 0; padding: .3rem .3rem .45rem; border-radius: var(--ui-r-lg); text-transform: none; letter-spacing: 0; }
.skins .skin svg { width: 100%; height: auto; border-radius: calc(var(--ui-r-lg) - 3px); display: block; }
.skins .skin b { font: 600 13px/1.2 var(--ui-body); text-align: center; }
.hx .skins .skin.on { border-color: var(--ui-accent); box-shadow: inset 0 0 0 2px var(--ui-accent); }
/* grouped rows (settings, and a game's public switch) */
.sgroup { background: var(--ui-panel-2); border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); overflow: hidden; }
.srow { display: flex; align-items: center; gap: .8rem; min-height: 50px; padding: .3rem .8rem; border-bottom: 1px solid var(--ui-line); font: 15px/1.25 var(--ui-body); color: var(--ui-text); }
.srow:last-child { border-bottom: 0; }
.srow span { flex: 1; }
.srow input[type=range] { flex: 0 1 45%; accent-color: var(--ui-accent); }

/* =====================================================================
   THE END (ui-end.js): results, the bots' record, the replay
   ===================================================================== */
/* The end of a game (09/10): a Game over card in the middle of the dimmed board, who won, the final points,
   Menu and Rematch; Details turns the same sheet into the ranking with what scored, then tabs below it
   (beside it on a wide screen). The replay plays in the dock. */
.results-sheet { align-items: center; padding: .6rem; background: rgb(var(--ui-shade) / .62); }
@supports (backdrop-filter: blur(2px)) { .results-sheet { backdrop-filter: blur(2px) saturate(.7); } }
.results-sheet .hx-panel { max-width: 27rem; max-height: 94dvh; padding: 1rem 1rem max(1rem, env(safe-area-inset-bottom)); border-radius: var(--ui-r-lg); box-shadow: var(--ui-shadow); }
.results-sheet.r-detailed .hx-panel { max-width: 36rem; }
.results .r-card[hidden], .results .r-detail[hidden] { display: none; }
.r-card { position: relative; display: flex; flex-direction: column; gap: .85rem; }
.results .r-over { margin: 0; padding: 0 2.4rem; text-align: center; font: 400 clamp(30px, 9vw, 42px)/1 var(--ui-head); letter-spacing: .03em; color: var(--ui-text); }
.r-over small { display: block; margin-top: .3rem; font: 14px/1 var(--ui-label); letter-spacing: .1em; text-transform: uppercase; color: var(--ui-muted); }
.hx .r-card .r-x { position: absolute; top: -.4rem; right: -.4rem; font-size: 16px; color: var(--ui-muted); }
.r-card .r-hero { justify-content: center; padding: .7rem .8rem; border-radius: var(--ui-r-lg); background: color-mix(in srgb, var(--c) 14%, var(--ui-panel-2)); border: 1px solid color-mix(in srgb, var(--c) 55%, var(--ui-line)); }
.r-card .r-disc { width: 56px; height: 56px; font-size: 32px; }
.r-rank.r-final li { min-height: 40px; padding-top: .15rem; padding-bottom: .15rem; }
.r-final .r-pts { font-size: 24px; }
.r-final .tm-badge { flex: none; }
/* Menu and Rematch side by side, the vote's names and hint under them, Details last and small */
.r-next { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .5rem; }
.r-next .r-vote { display: contents; }
.r-next > :not(.big):not(.r-vote), .r-next .r-vote > :not(#r-again) { grid-column: 1 / -1; }
.r-next:not(:has(#r-again, #r-watch)) > .big { grid-column: 1 / -1; }
.hx .r-next .big { width: 100%; min-height: 64px; display: flex; flex-direction: column; gap: .15rem; font: 600 20px/1.1 var(--ui-body); text-transform: none; letter-spacing: 0; border-radius: var(--ui-r-lg); }
.hx .r-next .big small { font: 400 12.5px/1.2 var(--ui-body); opacity: .85; text-transform: none; letter-spacing: 0; }
.hx .r-next .big:not(.primary) { background: transparent; color: var(--ui-accent); border: 0; box-shadow: inset 0 0 0 2px var(--ui-accent); }
.hx .r-next #r-again.voted { background: color-mix(in srgb, var(--ui-accent) 20%, var(--ui-panel-2)); color: var(--ui-text); }
.hx .r-next .r-more-btn { justify-self: center; display: flex; flex-direction: column; align-items: center; gap: .1rem; min-height: 44px; padding: .3rem 1.1rem; border-radius: var(--ui-pill); font: 600 15px/1.1 var(--ui-body); text-transform: none; letter-spacing: 0; position: relative; }
.hx .r-next .r-more-btn small { font: 400 12px/1.1 var(--ui-body); color: var(--ui-muted); }
/* what the game paid an account waits behind Details: a dot says it's there */
.results-sheet:has(.acct-pay) #r-details::after { content: ""; position: absolute; top: 6px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--ui-accent-2); }
.r-detail { display: flex; flex-direction: column; gap: 1rem; }
.r-detail-h { display: flex; align-items: center; gap: .7rem; }
.r-detail-h h3 { margin: 0; }
.results { display: block; }
.r-main { display: flex; flex-direction: column; gap: .75rem; }
.r-hero { display: flex; align-items: center; gap: .85rem; padding-right: 2.6rem; position: relative; }
.r-disc { flex: none; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: var(--c); text-shadow: 0 0 6px color-mix(in srgb, var(--c) 70%, transparent); color: var(--ci, var(--ui-ink-dark));
  font: 40px/1 var(--ui-num); box-shadow: inset 0 0 0 3px rgb(var(--ui-shade) / .22), 0 0 0 3px var(--ui-panel), 0 0 0 5px var(--c), 0 0 0 6px color-mix(in srgb, var(--ui-text) 25%, transparent); }
.r-hero.shared .r-disc { background: linear-gradient(115deg, var(--c) 50%, var(--c2) 50%); }      /* a shared win: both colours */
.r-title { min-width: 0; }
.r-title small { display: block; font: 14px/1 var(--ui-label); letter-spacing: .1em; text-transform: uppercase; color: var(--ui-muted); }
.hx-modal .r-title h2 { margin: .2rem 0 .1rem; font: 400 clamp(26px, 8vw, 34px)/1.05 var(--ui-head); color: var(--ui-accent); overflow-wrap: anywhere; }
.r-title p { margin: 0; font: 15px/1.2 var(--ui-body); color: var(--ui-muted); }
/* the ranking: place, colour, who and what scored, points */
.r-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.r-rank li { position: relative; overflow: hidden; display: flex; align-items: center; gap: .55rem; min-height: 48px; padding: .3rem .7rem .3rem .75rem; background: var(--ui-panel-2); border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); }
/* each player's colour: a bar down the row's edge, in the colour's own paint (a gradient or pattern: ui-end.js --p) */
.r-rank li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--p, var(--c)); box-shadow: 1px 0 0 color-mix(in srgb, var(--ui-text) 25%, transparent); }
.r-rank li.r-team::before { content: none; }
.r-rank li.me { border-color: var(--c); }
.r-place { flex: none; width: 1.3rem; text-align: center; font: 20px/1 var(--ui-num); color: var(--ui-muted); }
.r-rank li:first-child .r-place { color: var(--ui-accent); }
.r-rank:has(.tie) .r-place { width: 1.9rem; }      /* a shared place reads '=3' */
.r-rank .r-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .12rem; }
.r-rank .r-who b { font: 600 15px/1.15 var(--ui-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-rank .r-who b i { font: 13px/1 var(--ui-label); font-style: normal; text-transform: uppercase; letter-spacing: .06em; color: var(--ui-muted); margin-left: .25rem; }
.r-rank .r-who small { font: 12.5px/1.2 var(--ui-body); color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-pts { flex: none; min-width: 2ch; text-align: right; font: 28px/1 var(--ui-num); color: var(--ui-text); }
/* a team game (05/10): each team one place, its total on the right; its players under it, smaller, each with their own points */
.r-rank li.r-team { flex-direction: column; align-items: stretch; gap: .25rem; padding: .35rem .5rem .45rem .6rem; box-shadow: none; }
.r-team-h { display: flex; align-items: center; gap: .5rem; min-height: 40px; padding-right: .2rem; }
.r-rank.r-teams .r-place { width: 1.9rem; }
.r-members { list-style: none; margin: 0 0 0 2.2rem; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.r-rank .r-members li { min-height: 40px; padding: .2rem .6rem .2rem .55rem; background: var(--ui-panel); }
.r-members .r-pts { font-size: 22px; color: var(--ui-muted); }
.r-rank li.r-team:first-child > .r-team-h .r-place { color: var(--ui-accent); }
/* what's next: one big button, the rest as chips */
.r-go { display: flex; flex-direction: column; gap: .55rem; }
.hx .r-go .big { min-height: 60px; font-size: 19px; text-transform: none; letter-spacing: 0; }
.r-chips { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; }
.r-hint { margin: 0; text-align: center; font: 13px/1.3 var(--ui-body); color: var(--ui-muted); }
/* the detail: tabs as one segmented row */
.r-more { min-width: 0; }
.r-tabs { margin-bottom: .7rem; }
.hx .r-tabs button { min-height: 38px; padding: .2rem .3rem; font: 500 14px/1 var(--ui-body); text-transform: none; letter-spacing: 0; }
.r-pane h3:first-child { margin-top: 0; }
.r-lab { font: 14px/1 var(--ui-label); letter-spacing: .08em; text-transform: uppercase; color: var(--ui-accent); }
.sm-sw { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: var(--p, var(--c)); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--ui-text) 60%, transparent); margin-right: .35rem; vertical-align: -.05rem; }
/* the points race */
.sm-chart { display: block; width: 100%; height: auto; max-height: 15rem; margin: 0 0 .4rem; background: var(--ui-panel-2); border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); }
.sm-grid { stroke: var(--ui-line); stroke-width: 1; }
.sm-ax { font: 13px var(--ui-num); fill: var(--ui-muted); }
.sm-lab { font: 15px var(--ui-num); fill: var(--ui-text); }
/* a thin outline in the text's colour round each line and dot (dark on light skins, light on noir),
   so a white player shows on atlas cream and a black one on noir */
.sm-halo { fill: none; stroke: color-mix(in srgb, var(--ui-text) 60%, transparent); stroke-width: 3.6; stroke-linejoin: round; }
.sm-dot { stroke: color-mix(in srgb, var(--ui-text) 60%, transparent); stroke-width: 1.3; }
.sm-legend { display: flex; flex-wrap: wrap; gap: .2rem .9rem; font: 13px/1.4 var(--ui-body); color: var(--ui-muted); }
/* awards */
.sm-awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .4rem; }
.sm-aw { display: grid; gap: .25rem; padding: .5rem .6rem; background: var(--ui-panel-2); border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); font: 13.5px/1.25 var(--ui-body); }
.sm-aw b { font: 20px/1 var(--ui-num); color: var(--ui-accent-2); }
/* tables: trades and totals */
.r-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 .5rem; scrollbar-width: thin;
  /* a shade at the right edge while there's more to scroll to (the cover scrolls with the table, the shade stays) */
  background: linear-gradient(to left, var(--ui-panel) 40%, transparent) right / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 100% 50%, rgb(var(--ui-shade) / .35), transparent) right / 12px 100% no-repeat scroll; }
/* the names stay put while the numbers scroll under them */
.r-t tbody th, .r-t thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--ui-panel); }
.sm-t thead th { letter-spacing: .02em; }
.sm-t th, .sm-t td { padding-left: .3rem; padding-right: .3rem; }
/* a phone: tokens held are left out (and Bank swaps too, in an old game with the Bank's tax column; summary.js), and "Gathered" shortens to "Got" */
@media (max-width: 520px) { .sm-t .sm-wide, .sm-t .sm-l { display: none; } .r-t.sm-t thead th { font-size: 12px; letter-spacing: 0; } .r-t.sm-t th, .r-t.sm-t td { padding-left: .22rem; padding-right: .22rem; } }
@media (min-width: 521px) { .sm-t .sm-s { display: none; } }
.r-t { width: 100%; margin: 0; border-collapse: collapse; font: 14px/1.2 var(--ui-body); }
.r-t th, .r-t td { padding: .35rem .4rem; border: 0; border-bottom: 1px solid var(--ui-line); background: transparent; color: var(--ui-text); white-space: nowrap; }
.r-t thead th { font: 14px/1 var(--ui-label); letter-spacing: .06em; text-transform: uppercase; color: var(--ui-muted); text-align: right; }
.r-t tbody th { text-align: left; font-weight: 500; }
.r-t td { text-align: right; font: 18px/1 var(--ui-num); color: var(--ui-text); }
.r-t td b { color: var(--ui-accent); font-weight: 400; }
.tr-grid th, .tr-grid td, .tr-grid thead th { text-align: center; }
.tr-grid tbody th { text-align: left; }
.tr-grid thead th .sm-sw { margin: 0; }
.tr-grid td.tr-0 { color: var(--ui-muted); opacity: .45; }
.tr-grid td.tr-x { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--ui-line) 4px 5px); }
.r-note { margin: 0 0 .5rem; font: 14px/1.6 var(--ui-body); }
.r-note .r-lab { display: block; margin-bottom: .1rem; }
.r-note .r-who { white-space: nowrap; }
.r-note b { font: 18px/1 var(--ui-num); color: var(--ui-accent-2); font-weight: 400; }
/* how the bots do in real games (the server's record; the Records sheet shows it too) */
.bot-record { list-style: none; margin: 0 0 .4rem; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.bot-record li { display: grid; grid-template-columns: 6.5rem 1fr 4.6rem; align-items: center; gap: .6rem; font: 14px/1.2 var(--ui-body); }
.bot-record li b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-bar { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--ui-text) 12%, transparent); overflow: hidden; }
.br-bar i { display: block; height: 100%; background: var(--ui-accent-2); border-radius: inherit; }
.bot-record li.people .br-bar i { background: var(--ui-accent); }
.br-n { text-align: right; font: 18px/1 var(--ui-num); }
.br-n small { margin-left: .3rem; font: 12px/1 var(--ui-body); color: var(--ui-muted); }
/* the replay, in the dock: what happened, the slider, speed */
#tray.replay-tray { height: auto; min-height: 80px; }
#tray.replay-tray:empty { min-height: 0; }
.rp { display: flex; flex-direction: column; gap: .3rem; }
.rp-cap { margin: 0; font: 13.5px/1.3 var(--ui-body); color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.3em; }
.rp-row { display: flex; align-items: center; gap: .3rem; }
.rp-row input[type=range] { flex: 1; min-width: 0; min-height: 36px; padding: 0; border: 0; background: none; accent-color: var(--ui-accent); }
.hx .rp-row .icon { min-width: 40px; min-height: 40px; font-size: 14px; }
.hx .rp-row #rp-play { min-width: 4.6rem; min-height: 40px; }
.hx .rp-row #rp-save { min-height: 36px; }
.rp-speed { flex: 1; }
.hx .rp-speed button { min-height: 32px; padding: 0; font: 16px/1 var(--ui-num); }
/* a wide screen: the ranking and what's next on the left, the detail beside it */
@media (min-width: 60em) {
  .results-sheet .hx-panel { max-width: 29rem; padding: 1.4rem 1.5rem; }
  .results-sheet.r-detailed .hx-panel { max-width: 62rem; padding: 1.2rem 1.4rem; }
  .r-detail { display: grid; grid-template-columns: minmax(0, 25rem) minmax(0, 1fr); gap: 1rem 1.6rem; align-items: start; }
  .r-detail-h { grid-column: 1 / -1; }
  .r-more { padding-left: 1.6rem; border-left: 1px solid var(--ui-line); }
}
@media (min-width: 75em) { .results-sheet.r-detailed .hx-panel { max-width: 70rem; } }
/* a phone on its side: the same two columns (the ranking and what's next; the detail), the winner smaller */
@media (orientation: landscape) and (max-height: 540px) and (min-width: 600px) {
  .results-sheet { padding: .3rem; }
  .results-sheet .hx-panel, .results-sheet.r-detailed .hx-panel { max-width: 50rem; max-height: 96dvh; padding: .6rem 1rem max(.6rem, env(safe-area-inset-bottom)); }
  .r-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "over next" "hero next" "rank next"; gap: .5rem 1.2rem; align-items: start; }
  .results .r-over { grid-area: over; font-size: 28px; } .results .r-over small { display: inline; margin-left: .5rem; }
  .r-card .r-hero { grid-area: hero; padding: .4rem .6rem; } .r-card .r-final { grid-area: rank; } .r-next { grid-area: next; align-self: center; }
  .r-card .r-disc { width: 44px; height: 44px; font-size: 26px; }
  .r-rank.r-final { gap: .2rem; } .r-rank.r-final li { min-height: 30px; } .r-final .r-pts { font-size: 20px; }
  .hx .r-next .big { min-height: 56px; }
  .r-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .6rem 1.2rem; align-items: start; }
  .r-detail-h { grid-column: 1 / -1; }
  .r-more { padding-left: 1.2rem; border-left: 1px solid var(--ui-line); }
  .r-disc { width: 52px; height: 52px; font-size: 30px; }
  .hx-modal .r-title h2 { font-size: 26px; }
  .r-rank li { min-height: 42px; }
  .hx .r-go .big { min-height: 52px; }
}
/* a team's mark beside a name in the tables */
.r-t .tm-badge { display: inline-grid; width: 16px; height: 16px; margin-left: .3rem; vertical-align: -.1rem; font-size: 11px; background: var(--ui-accent-2); color: var(--ui-accent-ink); }

/* =====================================================================
   THE BOARD'S CUES (ui-board.js)
   ===================================================================== */
#board { position: relative; z-index: 1; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
#board.dragging { cursor: grabbing; }
.gt-pick { fill: transparent; stroke: var(--ui-accent-2); stroke-width: 3; stroke-dasharray: 6 6; cursor: pointer; }
.gt-pick.took { fill: color-mix(in srgb, var(--ui-accent) 24%, transparent); stroke: var(--ui-accent); stroke-width: 6; stroke-dasharray: none; }
/* the wreath: your two sides of the Horizon (home and far), outlined; gold once an Emitter of yours lights it */
.wr-side { fill: none; stroke-width: 3; stroke-dasharray: 3 7; stroke-linecap: round; opacity: .75; }
.wr-side.home { stroke: var(--ui-accent-2); }
.wr-side.far { stroke: var(--ui-accent); }
.wr-side.lit { stroke: #f2c230; stroke-dasharray: none; opacity: .9; }
.gt-res { opacity: .95; }
.wr-label { font: 600 19px var(--font-body, serif); paint-order: stroke; stroke: var(--ui-bg, #f6efe0); stroke-width: 4px; }
.wr-label.home { fill: var(--ui-accent-2); }
.wr-label.far { fill: var(--ui-accent); }
.gt-pick:focus-visible { outline: 0; stroke: var(--focus, var(--ui-accent-2)); stroke-width: 7; }
@media (prefers-reduced-motion: no-preference) { .gt-pick:not(.took) { animation: last-glow 1.6s ease-in-out infinite; } }
.site-hit { fill: transparent; stroke: var(--ui-accent-2); stroke-width: 2; stroke-dasharray: 4 5; cursor: pointer; }
@media (prefers-reduced-motion: no-preference) { .site-hit { animation: last-glow 1.6s ease-in-out infinite; } }
/* the settlement whose harvest sheet is open (ui-game.js harvestSheet) */
.hv-at { fill: color-mix(in srgb, var(--ui-accent) 22%, transparent); stroke: var(--ui-accent); stroke-width: 5; }
@media (prefers-reduced-motion: no-preference) { .hv-at { animation: last-glow 1.2s ease-in-out infinite; } }

/* the spots a keyboard can reach (Tab to one, Enter to tap it) */
#board [tabindex]:focus-visible { outline: 3px solid var(--focus, var(--ui-accent-2)); outline-offset: 1px; }
#board .piece-hit[tabindex]:focus-visible { outline: 0; stroke: var(--focus, var(--ui-accent-2)); stroke-opacity: .5; }
.hint-tile { fill: none; stroke-width: 2; stroke-dasharray: 3 6; opacity: .3; pointer-events: none; }

/* ---- account (progression, 05/10: account.js, photo.js) ---- */
svg.avatar { display: block; overflow: visible; }
/* the chips: the player's raccoon inside the colour ring, the points a badge on it */
.chip .ring.av svg.avatar { position: absolute; left: 4px; top: 4px; width: 26px; height: 26px; border-radius: 50%; clip-path: circle(50%); }
.chip .ring.av b.pts { position: absolute; right: -7px; bottom: -6px; z-index: 1; min-width: 18px; height: 18px; padding: 0 3px; border-radius: 9px; display: grid; place-items: center;
  background: var(--ui-panel); border: 1.5px solid var(--c); font: 14px/1 var(--ui-num); color: var(--ui-text); }
body.cb .chip .ring.av::after { bottom: auto; top: -4px; right: -4px; }
/* the start screen's You button: your raccoon, your Bits under it */
.hx .you-btn { position: relative; padding: 2px; }
.you-btn svg.avatar { width: 34px; height: 34px; }
.you-btn .bits { position: absolute; right: -4px; bottom: -4px; min-width: 18px; height: 16px; padding: 0 3px; border-radius: 8px; display: grid; place-items: center; background: var(--ui-accent-2); color: var(--ui-accent-ink); font: 13px/1 var(--ui-num); }
.bit-ico { width: .9em; height: .9em; vertical-align: -.08em; margin-right: .2em; shape-rendering: crispEdges; }
.bits-tag { display: inline-flex; align-items: center; font: 22px/1 var(--ui-num); color: var(--ui-text); }
.you-btn .new-dot { position: absolute; top: 1px; right: 1px; width: 9px; height: 9px; border-radius: 50%; background: var(--ui-accent); box-shadow: 0 0 0 2px var(--ui-bg); }
/* the You sheet: Bits with the way to the Shop beside them; three tabs under the header (the results' segmented row) */
.you-bits { display: flex; align-items: center; gap: .6rem; margin: .2rem 0 .1rem; }
.hx .you-bits #a-shop { min-height: 34px; padding: .2rem .9rem; }
.you-tabs { margin: .6rem 0 .4rem; }
.hx .you-tabs button { flex: 1 1 auto; min-height: 38px; padding: .2rem .3rem; gap: .3rem; font: 500 14px/1 var(--ui-body); text-transform: none; letter-spacing: 0; }
.you-tabs small { font: 13px/1 var(--ui-num); opacity: .8; }
.you-tabs .badge { min-width: 18px; height: 18px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--ui-accent-2); color: var(--ui-accent-ink); font: 700 11px/1 var(--ui-body); }
.you-pane > h3:first-child, .you-pane > h4:first-child { margin-top: .4rem; }
.you-top { display: flex; align-items: center; gap: .9rem; margin-bottom: .3rem; }
.you-top h2, .you-top h3 { margin: 0; }
.you-top p { margin: .15rem 0; }
.you-top svg.you-av { width: 84px; height: 84px; flex: none; border-radius: 50%; background: var(--ui-panel-2); box-shadow: 0 0 0 3px var(--ui-accent-2); }
/* what you wear: a row a slot, each choice drawn on you */
.wear-row { display: flex; gap: .4rem; overflow-x: auto; padding: 3px 3px .3rem; scrollbar-width: thin; }
.hx .wear { flex: none; display: flex; flex-direction: column; align-items: center; gap: .15rem; width: 76px; min-height: 0; padding: .3rem .2rem; border-radius: var(--ui-r); }
.wear svg.avatar { width: 54px; height: 54px; }
.wear small { font: 12px/1.1 var(--ui-body); text-align: center; white-space: normal; }
.hx .wear.on { box-shadow: 0 0 0 2px var(--ui-accent-2); background: var(--ui-panel-2); }
.hx .wear.locked { opacity: .55; }
/* achievements: by group; the earned ones lit */
.you-sheet h4 { margin: .6rem 0 .2rem; font: 13px/1 var(--ui-label); text-transform: uppercase; color: var(--ui-muted); }
.ach-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .3rem; }
.ach-list li { padding: .35rem .5rem; border: 1px solid var(--ui-line); border-radius: var(--ui-r); opacity: .55; }
.ach-list li.got { opacity: 1; border-color: var(--ui-accent-2); background: color-mix(in srgb, var(--ui-accent-2) 12%, transparent); }
.ach-list b { display: block; font: 600 14px/1.2 var(--ui-body); }
.ach-list small { display: block; font: 12.5px/1.25 var(--ui-body); color: var(--ui-muted); }
.acct-prof { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--ui-line); }
.acct-prof svg.you-av { width: 64px; height: 64px; }
/* sign up and sign in */
.acct-form { display: grid; gap: .55rem; }
.acct-form label { display: grid; gap: .2rem; font: 600 14px/1.2 var(--ui-body); }
.acct-form label small { font-weight: 400; color: var(--ui-muted); }
.acct-form input { width: 100%; box-sizing: border-box; }
/* the shop: each item on your own raccoon */
.shop-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .4rem; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .5rem .3rem; border: 1px solid var(--ui-line); border-radius: var(--ui-r); text-align: center; }
.shop-item.focus { border-color: var(--ui-accent-2); }
.shop-item svg.avatar { width: 72px; height: 72px; }
.shop-item b { font: 600 14px/1.2 var(--ui-body); }
.shop-item small { color: var(--ui-muted); font: 12.5px/1.2 var(--ui-body); }
/* phase 2-3 (account.js): swatches and previews in the shop, buying for a friend, the inbox, friends, titles */
.shop-item .colour-pv, .gift-inbox .colour-pv { width: 56px !important; height: 56px !important; }
.shop-item svg.variant-pv, .shop-item .skin-pv { width: 80px; height: 52px; }
.shop-item [data-gift] { margin-top: .1rem; }
.shop-away { border-left: 3px solid var(--ui-accent-2); padding-left: .5rem; }
.friend-list, .gift-inbox { list-style: none; margin: .2rem 0 .4rem; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.friend-list li, .gift-inbox li { display: flex; align-items: center; gap: .5rem; padding: .3rem .5rem; border: 1px solid var(--ui-line); border-radius: var(--ui-r); }
.friend-list li b { flex: 1; font: 600 14px/1.2 var(--ui-body); }
.friend-list.req li { border-color: var(--ui-accent-2); }
.gift-inbox li span { flex: 1; display: flex; flex-direction: column; }
.gift-inbox li small { color: var(--ui-muted); }
.gift-inbox svg.avatar, .gift-inbox svg.emote { width: 44px; height: 44px; }
small.ttl { display: block; font: italic 500 11px/1.15 var(--ui-body); color: var(--ui-accent-2); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip small.ttl { font-size: 9.5px; max-width: 8.5em; margin-top: -1px; }
.you-top small.ttl, .acct-prof small.ttl { font-size: 12.5px; }
#a-title { min-width: 12rem; }
/* what the last game paid, on the results */
.acct-pay { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35rem .6rem; margin-bottom: .5rem; padding: .4rem .6rem; border: 1px solid var(--ui-accent-2); border-radius: var(--ui-r); font: 14px/1.2 var(--ui-body); }
.acct-pay .ach-new, .acct-pay .drop-new { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .45rem; border-radius: var(--ui-pill); background: var(--ui-panel-2); font-weight: 600; }
.acct-pay .drop-new svg.avatar { width: 26px; height: 26px; }
/* the new emotes (05/10): a wave from the shoulder; a slow thought bubble */
svg.emote .em-wave { transform-box: fill-box; transform-origin: 15% 90%; }
@media (prefers-reduced-motion: no-preference) {
  svg.emote .em-wave { animation: em-wave .9s ease-in-out infinite; }
  svg.emote .em-slow { animation-duration: 3.2s; }
}
@keyframes em-wave { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(16deg); } }
/* skin variants (05/10, account.js VARIANTS): Midnight Blossom, the sweetshop after dark */
:root[data-skin="blossom"][data-variant="night"] {
  --bg: #241026;
  --stage:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='%23ffb3d6' opacity='.22'%3E%3Cpath d='M20 27c-5-4-7-6-7-9a3.5 3.5 0 0 1 7-1a3.5 3.5 0 0 1 7 1c0 3-2 5-7 9z'/%3E%3Cpath d='M92 20l1.6 4.4l4.4 1.6l-4.4 1.6l-1.6 4.4l-1.6-4.4l-4.4-1.6l4.4-1.6z'/%3E%3Ccircle cx='58' cy='52' r='2'/%3E%3Ccircle cx='110' cy='106' r='1.5'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(ellipse 70% 60% at 50% 45%, #3a1a40, #241026 60%, #160a18 100%);
  --panel: #321636; --panel-2: #3f1d45; --line: #5e2d63;
  --text: #fde6ef; --head: #ff8cc4; --muted: #c99ab8; --ink: #ffb3d6;
  --accent: #ff5fa8; --accent-ink: #ffffff; --accent-2: #b39bff; --glow: rgba(255,95,168,.45); --focus: #b39bff;
  --tile-grass: #6f9a78; --tile-forest: #4f8068; --tile-mountain: #8a76b0; --tile-water: #4f7fae; --tile-keep: #e0a94a;
  --shadow: 0 3px 0 #160a18, 0 10px 24px rgba(0,0,0,.4); --btn-shadow: 0 3px 0 #160a18;
  --pop-shadow: 0 1px 0 #160a18; --pop-shadow-lg: 0 2px 0 #160a18; --pop-drop: 0 6px 18px rgba(0,0,0,.45);
  --hud-lift: 0 1px 0 rgba(0,0,0,.6);
}
.variant-pv { display: block; width: 100%; }
.shop-item .variant-pv { width: 96px; height: 62px; border-radius: var(--ui-r); }
.shop-item svg.emote, .wear svg.emote { width: 64px; height: 64px; }
.hx .wear.em:disabled { opacity: 1; cursor: default; }

/* ---- extras ---- */
/* what's new: a dot on the start screen's chip until it's been read; the sheet's lists */
.home-chips .new-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ui-accent-2); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ui-accent-2) 30%, transparent); }
.news { margin: .1rem 0 .5rem; padding-left: 1.1rem; display: grid; gap: .3rem; font: 14.5px/1.35 var(--ui-body); }
.news li::marker { color: var(--ui-accent); }
.news-sheet h3:first-of-type { margin-top: .2rem; }
/* the skin from the lobby: the Settings sheet's cards */

/* ---- uix ---- */

/* a tray item you're short of, on your turn: its card ends with the trade that gets it (ui-game.js wantFor) */
.tray-card-sheet .want { margin: 0 0 .9rem; padding: .6rem .7rem .7rem; border-radius: var(--ui-r-lg); background: var(--ui-panel-2); border: 1px solid var(--ui-line); }
.tray-card-sheet .want p { margin: 0 0 .5rem; color: var(--ui-muted); font: 14px/1.35 var(--ui-body); }
.hx .tray-card-sheet .want button { width: 100%; min-height: 52px; flex-direction: column; gap: .15rem; flex-wrap: wrap; }
.tray-card-sheet .want button > span { display: inline-flex; align-items: center; gap: .2rem; flex-wrap: wrap; justify-content: center; }
.tray-card-sheet .want button i { font-style: normal; opacity: .8; margin: 0 .15rem; }
.tray-card-sheet .want button svg { width: 18px; height: 18px; vertical-align: -.25em; }
.tray-card-sheet .want button small { font: 400 12.5px/1.2 var(--ui-body); opacity: .85; text-transform: none; letter-spacing: 0; }

/* the price list (ui-sheets.js priceSheet): a compact table, the skin's own type and colours; tall enough to need no scrolling on a phone */
.price-sheet .hx-panel { max-height: 96dvh; }
.prices { width: 100%; border-collapse: collapse; margin: .2rem 0 .6rem; font: 14px/1.2 var(--ui-body); }
.prices .ph th { padding: .55rem .25rem .2rem; text-align: left; font: 13px/1 var(--ui-label); color: var(--ui-accent); text-transform: var(--caps, uppercase); letter-spacing: .04em; border-bottom: 1px solid var(--ui-line); }
.prices .ph th + th { text-align: right; color: var(--ui-muted); font-size: 11px; }
.prices td { padding: .14rem .25rem; border-bottom: 1px solid color-mix(in srgb, var(--ui-line) 55%, transparent); vertical-align: middle; }
.prices td.pi { width: 26px; padding-left: 0; }
.prices td.pi svg { width: 24px; height: 24px; display: block; }
.prices td b { display: block; font-weight: 600; color: var(--ui-text); }
.prices td small { display: block; font-size: 12px; line-height: 1.2; color: var(--ui-muted); }
.prices td.pc { text-align: right; white-space: nowrap; font-family: var(--ui-num); }
.prices td.pc .cost { display: inline-flex; flex-wrap: nowrap; gap: .3rem; justify-content: flex-end; }
.prices th, .prices td { border-left: 0; border-right: 0; border-top: 0; background: none; }
.prices td.pc svg { width: 14px; height: 14px; vertical-align: -.15em; }
.prices td.pp { text-align: right; width: 2.6rem; font: 16px/1 var(--ui-num); color: var(--ui-text); }
.prices .pex { display: grid; grid-template-columns: repeat(4, 1fr); gap: .25rem; text-align: center; }
.prices .pex > span { display: grid; justify-items: center; gap: .1rem; font-size: 12px; color: var(--ui-muted); }
.prices .pex b { font-weight: 600; color: var(--ui-text); font-size: 12px; }
.prices .pex > span > svg { width: 24px; height: 24px; }
.prices .pex .cost { display: inline-flex; gap: .15rem; align-items: center; }
.prices .pex .cost svg { width: 14px; height: 14px; }
.price-notes { margin: 0 0 .8rem; padding-left: 1.1rem; display: grid; gap: .25rem; color: var(--ui-muted); font: 13px/1.35 var(--ui-body); }
.price-notes li::marker { color: var(--ui-accent); }

/* the primary button's moment of grace as your turn starts and after gathering (ui-game.js renderPrimary):
   it fades up while a bar fills along its foot, and ignores taps until then */
.hx #primary { position: relative; overflow: hidden; }
.hx #primary.cooling { animation: p-cool-in var(--cool, 1s) ease-in both; }
.hx #primary.cooling::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; pointer-events: none;
  background: currentColor; opacity: .55; transform-origin: left; animation: p-cool-bar var(--cool, 1s) linear both; }
@keyframes p-cool-in { from { opacity: .5; } to { opacity: 1; } }
@keyframes p-cool-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .hx #primary.cooling { animation: none; opacity: .6; } .hx #primary.cooling::after { animation: none; transform: none; } }

/* social (05/10): the rematch vote on the results, the watchers' chat tab, muting, the rating (net.js SOCIAL, ui-end.js, ui-sheets.js logSheet) */
.r-vote { display: flex; flex-direction: column; gap: .5rem; align-items: stretch; }
.hx .r-vote .big.voted { background: var(--ui-panel-2); color: var(--ui-text); box-shadow: inset 0 0 0 2px var(--ui-accent); }
.r-votes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; }
.r-votes li { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem .15rem .2rem; border-radius: var(--ui-pill); border: 1px solid var(--ui-line); background: var(--ui-panel-2); font: 13px/1.2 var(--ui-body); color: var(--ui-muted); }
.r-votes li.yes { border-color: var(--c); color: var(--ui-text); }
.r-votes li.off { opacity: .6; }
.r-votes li b { font: 700 14px/1 var(--ui-body); color: var(--ui-muted); }
.r-votes li:not(.yes) b { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ui-muted); }     /* not yet: an empty ring (an ellipsis read as a cut-off name) */
.r-votes li.yes b { color: var(--ui-good); }
.r-votes svg.rv-av { width: 26px; height: 26px; border-radius: 50%; background: var(--ui-panel); box-shadow: 0 0 0 2px var(--c); }
.hx .r-vote #r-ahead { align-self: center; }
.lg-tabs { margin-bottom: .5rem; }
.lg-tabs .badge { min-width: 18px; height: 18px; padding: 0 4px; margin-left: .3rem; border-radius: 9px; display: inline-grid; place-items: center; vertical-align: 1px; background: var(--ui-accent-2); color: var(--ui-accent-ink); font: 700 11px/1 var(--ui-body); font-style: normal; letter-spacing: 0; }
.log-sheet .log.spec .chat b { color: var(--ui-text); margin-right: .2rem; }
.log-sheet .mutes { margin-top: .6rem; font: 14px/1.3 var(--ui-body); }
.log-sheet .mutes summary { cursor: pointer; color: var(--ui-muted); }
.log-sheet .mutes .row { flex-wrap: wrap; gap: .3rem; }
.hx .log-sheet .mutes button.on { background: var(--ui-panel-2); color: var(--ui-muted); }
.rating { color: var(--ui-text); font-weight: 600; }
.acct-pay .rating-new { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .45rem; border-radius: var(--ui-pill); background: var(--ui-panel-2); font-weight: 600; }

/* resources on the move (ui-game.js resFly): a token from where it came from to whoever gains it, yours to your counter in the dock */
.res-fly { position: fixed; left: -9px; top: -9px; z-index: 70; width: 18px; height: 18px; pointer-events: none; filter: drop-shadow(0 1px 3px rgb(var(--ui-shade, 0 0 0) / .5)); }
.res-fly svg { width: 100%; height: 100%; display: block; }

/* ---- the specialisations (06/10): the start picker in setup's tray, and a camp's upgrade sheet ---- */
#tray.note:has(.start-pick) { color: var(--ui-text); }
.start-pick { display: flex; flex-direction: column; gap: .3rem; width: 100%; }
.start-pick small { display: block; color: var(--ui-muted); font-size: 12px; }
.sp-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .25rem; }
.sp-row button { display: flex; flex-direction: column; align-items: center; gap: .1rem; min-height: var(--ui-tap); padding: .2rem .1rem; font: 11px/1.1 var(--ui-body); }
.sp-row button svg { width: 24px; height: 24px; }
.sp-row button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-row button.on { border-color: var(--ui-accent); box-shadow: inset 0 0 0 2px var(--ui-accent); color: var(--ui-text); }
.up-list { list-style: none; margin: .3rem 0 .5rem; padding: 0; display: grid; gap: .35rem; }
.up-row { display: grid; grid-template-columns: 34px 1fr auto; gap: .5rem; align-items: center; padding: .35rem .4rem; border: 1px solid var(--ui-line); border-radius: var(--ui-r); background: var(--ui-panel-2); }
.up-row > svg { width: 34px; height: 34px; }
.up-row p { margin: .1rem 0 0; font: 13px/1.25 var(--ui-body); color: var(--ui-muted); }
.up-row small { color: var(--ui-muted); font-size: 12px; }
.up-row button { min-height: var(--ui-tap); white-space: nowrap; display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.up-row .up-verb { font: 600 11px/1 var(--ui-label); text-transform: uppercase; letter-spacing: .06em; }   /* the verb over the price: what the tap does */
.up-row.off { opacity: .8; }

/* ---- the harvest sheets (ui-game.js harvestSheet): one settlement at a time, then the summary ---- */
.hx-modal.harvest-sheet { background: rgb(var(--ui-shade) / .3); }   /* light: the ringed settlement on the board shows through */
.harvest-sheet .hx-panel { max-height: 92dvh; padding: .7rem 1rem max(.8rem, env(safe-area-inset-bottom)); }
.hv-top small { display: block; font: 12px/1.2 var(--ui-label); letter-spacing: .06em; text-transform: uppercase; color: var(--ui-muted); }
.hv-top h2 { display: flex; align-items: center; gap: .4rem; margin: .1rem 0 0; }
.hv-top h2 svg { width: 28px; height: 28px; flex: none; }
.harvest-sheet .g-ring { max-height: 40dvh; margin: .2rem auto; }
.harvest-sheet .g-tile { fill: transparent; stroke: var(--ui-accent-2); stroke-width: 3; stroke-dasharray: 6 6; }
.harvest-sheet .g-tile.took { fill: color-mix(in srgb, var(--ui-accent) 24%, transparent); stroke: var(--ui-accent); stroke-width: 7; stroke-dasharray: none; cursor: pointer; }
.harvest-sheet .g-tile:focus-visible { outline: 0; stroke: var(--focus, var(--ui-accent-2)); stroke-width: 7; }
.harvest-sheet .g-res, .harvest-sheet .g-res.took { opacity: 1; }
.harvest-sheet .g-res > circle { fill: color-mix(in srgb, var(--ui-panel) 86%, transparent); stroke: var(--ui-line); stroke-width: 2; }
.harvest-sheet .g-res.took > circle { stroke: var(--ui-accent); stroke-width: 3; }
.g-check circle { fill: var(--ui-accent); }
.g-check path { fill: none; stroke: var(--ui-accent-ink, #000); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.g-bonus rect { fill: color-mix(in srgb, var(--ui-panel) 90%, transparent); stroke: var(--ui-accent-2); stroke-width: 1.5; }
.g-bonus text { font: 14px/1 var(--ui-num); fill: var(--ui-text); }
.hv-line { display: flex; align-items: center; gap: .6rem; min-height: 28px; font: 14px/1.3 var(--ui-body); }
.hv-line .cost svg { width: 18px; height: 18px; }
.harvest-sheet .pips { display: inline-flex; gap: 5px; flex: none; }
.harvest-sheet .pips i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ui-accent); }
.harvest-sheet .pips i.full { background: var(--ui-accent); }
.harvest-sheet.advance .g-ring { opacity: .75; transition: opacity .3s; }
.hv-sum { list-style: none; margin: .5rem 0; padding: 0; }
.hv-sum li { display: flex; align-items: center; gap: .55rem; padding: .45rem 0; border-bottom: 1px solid var(--ui-line); font: 15px/1.3 var(--ui-body); }
.hv-sum li > svg { width: 26px; height: 26px; flex: none; }
.hv-sum li > span:not(.cost) { flex: 1; }
.hv-sum .cost svg, .hv-all .cost svg { width: 20px; height: 20px; }
.hv-all { display: flex; align-items: center; gap: .5rem; font: 17px/1.3 var(--ui-label); margin: .3rem 0 .6rem; }
#tray.note.hv-tray { color: var(--ui-text); }
#tray.note.hv-tray > span { flex: 1; }
#tray.note.hv-tray button { flex: none; }
/* a wide screen: the sheet stands over the dock, beside the board, so the ringed settlement shows */
@media (min-width: 60em) {
  .hx-modal.harvest-sheet { justify-content: flex-end; align-items: center; }
  .harvest-sheet .hx-panel { max-width: 25rem; border-radius: var(--ui-r-lg); }
  .harvest-sheet .g-ring { max-height: 52dvh; }
}

/* chat over the board (09/10, ui-game.js chatPop): a few lines under the top bar and the corner's goal line (14/10), above the sheets and the Game over
   card too, the speaker in their colour; taps go through to what's under them */
#chat-pops { position: fixed; z-index: 45; top: calc(var(--barh, 0px) + var(--hudh, 0px) + .4rem); left: 50%; transform: translateX(-50%); width: min(24rem, calc(100% - 1.5rem));
  display: flex; flex-direction: column; align-items: center; gap: .3rem; pointer-events: none; }
body:not(:has(#game)) #chat-pops { display: none; }
body:has(.toast:not([hidden])) #chat-pops { top: calc(var(--barh, 0px) + max(3.4rem, var(--hudh, 0px) + .4rem)); }   /* (under a toast while one shows) */
.chat-toast { max-width: 100%; padding: .35rem .7rem .35rem .6rem; background: var(--ui-panel); color: var(--ui-text); border: 1px solid var(--c, var(--ui-line)); border-radius: var(--ui-r-lg);
  box-shadow: inset 4px 0 0 var(--c, var(--ui-muted)), var(--ui-shadow); font: 15px/1.3 var(--ui-body); overflow-wrap: anywhere; }
.chat-toast b { margin-right: .25rem; font-weight: 700; color: color-mix(in srgb, var(--c, var(--ui-text)) 60%, var(--ui-text)); }
.chat-toast.spec { border-style: dashed; }
.chat-toast.spec b::after { content: " (watching)"; font-weight: 400; color: var(--ui-muted); }
@media (prefers-reduced-motion: no-preference) { .chat-toast { animation: rise-in .22s ease-out; } }

/* V2 (13/10): a piece newly unlocked in the tray */
.item.unlock { animation: hx-unlock 1.1s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes hx-unlock { 0% { transform: scale(.3) rotate(-12deg); opacity: 0; filter: brightness(2.2); } 60% { transform: scale(1.12) rotate(3deg); opacity: 1; filter: brightness(1.5) drop-shadow(0 0 10px gold); } 100% { transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { .item.unlock { animation: none; } }
/* V2 (13/10): the tray by type, each row led by its name */
#tray .item.group-first { grid-column-start: 1; }
#tray .item.group-first.group-inline { grid-column-start: auto; }
/* the group's label above the icon, not on it, at a size its own (the card's 11.5px name rule had it, cut to 'HARVE…'), running on
   over the next card's top rather than cut short (14/10); a wide screen pads its cards itself (the desktop tray, min-width 60em) */
/* on a phone a card is narrower than its group's name: the name sits in the gap above its first card, where it can run on
   over the next cards' tops without meeting an icon or a +food badge */
@media (max-width: 59.99em) { #tray.items:has(.tray-group) { row-gap: 11px; padding-top: 11px; } .hx #tray .item span.tray-group { top: -10px; left: 1px; } }
.hx #tray .item span.tray-group { font: 600 9px/1 var(--ui-body); letter-spacing: .04em; max-width: none; overflow: visible; padding: 0; z-index: 1; }
#tray .item .tray-group { position: absolute; top: 1px; left: 3px; font: 600 .5rem/1 var(--font-ui, sans-serif); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); pointer-events: none; }
