/* ── fonts: self-hosted, since the page may load only from this server (web/fonts, OFL) ── */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-latin-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(fonts/space-grotesk-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(fonts/space-grotesk-latin-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ── themes: theme.js sets <html data-theme> (midnight unless chosen; ui.theme) ── */
/* midnight: dark, one lime accent, Space Grotesk headings */
:root {
  --bg: #0f1115;
  --surface: #171a21;
  --raised: #20242d;
  --text: #eceef2;
  --muted: #a3aab7;
  --border: #2b303b;
  --accent: #c8f04a;
  --accent-text: #12140f;      /* text on the accent */
  --accent-soft: rgb(200 240 74 / .12);
  --accent-ink: #c8f04a;       /* accent-coloured text on the page */
  --user-bg: #20242d;
  --code-bg: #1d2129;
  --think-bg: #171a21;
  --danger: #ff8a7a;
  --on-danger: #1a0b08;
  --good: #8ee07a;             /* the games' yes, found */
  --bad: #ff9d8a;              /* the games' no */
  --shadow: 0 8px 28px rgb(0 0 0 / .45);
  --radius: 10px;
  --radius-btn: 8px;
  --radius-pill: 8px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
/* calm: light, polished neutral, Inter throughout */
:root[data-theme="calm"] {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --raised: #f1f3f7;
  --text: #111827;
  --muted: #5f6673;
  --border: #e5e7eb;
  --accent: #2f5bea;
  --accent-text: #ffffff;
  --accent-soft: #eef2ff;
  --accent-ink: #2447c4;
  --user-bg: #e8edfb;
  --code-bg: #f1f3f6;
  --think-bg: #f4f5f8;
  --danger: #b42318;
  --on-danger: #ffffff;
  --good: #157f3b;
  --bad: #b42318;
  --shadow: 0 8px 24px rgb(17 24 39 / .10);
  --radius-btn: 10px;
  --radius-pill: 999px;
  --font-display: var(--font);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  isolation: isolate;  /* (its own layer order: the tab background below the page, above its color) */
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.logo, .icon { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }

button, select, textarea, input { font: inherit; color: inherit; }

/* ── top bar ─────────────────────────────────────────── */
.topbar {
  position: relative;  /* on phones the credits menu spans the bar's width */
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 60px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
[data-theme="midnight"] .topbar { background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700;
  font-size: 16.5px; letter-spacing: -0.01em; white-space: nowrap; }
.logo { width: 24px; height: 24px; color: var(--accent-ink); }
/* The logo (2026-11-23; ui.brand aixia; index.html .brand-aixia): the wordmark aiXia (Quicksand, the last a
   flipped, the i-dots lit, the icon's glowing X) in one inline SVG. At rest the logo shows, at the left: the X with
   its two dots beside it, as in the icon (the SVG moved left by the space before the left dot, 29.38%; the letters
   faded out; each i's dot moved down beside the X and shrunk to the icon's size, .bm-dot). On hover the X moves to
   the middle, the letters come out of it, and the two dots rise onto the i's. The box keeps the whole word's width,
   so nothing beside it moves. Signed out (the first page): the whole word. The numbers come from
   scripts/brand/header_logo.py. Its colours: the theme's (--lg-*). ui.brand classic: the old logo (.brand-classic). */
:root {
  --lg-letters: #eef0f7; --lg-lime: #97ec54; --lg-mid1: #cfea7f; --lg-mid2: #e9e483; --lg-gold: #f7d983;
  --lg-gold-end: #f3c873; --lg-rim-lime: #c6fb96; --lg-rim-gold: #fceba0; --lg-dot: #f8e19a; --lg-glow: #f3c873;
  --lg-glow-op: .5;
}
:root[data-theme="calm"] {
  --lg-letters: #0f1a3d; --lg-lime: #5aa81c; --lg-mid1: #93b21f; --lg-mid2: #c3a422; --lg-gold: #d99a1c;
  --lg-gold-end: #d48a14; --lg-rim-lime: #6fbb2c; --lg-rim-gold: #e2a531; --lg-dot: #e3a52c; --lg-glow: #e3a52c;
  --lg-glow-op: .3;
}
.brand-aixia { position: relative; width: 88px; height: 40px; flex: none; }
.brand-mark { position: absolute; left: 0; top: 0; width: 88px; height: 40px; overflow: visible;
  transform: translateX(-29.38%); transition: transform .38s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.brand-mark .bm-glow { opacity: var(--lg-glow-op); }
/* (its colours by class: the page's Content-Security-Policy allows no style="" in the SVG) */
.brand-mark .lg-letters { fill: var(--lg-letters); }
.brand-mark .lg-dot { fill: var(--lg-dot); }
.brand-mark .lg-glow { fill: var(--lg-glow); opacity: .85; }
.brand-mark .lg-halo { fill: var(--lg-glow); opacity: .5; }
.brand-mark .lg-s-lime { stop-color: var(--lg-lime); }
.brand-mark .lg-s-mid1 { stop-color: var(--lg-mid1); }
.brand-mark .lg-s-mid2 { stop-color: var(--lg-mid2); }
.brand-mark .lg-s-gold { stop-color: var(--lg-gold); }
.brand-mark .lg-s-gold-end { stop-color: var(--lg-gold-end); }
.brand-mark .lg-s-rim-lime { stop-color: var(--lg-rim-lime); }
.brand-mark .lg-s-rim-gold { stop-color: var(--lg-rim-gold); }
.brand-mark .bm-left, .brand-mark .bm-right { opacity: 0; transition: opacity .3s ease, transform .38s cubic-bezier(.2, .8, .2, 1); }
.brand-mark .bm-left { transform: translateX(40px); }     /* (the SVG's own units: about 14 px on the page) */
.brand-mark .bm-right { transform: translateX(-40px); }
/* each i's dot at rest: where the icon has it, beside the X at its middle, at the icon's size (the right one is
   inside a mirroring group, so the same numbers move it the other way) */
.brand-mark .bm-dot { transform-box: fill-box; transform-origin: center;
  transform: translate(4.27px, 29.32px) scale(.791); transition: transform .46s cubic-bezier(.45, .05, .25, 1); }
.brand-aixia:hover .brand-mark, body.signed-out .brand-aixia .brand-mark { transform: none; }
.brand-aixia:hover .bm-left, .brand-aixia:hover .bm-right,
body.signed-out .brand-aixia .bm-left, body.signed-out .brand-aixia .bm-right { opacity: 1; transform: none; }
.brand-aixia:hover .bm-left, .brand-aixia:hover .bm-right { transition-delay: .1s; }   /* (the dots lead, the i's meet them) */
.brand-aixia:hover .bm-dot, body.signed-out .brand-aixia .bm-dot { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .brand-mark, .brand-mark .bm-left, .brand-mark .bm-right, .brand-mark .bm-dot { transition: none; }
}
/* SolendAI's logo (2026-11-28, the default until 2026-11-29; ui.brand solendai; index.html .brand-solendai): the S of day and night (the
   sun's gold arc over the night's blue) on its navy square, then "SolendAI" (Outfit 600, "AI" in gold), one inline
   SVG from scripts/brand/solendai.py. The square keeps its own colours; the name takes the theme's (--sl-*).
   (Which logo shows: below.) */
:root { --sl-ink: #eef0f7; --sl-ai: #ffc14d; }
:root[data-theme="calm"] { --sl-ink: #0e1726; --sl-ai: #b7791f; }
.brand-solendai { flex: none; }
.sl-mark { display: block; height: 30px; width: auto; aspect-ratio: 5407 / 1083; }   /* (its viewBox's) */
.sl-mark .sl-ink { fill: var(--sl-ink); }
.sl-mark .sl-ai { fill: var(--sl-ai); }
/* The logo (2026-11-29; ui.brand solnyxia, the default; index.html .brand-solnyxia): aiXia's neon X as the meeting of
   day and night (the sun's amber beam, the night's violet one) and the word "SolnyXia" (Quicksand 600, the i's dot the
   moon, the last a flipped), one inline SVG from scripts/brand/solnyxia.py. At rest the X and its two dots, as in the
   icon (the SVG moved left 57.63%, the letters faded out, the moon dot moved from its i to beside the X); on hover the
   X glides to its place, the letters come out of it and the moon dot rises onto the i while the sun's fades (there is
   one i). The box keeps the whole word's width, so nothing beside it moves. Signed out (the first page): the word.
   Its colours: the theme's (--sx-*). */
:root {
  --sx-letters: #eef0f7; --sx-sun0: #ffb347; --sx-sun1: #ffe08a; --sx-sun-rim: #ffefc2; --sx-night0: #7c8cff;
  --sx-night1: #b38cff; --sx-night-rim: #dcd6ff; --sx-sun-dot: #ffe08a; --sx-sun-glow: #ffb347; --sx-moon-dot: #e3e0ff;
  --sx-moon-glow: #8c9cff; --sx-glow-op: .55;
}
:root[data-theme="calm"] {
  --sx-letters: #0f1a3d; --sx-sun0: #e08a12; --sx-sun1: #e9a93a; --sx-sun-rim: #f2c26b; --sx-night0: #4f5be0;
  --sx-night1: #7b4fd6; --sx-night-rim: #9c8cf0; --sx-sun-dot: #e9a93a; --sx-sun-glow: #e08a12; --sx-moon-dot: #7b4fd6;
  --sx-moon-glow: #9c8cf0; --sx-glow-op: .3;
}
.brand-solnyxia { position: relative; width: 153px; height: 40px; flex: none; }
.sx-mark { position: absolute; left: 0; top: 0; width: 153px; height: 40px; overflow: visible;
  transform: translateX(-57.63%); transition: transform .38s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.sx-mark .sx-letters { fill: var(--sx-letters); }
.sx-mark .sx-s-sun0 { stop-color: var(--sx-sun0); }
.sx-mark .sx-s-sun1 { stop-color: var(--sx-sun1); }
.sx-mark .sx-s-night0 { stop-color: var(--sx-night0); }
.sx-mark .sx-s-night1 { stop-color: var(--sx-night1); }
.sx-mark .sx-sun-rim { stroke: var(--sx-sun-rim); }
.sx-mark .sx-night-rim { stroke: var(--sx-night-rim); }
.sx-mark .sx-glow { opacity: var(--sx-glow-op); }
.sx-mark .sx-sun-dot { fill: var(--sx-sun-dot); }
.sx-mark .sx-sun-glow { fill: var(--sx-sun-glow); opacity: .5; }
.sx-mark .sx-moon-dot { fill: var(--sx-moon-dot); }
.sx-mark .sx-moon-glow { fill: var(--sx-moon-glow); opacity: .6; }
.sx-mark .sx-left, .sx-mark .sx-right { opacity: 0; transition: opacity .3s ease, transform .38s cubic-bezier(.2, .8, .2, 1); }
.sx-mark .sx-left { transform: translateX(250px); }      /* (the SVG's own units: about 8 px on the page) */
.sx-mark .sx-right { transform: translateX(-250px); }
/* the moon dot at rest: where the icon has it, beside the X at its middle, at the icon's size */
.sx-mark .sx-moon { transform-box: fill-box; transform-origin: center;
  transform: translate(-96px, 373px) scale(.769); transition: transform .46s cubic-bezier(.45, .05, .25, 1); }
.sx-mark .sx-sun { transform-box: fill-box; transform-origin: center; transition: opacity .3s ease, transform .38s ease; }
.brand-solnyxia:hover .sx-mark, body.signed-out .brand-solnyxia .sx-mark { transform: none; }
.brand-solnyxia:hover .sx-left, .brand-solnyxia:hover .sx-right,
body.signed-out .brand-solnyxia .sx-left, body.signed-out .brand-solnyxia .sx-right { opacity: 1; transform: none; }
.brand-solnyxia:hover .sx-left, .brand-solnyxia:hover .sx-right { transition-delay: .1s; }   /* (the moon leads, the i meets it) */
.brand-solnyxia:hover .sx-moon, body.signed-out .brand-solnyxia .sx-moon { transform: none; }
.brand-solnyxia:hover .sx-sun, body.signed-out .brand-solnyxia .sx-sun { opacity: 0; transform: scale(.4); }
@media (prefers-reduced-motion: reduce) {
  .sx-mark, .sx-mark .sx-left, .sx-mark .sx-right, .sx-mark .sx-moon, .sx-mark .sx-sun { transition: none; }
}
/* The page's <html data-brand> (server/pages.py home_html, auth.js) picks the logo: none, Solnyxia's; solendai,
   SolendAI's; aixia, aiXia's; classic, the old one. */
:root[data-brand] .brand-solnyxia, :root:not([data-brand="solendai"]) .brand-solendai,
:root:not([data-brand="aixia"]) .brand-aixia, :root:not([data-brand="classic"]) .brand-classic { display: none; }
.topbar-signin { margin-inline-start: auto; }
.tabs { display: flex; gap: 4px; align-self: stretch; align-items: center; }
.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
}
.tabs .icon { width: 18px; height: 18px; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
/* midnight: the chosen tab is underlined at the bar's edge */
[data-theme="midnight"] .tabs { gap: 2px; }
[data-theme="midnight"] .tabs button { height: 100%; border-radius: 0; box-shadow: inset 0 -2px 0 transparent; }
[data-theme="midnight"] .tabs button[aria-selected="true"] { background: none; color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent); }

main { flex: 1; min-height: 0; display: flex; }

.panel { flex: 1; min-height: 0; width: 100%; max-width: 880px; margin: 0 auto; padding: 0 16px; }
/* The Text, Image and Agent tabs' soft backgrounds (ui.backgrounds; app.js sets body
   data-tab and .tab-bg): fixed behind the page, faint toward the theme's color, so the work
   stays in front; a light wash shows less on the dark theme, the dark one less on the light. */
/* (second version, 2026-11-17: watercolor scenes, each in a version for each theme: the lake by
   day and by moonlight, the artist's desk on white and on charcoal paper, the sky at dawn and at
   night, so neither theme gets a washed-out picture) */
/* (third, 2026-11-20: the Image tab's is a sunlit studio, by night on midnight, the user's pick of
   eight; ui.image_background: supplies brings back the art-supply sheet, html[data-image-bg]) */
:root { --tab-bg-text: .45; --tab-bg-image: .5; --tab-bg-agent: .5;
  --tab-pic-text: url(/sprites/tabs/text-dark.webp); --tab-pic-image: url(/sprites/tabs/image-studio-dark.webp);
  --tab-pic-agent: url(/sprites/tabs/agent-dark.webp); }
:root[data-theme="calm"] { --tab-bg-text: .62; --tab-bg-image: .6; --tab-bg-agent: .55;
  --tab-pic-text: url(/sprites/tabs/text.webp); --tab-pic-image: url(/sprites/tabs/image-studio.webp);
  --tab-pic-agent: url(/sprites/tabs/agent.webp); }
:root[data-image-bg="supplies"] { --tab-pic-image: url(/sprites/tabs/image-dark.webp); }
:root[data-theme="calm"][data-image-bg="supplies"] { --tab-pic-image: url(/sprites/tabs/image.webp); }
/* Portrait screens (phones): the tall version, where there is one (2026-11-20; a wide picture
   there shows only its empty middle). ui.tall_backgrounds false sets html[data-wide-bg]. The
   :where() keeps these as weak as the rules above, so a bought scene (data-scene, later) wins. */
@media (max-aspect-ratio: 4/5) {
  :root:not(:where([data-wide-bg])) { --tab-pic-image: url(/sprites/tabs/image-studio-tall-dark.webp); }
  :root[data-theme="calm"]:not(:where([data-wide-bg])) { --tab-pic-image: url(/sprites/tabs/image-studio-tall.webp); }
  :root[data-image-bg="supplies"]:not(:where([data-wide-bg])) { --tab-pic-image: url(/sprites/tabs/image-tall-dark.webp); }
  :root[data-theme="calm"][data-image-bg="supplies"]:not(:where([data-wide-bg])) { --tab-pic-image: url(/sprites/tabs/image-tall.webp); }
}
body.tab-bg::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: center / cover no-repeat; transition: opacity .4s ease; }
body.tab-bg[data-tab="text"]::before { background-image: var(--tab-pic-text); opacity: var(--tab-bg-text); }
body.tab-bg[data-tab="image"]::before { background-image: var(--tab-pic-image); opacity: var(--tab-bg-image); }
body.tab-bg[data-tab="agent"]::before { background-image: var(--tab-pic-agent); opacity: var(--tab-bg-agent); }
@media (prefers-reduced-motion: reduce) { body.tab-bg::before { transition: none; } }
.panel[hidden] { display: none; }
.placeholder { padding-top: 32px; }
.muted { color: var(--muted); }

/* ── credits (app.js, renderCredits) ─────────────────── */
.credits { margin-inline-start: auto; position: relative; }
.credits + .account { margin-inline-start: 0; }
.credits summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  white-space: nowrap;
  font-size: 14px;
}
.credits summary::before { content: ""; width: 9px; height: 9px; margin-inline-end: 4px; border: 2.5px solid var(--accent);
  border-radius: 50%; }
.credits summary::-webkit-details-marker { display: none; }
.credits summary b { font-variant-numeric: tabular-nums; }
.credits summary .chip-short { display: none; }
.credits.none-left summary { color: var(--danger); border-color: var(--danger); }
.credits.none-left summary::before { border-color: var(--danger); }
.credits-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  z-index: 20;
  width: min(320px, calc(100vw - 32px));
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgb(0 0 0 / .12);
  font-size: 13px;
}
/* (closed: not laid out at all; newer Chromium lays out a closed details' content, and on a phone this menu then
   made the page 2 px wider than the screen) */
.credits:not([open]) .credits-menu { display: none; }
.credits-head { display: flex; align-items: baseline; gap: 2px; margin-bottom: 8px; }
.credits-head strong { font-family: var(--font-display); font-size: 22px; font-variant-numeric: tabular-nums; }
.credits-tier { margin-inline-start: auto; color: var(--muted); }
.credits-parts { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0 0 10px; }
.credits-parts dt { color: var(--muted); }
.credits-parts dd { margin: 0; }
.credits-prices { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.credits-prices th { text-align: start; font-weight: 500; color: var(--muted); padding: 2px 0; }
.credits-prices td { padding: 3px 0; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.credits-prices :is(th, td):not(:first-child) { padding-inline-start: 8px; white-space: nowrap; }
.credits-menu p { margin: 6px 0 0; }
.credits-menu > button { margin-top: 10px; width: 100%; }
.credits-examples { margin: 0 0 4px; }

/* ── the Credits page (app.js, renderCreditsPage) ─────── */
.credits-page { overflow-y: auto; padding-bottom: 48px; }
.cp-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 8px; }
.cp-head h1 { margin: 0; font-family: var(--font-display); font-size: 26px; }
.cp-balance { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.cp-balance p { margin: 0; }
.cp-balance .credits-parts { margin: 8px 0 0; font-size: 14px; }
.cp-total strong { font-family: var(--font-display); font-size: 34px; font-variant-numeric: tabular-nums; }
.cp-section { margin-top: 28px; }
.cp-section h2 { font-size: 17px; margin: 0 0 10px; }
.cp-section h3 { font-size: 14px; margin: 18px 0 6px; }
.cp-section p { margin: 6px 0; font-size: 14px; }
.cp-note { padding: 8px 12px; border-radius: 8px; background: var(--think-bg); font-size: 14px; }
.cp-note.test { background: var(--user-bg); }
.cp-note.error { color: var(--danger); }
.cp-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.cp-pack {
  display: grid;
  gap: 4px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cp-price { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.cp-credits { font-variant-numeric: tabular-nums; }
.cp-buys { font-size: 12px; }
.cp-pack button { margin-top: 6px; }
.cp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cp-table th { text-align: start; font-weight: 500; color: var(--muted); padding: 4px 0; }
.cp-table td { padding: 6px 0; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; vertical-align: top; }
.cp-table :is(th, td):not(:first-child) { padding-inline-start: 12px; }
.cp-table td:not(:first-child) { white-space: nowrap; }
.cp-table td:last-child { white-space: normal; overflow-wrap: anywhere; }
.cp-table.cp-costs :is(th, td):last-child { white-space: nowrap; overflow-wrap: normal; }  /* "0.13 to 0.78" on one line */

/* ── accounts (auth.js) ──────────────────────────────── */
.signed-out .tabs { display: none; }
.account { margin-inline-start: auto; position: relative; }
.account summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  max-width: 200px;
  padding: 0 12px 0 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  white-space: nowrap;
}
#account-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 14px; }
/* (2026-11-25: round in every theme, as pictures always were; the Dark theme's letters were rounded squares, 6px) */
.theme-pick { display: flex; align-items: center; gap: 6px; }
.account-menu .theme-pick button { flex: 1; }
.theme-pick button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.account summary::-webkit-details-marker { display: none; }
.account summary::after { content: " ▾"; color: var(--muted); }
.account-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: grid;
  gap: 6px;
  min-width: 220px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgb(0 0 0 / .12);
}
.account-menu p { margin: 0 0 4px; font-size: 13px; overflow-wrap: anywhere; }

.auth { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 40px 20px 28px;
  overflow-y: auto; }
.auth-back { margin: -6px 0 14px; font-size: 14px; }
.auth-card .auth-back a { color: var(--muted); text-decoration: none; }
.auth-card .auth-back a:hover { color: var(--text); }
.auth-foot { font-size: 13px; }

/* ── the first-visit page (auth.js, renderWelcome) ───── */
/* The first page's soft background (2026-11-25; ui.landing_glow): a faint glow of the logo's green and gold and
   the scenes' night blue behind its top, scrolling with the page */
:root { --glow-green: rgb(151 236 84 / .09); --glow-gold: rgb(243 200 115 / .06); --glow-blue: rgb(70 100 220 / .16); }
:root[data-theme="calm"] { --glow-green: rgb(120 200 70 / .14); --glow-gold: rgb(243 190 95 / .16); --glow-blue: rgb(47 91 234 / .09); }
.auth.glow {
  background:
    radial-gradient(55% 520px at 16% 0, var(--glow-green), transparent 72%),
    radial-gradient(50% 560px at 88% 40px, var(--glow-blue), transparent 72%),
    radial-gradient(45% 420px at 52% 480px, var(--glow-gold), transparent 72%),
    var(--bg);
  background-attachment: local;
}
/* ui.landing_scene (2026-11-28): the painted land between night and day across the top (night in the dark theme,
   day in the light one), at least 1200 px wide so phones keep its middle, under a veil of the page's colour that
   thickens going down until the page's own colour takes over */
.auth.scene {
  --scene: url("/welcome/scene-night.webp");
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 30%, transparent) 0, color-mix(in srgb, var(--bg) 50%, transparent) 380px,
      color-mix(in srgb, var(--bg) 86%, transparent) 620px, var(--bg) 780px),
    var(--scene) top center / max(100%, 1200px) auto no-repeat,
    var(--bg);
  background-attachment: local;
}
:root[data-theme="calm"] .auth.scene { --scene: url("/welcome/scene-day.webp"); }
.welcome { width: 100%; max-width: 1080px; display: grid; gap: 40px; }
.welcome-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 36px; }
.welcome-text { flex: 1 1 340px; display: grid; gap: 18px; align-content: start; }
.welcome-kicker { margin: 0; justify-self: start; font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent-ink); }
[data-theme="calm"] .welcome-kicker { padding: 6px 12px; border-radius: 999px; background: var(--accent-soft);
  font-family: var(--font); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }
/* the showcase's: "Up to 95 free credits a day" as a gold pill with a gift (2026-11-23) */
.is-showcase .welcome-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px 7px 12px;
  border-radius: 999px; font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: .01em;
  text-transform: none; color: var(--gold); background: var(--gold-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 50%, transparent), 0 0 24px color-mix(in srgb, var(--gold) 18%, transparent); }
.is-showcase .welcome-kicker::before { content: "🎁"; font-size: 17px; }
[data-theme="calm"] .is-showcase .welcome-kicker { color: var(--gold-deep); }
.welcome h1 { margin: 0; font-family: var(--font-display); font-size: clamp(34px, 5.2vw, 54px); line-height: 1.06;
  letter-spacing: -0.025em; font-weight: 700; }
.welcome-lead { margin: 0; max-width: 34em; color: var(--muted); font-size: 17px; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.welcome-actions button { flex: 1 1 200px; height: 52px; font-size: 16px; font-weight: 600; }
.welcome-actions button.ghost { flex: 1 1 130px; }
.welcome-small { margin: 0; font-size: 13px; }
.welcome-example { flex: 1 1 320px; display: grid; gap: 10px; padding: 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; }
.welcome-example p { margin: 0; }
.we-user { justify-self: end; max-width: 85%; padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: var(--user-bg); }
.we-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.welcome-features { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.welcome-features li { flex: 1 1 240px; display: flex; align-items: flex-start; gap: 14px; padding: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.welcome-features h2 { margin: 0 0 2px; font-family: var(--font-display); font-size: 16px; }
.welcome-features p { margin: 0; color: var(--muted); }
.wf-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center;
  justify-content: center; background: var(--accent-soft); color: var(--accent-ink); }
.wf-icon .icon { width: 20px; height: 20px; }
/* midnight: the features as a ruled list rather than cards */
[data-theme="midnight"] .welcome-features { gap: 0 28px; }
[data-theme="midnight"] .welcome-features li { padding: 18px 0; background: none; border: 0;
  border-top: 1px solid var(--border); border-radius: 0; }
.welcome-day { margin: 0; padding: 14px 18px; border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); }
/* ── the showcase (auth.js renderShowcase; ui.landing_showcase): the site as it is ─────
   The hero's picture: the Text tab's painted scene with a reply on it, a painting pinned beside, Hana at the corner. */
.welcome.is-showcase { gap: 56px; padding-bottom: 32px; }
.welcome-visual { position: relative; flex: 1 1 380px; display: grid; min-height: 0; }
.welcome.is-showcase .welcome-visual { min-height: 400px; padding: 28px 18px 64px; }
.wv-scene { position: absolute; inset: 0; border-radius: 22px; background: var(--tab-pic-text) center / cover, var(--surface);
  box-shadow: 0 24px 60px rgb(0 0 0 / .35); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border)); }
.wv-scene::after { content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, transparent 30%, color-mix(in srgb, var(--bg) 55%, transparent)); }
.welcome.is-showcase .welcome-example { position: relative; z-index: 1; align-self: start; max-width: 380px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); box-shadow: var(--shadow); }
.wv-picture { position: absolute; z-index: 2; inset-inline-end: 18px; bottom: 26px; width: min(46%, 240px); margin: 0; padding: 8px 8px 6px;
  background: #fbf7ee; border-radius: 6px; box-shadow: 0 14px 34px rgb(0 0 0 / .4); transform: rotate(3deg); }
.wv-picture img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 3px; }
.wv-picture figcaption { margin-top: 4px; font-size: 11.5px; color: #4a4036; text-align: center; font-family: var(--font-display); }
/* the agent's (2026-11-28; auth.js .has-chart with the agent on): the ask, its steps and the chart it made, pinned at
   the right between the reply and the painting; the scene grows to hold it. Phones: under the reply. */
.welcome.is-showcase .welcome-visual.has-chart { min-height: 660px; }
.wv-chart { position: absolute; z-index: 2; inset-inline-end: 14px; top: 238px; width: min(58%, 310px); min-width: 0; margin: 0;
  display: grid; gap: 7px; padding: 10px 10px 9px; border-radius: 14px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(8px);
  box-shadow: 0 14px 34px rgb(0 0 0 / .35); transform: rotate(-1.5deg); }
.wvc-ask { margin: 0; justify-self: end; max-width: 94%; padding: 7px 10px; border-radius: 12px 12px 4px 12px;
  background: var(--user-bg); font-size: 12.5px; line-height: 1.35; }
.wvc-steps { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11.5px; color: var(--muted); }
.wv-chart img { display: block; width: 100%; height: auto; border-radius: 8px; background: #fff; }
.has-chart .wv-picture { width: min(40%, 210px); }
.wv-hana { position: absolute; z-index: 3; left: -6px; bottom: -18px; display: flex; align-items: flex-end; gap: 0; pointer-events: none; }
.wv-hana img { width: 104px; height: auto; order: -1; filter: drop-shadow(0 8px 16px rgb(0 0 0 / .4)); }
.wv-bubble { margin: 0 0 70px -6px; padding: 8px 12px; max-width: 180px; border-radius: 14px 14px 14px 4px; font-size: 13px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.wv-bubble strong { display: block; color: var(--good); font-family: var(--font-display); font-size: 12.5px; }
/* the three tools, each in its tab's painted scene */
.welcome-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.wt-card { display: grid; grid-template-rows: 130px auto; overflow: hidden; border-radius: 18px; border: 1px solid var(--border);
  background: var(--surface); min-width: 0; }
.wt-art { background: center / cover; position: relative; }
.wt-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, var(--surface)); }
.wt-text .wt-art { background-image: var(--tab-pic-text); }
.wt-image .wt-art { background-image: var(--tab-pic-image); }
.wt-agent .wt-art { background-image: var(--tab-pic-agent); }
.wt-body { display: grid; align-content: start; gap: 6px; padding: 0 18px 18px; margin-top: -24px; position: relative; }
.wt-body h2 { margin: 0; font-family: var(--font-display); font-size: 22px; }
.wt-body p { margin: 0; color: var(--muted); }
.wt-chips { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.wt-chips li { padding: 3px 10px; border-radius: 999px; font-size: 12.5px; background: var(--accent-soft); color: var(--accent-ink); }
/* the games corner */
.welcome-games { display: grid; gap: 16px; }
.wg-head h2, .welcome-final h2 { margin: 0 0 4px; font-family: var(--font-display); font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -0.015em; }
.wg-head p { margin: 0; font-size: 16px; }
.wg-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .wg-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 520px) { .wg-list { gap: 10px; } .wg-card:not(.big) .wg-words { padding: 8px 10px 10px; }
  .wg-card:not(.big) .wg-words h3 { font-size: 14.5px; } .wg-card:not(.big) .wg-words p { font-size: 12.5px; } }
.wg-card { position: relative; display: grid; grid-template-rows: auto 1fr; overflow: hidden; border-radius: 16px;
  border: 1px solid var(--border); background: var(--surface); min-width: 0; transition: transform .2s ease, box-shadow .2s ease; }
.wg-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { .wg-card, .wg-card:hover { transition: none; transform: none; } }
.wg-card img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.wg-words { display: grid; align-content: start; gap: 3px; padding: 10px 14px 14px; }
.wg-words h3 { margin: 0; font-family: var(--font-display); font-size: 16px; }
.wg-words p { margin: 0; font-size: 13.5px; color: var(--muted); }
.wg-card.big { grid-column: span 2; } .wg-card.big .wg-words h3 { font-size: 20px; }

/* achievements, the leaderboard, friends */
.welcome-community { display: grid; gap: 18px; padding: 24px; border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--border));
  background: radial-gradient(120% 120% at 0% 0%, var(--gold-soft), transparent 55%), var(--surface); }
.wc-medals { display: flex; flex-wrap: wrap; gap: 6px; }
.wc-medals img { width: 52px; height: 52px; border-radius: 50%; box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 60%, transparent), 0 4px 12px rgb(0 0 0 / .3); }
.wc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.wc-list li { display: flex; align-items: center; gap: 10px; }
.wc-icon { font-size: 26px; }
.wc-list h3 { margin: 0; font-family: var(--font-display); font-size: 18px; }
/* the credits */
.wcr-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.wcr-list li { display: grid; gap: 2px; padding: 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.wcr-list b { font-family: var(--font-display); font-size: 34px; line-height: 1.05; color: var(--accent-ink); }
.wcr-plus { margin-left: 8px; padding: 2px 10px; border-radius: 999px; font-size: 20px; vertical-align: 6px; color: var(--gold);
  background: var(--gold-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 45%, transparent); }
:root[data-theme="calm"] .wcr-plus { color: var(--gold-deep); }
.wcr-list li.wcr-gift { align-content: center; border-color: color-mix(in srgb, var(--gold) 45%, var(--border));
  background: radial-gradient(120% 140% at 0% 0%, var(--gold-soft), transparent 60%), var(--surface); }
.wcr-gift b { font-size: 40px; } .wcr-gift span { font-family: var(--font-display); font-size: 19px; }
.wcr-list span { font-weight: 600; }
.wcr-list small { font-size: 13px; }
.welcome-final { display: grid; justify-items: center; gap: 14px; padding: 30px 18px; text-align: center; border-radius: 20px;
  background: var(--tab-pic-image) center / cover; position: relative; overflow: hidden; }
.welcome-final::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 72%, transparent); }
.welcome-final > * { position: relative; }
.welcome-final .welcome-actions { width: min(460px, 100%); }
@media (max-width: 560px) {
  .welcome.is-showcase .welcome-visual { min-height: 380px; padding: 18px 12px 70px; }
  .wv-picture { width: 40%; inset-inline-end: 10px; bottom: 20px; }
  .wv-picture figcaption { font-size: 10px; }
  .wv-hana img { width: 76px; }
  .wv-bubble { margin-bottom: 54px; max-width: 112px; padding: 6px 9px; font-size: 12px; }
  .welcome.is-showcase .welcome-visual.has-chart { min-height: 0; padding-bottom: 200px; }
  .wv-chart { position: relative; z-index: 1; inset: auto; width: auto; max-width: 94%; margin: 14px 0 0;
    margin-inline-start: auto; transform: none; }
}
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.auth-card h1 { font-family: var(--font-display); font-size: 22px; margin: 0 0 16px; }
.auth-card form { display: grid; gap: 14px; }
.auth-card input { width: 100%; height: 38px; }
.auth-card small { font-size: 12px; }
.auth-card button[type="submit"] { height: 38px; }
.auth-card [aria-invalid="true"] { border-color: var(--danger); }
.auth-card code { font-family: var(--mono); font-size: 13px; background: var(--code-bg); padding: 1px 4px; border-radius: 4px; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 0; font-size: 14px; }
.auth-links a, .auth-card a { color: var(--accent); }
.auth-note {
  margin: 0 0 16px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--user-bg);
  font-size: 14px;
}
.robot-check { margin: 0; font-size: 13px; color: var(--muted); }
.robot-check[data-state="done"] { color: var(--text); }
.robot-check[data-state="failed"] { color: var(--danger); }

.password-dialog {
  width: min(400px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.password-dialog::backdrop { background: rgb(0 0 0 / .35); }
.password-dialog form { display: grid; gap: 14px; }
.password-dialog h2 { font-size: 18px; margin: 0; }
.password-dialog input { width: 100%; height: 36px; }
.dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; }
.logins-dialog { width: min(520px, calc(100vw - 32px)); }
.logins-dialog > p { margin: 8px 0; font-size: 14px; }
.logins { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; }
.logins li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
}
.logins li div { display: grid; gap: 2px; min-width: 0; }
.logins li small { overflow-wrap: anywhere; }

/* two-factor sign-in: the QR code stays black on white so apps read it in dark mode too */
.qr { display: block; width: 205px; height: 205px; margin: 0 auto; background: #fff; border-radius: 6px; image-rendering: pixelated; }
.secret { overflow-wrap: anywhere; user-select: all; }
.recovery-codes {
  margin: 12px 0; padding: 10px 10px 10px 34px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 16px;
  font-family: var(--mono); font-size: 14px; background: var(--code-bg); border-radius: 8px; user-select: all;
}
#two-factor-dialog > div > p, .tf-state { margin: 8px 0; font-size: 14px; }

/* ── chat layout ─────────────────────────────────────── */
.chat { display: flex; flex-direction: column; }

.toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 0 8px; flex-wrap: wrap; }
.model-pick { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.model-pick span { color: var(--muted); }
.model-pick select { flex: 1; min-width: 0; }
.mode-pick { flex: 0 1 auto; }

select, textarea, input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
}
textarea { resize: vertical; width: 100%; }

button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius-btn);
  padding: 6px 14px;
  font-weight: 500;
  cursor: pointer;
}
.button {
  display: inline-block;
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 6px 14px;
  background: var(--accent);
  color: var(--accent-text);
}
a.button:not([href]) { opacity: .45; pointer-events: none; }
button.ghost, .button.ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
button.danger { color: var(--danger); }
button.small { padding: 3px 10px; font-size: 13px; }
button.stop { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
button:disabled { opacity: .5; cursor: default; }

.system { margin-bottom: 8px; }
.system summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.system textarea { margin-top: 6px; }

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.empty { color: var(--muted); text-align: center; margin-top: 15vh; }

.msg { max-width: 100%; overflow-wrap: anywhere; }
.msg.user.pending { opacity: 0.6; }
.no-features { padding: 24px 16px; }
.msg.user {
  align-self: flex-end;
  max-width: 85%;
  background: var(--user-bg);
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  white-space: pre-wrap;
}
[data-theme="midnight"] .msg.user { border-radius: 12px; }
.msg.assistant .body > :first-child { margin-top: 0; }
.msg.assistant .body > :last-child { margin-bottom: 0; }
.msg .body pre {
  background: var(--code-bg);
  padding: 10px 12px;
  border-radius: 8px;
  overflow-x: auto;
}
.msg .body code { font-family: var(--mono); font-size: 13.5px; }
.msg .body :not(pre) > code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
.msg .body table { border-collapse: collapse; display: block; overflow-x: auto; }
.msg .body th, .msg .body td { border: 1px solid var(--border); padding: 4px 8px; }
.msg .body img { max-width: 100%; }

.thinking {
  background: var(--think-bg);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 14px;
}
.thinking summary { cursor: pointer; color: var(--muted); }
.thinking .think-body { white-space: pre-wrap; color: var(--muted); margin-top: 6px; max-height: 320px; overflow-y: auto; }
/* ui.show_thinking false (2026-11-25): only "Thinking…" with a changing word, nothing to open */
.thinking.veiled summary { cursor: default; list-style: none; }
.thinking.veiled summary::-webkit-details-marker { display: none; }
/* While it thinks (2026-11-25, more alive): the emoji bobs, a shine sweeps the words, three dots bounce in turn, and
   each new word slides in */
.thinking.veiled summary .think-emoji { display: inline-block; animation: think-pop .4s ease-out both, think-bob 1.4s ease-in-out .4s infinite; }
.thinking.veiled summary .think-word {
  display: inline-block; font-weight: 500; color: transparent;
  background: linear-gradient(90deg, var(--muted) 0%, var(--muted) 38%, var(--text) 50%, var(--muted) 62%, var(--muted) 100%);
  background-size: 260% 100%; -webkit-background-clip: text; background-clip: text;
  animation: think-in .4s ease-out both, think-shine 2.2s linear infinite;
}
.thinking.veiled summary .think-dots { display: inline-flex; margin-inline-start: 1px; }
.thinking.veiled summary .think-dots span { display: inline-block; animation: think-dot 1.2s ease-in-out infinite; }
.thinking.veiled summary .think-dots span:nth-child(2) { animation-delay: .15s; }
.thinking.veiled summary .think-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes think-bob { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-2px) rotate(-9deg); }
  75% { transform: translateY(-1px) rotate(9deg); } }
@keyframes think-pop { from { transform: scale(.4) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes think-in { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes think-shine { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes think-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-3px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .thinking.veiled summary .think-emoji, .thinking.veiled summary .think-word, .thinking.veiled summary .think-dots span { animation: none; }
  .thinking.veiled summary .think-word { color: var(--muted); background: none; }
}

.meta { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
[data-theme="midnight"] .meta { font-family: var(--mono); font-size: 12px; }

/* ── suggestions (app.js; ui.suggestions) ────────────── */
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestions.starters { justify-content: center; max-width: 560px; margin: 0 auto; }
.suggestions.follow-ups { margin-top: -4px; }
.suggestions button { height: 36px; padding: 0 14px; border-radius: var(--radius-pill); background: var(--surface);
  font-size: 14px; }
.suggestions button:hover { border-color: var(--accent); }
.error { color: var(--danger); white-space: pre-wrap; margin-top: 6px; }

.cursor::after { content: "▍"; animation: blink 1s steps(1) infinite; color: var(--muted); }
@keyframes blink { 50% { opacity: 0; } }

.composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin: 8px 0 16px;
  padding: 6px 6px 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
[data-theme="midnight"] .composer { border-radius: 12px; box-shadow: none; }
.composer:focus-within { border-color: var(--accent); }
.composer textarea { resize: none; max-height: 40vh; padding: 10px 0; border: 0; background: transparent; }
.composer textarea:focus-visible { outline: none; }
.composer button { height: 44px; padding: 0 20px; font-weight: 600; }

/* ── image tab ───────────────────────────────────────── */
.image { overflow-y: auto; padding-bottom: 32px; }
.image-form { display: grid; gap: 10px; padding: 14px 0 6px; }
.field { display: grid; gap: 4px; }
.field > span { font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row .grow { flex: 1; min-width: 180px; }
/* the Image tab's task list: a long name ("Edit with words (unavailable)") shrinks with "…" instead of
   pushing Refresh off a phone's screen (a select is as wide as its longest option) */
#image-form .row .field.grow { min-width: 0; grid-template-columns: minmax(0, 1fr); }
#image-provider { min-width: 0; width: 100%; text-overflow: ellipsis; }
.image-form select, .image-form input, .image-form .row > button { height: 36px; }
.field.num input { width: 100px; }
.field.seed input { width: 170px; }
.push-right { margin-inline-start: auto; }
#image-extras:empty { display: none; }

/* picture tasks (image_tasks): the task's description, its picture, its presets */
.task-desc { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); height: 36px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
#enhance-field[hidden] + #image-generate { margin-inline-start: auto; }  /* (Generate stays right without the box) */
.picture-drop {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 10px; border: 1px dashed var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.picture-drop.over, .picture-drop:focus-visible { border-color: var(--accent); outline: none; }
.picture-preview { width: 96px; height: 96px; object-fit: contain; border-radius: 6px; }
.picture-side { display: grid; gap: 6px; min-width: 0; flex: 1; }
.picture-hint { margin: 0; font-size: 13px; color: var(--muted); }
.picture-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.picture-upload { cursor: pointer; }
.picture-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px;
  max-height: 260px; overflow-y: auto; margin-top: 8px;
}
.thumb.pick { cursor: pointer; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.preset {
  height: auto; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer;
}
.preset[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--bg); }
/* transparent pictures (background removal, stickers) show a checkerboard behind them */
.thumb img, .picture-preview, .viewer-pics img {
  background-color: var(--surface);
  background-image: conic-gradient(var(--border) 25%, transparent 0 50%, var(--border) 0 75%, transparent 0);
  background-size: 16px 16px;
}

.jobs { display: grid; gap: 8px; margin: 10px 0 4px; grid-template-columns: minmax(0, 1fr); }  /* (a long prompt's nowrap line made a card as wide as it on a phone) */
.job {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.job-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.job-prompt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-status { color: var(--muted); font-size: 13px; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.job.failed .job-status { color: var(--danger); white-space: pre-wrap; }
.job.failed .bar { display: none; }
.bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .4s; }
.bar.indeterminate > div { width: 30%; animation: slide 1.6s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

.section-title { font-size: 14px; color: var(--muted); font-weight: 600; margin: 20px 0 8px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.thumb {
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: zoom-in;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

#viewer {
  border: 0;
  border-radius: 12px;
  padding: 0;
  width: min(1100px, 94vw);
  max-width: none;
  background: var(--surface);
  color: var(--text);
}
#viewer::backdrop { background: rgb(0 0 0 / .65); }
/* the agent's web page previews (agent.preview): a sandboxed frame in a dialog */
.preview-dialog { border: 0; border-radius: 12px; padding: 0; width: min(1200px, 96vw); height: min(860px, 92vh);
  max-width: none; max-height: none; background: var(--surface); color: var(--text); }
.preview-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.preview-dialog::backdrop { background: rgb(0 0 0 / .65); }
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.preview-bar strong { min-width: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-note { flex: 1 1 200px; font-size: 13px; }
#preview-frame { width: 100%; height: 100%; border: 0; background: #fff; }
@media (max-width: 640px) {
  .preview-dialog { width: 100vw; height: 100dvh; border-radius: 0; }
  .preview-note { display: none; }
}
.viewer { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.viewer-pics { position: relative; min-width: 0; }
.viewer img { width: 100%; max-height: 86vh; object-fit: contain; display: block; }
.viewer-before {
  position: absolute; inset-inline-start: 10px; bottom: 10px; margin: 0; width: 28%; max-width: 220px;
  border: 2px solid var(--surface); border-radius: 8px; overflow: hidden; box-shadow: 0 2px 12px rgb(0 0 0 / .35);
}
.viewer-before img { max-height: 30vh; }
.viewer-before figcaption {
  position: absolute; top: 4px; inset-inline-start: 4px; font-size: 12px; padding: 1px 6px; border-radius: 4px;
  background: var(--surface); color: var(--text);
}
.viewer-info { padding: 16px; display: flex; flex-direction: column; gap: 12px; max-height: 86vh; overflow-y: auto; }
.viewer-prompt { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.viewer-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; margin: 0; }
.viewer-meta dt { color: var(--muted); }
.viewer-meta dd { margin: 0; overflow-wrap: anywhere; }
.viewer-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

/* ── agent tab ───────────────────────────────────────── */
.panel.agent {
  max-width: 1240px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-rows: minmax(0, 1fr);
  gap: 20px;
}
.agent-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.agent-main .toolbar { padding-bottom: 0; }
.agent-main .toolbar + .toolbar { padding-top: 8px; padding-bottom: 8px; }
.toolbar .grow { flex: 1; min-width: 0; }
.side-toggle { display: none; }
label.button { cursor: pointer; }
a.button.small, label.button.small { padding: 3px 10px; font-size: 13px; }

.agent-side {
  border-inline-start: 1px solid var(--border);
  padding: 12px 0 16px 20px;
  overflow-y: auto;
  min-height: 0;
}
.side-block + .side-block { margin-top: 22px; }
.side-block h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.side-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.side-head h3 { margin: 0 auto 0 0; }

.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.todo li { display: grid; grid-template-columns: 16px 1fr; gap: 8px; align-items: start; }
.todo .mark { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; border: 1.5px solid var(--muted); }
.todo .in_progress .mark { border-color: var(--accent); background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }
.todo .done .mark { border-color: var(--accent); background: var(--accent); }
.todo .done .text { color: var(--muted); text-decoration: line-through; }
.todo .empty-note, .files .empty-note { color: var(--muted); display: block; }

.files { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.files li { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.files .dir { color: var(--muted); }
.files a.name { color: var(--text); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files a.name:hover { text-decoration: underline; }
.files .size { color: var(--muted); margin-inline-start: auto; font-size: 12px; white-space: nowrap; }
.files .icon-btn { border: 0; background: none; color: var(--muted); padding: 0 4px; cursor: pointer; font-size: 13px; text-decoration: none; }
.files .icon-btn:hover { color: var(--text); }
.files li.fresh a.name { color: var(--accent); }


.tool {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13.5px;
}
.tool summary {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 6px 10px;
  cursor: pointer;
  list-style: none;
}
.tool summary::-webkit-details-marker { display: none; }
.tool .tool-name { font-family: var(--mono); font-weight: 600; font-size: 12.5px; }
.tool .tool-arg { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tool .tool-state { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tool.ok .tool-state { color: var(--muted); }
.tool.failed .tool-state { color: var(--danger); }
.tool.running .tool-state::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-end: 6px; border-radius: 50%; background: var(--accent); animation: blink 1s steps(1) infinite; }
.tool-body { padding: 0 10px 10px; display: grid; gap: 6px; }
.tool-body .label { font-size: 12px; color: var(--muted); }
.tool-body pre { margin: 0; background: var(--code-bg); padding: 8px 10px; border-radius: 6px; overflow-x: auto; max-height: 320px; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; }
.tool .bar { margin: 0 10px 10px; }
.tool .tool-images { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 10px 10px; }
.tool .tool-images img { max-width: 260px; max-height: 260px; border-radius: 6px; display: block; }

.note { align-self: center; color: var(--muted); font-size: 12.5px; text-align: center; max-width: 90%; }
.msg-actions { align-self: flex-end; margin-top: -6px; }
.msg-actions.center { align-self: center; }
.offer-full { align-self: flex-start; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--muted); }
.offer-full button { font-size: 13px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12px; cursor: pointer; }
/* read aloud (speak.js): under a finished reply */
.speak-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 6px; }
.speak-btn { font-size: 13px; }
.speak-btn[aria-pressed="true"] { color: var(--accent-ink); }
.speak-note { font-size: 13px; color: var(--danger); }
.pf-select { min-height: 36px; max-width: 100%; }
/* dictation (dictate.js): the microphone beside Send */
.mic-btn { min-width: 44px; padding: 0 10px; font-variant-numeric: tabular-nums; }
.mic-btn[data-state="recording"] { border-color: var(--danger); color: var(--danger); }
.mic-note { margin: 4px 0 0; font-size: 13px; color: var(--danger); }
.link-btn:hover:not(:disabled) { color: var(--accent); text-decoration: underline; }
.link-btn:disabled { opacity: .5; cursor: default; }
.summary-marker { align-self: stretch; border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); padding: 6px 0; color: var(--muted); font-size: 12.5px; }
.summary-marker summary { cursor: pointer; text-align: center; }
.summary-marker .md { color: var(--text); font-size: 13.5px; padding: 6px 4px 0; }
.tool .approval { display: flex; align-items: center; gap: 8px; padding: 0 10px 10px; flex-wrap: wrap; }
.tool .approval span { color: var(--text); font-size: 13px; margin-inline-end: auto; }
.tool .approval button { padding: 4px 14px; font-size: 13px; }
.usage { color: var(--muted); font-size: 12px; margin: -4px 0 8px; }
.tool .approval .question { white-space: pre-wrap; overflow-wrap: anywhere; flex-basis: 100%; }
.tool .tool-links { margin: 0; padding: 0 10px 10px 30px; font-size: 13px; }
.tool .tool-links li { margin: 2px 0; }
.tool .tool-links a, .refs a.name { color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
.tool .tool-links a:hover, .refs a.name:hover { text-decoration: underline; }
.tool .tool-links .host, .refs .host { color: var(--muted); font-size: 12px; margin-inline-start: 6px; }
.refs { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.refs > li { padding: 3px 0; }
.refs .empty-note { color: var(--muted); }
.refs li.failed a.name { color: var(--muted); }
.refs li.failed .host { color: var(--danger); }
.msg .citations { margin-top: 8px; padding: 6px 10px; border-inline-start: 3px solid var(--border); color: var(--muted);
  font-size: 12.5px; }
.msg .citations p { margin: 2px 0; overflow-wrap: anywhere; }
.msg .citations a { color: var(--muted); }
.msg .citations ul { margin: 2px 0 4px; padding-inline-start: 18px; }
.msg .context-cut { margin-top: 8px; padding: 6px 10px; border-inline-start: 3px solid var(--danger); color: var(--muted); font-size: 12.5px; }
.msg .citations strong { color: var(--text); font-weight: 600; }
.refs .searches summary { color: var(--muted); cursor: pointer; font-size: 13px; }
.refs .searches ol { margin: 4px 0 0; padding-inline-start: 20px; color: var(--muted); font-size: 12.5px; }
.usage.full { color: var(--danger); }
.agent-status { color: var(--muted); font-size: 13px; padding: 2px 0 0; }
.agent-status.error { color: var(--danger); }

@media (max-width: 900px) {
  .panel.agent { grid-template-columns: 1fr; }
  .side-toggle { display: inline-block; }
  .agent-side {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(340px, 88vw);
    background: var(--surface);
    border-inline-start: 1px solid var(--border);
    padding: 16px;
    z-index: 10;
    box-shadow: -8px 0 24px rgb(0 0 0 / .25);
    transform: translateX(100%);
    transition: transform .2s;
  }
  .agent-side.open { transform: none; }
}

@media (max-width: 700px) {
  .viewer { grid-template-columns: 1fr; }
  .viewer img { max-height: 60vh; }
  .push-right { margin-inline-start: 0; }
  /* touch: controls at least 44 px high, and fields at 16 px so phones don't zoom into them */
  button:not(.link-btn):not(.icon-btn):not(.thumb), .button, select,
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  .credits summary, .account summary { min-height: 44px; }
  textarea, input, select { font-size: 16px; }
  .suggestions button { height: 44px; }
}

@media (max-width: 560px) {
  /* (clip: the account picture's twinkling star, scaled, poked past the screen's edge: a page 2 px too wide; the
     menus open downwards, so clipping sideways cuts nothing) */
  .topbar { gap: 8px; padding: 0 12px; overflow-x: clip; }
  body:not(.signed-out) .brand { display: none; }
  /* the tabs: icon above a small label */
  .tabs button { flex-direction: column; justify-content: center; gap: 2px; height: 56px; padding: 0 9px; font-size: 11.5px; }
  .tabs .icon { width: 20px; height: 20px; }
  /* the account: its letter only */
  #account-name { display: none; }
  .account summary { width: 44px; padding: 0; justify-content: center; }
  .account summary::after { display: none; }
  .auth { padding: 24px 16px; }
  /* the agent's model and mode: a row each, so neither is squeezed */
  .agent-main .model-pick { flex: 1 1 100%; }
  .credits { position: static; }
  .credits summary .chip-long { display: none; }
  .credits summary .chip-short { display: inline; }
  .credits-menu { inset-inline-start: 12px; inset-inline-end: 12px; width: auto; top: calc(100% - 4px); }
  .model-pick span { display: none; }
  .msg.user { max-width: 95%; }
}

/* ── the Games tab (games.js) ─────────────────────────── */
.games { overflow-y: auto; padding-bottom: 48px; }
/* The painted backgrounds (games.js setGamesBackdrop): the panel spans the window, its parts keep
   the panel's width, and the scene sits behind them across the top, fading out going down. It
   stays put while the page scrolls over it (sticky at the panel's top, taking no room: its
   negative margin lets the content start at the top too). */
.panel.games { position: relative; max-width: none; padding: 0; }
.panel.games > .games-hub, .panel.games > .game-view, .panel.games > .games-ad {
  position: relative; z-index: 1; width: 100%; max-width: 880px; margin-inline: auto; padding-inline: 16px; }
.games-backdrop { display: none; }
.games.has-bg .games-backdrop {
  --bg-h: clamp(380px, 50vw, 680px);
  display: block; position: sticky; top: 0; z-index: 0; pointer-events: none;
  height: var(--bg-h); margin-bottom: calc(-1 * var(--bg-h));
  background: var(--bg-wide) center 35% / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 38%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 38%, transparent 100%); }
.games.has-bg .games-backdrop::after {  /* toward the theme's own color as it goes down */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 6%, transparent) 0%,
    color-mix(in srgb, var(--bg) 28%, transparent) 45%, color-mix(in srgb, var(--bg) 75%, transparent) 85%); }
.games-backdrop.swap { animation: games-bg-in .6s ease; }
@keyframes games-bg-in { from { opacity: 0; } to { opacity: 1; } }
.games.has-bg .games-head { padding-top: clamp(120px, 18vw, 230px); }
.games.has-bg .games-head h1 { font-size: clamp(30px, 4.2vw, 40px); }
.games.has-bg .games-head p { color: var(--text); font-weight: 500; }
.games.has-bg .games-head h1, .games.has-bg .games-head p {
  text-shadow: 0 1px 3px var(--bg), 0 0 14px var(--bg), 0 0 28px var(--bg); }
/* a game: a sheet over the scene, the scene showing above it and dimly through it */
.games.has-bg .game-view {
  width: calc(100% - 24px); margin-top: clamp(60px, 11vw, 150px); padding: 4px 20px 20px; border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 84%, transparent); border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow); }
@media (max-width: 700px) {
  .games.has-bg .games-backdrop { background-image: var(--bg-small); --bg-h: 380px; }
  .games.has-bg .game-view { width: calc(100% - 16px); padding: 2px 12px 16px; }
}
@media (prefers-reduced-motion: reduce) { .games-backdrop.swap { animation: none; } }
.games-head { margin: 20px 0 14px; }
.games-head h1 { margin: 0; font-family: var(--font-display); font-size: 26px; }
.games-head p { margin: 4px 0 0; font-size: 14px; }
.games-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.game-card {
  display: grid; align-content: start; gap: 8px; padding: 16px; text-align: left;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  font-weight: 400;
}
.game-card:hover { border-color: var(--accent); }
.game-card { overflow: hidden; }
.gc-art { display: block; width: calc(100% + 32px); max-width: none; margin: -16px -16px 2px; aspect-ratio: 2 / 1;
  object-fit: cover; background: var(--raised); }
.gc-top { display: flex; align-items: center; gap: 10px; }
.gc-top h3 { margin: 0; font-size: 17px; font-family: var(--font-display); }
.gc-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center;
  justify-content: center; background: var(--accent-soft); color: var(--accent-ink); }
.gc-blurb, .game-status, .gc-prize { margin: 0; font-size: 14px; }
.gc-blurb { color: var(--muted); }
.game-status { font-variant-numeric: tabular-nums; }
.gc-new { color: var(--accent-ink); font-weight: 600; }
.gc-prize { font-size: 13px; color: var(--muted); }
/* a game's tags under its name (games.tags): "Collaborative" */
.gc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -2px; }
.gc-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px;
  font-weight: 600; letter-spacing: .02em; color: var(--accent-ink); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.gc-tag-collaborative::before { content: ""; width: 14px; height: 10px; flex: none; background: currentColor;
  -webkit-mask: radial-gradient(circle 3.2px at 4px 3.4px, #000 98%, transparent) , radial-gradient(circle 3.2px at 10px 3.4px, #000 98%, transparent),
    radial-gradient(6px 4.5px at 4px 10px, #000 98%, transparent), radial-gradient(6px 4.5px at 10px 10px, #000 98%, transparent);
  mask: radial-gradient(circle 3.2px at 4px 3.4px, #000 98%, transparent) , radial-gradient(circle 3.2px at 10px 3.4px, #000 98%, transparent),
    radial-gradient(6px 4.5px at 4px 10px, #000 98%, transparent), radial-gradient(6px 4.5px at 10px 10px, #000 98%, transparent); }
.gc-down { color: var(--danger); font-weight: 600; }

.game-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 10px; }
.game-top h2 { margin: 0; font-size: 20px; font-family: var(--font-display); }
.game-clock { margin-left: auto; font-size: 13px; font-variant-numeric: tabular-nums; }
.game-body { display: grid; gap: 12px; }
.game-body > p { margin: 0; }
.game-intro { font-size: 15px; }
.game-count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.game-wait { padding: 16px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
.game-meter { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.game-meter span { display: block; height: 100%; background: var(--accent); }
.game-form { display: flex; gap: 8px; }
.game-form input { flex: 1; min-width: 0; }
.game-actions { display: flex; gap: 8px; justify-content: flex-end; }
.game-error { margin: 0; }
.game-result { padding: 16px; border-radius: var(--radius); background: var(--accent-soft); display: grid; gap: 8px; }
.game-result h3 { margin: 0; font-size: 18px; font-family: var(--font-display); }
.game-result p { margin: 0; }
.game-prize-won { color: var(--accent-ink); font-weight: 700; font-size: 16px; }
.game-prev { color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); padding-top: 12px; }

.secret-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.secret-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.secret-q { min-width: 0; overflow-wrap: anywhere; }
.ans { flex: none; padding: 2px 10px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600;
  background: var(--raised); color: var(--muted); white-space: nowrap; }
.ans-yes, .ans-found { color: var(--good); background: color-mix(in srgb, var(--good) 16%, transparent); }
.ans-no { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.ans-partly, .ans-close { color: var(--accent-ink); background: var(--accent-soft); }
.ans-not_yes_no { font-weight: 500; }

.riddle-pic { width: 100%; max-height: 56vh; object-fit: contain; border-radius: var(--radius); background: var(--raised); }
.things { display: flex; flex-wrap: wrap; gap: 6px; }
.thing { padding: 3px 12px; border-radius: var(--radius-pill); border: 1px dashed var(--border); color: var(--muted);
  font-size: 14px; min-width: 40px; text-align: center; }
.thing.found { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.thing.missed { border-style: solid; color: var(--text); }
.riddle-description { font-size: 16px; }
.word-count { margin-top: -6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.word-count.over { color: var(--danger); }
.riddle-guesses { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.riddle-guesses li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.rg-text { min-width: 0; overflow-wrap: anywhere; }
.rg-found { flex: none; color: var(--muted); }
.riddle-prev { display: flex; gap: 12px; align-items: center; }
.riddle-prev p { margin: 0; }
.riddle-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; }

.draw-word { margin: 0; font-size: 18px; text-align: center; }
.draw-word strong { font-family: var(--font-display); font-size: 24px; color: var(--accent-ink); }
.timebar { height: 6px; width: min(100%, 480px); justify-self: center; border-radius: 3px; background: var(--raised); overflow: hidden; }
.timebar span { display: block; height: 100%; background: var(--accent); transition: width .25s linear; }
.timebar span.late { background: var(--danger); }
.draw-canvas { width: min(100%, 480px); aspect-ratio: 1; justify-self: center; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; touch-action: none; cursor: crosshair; }
.draw-tools { display: flex; gap: 8px; justify-content: center; }
.ai-guess { text-align: center; font-family: var(--font-display); font-size: 22px; min-height: 1.5em; }
.ai-guess.thinking { opacity: .6; }
.guess-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.guess-chip { padding: 2px 10px; border-radius: var(--radius-pill); background: var(--raised); color: var(--muted);
  font-size: 13px; text-decoration: line-through; }
.draw-left { text-align: center; }
.game-start { justify-self: start; }
/* one round, then a wait (games.waits, 2026-11-25): when the next is ready, a video that opens it now */
.game-wait { display: grid; gap: 8px; justify-items: start; padding: 12px 14px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid var(--border); }
.game-wait .game-wait-left { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.game-wait .game-wait-note { margin: 0; font-size: 13px; }
.gc-wait { font-variant-numeric: tabular-nums; }

.games-ad { margin-top: 28px; }
/* web/fx.js: the confetti, a solved quote's wave; and the CSS ones while it's on (.fx-on) */
.fx-layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.fx-bit, .fx-coin { position: fixed; display: block; }
.fx-bit { width: 8px; height: 12px; border-radius: 2px; }
.fx-coin { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3b0, #f4c430 45%, #b8860b);
  box-shadow: inset 0 0 0 1.5px rgb(120 80 0 / .5); }
.fx-word { display: inline-block; white-space: nowrap; }
.fx-letter { display: inline-block; }
.games.fx-on .game-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.games.fx-on .game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.games.fx-on .streak:not(.none) .gc-icon .icon { animation: fx-flicker 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes fx-flicker { 0%, 100% { transform: scale(1) rotate(0deg); } 25% { transform: scale(1.06, .95) rotate(-3deg); }
  50% { transform: scale(.97, 1.05) rotate(2deg); } 75% { transform: scale(1.03, .98) rotate(-1deg); } }
.badge.fx-new { box-shadow: 0 0 0 2px var(--accent), 0 0 14px var(--accent-soft); }
.crypto-cell input, .cg-cell input { backface-visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .games.fx-on .streak .gc-icon .icon { animation: none; }
  .games.fx-on .game-card:hover { transform: none; } .cp-layer.spread.shown { animation: none; } }
.games-ad.far { margin-top: 150px; }  /* under a game: clear of it and its controls */
.ad-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgb(0 0 0 / .65); }
.ad-overlay iframe { width: min(100%, 720px); height: min(100%, 520px); border: 0; border-radius: 14px; background: #fff; }
.game-more { justify-self: start; }

/* the cryptogram (games.js renderCryptoPuzzle): a cell per letter, the guess over the code */
.crypto-board { display: flex; flex-wrap: wrap; gap: 14px 20px; padding: 16px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); }
.cw { display: inline-flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 3px; }
.cc { display: grid; justify-items: center; gap: 3px; cursor: text; }
input.cc-in { width: 34px; height: 38px; padding: 0; text-align: center; font: 700 18px/1 var(--mono);
  text-transform: uppercase; border: 0; border-bottom: 2px solid var(--muted); border-radius: 5px 5px 0 0;
  background: var(--raised); color: var(--text); caret-color: transparent; }
input.cc-in:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.cc.same input.cc-in { background: var(--accent-soft); border-bottom-color: var(--accent); }
.cc.given input.cc-in { background: transparent; color: var(--accent-ink); border-bottom-style: dotted; }
.cc.clash input.cc-in { color: var(--bad); }
.cc-code { font: 500 12px/1 var(--mono); color: var(--muted); }
.cc-mark { display: flex; align-items: center; height: 38px; font: 700 18px/1 var(--mono); color: var(--muted); }
.crypto-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.ck { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 9px; border: 1px solid var(--border);
  border-radius: var(--radius-pill); font: 13px/1.4 var(--mono); }
.ck-code { font-weight: 700; }
.ck-n { color: var(--muted); font-size: 12px; }
.ck-guess { min-width: 1ch; color: var(--accent-ink); font-weight: 700; }
.ck-guess::before { content: "="; margin-right: 5px; color: var(--muted); font-weight: 400; }
.ck-guess:empty::after { content: "?"; color: var(--muted); font-weight: 400; }
.ck.done { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.ck.same { background: var(--accent-soft); border-color: var(--accent); }
.crypto-status { min-height: 1.4em; color: var(--bad); font-size: 14px; }
.crypto-hints { display: flex; flex-wrap: wrap; gap: 8px; }
.crypto-clue { padding: 10px 14px; border-radius: var(--radius); background: var(--accent-soft); font-size: 15px; }
.crypto-answer { margin: 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--accent); display: grid; gap: 4px; }
.crypto-answer p { margin: 0; font-size: 17px; }
.crypto-answer cite { color: var(--muted); font-style: normal; font-size: 14px; }
@media (max-width: 560px) {
  .crypto-board { padding: 12px 10px; gap: 12px 14px; }
  .cw { gap: 4px 2px; }
  input.cc-in { width: 25px; height: 34px; font-size: 16px; }  /* 16px: phones don't zoom in on it */
  .cc-mark { height: 34px; font-size: 16px; }
}

/* Color guess (games.js renderColorsPlay): the gray picture, each color found laid over it, the
   spots (rings with a number, the area inside left visible), the color swatches */
.colors-pic { position: relative; width: 100%; max-width: 768px; margin: 0 auto; border-radius: var(--radius);
  overflow: hidden; line-height: 0; user-select: none; -webkit-user-select: none; }
.cp-gray { display: block; width: 100%; height: auto; }
.cp-layer { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .9s ease; pointer-events: none; }
.cp-layer.shown, .game-result .cp-layer { opacity: 1; }
/* a right color spreading out from its spot (web/fx.js on; games.js guessColor sets --x, --y) */
.cp-layer.spread.shown { transition: none; animation: cp-spread .75s cubic-bezier(.3,.7,.4,1) both; }
@keyframes cp-spread { from { clip-path: circle(0% at var(--x, 50%) var(--y, 50%)); }
  to { clip-path: circle(150% at var(--x, 50%) var(--y, 50%)); } }
.game-result .cp-layer { animation: cp-fade 1.2s ease; }
@keyframes cp-fade { from { opacity: 0; } to { opacity: 1; } }
.cp-spot { position: absolute; width: 32px; height: 32px; margin: -16px 0 0 -16px; padding: 0; border: 0;
  background: transparent; cursor: pointer; line-height: 1; }
.cp-spot::before { content: ''; position: absolute; left: 10px; top: 10px; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 2px #1c1c1e, 0 1px 4px rgba(0, 0, 0, .5); }
.cp-num { position: absolute; left: 25px; top: -1px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: #1c1c1e; color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; }
.cp-spot.flip .cp-num { left: auto; right: 25px; }  /* near the right edge: the number on the left */
.cp-spot.sel::before { background: #ffd60a; animation: cp-pulse 1.6s ease-in-out infinite; }
.cp-spot.sel .cp-num { background: #ffd60a; color: #1c1c1e; }
.cp-spot.found { cursor: default; }
.cp-spot.found::before { background: var(--spot, #fff); }
.cp-spot.found .cp-num { background: #1f8a3a; }
.game-result .cp-spot { pointer-events: none; }
@keyframes cp-pulse { 50% { box-shadow: 0 0 0 2px #1c1c1e, 0 0 0 9px rgba(255, 214, 10, .45); } }
@media (prefers-reduced-motion: reduce) { .cp-spot.sel::before { animation: none; } .cp-layer { transition: none; } .game-result .cp-layer { animation: none; } }
.colors-ask { margin: 0; font-weight: 600; min-height: 1.4em; }
.colors-ask-text { display: grid; gap: 4px; margin-top: 4px; }
.colors-hint { margin: 0; font-size: 14px; color: var(--muted); }
/* the selected spot's color outlined wherever it is (games.js showColors) */
.cp-area { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cp-area[hidden] { display: none; }
/* the selected spot enlarged (games.js showZoom): the picture as background, 4× */
.cp-zoom { position: relative; flex: 0 0 auto; width: 176px; aspect-ratio: 4 / 3; border-radius: var(--radius);
  border: 1px solid var(--border); background-color: var(--surface); background-repeat: no-repeat; overflow: hidden; }
.cp-zoom[hidden] { display: none; }
.cp-zoom-mark { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  border: 2px solid #ffd60a; box-shadow: 0 0 0 1px #1c1c1e, inset 0 0 0 1px #1c1c1e; }
.colors-palette { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px; }
.cp-sw { display: grid; justify-items: center; gap: 4px; padding: 6px 2px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); color: inherit; cursor: pointer; font-size: 12px; }
/* the color at the selected spot's brightness (--shade), ringed by its usual color (--sw) */
.cp-chip { width: 34px; height: 34px; box-sizing: border-box; border-radius: 50%; background: var(--shade, var(--sw));
  border: 4px solid var(--sw); }
.cp-sw:disabled { cursor: default; opacity: .35; }
.cp-sw.tried .cp-chip { background: linear-gradient(to top right, transparent 46%, var(--text, #222) 46% 54%, transparent 54%), var(--shade, var(--sw)); }
.cp-sw.close::after { content: 'close'; font-size: 11px; font-weight: 600; color: var(--accent-ink); }  /* a neighbour of the answer */
.cp-sw:not(:disabled):hover { border-color: var(--accent); }
@media (max-width: 560px) {
  .colors-palette { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .cp-zoom { width: 132px; }
}

/* a prize, and "watch a short ad to make it 3 credits" (games.js prizeLine) */
/* Haggle: the stall, the talk (the merchant's lines left, the player's right), the form */
.hg-stall { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); }
.game-result .hg-stall { background: transparent; border: 0; padding: 0; }
.hg-emoji { font-size: 34px; line-height: 1; flex: none; }
.hg-what { display: grid; gap: 2px; min-width: 0; flex: 1; }
.hg-what strong { font-size: 17px; }
.hg-what span { font-size: 13px; }
.hg-ask { display: grid; justify-items: end; flex: none; font-variant-numeric: tabular-nums; font-size: 12px; }
.hg-ask strong { font-size: 22px; line-height: 1.15; font-family: var(--font-display); color: var(--accent-ink); }
.hg-ask s { color: var(--muted); font-size: 13px; }
.hg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--muted); font-size: 14px; }
.hg-meta span:last-child { margin-left: auto; font-variant-numeric: tabular-nums; }
.hg-hearts { color: var(--bad); letter-spacing: 2px; }
.hg-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hg-line { display: flex; }
.hg-you { justify-content: flex-end; }
.hg-bubble { max-width: min(82%, 540px); padding: 8px 12px; border-radius: 14px; display: grid; gap: 4px;
  overflow-wrap: anywhere; }
.hg-bubble p { margin: 0; }
.hg-them .hg-bubble { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.hg-you .hg-bubble { background: var(--user-bg); border-bottom-right-radius: 4px; }
.hg-pending .hg-bubble p { color: var(--muted); }
.hg-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums; }
.hg-you .hg-tags { justify-content: flex-end; }
.hg-price { font-weight: 600; }
.hg-price.down { color: var(--good); }
.hg-price.up { color: var(--bad); }
.hg-mood { padding: 1px 8px; border-radius: var(--radius-pill); font-weight: 600; background: var(--raised); }
.hg-mood.great { color: var(--good); background: color-mix(in srgb, var(--good) 16%, transparent); }
.hg-mood.good { color: var(--accent-ink); background: var(--accent-soft); }
.hg-mood.rude { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.hg-mood.held { color: var(--gold, #e9c46a); background: color-mix(in srgb, var(--gold, #e9c46a) 14%, transparent); }   /* (refuse_chance) */
.hg-form .hg-offer { flex: 0 0 84px; }
.hg-talk summary { cursor: pointer; color: var(--muted); font-size: 14px; }
/* the merchant's portrait (sprites): left of the thing and the price; it breathes, and reacts
   to a change of mood (hop, nod, shake, tilt); none of it with reduced motion */
.hg-stall.with-portrait { display: grid; grid-template-columns: 150px minmax(0, 1fr); column-gap: 14px; row-gap: 4px;
  align-items: center; padding: 6px 14px 0 6px; overflow: hidden; }
.game-result .hg-stall.with-portrait { padding: 0; }
.with-portrait .hg-portrait { grid-row: 1 / span 2; align-self: end; }
.with-portrait .hg-head { display: flex; align-items: center; gap: 10px; min-width: 0; padding-top: 8px; }
.with-portrait .hg-ask { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; justify-items: start;
  align-self: start; padding-bottom: 10px; }
.hg-portrait { width: 150px; aspect-ratio: 3 / 4; }
.hg-portrait img { display: block; width: 100%; height: 100%; object-fit: contain; transform-origin: 50% 100%;
  animation: hg-breathe 5s ease-in-out infinite; }
.hg-portrait.react-charmed img { animation: hg-hop .7s ease-out, hg-breathe 5s ease-in-out .7s infinite; }
.hg-portrait.react-pleased img { animation: hg-nod .6s ease-out, hg-breathe 5s ease-in-out .6s infinite; }
.hg-portrait.react-offended img { animation: hg-shake .5s ease-in-out, hg-breathe 5s ease-in-out .5s infinite; }
.hg-portrait.react-unmoved img { animation: hg-tilt .7s ease-in-out, hg-breathe 5s ease-in-out .7s infinite; }
.hg-thing { flex: none; width: 52px; height: 52px; object-fit: contain; }
.hg-rec-top .hg-thing { width: 56px; height: 56px; }
/* still between reactions (games.breathing false): only the reaction plays */
.games.still .hg-portrait img { animation: none; }
.games.still .hg-portrait.react-charmed img { animation: hg-hop .7s ease-out; }
.games.still .hg-portrait.react-pleased img { animation: hg-nod .6s ease-out; }
.games.still .hg-portrait.react-offended img { animation: hg-shake .5s ease-in-out; }
.games.still .hg-portrait.react-unmoved img { animation: hg-tilt .7s ease-in-out; }
.games.still .artist { animation: none; }
.games.still .artist.pop { animation: hg-hop .6s ease-out; }
@keyframes hg-breathe { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-1px) scaleY(1.012); } }
@keyframes hg-hop { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-10px); } 55% { transform: translateY(0); }
  75% { transform: translateY(-4px); } }
@keyframes hg-nod { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(4px); } }
@keyframes hg-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@keyframes hg-tilt { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-2.5deg); } }
@media (max-width: 480px) {
  .hg-stall.with-portrait { grid-template-columns: 96px minmax(0, 1fr); column-gap: 10px; }
  .hg-portrait { width: 96px; }
  .hg-thing { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .hg-portrait img { animation: none !important; } }
.hg-rec-note { font-size: 14px; padding: 6px 12px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-ink); }
.hg-standing { font-weight: 600; }
.hg-records { display: grid; gap: 10px; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.hg-records > h3 { margin: 0; font-size: 18px; font-family: var(--font-display); }
.hg-records > p { margin: 0; font-size: 14px; }
.hg-rec { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); }
.hg-rec .hg-rec-top { padding: 0; border: 0; background: transparent; }
.hg-rec > button { justify-self: start; }
.hg-rec-line { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.hg-board summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.hg-board-list { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 14px;
  font-variant-numeric: tabular-nums; }
.hg-board-list li { display: grid; grid-template-columns: 2.2em 1fr auto 4.5em; gap: 8px; padding: 3px 6px; border-radius: 6px; }
.hg-board-list li.you { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.hg-board-list .hg-paid { text-align: right; }
.hg-board-list li > span:last-child { text-align: right; }
.hg-talk .hg-log { margin-top: 8px; }
.game-prize { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.game-prize .game-prize-won { margin: 0; }
.game-boost { white-space: normal; text-align: left; }

/* the streak and the badges, above the games (games.js renderProgress) */
.games-progress { display: grid; gap: 10px; margin-bottom: 16px; }
.games-progress:empty { display: none; }
.streak { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.streak .gc-icon { width: 36px; height: 36px; }
.streak.none .gc-icon { background: var(--raised); color: var(--muted); }
.streak-words { display: grid; gap: 2px; margin-right: auto; }
.streak-words strong { font-family: var(--font-display); font-size: 17px; font-variant-numeric: tabular-nums; }
.streak-gift { font-size: 13px; color: var(--accent); font-variant-numeric: tabular-nums; }
.streak-words span { font-size: 13px; }
.streak-save { white-space: normal; text-align: left; }
.streak-note { font-size: 13px; }
.badges-head { margin: 0; font-size: 13px; }
.badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13px; }
.badge .gc-icon { width: 24px; height: 24px; border-radius: 50%; background: var(--raised); color: var(--muted); }
.badge .gc-icon .icon { width: 15px; height: 15px; }
.badge.earned { color: var(--text); border-color: var(--accent); }
.badge.earned .gc-icon { background: var(--accent-soft); color: var(--accent-ink); }
.badge-count { font-variant-numeric: tabular-nums; }
.badge-pic { flex: none; width: 28px; height: 28px; object-fit: contain; }
.badge:not(.earned) .badge-pic { filter: grayscale(1); opacity: .5; }
/* Draw and guess's AI artist: beside what it says; a pop when its mood changes */
.artist-row { display: flex; align-items: center; gap: 12px; }
.artist-row > :not(.artist) { flex: 1; min-width: 0; margin: 0; }
.artist { flex: none; width: 100px; aspect-ratio: 3 / 4; object-fit: contain; transform-origin: 50% 100%;
  animation: hg-breathe 5s ease-in-out infinite; }
.game-result .artist { width: 112px; }
.artist.pop { animation: hg-hop .6s ease-out, hg-breathe 5s ease-in-out .6s infinite; }
@media (prefers-reduced-motion: reduce) { .artist { animation: none !important; } }

/* "watch a short ad for 10 credits" (app.js creditsVideoOffer) */
.video-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; font-size: 13px; }
.video-done { color: var(--accent-ink); font-weight: 600; margin: 0; }
/* The framed "watch a video for credits" line in the Text, Image and Agent tabs (ads.rewarded_credits.in_tabs) */
.video-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 8px 0; padding: 8px 12px;
  border: 1.5px solid var(--accent); border-radius: 10px; font-size: 14px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); }
.video-strip-icon { color: var(--accent-ink); font-size: 12px; }
.video-strip-text { font-weight: 600; color: var(--accent-ink); }
.video-strip-left { color: var(--muted); font-size: 13px; }
.video-strip button { margin-inline-start: auto; }
.video-strip-done { color: var(--accent-ink); font-weight: 600; }
.cp-video { display: grid; gap: 8px; }
.cp-video p { margin: 0; }
.cp-video .video-offer { margin-top: 0; }
@media (max-width: 560px) { .ad-overlay { padding: 0; } .ad-overlay iframe { width: 100%; height: 100%; border-radius: 0; } }

/* five tabs (with the Garden), the credits and the account on a phone: the chip shows the
   number (the word stays for screen readers), and the tabs sit closer */
@media (max-width: 430px) {
  .topbar { gap: 6px; padding: 0 8px; }
  .tabs { gap: 0; }
  .tabs button { padding: 0 5px; font-size: 10.5px; }
  .account summary { width: 40px; }
  .credits summary { padding: 0 8px; }
  .credits summary .chip-unit { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
    white-space: nowrap; }
}

@media (max-width: 560px) {
  .games-head h1 { font-size: 22px; }
  .game-clock { margin-left: 0; width: 100%; }
  .ai-guess { font-size: 19px; }
}

/* ── Ads (ads.js): each in its own box, saying it is from an advertiser, not this site ── */
.ad-spot:empty { display: none; }
.ad-box { margin: 0 auto; max-width: 760px; padding: 6px 8px 8px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--raised); }
.ad-head { display: flex; align-items: center; gap: 8px; margin: 0 2px 6px; font-size: 11.5px; line-height: 1.3;
  color: var(--muted); }
.ad-tag { flex: none; padding: 0 5px; border: 1px solid var(--muted); border-radius: 4px; font-size: 10px;
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ad-box iframe { display: block; width: 100%; height: 90px; border: 0; border-radius: 8px; background: var(--surface); }
.ad-size-box { max-width: 316px; }
.ad-box.ad-rest { display: none !important; }   /* a place resting this turn (ads.banner_share; the rails' own boxes too) */
.ad-size-box iframe { height: 250px; }
#image-ad, #credits-ad { margin-top: 24px; }
.gallery .ad-row { grid-column: 1 / -1; width: 100%; margin: 6px auto; }
/* in a conversation: set apart from the replies, a little narrower, with room around it */
.messages .ad-box { width: 100%; margin: 22px auto; }
.messages .ad-box.ad-thread { max-width: 600px; }
.agent-side .ad-box { margin: 0; }
/* the rails: fixed beside the page, only where the screen leaves room (ads.js RAIL_MIN) */
.ad-rail { position: fixed; top: 76px; z-index: 1; display: none; width: 176px;
  height: min(640px, calc(100vh - 92px)); }
.ad-rail.left { left: 16px; }
.ad-rail.right { right: 16px; }
.ad-rail .ad-box { height: 100%; max-width: none; display: flex; flex-direction: column; padding: 6px; }
.ad-rail .ad-box iframe { flex: 1; min-height: 0; height: auto; }
.ad-rail .ad-head { align-items: flex-start; }
@media (min-width: 1280px) { body:not([data-ad-tab="games"]):not([data-ad-tab="agent"]):not([data-ad-tab="nightshift"]) .ad-rail { display: block; } }
@media (min-width: 1540px) { body[data-ad-tab="games"] .ad-rail, body[data-ad-tab="nightshift"] .ad-rail { display: block; } }
@media (min-width: 1640px) { body[data-ad-tab="agent"] .ad-rail { display: block; } }
@media (max-height: 560px) { .ad-rail { display: none !important; } }
@media (max-width: 560px) { .messages .ad-box { margin: 16px auto; } .ad-head { font-size: 11px; } }

/* ── the Garden tab (garden.js) ─────────────────────────── */
/* the panel is the window's height (.panel): the garden scrolls inside it, like the games, and
   its parts keep their own heights (a squeezed grid row cut the scene to a strip) */
.garden { overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding-bottom: 32px; }
.garden > * { flex: none; min-width: 0; }
.garden > [hidden] { display: none; }
.garden-head { position: relative; display: flex; align-items: flex-end; gap: 14px; margin-top: 12px; }
/* Hana alive (garden.js setLive): a canvas over her picture, the same box (placeLive) */
.garden-hana-live { position: absolute; z-index: 1; pointer-events: none; transform-origin: 50% 100%; }
.garden-hana-live.pop { animation: hg-hop .6s ease-out; }
.garden.hana-side .garden-hana-live {
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 98%);
  mask-image: linear-gradient(to bottom, #000 70%, transparent 98%); }
.garden-hana { flex: none; width: 104px; aspect-ratio: 3 / 4; object-fit: contain; transform-origin: 50% 100%;
  animation: hg-breathe 5s ease-in-out infinite; }
.garden-hana.pop { animation: hg-hop .6s ease-out, hg-breathe 5s ease-in-out .6s infinite; }
/* her idle animation (garden.js renderHana): its still layer is the picture's background, its
   moving layer the picture; no stretching besides it, only the hop on a new mood */
.garden-hana { background: no-repeat center / 100% 100%; }
.garden.hana-alive .garden-hana { animation: none; }
.garden.hana-alive .garden-hana.pop { animation: hg-hop .6s ease-out; }
/* her slight breathing while idle where there's no canvas (games.garden.hana_breathing): the
   picture rises 1 px and settles, no stretch (the old breathing's 1.2% stretch read as one) */
.garden.hana-breathes .garden-hana.idle { animation: hana-breathe 4.2s ease-in-out infinite; will-change: transform; }
.garden.hana-breathes .garden-hana.idle.pop { animation: hg-hop .6s ease-out, hana-breathe 4.2s ease-in-out .6s infinite; }
@keyframes hana-breathe { 0%, 100% { transform: translateY(0); } 42% { transform: translateY(-1px); } }
.garden-say { display: grid; gap: 6px; min-width: 0; padding-bottom: 8px; }
.garden-say h1 { margin: 0; font-size: 24px; font-family: var(--font-display); }
.garden-line { margin: 0; padding: 10px 14px; border-radius: 14px 14px 14px 4px; background: var(--surface);
  border: 1px solid var(--border); font-size: 15px; }
/* The head keeps one height (2026-11-18): her line in a box of three lines (four on a phone)
   that scrolls inside when she says more, the player's question and the day's line one line
   each, there even when empty. Her answer used to make the head taller, and the garden below it,
   the picture with it, slid down by its height (a dark band opening at the top), more for a
   longer answer: the user saw it as the background shifting when Enter sent a question. */
.garden-line { box-sizing: border-box; height: calc(3 * 1.45em + 22px); line-height: 1.45; overflow-y: auto;
  overscroll-behavior: contain; }
@media (max-width: 600px) { .garden-line { height: calc(4 * 1.45em + 22px); } }
.garden-you, .garden-weather { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35;
  min-height: 1.35em; }
.garden-you[hidden], .garden-weather[hidden] { display: block !important; visibility: hidden; }   /* (over [hidden]'s !important) */
/* the scene: 2:1 like its backdrop; on a narrow screen it keeps 640 px and scrolls sideways */
.garden-scroll { max-width: 100%; overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
/* The garden filling the page (garden.js placeWorld; games.garden.world): the panel spans the
   window, its parts keep their width over the wide picture, the scene loses its frame and shows
   only the pots; the picture fades out at the bottom (and at its sides on very wide windows). */
.garden-world, .garden-world-clip { display: none; }
.garden.has-world { position: relative; max-width: none; padding-inline: 0; overflow-x: hidden; }
.garden.has-world > :not(.garden-world-clip) { position: relative; z-index: 1; width: 100%; max-width: 880px;
  margin-inline: auto; padding-inline: 16px; }
/* the wide picture in a band as wide as the panel that clips it: nothing sticks out sideways, so
   the panel can't be scrolled sideways (a field focused or scrolled into view used to slide the
   whole garden by up to the picture's overhang; 2026-11-18) */
.garden.has-world .garden-world-clip { display: block; position: absolute; left: 0; right: 0; top: 0; z-index: 0;
  overflow: hidden; pointer-events: none; }   /* (from the content's top to its end: garden.js placeWorld) */
.garden.has-world .garden-world { display: block; position: absolute; top: 0; z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 86%, transparent 100%),
    linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 86%, transparent 100%),
    linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-composite: intersect; }
.garden-world img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; }
/* below the picture the page goes on in its bottom's color (garden.js: --ground, at this hour) */
.garden.has-world { background: var(--bg); }
/* …the sky above the picture and the lawn below it: elements in the picture's band, so they move
   with it as one (2026-11-18: painted as the panel's own background, attached to its content, they
   stayed behind when the page was pulled past its top or bottom: browsers bounce the content, not
   always such a background; the warm sky came loose from the picture) */
.garden-sky, .garden-ground { position: absolute; left: 0; right: 0; pointer-events: none; }
.garden-sky { top: 0; background: var(--sky, transparent); }
.garden-ground { background: linear-gradient(to bottom, transparent, var(--ground, transparent) var(--ground-fade, 0px)); }
/* the plants dim at night and warm at sunset and dawn, with the light (garden.js --night, --warm) */
.garden.day-cycle .garden-scene .gs-plant img {
  filter: brightness(calc(1 - .28 * var(--night, 0) - var(--gloom, 0)))
    saturate(calc(1 - .15 * var(--night, 0) + .1 * var(--warm, 0) - var(--cool, 0)))
    sepia(calc(.15 * var(--warm, 0))); }
/* a little fade toward the left and right, the middle in focus (games.garden.world_fade) */
.garden.has-world.fade-sides .garden-world {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 86%, transparent 100%),
    linear-gradient(to right, transparent, rgb(0 0 0 / .4) 10%, #000 31%, #000 69%, rgb(0 0 0 / .4) 90%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 86%, transparent 100%),
    linear-gradient(to right, transparent, rgb(0 0 0 / .4) 10%, #000 31%, #000 69%, rgb(0 0 0 / .4) 90%, transparent); }
/* Hana beside the garden (garden.js placeHana sets her width and place) */
.garden.hana-side .garden-head { position: relative; min-height: 0; }
.garden.hana-side .garden-hana { position: absolute; z-index: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 98%);
  mask-image: linear-gradient(to bottom, #000 70%, transparent 98%); }
.garden.has-world > .garden-scroll { max-width: 848px; padding-inline: 0; border: 0; border-radius: 0; }
.garden.has-world .garden-scene { background: transparent; }
.garden.has-world .garden-say h1 { text-shadow: 0 1px 3px var(--bg), 0 0 14px var(--bg), 0 0 28px var(--bg); }
/* the collection's heading is on the lawn or the ground below it, whatever the theme */
.garden.has-world .book-head { color: #fff; text-shadow: 0 1px 3px rgb(0 0 0 / .7), 0 0 14px rgb(0 0 0 / .55); }
.garden.has-world .book-head .muted { color: rgb(255 255 255 / .88); }
.garden.has-world .garden-actions { width: calc(100% - 32px); max-width: 848px; padding: 10px 14px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 86%, transparent); border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.garden-scene { position: relative; min-width: 640px; aspect-ratio: 2 / 1; overflow: hidden; background: #6b3a22; }
.gs-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.gs-plant { position: absolute; padding: 0; border: 0; background: none; cursor: pointer; transform-origin: 50% 100%;
  transition: filter .2s; }
.gs-plant img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.gs-plant.sel { filter: drop-shadow(0 0 6px rgb(255 255 255 / .95)) drop-shadow(0 0 2px rgb(255 240 160)); }
.gs-plant:focus-visible { outline: none; filter: drop-shadow(0 0 6px var(--accent)); }
.gs-plant.grew { animation: gs-grow .7s ease-out; }
.gs-plant.bloom.grew { animation: gs-bloom 1s ease-out; }
.gs-plant.thirsty::after { content: ''; position: absolute; left: 50%; bottom: calc(100% - 8px); width: 18px; height: 18px;
  margin-left: -9px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #6cc4ff; border: 2px solid #fff;
  animation: gs-drip 2.4s ease-in-out infinite; }
.gs-empty { position: absolute; width: 44px; height: 44px; margin: -50px 0 0 -22px; border-radius: 50%;
  border: 2px dashed rgb(255 255 255 / .75); background: rgb(0 0 0 / .18); color: #fff; font-size: 24px; line-height: 1; }
.gs-empty.sel { border-style: solid; background: rgb(0 0 0 / .35); }
.garden-scene[data-time="night"] .gs-plant img { filter: brightness(.72) saturate(.85); }
.garden-scene[data-time="sunset"] .gs-plant img { filter: sepia(.15) saturate(1.1); }
.gs-visitor { position: absolute; z-index: 4; width: 34px; height: 34px; pointer-events: none;
  top: calc(18% + var(--k) * 7%); left: -40px; animation: gs-fly calc(16s + var(--k) * 5s) linear calc(var(--k) * -6s) infinite; }
.gs-visitor img { width: 100%; height: 100%; object-fit: contain; animation: gs-flutter .35s ease-in-out infinite alternate; }
.gs-visitor.gs-ladybug { top: 79%; width: 22px; height: 22px; animation: gs-crawl 40s linear infinite; }
.gs-visitor.gs-ladybug img { animation: none; }
.gs-visitor.gs-robin { top: 49%; width: 46px; height: 46px; animation: gs-hop-by 28s ease-in-out infinite; }
.gs-visitor.gs-robin img { animation: none; }
/* the visitors moved by code (web/garden-visitors.js; games.garden.visitor_motion natural) */
.gv-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden;
  /* (the scene is clipped while the wide garden goes on: they fade at its sides, not cut off) */
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.gv { position: absolute; left: 0; top: 0; width: 34px; height: 34px; will-change: transform; }
.gv-butterfly { perspective: 80px; }
.gv-wing, .gv-img { position: absolute; top: 0; height: 100%; background-repeat: no-repeat; }
.gv-img { left: 0; width: 100%; background-size: contain; background-position: center; }
.gv-body { z-index: 1; }
.gv-buzz { transform-origin: 48% 47%; opacity: .5; filter: blur(.4px); }
.garden-scene[data-time="sunset"] .gv { filter: sepia(.15) saturate(1.1); }
@keyframes gs-fly { 0% { transform: translate(0, 0); } 25% { transform: translate(28vw, -30px); }
  50% { transform: translate(52vw, 20px); } 75% { transform: translate(78vw, -24px); } 100% { transform: translate(110vw, 0); } }
@keyframes gs-flutter { from { transform: scaleX(1); } to { transform: scaleX(.7); } }
@keyframes gs-crawl { from { left: 6%; } to { left: 94%; } }
@keyframes gs-hop-by { 0%, 100% { left: -50px; } 20%, 45% { left: 38%; } 50% { left: 40%; } 70% { left: 40%; }
  95% { left: 105%; } }
@keyframes gs-grow { 0% { transform: scale(.92); } 60% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes gs-bloom { 0% { transform: scale(.9); filter: brightness(1.6); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes gs-drip { 0%, 100% { transform: translateY(0) rotate(-45deg); opacity: .9; } 50% { transform: translateY(-5px) rotate(-45deg); opacity: 1; } }
.garden-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ga-what { margin: 0 auto 0 0; font-size: 16px; }
.garden-seeds { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); }
.garden-seeds h3, .garden-book h3 { margin: 0; font-size: 17px; font-family: var(--font-display); }
.seed-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.seed { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font-size: 13px; font-weight: 500; }
.seed:hover:not(:disabled) { border-color: var(--accent); }
.seed:disabled { opacity: .45; cursor: not-allowed; }
.seeds-note { margin: -4px 0 0; font-size: 14px; }
.ga-note { font-size: 14px; flex-basis: 100%; }
.seed img { width: 64px; height: 85px; object-fit: contain; }
/* the plants' seasons (games.garden.seasonal_growth): in season, a green tag; out of it, slower */
.seed .seed-season { font-size: 11px; font-weight: 600; color: var(--good); }
.seed.off-season .seed-season { color: var(--muted); font-weight: 500; }
.ga-season { flex-basis: 100%; margin: -4px 0 0; font-size: 14px; }
.garden-book { display: grid; gap: 10px; }
/* asking Hana (garden.js askHana) */
.garden-you { margin: 0 0 -2px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.garden.has-world .garden-you { color: var(--text); text-shadow: 0 1px 3px var(--bg), 0 0 12px var(--bg); }
.garden-line.thinking { color: var(--muted); animation: hana-think 1.2s ease-in-out infinite; }
@keyframes hana-think { 50% { opacity: .45; } }
.garden-ask { display: flex; gap: 6px; max-width: 520px; }
.garden-ask input { flex: 1; min-width: 0; padding: 7px 10px; border-radius: var(--radius-btn); border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--text); font: inherit; font-size: 14px; }
.garden-ask input:disabled { opacity: .7; }
/* the day's weather (garden.js renderWeather): a line under the title, and over the picture */
.garden-weather { margin: -2px 0 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.garden.has-world .garden-weather { color: var(--text); text-shadow: 0 1px 3px var(--bg), 0 0 12px var(--bg); }
/* The weather's and the season's tints are on the veils; what falls (rain, snow, petals, leaves)
   is drawn on a canvas by web/garden-fall.js (games.garden.weather_motion particles), or with
   weather_motion css by tiled patterns on the veils' ::before, each loop moving whole tiles (it
   moved part of one before 2026-11-18, so every loop ended in a jump). */
.gw-weather { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.gw-weather::before, .gw-season::before { content: ''; position: absolute; inset: 0; }
.gw-fall { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; pointer-events: none; }
.garden-world.fall-canvas .gw-weather::before, .garden-world.fall-canvas .gw-season::before { display: none; }
.gw-weather[data-kind="cloudy"] { background: linear-gradient(to bottom, rgb(120 130 140 / .28), rgb(120 130 140 / .12) 60%, transparent); }
.gw-weather[data-kind="rain"] { background: linear-gradient(to bottom, rgb(90 105 125 / .32), rgb(90 105 125 / .15) 70%, transparent); }
.gw-weather[data-kind="rain"]::before {
  background: repeating-linear-gradient(104deg, transparent 0 9px, rgb(225 238 255 / .42) 9px 10.5px, transparent 10.5px 23px);
  background-size: 140px 140px; animation: gw-rain .6s linear infinite; }
@keyframes gw-rain { to { background-position: 0 140px; } }
.gw-weather[data-kind="rainbow"] { background: radial-gradient(ellipse 46% 42% at 50% 30%, transparent 78%,
    rgb(255 80 80 / .3) 80%, rgb(255 165 60 / .3) 82.5%, rgb(255 230 90 / .3) 85%, rgb(110 210 110 / .3) 87.5%,
    rgb(80 160 255 / .3) 90%, rgb(150 110 230 / .3) 92.5%, transparent 95%); }
/* Hana's requests (garden.js renderRequests) */
.garden-requests { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent); }
.req-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.req-head h3 { margin: 0; font-size: 17px; font-family: var(--font-display); }
.req-head .muted { font-size: 13px; }
.req-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.req { display: flex; align-items: center; gap: 10px; }
.req.done { opacity: .6; }
.req-pic { width: 42px; height: 56px; object-fit: contain; flex: none; }
.req-words { flex: 1; min-width: 0; }
.req-words p { margin: 0; font-size: 14px; }
.req-words .muted { font-size: 13px; }
/* the season's touch over the garden (garden.js renderWeather): petals, leaves or snow drifting */
.gw-season { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.gw-season[data-kind="spring"] { background: linear-gradient(to bottom, rgb(255 205 225 / .10), transparent 70%); }
.gw-season[data-kind="spring"]::before { background-image: radial-gradient(ellipse 4.5px 3px, rgb(255 180 205 / .95) 60%, transparent 72%),
    radial-gradient(ellipse 3.5px 2.5px, rgb(255 215 228 / .9) 60%, transparent 72%);
  background-size: 150px 140px, 100px 120px; animation: gw-drift 14s linear infinite; }
.gw-season[data-kind="summer"] { background: linear-gradient(to bottom, rgb(255 225 150 / .12), transparent 65%); }
.gw-season[data-kind="autumn"] { background: linear-gradient(to bottom, rgb(225 140 55 / .18), transparent 70%); }
.gw-season[data-kind="autumn"]::before { background-image: radial-gradient(ellipse 6px 3.5px, rgb(220 120 35 / .95) 60%, transparent 72%),
    radial-gradient(ellipse 4.5px 3px, rgb(175 85 25 / .9) 60%, transparent 72%);
  background-size: 160px 150px, 115px 135px; animation: gw-leaves 11s linear infinite; }
.gw-season[data-kind="winter"], .gw-weather[data-kind="snow"] { background: linear-gradient(to bottom, rgb(205 225 255 / .2), transparent 75%); }
/* the day's own pictures (games.garden.weather_pictures) show the snow or the wet already */
.gw-weather[data-kind="rain"][data-pictured] { background: linear-gradient(to bottom, rgb(90 105 125 / .12), transparent 70%); }
.gw-weather[data-kind="snow"][data-pictured], .gw-weather[data-pictured] + .gw-season[data-kind="winter"] { background: none; }
.gw-season[data-kind="winter"]::before, .gw-weather[data-kind="snow"]::before {
  background-image: radial-gradient(circle 3px, rgb(255 255 255 / .95) 60%, transparent 72%),
    radial-gradient(circle 2px, rgb(255 255 255 / .85) 60%, transparent 72%);
  background-size: 90px 95px, 60px 70px; animation: gw-snow 9s linear infinite; }
/* (each move whole tiles of its layer: 150x140 and 100x120; 160x150 and 115x135; 90x95 and 60x70) */
@keyframes gw-drift { to { background-position: 150px 280px, -100px 240px; } }
@keyframes gw-leaves { to { background-position: 160px 300px, -115px 270px; } }
@keyframes gw-snow { to { background-position: 90px 190px, -60px 140px; } }
@media (prefers-reduced-motion: reduce) { .gw-season::before, .gw-weather::before { animation: none !important; } }
/* the terrace pots (bought): the scene taller (garden.js TERRACE_BOX 1.4: 2 / 1.4) */
.garden-scene.terrace { aspect-ratio: 2 / 1.4; }
/* the watering can (garden.js waterFx) */
.gw-can { position: absolute; z-index: 6; pointer-events: none; object-fit: contain; }
.gw-drop { position: absolute; z-index: 6; width: 4px; height: 7px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: rgb(130 195 255 / .95); box-shadow: 0 0 2px rgb(255 255 255 / .8); pointer-events: none; }
.gw-splash { position: absolute; z-index: 6; width: 3px; height: 3px; border-radius: 50%; background: rgb(170 215 255 / .95);
  pointer-events: none; }
.gw-stream { position: absolute; z-index: 5; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.gw-stream path { fill: none; stroke: rgb(150 205 255 / .55); stroke-width: 2.2; stroke-linecap: round; }
/* the flower market (garden.js renderMarket) */
.garden-market { display: grid; gap: 10px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent); }
.mk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.mk-head h3 { margin: 0; font-size: 17px; font-family: var(--font-display); }
.mk-head .muted { font-size: 13px; }
.mk-head button { margin-left: auto; }
.mk-coins { font-weight: 700; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.mk-part { display: grid; gap: 6px; }
.mk-part h4 { margin: 0; font-size: 14px; }
.mk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.mk-pic { width: 36px; height: 44px; object-fit: contain; flex: none; }
.mk-name { flex: 1; min-width: 0; font-size: 14px; }
.mk-name .muted { font-size: 13px; }
/* videos: coins into credits at the market, sunshine and seeds by the actions */
.mk-cash { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; }
.ga-videos { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
/* haggling with the day's trader (games.garden.haggle) */
.mk-trader { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; }
.mk-face { width: 44px; height: 44px; object-fit: cover; object-position: top; border-radius: 50%; flex: none;
  background: var(--raised); }
.mk-face.big { width: 64px; height: 64px; }
.mk-haggle { display: grid; gap: 8px; padding: 10px 12px; border-radius: var(--radius, 12px);
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent); border: 1px solid var(--border); }
.mk-haggle-top { display: flex; align-items: center; gap: 12px; }
.mk-haggle-what { font-size: 14px; }
.mk-haggle-price { margin: 2px 0 0; font-size: 15px; }
.mk-ask { font-variant-numeric: tabular-nums; color: var(--accent-ink); }
.mk-saved { color: var(--good); font-weight: 600; }
.mk-talk { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 220px; overflow-y: auto;
  font-size: 14px; }
.mk-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.mk-line.you { justify-content: flex-end; text-align: right; }
.mk-who { font-weight: 700; font-size: 12px; color: var(--muted); }
.mk-offer { font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.mk-say { display: flex; gap: 6px; }
.mk-say input[name="message"] { flex: 1; min-width: 0; }
.mk-say input[name="offer"] { width: 84px; }
.mk-left, .mk-wait { margin: 0; font-size: 13px; }
.mk-haggle-end { display: flex; gap: 8px; }
/* a hybrid not found yet, in the book */
.book-card.hybrid:not(.found) { border-style: dashed; }
/* the plant guide (garden.js renderGuide) */
.garden-guide { display: grid; gap: 10px; }
.guide-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.guide-chip { display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 12px; font-weight: 500; }
.guide-chip img { width: 48px; height: 64px; object-fit: contain; }
.guide-chip.open, .guide-chip:hover { border-color: var(--accent); }
.guide-page { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); }
.guide-top { display: flex; gap: 14px; align-items: center; }
.guide-pic { width: 72px; height: 96px; object-fit: contain; flex: none; }
.guide-names { display: grid; gap: 2px; min-width: 0; }
.guide-names h4 { margin: 0; font-size: 19px; font-family: var(--font-display); }
.guide-names p { margin: 0; font-size: 13px; }
.guide-latin { font-style: italic; }
.guide-about { margin: 0; font-size: 15px; max-width: 70ch; }
.guide-care { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
.guide-care dt { color: var(--muted); }
.guide-care dd { margin: 0; }
.guide-page h5 { margin: 4px 0 0; font-size: 14px; }
.guide-facts { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; max-width: 70ch; }
.book-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.book-icon { width: 36px; height: 36px; object-fit: contain; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.book-card { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); font-size: 12px; text-align: center; }
.book-card img { width: 56px; height: 75px; object-fit: contain; filter: grayscale(1) brightness(.35); opacity: .45; }
.book-card.found img { filter: none; opacity: 1; }
.book-card:not(.found) .book-name { color: var(--muted); }
.book-count { position: absolute; top: 4px; right: 6px; font-size: 11px; color: var(--accent-ink); font-weight: 700; }
@media (max-width: 480px) { .garden-hana { width: 84px; } .garden-say h1 { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) {
  .garden-hana, .gs-plant, .gs-visitor, .gs-visitor img, .gs-plant.thirsty::after { animation: none !important; }
  .gs-visitor, .gv-layer { display: none; }
}

/* the sounds' speaker (web/sfx.js; ui.sounds): only where there are sounds, the Games and Garden tabs */
.sound-toggle { padding: 6px 8px; line-height: 0; }
.sound-toggle .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.sound-toggle .sound-off { display: none; }
.sound-toggle.muted .sound-waves { display: none; }
.sound-toggle.muted .sound-off { display: inline; }
.sound-toggle.muted { opacity: .7; }
body:not([data-tab="games"]):not([data-tab="garden"]) .sound-toggle { display: none; }

/* ── Decorations (web/decor.js, server/decor.py; decor.enabled) ───────────────────────────── */
/* color accents: on <html data-accent>, for the dark theme and the light one */
:root[data-accent="rose"]:not([data-theme="calm"]) { --accent: #ff7aa8; --accent-text: #1a0a10; --accent-soft: rgb(255 122 168 / .14); --accent-ink: #ff8fb5; }
:root[data-theme="calm"][data-accent="rose"] { --accent: #d6336c; --accent-text: #fff; --accent-soft: #fde8ef; --accent-ink: #b42357; }
:root[data-accent="forest"]:not([data-theme="calm"]) { --accent: #5fd18a; --accent-text: #08140d; --accent-soft: rgb(95 209 138 / .14); --accent-ink: #6fe09a; }
:root[data-theme="calm"][data-accent="forest"] { --accent: #1f8a4c; --accent-text: #fff; --accent-soft: #e6f4ec; --accent-ink: #17703d; }
:root[data-accent="sand"]:not([data-theme="calm"]) { --accent: #f0c27b; --accent-text: #1a1206; --accent-soft: rgb(240 194 123 / .14); --accent-ink: #f3cd8f; }
:root[data-theme="calm"][data-accent="sand"] { --accent: #b7791f; --accent-text: #fff; --accent-soft: #fbf1e1; --accent-ink: #94600f; }
:root[data-accent="ocean"]:not([data-theme="calm"]) { --accent: #4cc3e8; --accent-text: #04131a; --accent-soft: rgb(76 195 232 / .14); --accent-ink: #62cdee; }
:root[data-theme="calm"][data-accent="ocean"] { --accent: #0e7aa6; --accent-text: #fff; --accent-soft: #e3f3f9; --accent-ink: #0b6488; }
/* background scenes for Text, Image and Agent: one scene on all three, its night for the dark theme */
:root[data-scene="sakura"]:not([data-theme="calm"]) { --tab-pic-text: url(/sprites/decor/scenes/sakura-dark.webp); --tab-pic-image: url(/sprites/decor/scenes/sakura-dark.webp); --tab-pic-agent: url(/sprites/decor/scenes/sakura-dark.webp); }
:root[data-theme="calm"][data-scene="sakura"] { --tab-pic-text: url(/sprites/decor/scenes/sakura-light.webp); --tab-pic-image: url(/sprites/decor/scenes/sakura-light.webp); --tab-pic-agent: url(/sprites/decor/scenes/sakura-light.webp); }
:root[data-scene="ocean"]:not([data-theme="calm"]) { --tab-pic-text: url(/sprites/decor/scenes/ocean-dark.webp); --tab-pic-image: url(/sprites/decor/scenes/ocean-dark.webp); --tab-pic-agent: url(/sprites/decor/scenes/ocean-dark.webp); }
:root[data-theme="calm"][data-scene="ocean"] { --tab-pic-text: url(/sprites/decor/scenes/ocean-light.webp); --tab-pic-image: url(/sprites/decor/scenes/ocean-light.webp); --tab-pic-agent: url(/sprites/decor/scenes/ocean-light.webp); }
:root[data-scene="dunes"]:not([data-theme="calm"]) { --tab-pic-text: url(/sprites/decor/scenes/dunes-dark.webp); --tab-pic-image: url(/sprites/decor/scenes/dunes-dark.webp); --tab-pic-agent: url(/sprites/decor/scenes/dunes-dark.webp); }
:root[data-theme="calm"][data-scene="dunes"] { --tab-pic-text: url(/sprites/decor/scenes/dunes-light.webp); --tab-pic-image: url(/sprites/decor/scenes/dunes-light.webp); --tab-pic-agent: url(/sprites/decor/scenes/dunes-light.webp); }
:root[data-scene="night-market"]:not([data-theme="calm"]) { --tab-pic-text: url(/sprites/decor/scenes/night-market-dark.webp); --tab-pic-image: url(/sprites/decor/scenes/night-market-dark.webp); --tab-pic-agent: url(/sprites/decor/scenes/night-market-dark.webp); }
:root[data-theme="calm"][data-scene="night-market"] { --tab-pic-text: url(/sprites/decor/scenes/night-market-light.webp); --tab-pic-image: url(/sprites/decor/scenes/night-market-light.webp); --tab-pic-agent: url(/sprites/decor/scenes/night-market-light.webp); }
:root[data-scene="space"]:not([data-theme="calm"]) { --tab-pic-text: url(/sprites/decor/scenes/space-dark.webp); --tab-pic-image: url(/sprites/decor/scenes/space-dark.webp); --tab-pic-agent: url(/sprites/decor/scenes/space-dark.webp); }
:root[data-theme="calm"][data-scene="space"] { --tab-pic-text: url(/sprites/decor/scenes/space-light.webp); --tab-pic-image: url(/sprites/decor/scenes/space-light.webp); --tab-pic-agent: url(/sprites/decor/scenes/space-light.webp); }
/* (2026-11-20) the Image tab's other drawn backgrounds the user kept, and its picture before (supplies),
   each with a tall version for portrait screens (phones), below */
:root[data-scene="photos"]:not([data-theme="calm"]) { --tab-pic-text: url(/sprites/decor/scenes/photos-dark.webp); --tab-pic-image: url(/sprites/decor/scenes/photos-dark.webp); --tab-pic-agent: url(/sprites/decor/scenes/photos-dark.webp); }
:root[data-theme="calm"][data-scene="photos"] { --tab-pic-text: url(/sprites/decor/scenes/photos-light.webp); --tab-pic-image: url(/sprites/decor/scenes/photos-light.webp); --tab-pic-agent: url(/sprites/decor/scenes/photos-light.webp); }
:root[data-scene="botanical"]:not([data-theme="calm"]) { --tab-pic-text: url(/sprites/decor/scenes/botanical-dark.webp); --tab-pic-image: url(/sprites/decor/scenes/botanical-dark.webp); --tab-pic-agent: url(/sprites/decor/scenes/botanical-dark.webp); }
:root[data-theme="calm"][data-scene="botanical"] { --tab-pic-text: url(/sprites/decor/scenes/botanical-light.webp); --tab-pic-image: url(/sprites/decor/scenes/botanical-light.webp); --tab-pic-agent: url(/sprites/decor/scenes/botanical-light.webp); }
:root[data-scene="ink"]:not([data-theme="calm"]) { --tab-pic-text: url(/sprites/decor/scenes/ink-dark.webp); --tab-pic-image: url(/sprites/decor/scenes/ink-dark.webp); --tab-pic-agent: url(/sprites/decor/scenes/ink-dark.webp); }
:root[data-theme="calm"][data-scene="ink"] { --tab-pic-text: url(/sprites/decor/scenes/ink-light.webp); --tab-pic-image: url(/sprites/decor/scenes/ink-light.webp); --tab-pic-agent: url(/sprites/decor/scenes/ink-light.webp); }
:root[data-scene="papercut"]:not([data-theme="calm"]) { --tab-pic-text: url(/sprites/decor/scenes/papercut-dark.webp); --tab-pic-image: url(/sprites/decor/scenes/papercut-dark.webp); --tab-pic-agent: url(/sprites/decor/scenes/papercut-dark.webp); }
:root[data-theme="calm"][data-scene="papercut"] { --tab-pic-text: url(/sprites/decor/scenes/papercut-light.webp); --tab-pic-image: url(/sprites/decor/scenes/papercut-light.webp); --tab-pic-agent: url(/sprites/decor/scenes/papercut-light.webp); }
:root[data-scene="supplies"]:not([data-theme="calm"]) { --tab-pic-text: url(/sprites/tabs/image-dark.webp); --tab-pic-image: url(/sprites/tabs/image-dark.webp); --tab-pic-agent: url(/sprites/tabs/image-dark.webp); }
:root[data-theme="calm"][data-scene="supplies"] { --tab-pic-text: url(/sprites/tabs/image.webp); --tab-pic-image: url(/sprites/tabs/image.webp); --tab-pic-agent: url(/sprites/tabs/image.webp); }
@media (max-aspect-ratio: 4/5) {
  :root[data-scene="photos"]:not([data-theme="calm"]):not(:where([data-wide-bg])) { --tab-pic-text: url(/sprites/decor/scenes/photos-tall-dark.webp); --tab-pic-image: url(/sprites/decor/scenes/photos-tall-dark.webp); --tab-pic-agent: url(/sprites/decor/scenes/photos-tall-dark.webp); }
  :root[data-theme="calm"][data-scene="photos"]:not(:where([data-wide-bg])) { --tab-pic-text: url(/sprites/decor/scenes/photos-tall-light.webp); --tab-pic-image: url(/sprites/decor/scenes/photos-tall-light.webp); --tab-pic-agent: url(/sprites/decor/scenes/photos-tall-light.webp); }
  :root[data-scene="botanical"]:not([data-theme="calm"]):not(:where([data-wide-bg])) { --tab-pic-text: url(/sprites/decor/scenes/botanical-tall-dark.webp); --tab-pic-image: url(/sprites/decor/scenes/botanical-tall-dark.webp); --tab-pic-agent: url(/sprites/decor/scenes/botanical-tall-dark.webp); }
  :root[data-theme="calm"][data-scene="botanical"]:not(:where([data-wide-bg])) { --tab-pic-text: url(/sprites/decor/scenes/botanical-tall-light.webp); --tab-pic-image: url(/sprites/decor/scenes/botanical-tall-light.webp); --tab-pic-agent: url(/sprites/decor/scenes/botanical-tall-light.webp); }
  :root[data-scene="ink"]:not([data-theme="calm"]):not(:where([data-wide-bg])) { --tab-pic-text: url(/sprites/decor/scenes/ink-tall-dark.webp); --tab-pic-image: url(/sprites/decor/scenes/ink-tall-dark.webp); --tab-pic-agent: url(/sprites/decor/scenes/ink-tall-dark.webp); }
  :root[data-theme="calm"][data-scene="ink"]:not(:where([data-wide-bg])) { --tab-pic-text: url(/sprites/decor/scenes/ink-tall-light.webp); --tab-pic-image: url(/sprites/decor/scenes/ink-tall-light.webp); --tab-pic-agent: url(/sprites/decor/scenes/ink-tall-light.webp); }
  :root[data-scene="papercut"]:not([data-theme="calm"]):not(:where([data-wide-bg])) { --tab-pic-text: url(/sprites/decor/scenes/papercut-tall-dark.webp); --tab-pic-image: url(/sprites/decor/scenes/papercut-tall-dark.webp); --tab-pic-agent: url(/sprites/decor/scenes/papercut-tall-dark.webp); }
  :root[data-theme="calm"][data-scene="papercut"]:not(:where([data-wide-bg])) { --tab-pic-text: url(/sprites/decor/scenes/papercut-tall-light.webp); --tab-pic-image: url(/sprites/decor/scenes/papercut-tall-light.webp); --tab-pic-agent: url(/sprites/decor/scenes/papercut-tall-light.webp); }
  :root[data-scene="supplies"]:not([data-theme="calm"]):not(:where([data-wide-bg])) { --tab-pic-text: url(/sprites/tabs/image-tall-dark.webp); --tab-pic-image: url(/sprites/tabs/image-tall-dark.webp); --tab-pic-agent: url(/sprites/tabs/image-tall-dark.webp); }
  :root[data-theme="calm"][data-scene="supplies"]:not(:where([data-wide-bg])) { --tab-pic-text: url(/sprites/tabs/image-tall.webp); --tab-pic-image: url(/sprites/tabs/image-tall.webp); --tab-pic-agent: url(/sprites/tabs/image-tall.webp); }
}
/* the avatar: a drawn one in place of the letter, and its frame */
.avatar.pic { background: var(--raised) center / cover no-repeat; color: transparent; border-radius: 50%; }
.avatar[data-frame="gold"] { box-shadow: 0 0 0 2px #f1cf6b, 0 0 0 3.5px #9a6d12; }
.avatar[data-frame="flowers"] { box-shadow: 0 0 0 2px #ff9ec4, 0 0 0 4px #ffe08a, 0 0 0 5.5px #9ee6a8; }
.avatar[data-frame="neon"] { box-shadow: 0 0 0 2px #59f3ff, 0 0 9px 2px rgb(89 243 255 / .75); }
.avatar[data-frame="laurel"] { box-shadow: 0 0 0 2px #e2b440, 0 0 0 3.5px #7a4e08; }   /* (2026-11-25) */
.avatar[data-frame="frost"] { box-shadow: 0 0 0 2px #e9f8ff, 0 0 0 3.5px #6fb6ec; }
.avatar[data-frame="galaxy"] { box-shadow: 0 0 0 2px #9b4dff, 0 0 0 3.5px #ff5fb8; }
/* the games' cards */
body[data-cards="gold"] .game-card { border: 1px solid #d9b45a; box-shadow: inset 0 0 0 1px rgb(255 230 160 / .35), 0 0 0 1px #8a6417, 0 6px 18px rgb(217 180 90 / .18); }
body[data-cards="watercolor"] .game-card { background: radial-gradient(120% 80% at 10% 0%, rgb(255 182 206 / .22), transparent 60%),
  radial-gradient(120% 90% at 100% 100%, rgb(150 210 255 / .22), transparent 60%), var(--surface); }
body[data-cards="starry"] .game-card { color: #eef1ff; border-color: #2c3566; background:
  radial-gradient(1px 1px at 20% 30%, #fff 60%, transparent), radial-gradient(1px 1px at 70% 20%, #fff 60%, transparent),
  radial-gradient(1.5px 1.5px at 85% 70%, #fff 60%, transparent), radial-gradient(1px 1px at 35% 80%, #fff 60%, transparent),
  linear-gradient(160deg, #1b2150, #0d1030); }
body[data-cards="starry"] .game-card .muted, body[data-cards="starry"] .game-card p { color: #c9cff5; }
/* the garden's ornaments, dimmed and warmed with the light as the plants are */
.gs-orn { position: absolute; pointer-events: none; display: flex; align-items: flex-end; justify-content: center; }
.gs-orn > img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.gs-orn > img.mirror { transform: scaleX(-1); }
.garden.day-cycle .gs-orn > img { filter: brightness(calc(1 - .28 * var(--night, 0) - var(--gloom, 0))) saturate(calc(1 - .15 * var(--night, 0) - var(--cool, 0))); }
.gs-orn-wind-chime > img { object-position: top; transform-origin: 50% 0; animation: gs-sway 5s ease-in-out infinite; }
.gs-orn-hanging-baskets > img { object-position: top; transform-origin: 50% 0; animation: gs-sway 9s ease-in-out infinite; }
@keyframes gs-sway { 0%, 100% { rotate: -2.5deg; } 50% { rotate: 2.5deg; } }
.gs-orn-glow { position: absolute; left: -40%; right: -40%; top: 0; bottom: -10%; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgb(255 205 120 / .75), rgb(255 170 70 / .25) 55%, transparent);
  opacity: calc(var(--night, 0) * .95 + var(--warm, 0) * .2); animation: gs-flicker 3.2s ease-in-out infinite; }
@keyframes gs-flicker { 0%, 100% { filter: brightness(1); } 40% { filter: brightness(.86); } 60% { filter: brightness(1.08); } }
.gs-orn > img.gs-cat { position: absolute; width: 30%; height: auto; left: 34%; bottom: 46%; pointer-events: auto; }
/* the pots' style: a layer over the pot alone (the picture as its mask, its bottom shown) */
.gs-potstyle { position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: var(--pic) center / 100% 100% no-repeat; mask: var(--pic) center / 100% 100% no-repeat;
  clip-path: inset(calc((1 - var(--pot, .3)) * 100%) 0 0 0); }
.garden.day-cycle .gs-potstyle { filter: brightness(calc(1 - .28 * var(--night, 0) - var(--gloom, 0))); }
.gs-potstyle[data-style="blue"] { background: #2f64c9; mix-blend-mode: color; }
.gs-potstyle[data-style="copper"] { background: linear-gradient(90deg, #b8643a, #f0a06a 45%, #9b4f2b); mix-blend-mode: color; }
.gs-potstyle[data-style="striped"] { background: repeating-linear-gradient(0deg, rgb(255 244 222 / .82) 0 2.2%, transparent 2.2% 6%); }
.gs-potstyle[data-style="painted"] { background:
  radial-gradient(circle, #2a5bd0 0 15%, #7c9cec 16% 23%, transparent 25%) 0 0 / 15% 9%,
  linear-gradient(90deg, rgb(60 40 20 / .28), transparent 28%, transparent 66%, rgb(60 40 20 / .34)), #f1e6cf; }
/* string lights across the wall: the wire, and bulbs brighter at night, twinkling */
.gs-lights { position: absolute; left: 0; width: 100%; height: auto; aspect-ratio: 100 / 6; z-index: 1; pointer-events: none; overflow: visible; }
.gs-wire { fill: none; stroke: #3b2f25; stroke-width: .18; }
.gs-bulb { filter: drop-shadow(0 0 calc(.2px + var(--night, 0) * 1.2px) currentColor); opacity: calc(.75 + var(--night, 0) * .25);
  animation: gs-twinkle 3s ease-in-out infinite; }
.gs-lights-warm .gs-bulb { color: #ffd27a; } .gs-lights-blue .gs-bulb { color: #9fd8ff; } .gs-lights-rainbow .gs-bulb { color: #fff2b0; }
@keyframes gs-twinkle { 0%, 100% { opacity: calc(.75 + var(--night, 0) * .25); } 50% { opacity: calc(.45 + var(--night, 0) * .2); } }
@media (prefers-reduced-motion: reduce) { .gs-orn > img, .gs-orn-glow, .gs-bulb { animation: none !important; } }
/* the garden's Decorate panel (as the market's) */
.garden-decor { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent); }
.dc-mini { display: inline-flex; align-items: center; justify-content: center; }
.dc-mini img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* the shop (the Credits page's Decorations) */
.dc-group { margin: 14px 0 6px; font-size: 15px; }
.dc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.dc-card { display: grid; grid-template-rows: auto 1fr auto; gap: 6px; padding: 10px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); }
.dc-card.in-use { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.dc-pic { height: 92px; border-radius: 8px; background: var(--raised); display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative; }
.dc-pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.dc-scene img { width: 100%; height: 100%; object-fit: cover; }
.dc-avatar img { width: 72px; height: 72px; border-radius: 50%; }
.dc-words strong { display: block; font-size: 14px; }
.dc-words p { margin: 2px 0 0; font-size: 12.5px; }
.dc-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.dc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dc-price { font-weight: 700; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.dc-owned { font-size: 12.5px; color: var(--muted); }
.dc-note { font-size: 12px; color: var(--muted); }
.dc-note:empty { display: none; }
/* swatches for the ones the page draws */
.dc-pots::after { content: ""; width: 54px; height: 48px; border-radius: 4px 4px 14px 14px; }
.dc-pots[data-style="blue"]::after { background: linear-gradient(90deg, #1f4c9f, #4b7fe0 45%, #1d3f86); }
.dc-pots[data-style="copper"]::after { background: linear-gradient(90deg, #a5552e, #f0a06a 45%, #8a4424); }
.dc-pots[data-style="striped"]::after { background: repeating-linear-gradient(0deg, #f6ead2 0 5px, #c4622d 5px 12px); }
.dc-pots[data-style="painted"]::after { background: radial-gradient(circle, #1f4fbf 0 3px, transparent 3.5px) 0 0 / 14px 14px, #efe4cc; }
.dc-lights, .dc-fireflies { background: #141a2e; gap: 10px; }
.dc-lights i, .dc-fireflies i { width: 9px; height: 9px; border-radius: 50%; background: #ffd27a; box-shadow: 0 0 8px 2px currentColor; color: #ffd27a; }
.dc-lights[data-style="blue"] i { background: #9fd8ff; color: #9fd8ff; }
.dc-lights[data-style="rainbow"] i:nth-child(5n+1) { background: #ff6b6b; color: #ff6b6b; }
.dc-lights[data-style="rainbow"] i:nth-child(5n+2) { background: #ffd93d; color: #ffd93d; }
.dc-lights[data-style="rainbow"] i:nth-child(5n+3) { background: #6bcb77; color: #6bcb77; }
.dc-lights[data-style="rainbow"] i:nth-child(5n+4) { background: #4d96ff; color: #4d96ff; }
.dc-lights[data-style="rainbow"] i:nth-child(5n) { background: #c77dff; color: #c77dff; }
.dc-fireflies i { width: 5px; height: 5px; background: #e6ff8a; color: #c9f560; }
.dc-fireflies i:nth-child(odd) { transform: translateY(-14px); opacity: .6; }
.dc-accent::after { content: ""; width: 64px; height: 28px; border-radius: 999px; }
.dc-accent[data-style="rose"]::after { background: #d6336c; } .dc-accent[data-style="forest"]::after { background: #1f8a4c; }
.dc-accent[data-style="sand"]::after { background: #b7791f; } .dc-accent[data-style="ocean"]::after { background: #0e7aa6; }
/* a frame: your picture wearing it (decor.js preview), drawn by the frame rules (the fancy ones further down) */
.dc-frame .avatar { width: 50px; height: 50px; font-size: 21px; }
.dc-cards::after { content: ""; width: 80px; height: 56px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }
.dc-cards[data-style="gold"]::after { border: 2px solid #d9b45a; box-shadow: 0 0 0 1px #8a6417; }
.dc-cards[data-style="watercolor"]::after { background: radial-gradient(120% 80% at 10% 0%, rgb(255 182 206 / .5), transparent 60%), radial-gradient(120% 90% at 100% 100%, rgb(150 210 255 / .5), transparent 60%), #fff; }
.dc-cards[data-style="starry"]::after { background: radial-gradient(1.5px 1.5px at 20% 30%, #fff 60%, transparent), radial-gradient(1.5px 1.5px at 70% 25%, #fff 60%, transparent), radial-gradient(2px 2px at 80% 70%, #fff 60%, transparent), linear-gradient(160deg, #1b2150, #0d1030); }
.dc-sounds::after { content: "♪ ♫ ♪"; font-size: 26px; color: var(--accent-ink); }
.dc-flourish span, .dc-showcase span { font-size: 30px; }
/* the badge showcase on the Games tab */
.showcase { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: color-mix(in srgb, var(--accent-soft) 70%, transparent); }
.showcase-label { font-weight: 700; font-size: 13px; }
.showcase-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.showcase-badge img { width: 34px; height: 34px; }
.badge.pinnable { cursor: pointer; }
.badge.pinned { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
/* the paper plane (Text: sending) */
.paper-plane { position: fixed; z-index: 60; width: 24px; height: 24px; pointer-events: none; color: var(--accent); }
.paper-plane svg { width: 100%; height: 100%; fill: color-mix(in srgb, var(--accent) 25%, transparent); stroke: currentColor;
  stroke-width: 1.6; stroke-linejoin: round; }

/* ── The profile page (web/profile.js) ─────────────────────────────────────────────────── */
.profile-page .pf-section { display: grid; gap: 10px; }
.pf-picture { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.pf-big.avatar { width: 96px; height: 96px; font-size: 40px; border-radius: 50%; }
.pf-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.pf-choice { display: grid; justify-items: center; gap: 4px; padding: 6px 8px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); font-size: 12px; color: var(--muted); cursor: pointer; }
.pf-choice.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; color: var(--text); }
.pf-mini.avatar { width: 44px; height: 44px; font-size: 18px; border-radius: 50%; }
.pf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pf-label { min-width: 96px; font-weight: 600; font-size: 14px; }
.pf-name { display: flex; gap: 8px; max-width: 460px; }
.pf-name input { flex: 1; min-width: 0; padding: 7px 10px; border-radius: var(--radius-btn); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); }
.pf-hint { margin: 0; font-size: 13px; }
.pf-note { margin: 0; font-size: 13px; color: var(--good); }
.pf-note.error { color: var(--bad); }
.pf-note:empty { display: none; }
.pf-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; font-size: 14px; }
.pf-facts dt { color: var(--muted); }
.pf-facts dd { margin: 0; overflow-wrap: anywhere; }
.account-menu #open-profile { width: 100%; }
/* a set in the shop: its things side by side */
.dc-pic.dc-parts { gap: 4px; padding: 4px; }
.dc-pic.dc-parts > .dc-pic { flex: 1; height: 100%; min-width: 0; background: transparent; }

/* ── Night Shift (nightshift.js): a terminal, dark in both themes like a real screen ── */
.nightshift { overflow-y: auto; display: flex; flex-direction: column; gap: 12px; max-width: 1100px; padding-bottom: 32px; }
.ns-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; padding-top: 14px; }
.ns-head h1 { margin: 0; font-family: var(--font-display); font-size: 26px; }
.ns-head .ns-back { display: block; margin: 0 0 6px -6px; padding: 2px 6px; font-size: 13px; }   /* (games.nightshift.in_games) */
.garden-say .games-back { display: block; margin: 0 0 6px -6px; padding: 2px 6px; font-size: 13px; }   /* (games.garden.in_games) */
.ns-rank { margin: 2px 0 0; font-size: 14px; }
.ns-open { display: flex; flex-wrap: wrap; gap: 8px; }
.ns-wait { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; }
.ns-wait .ns-wait-line { margin: 0; font-variant-numeric: tabular-nums; }
.ns-wait .ns-wait-note { font-size: 13px; }
.ns-note { margin: -4px 0 0; font-size: 14px; }
.ns-board { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 14px; align-items: start; }
.ns-terminal { --t-bg: #0a120e; --t-glow: #0f1c15; --t-line: #1d3527; --t-fg: #b9f3c6; --t-dim: #6e977a; --t-bright: #effff3;
  --t-partner: #86d9ff; --t-rogue: #ff94dc; --t-alert: #ffcb6b; --t-win: #fff1a6;
  --t-btn: #12231a; --t-btn-line: #27462f; --t-btn-hover: #173023; --t-focus: #2f6b45;
  position: relative; display: grid; min-width: 0; border: 1px solid var(--t-line); border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, var(--t-glow) 0%, var(--t-bg) 70%); color: var(--t-fg);
  font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, .55); }
.ns-bar { display: flex; justify-content: space-between; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--t-line);
  color: var(--t-dim); font-size: 13px; }
.ns-bar .urgent { color: var(--t-alert); animation: ns-blink 1.2s steps(2) infinite; }
@keyframes ns-blink { 50% { opacity: .45; } }
.ns-screen { height: min(58vh, 540px); overflow-y: auto; padding: 10px 12px; overflow-wrap: anywhere; scrollbar-color: var(--t-line) transparent; }
.ns-l { margin: 0 0 2px; white-space: pre-wrap; animation: ns-in .16s ease-out both; }
@keyframes ns-in { from { opacity: 0; transform: translateY(3px); } }
.ns-cmd { color: var(--t-bright); margin-top: 8px; }
.ns-cmd .ns-p, .ns-sys { color: var(--t-dim); }
.ns-partner { color: var(--t-partner); }
.ns-who { font-weight: 700; }
.ns-rogue { color: var(--t-rogue); }
.ns-alert { color: var(--t-alert); }
.ns-win { color: var(--t-win); font-weight: 700; }
/* Case Files (nightshift.js renderCase): a novel's page inside the terminal. The chapter's title, its prose in a
   book face at a reading measure, a document's title and its text set off by a rule, what people say, what the
   notebook takes down, the accusation's choices */
.ns-chapter { margin: 18px 0 10px; color: var(--t-win); font-family: var(--font-display); font-size: 19px; letter-spacing: .01em; }
.ns-prose { max-width: 66ch; margin: 0 0 12px; color: var(--t-bright); font-family: "Iowan Old Style", "Palatino Linotype",
  Palatino, "Book Antiqua", Georgia, serif; font-size: 16px; line-height: 1.62; white-space: normal; }
.ns-head { margin: 14px 0 6px; color: var(--t-bright); font-weight: 700; border-bottom: 1px solid var(--t-line); padding-bottom: 4px; }
.ns-doc { max-width: 78ch; margin: 0 0 6px; padding-left: 12px; border-left: 2px solid var(--t-line); color: var(--t-fg);
  line-height: 1.5; }
.ns-speech { max-width: 70ch; margin: 0 0 8px; padding-left: 12px; color: var(--t-bright); font-family: "Iowan Old Style",
  "Palatino Linotype", Palatino, Georgia, serif; font-size: 15.5px; line-height: 1.55; white-space: normal; }
.ns-note { margin: 4px 0 6px; color: var(--t-alert); font-size: 13px; }
.ns-note::before { content: "✎ "; }
.ns-choice { margin: 0 0 3px; padding-left: 12px; color: var(--t-bright); }
.ns-board.case-mode .ns-screen { height: min(70vh, 720px); }
.ns-board.case-mode .ns-side > :not(#ns-case-card):not(#ns-room-chat) { display: none !important; }
.ns-board.case-mode .ns-tools-bar { display: none; }
.ns-choice-btn { text-align: left; white-space: normal; }
.ns-cases-btn.locked { opacity: .75; }
.ns-cases-btn.on { border-color: var(--accent); }
.ns-case-card h3 { margin: 12px 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.ns-case-img { display: block; width: 100%; border-radius: 8px; margin: 4px 0 6px; }
.ns-people, .ns-notes { margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.ns-people { list-style: none; }
.ns-people li { display: grid; gap: 1px; }
.ns-person { justify-self: start; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; color: var(--text);
  font: inherit; font-weight: 600; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.ns-notes { padding-left: 20px; max-height: 340px; overflow-y: auto; }
.ns-notes li { color: var(--text); line-height: 1.4; }
.ns-case-card > button { margin-top: 12px; }
.ns-tok { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.ns-tok:hover { color: var(--t-bright); }
.ns-input { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--t-line); }
.ns-input:focus-within { box-shadow: inset 0 1px 0 var(--t-focus); }
.ns-input label { color: var(--t-dim); white-space: nowrap; }
.ns-input input { flex: 1; min-width: 0; padding: 4px 0; border: 0; border-radius: 0; background: transparent; color: var(--t-bright);
  font: inherit; caret-color: var(--t-fg); box-shadow: none; outline: none; }
.ns-input input::placeholder { color: var(--t-dim); opacity: .7; }
.ns-input input:disabled { opacity: .5; }
.ns-verbs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.ns-verbs:empty, .ns-verbs[hidden] { display: none; }
.ns-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 14px; padding: 0 12px 6px; }
/* Read aloud (nightshift-voice.js): the switch, "stop this" while reading, a problem said beside them */
.ns-voice.on { color: var(--t-win); }
.ns-voice-note { margin-right: auto; color: var(--t-alert); font-size: 12.5px; }
.ns-voice-note:empty { display: none; }
.ns-link { min-height: 0; padding: 2px 0; border: 0; background: none; box-shadow: none; color: var(--t-partner);
  font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ns-link:hover { background: none; color: var(--t-bright); }
.ns-verbs button { min-height: 30px; padding: 3px 10px; border: 1px solid var(--t-btn-line); border-radius: 6px; background: var(--t-btn);
  color: var(--t-fg); font: inherit; font-size: 13px; box-shadow: none; }
.ns-verbs button:hover { border-color: var(--t-dim); background: var(--t-btn-hover); color: var(--t-bright); }
.ns-side { display: grid; gap: 12px; }
.ns-card { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ns-card h2 { margin: 0 0 8px; font-family: var(--font-display); font-size: 16px; }
/* City camera (nightshift.js camera): a night still with a camera's label, scanlines and a REC dot */
.ns-cam-view { position: relative; display: block; width: 100%; padding: 0; border: 1px solid #1c2740; border-radius: 8px;
  overflow: hidden; background: #05080f; cursor: zoom-in; min-height: 0 !important; }
.ns-cam-view img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.ns-cam-view::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgb(0 0 0 / .16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgb(0 0 0 / .45)); }
.ns-cam-label { position: absolute; left: 7px; bottom: 6px; z-index: 1; display: flex; align-items: center; gap: 6px;
  font: 600 11px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .06em; color: #e8f1ff;
  text-shadow: 0 1px 2px #000; }
.ns-rec { width: 7px; height: 7px; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 6px #ff3b3b;
  animation: ns-rec 1.2s steps(2, jump-none) infinite; }
.ns-camera.over .ns-rec { animation: none; background: #6b7280; box-shadow: none; }
@keyframes ns-rec { 50% { opacity: .15; } }
.ns-cam-stamp { position: absolute; inset: 0; z-index: 1; margin: auto; width: max-content; height: max-content;
  padding: 4px 12px; border: 3px solid #49d17d; border-radius: 6px; color: #49d17d; background: rgb(5 8 15 / .55);
  font: 800 18px/1.1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; text-transform: uppercase;
  transform: rotate(-8deg); }
.ns-cam-stamp.lost { border-color: #ff6b6b; color: #ff6b6b; }
.ns-cam-dialog { padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  max-width: min(960px, 94vw); }
.ns-cam-dialog img { display: block; width: 100%; border-radius: 6px; }
.ns-cam-dialog form { display: flex; justify-content: flex-end; margin-top: 8px; }
.ns-cam-dialog::backdrop { background: rgb(0 0 0 / .6); }
@media (prefers-reduced-motion: reduce) { .ns-rec { animation: none; } }
/* The minigames (nightshift-tools.js). Decode by hand: a dialog inside the terminal (its colours) */
.ns-tools-bar { display: flex; gap: 8px; padding: 0 12px 10px; }
.ns-tool-btn { min-height: 30px; padding: 3px 12px; border: 1px dashed var(--t-dim); border-radius: 6px; background: transparent;
  color: var(--t-partner); font: inherit; font-size: 13px; box-shadow: none; }
.ns-tool-btn:hover { border-style: solid; background: var(--t-btn-hover); color: var(--t-bright); }
.ns-bench { width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 14px 16px; overflow: auto;
  border: 1px solid var(--t-line); border-radius: var(--radius); background: var(--t-bg); color: var(--t-fg); }
.ns-bench::backdrop { background: rgb(0 0 0 / .62); }
.ns-bench-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ns-bench-head h2 { margin: 0; font-family: var(--font-display); font-size: 17px; color: var(--t-bright); }
.ns-bench-x { min-height: 0; padding: 0 8px; border: 0; background: none; box-shadow: none; color: var(--t-dim); font-size: 24px; }
.ns-bench-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 13.5px; color: var(--t-dim); }
.ns-bench select, .ns-bench-word { min-height: 32px; padding: 3px 8px; border: 1px solid var(--t-btn-line); border-radius: 6px;
  background: var(--t-btn); color: var(--t-bright); font: inherit; font-size: 14px; letter-spacing: .06em; }
.ns-bench-word { width: 12em; text-transform: uppercase; }
.ns-bench-ways { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ns-bench-ways button, .ns-step { min-height: 30px; padding: 3px 10px; border: 1px solid var(--t-btn-line); border-radius: 6px;
  background: var(--t-btn); color: var(--t-fg); font: inherit; font-size: 13px; box-shadow: none; }
.ns-bench-ways button.on { border-color: var(--t-fg); background: var(--t-btn-hover); color: var(--t-bright); }
.ns-step { min-width: 32px; padding: 3px 0; font-size: 16px; }
.ns-bench-n { min-width: 2ch; text-align: center; color: var(--t-bright); font-variant-numeric: tabular-nums; }
.ns-bench-tool { margin-top: 10px; }
.ns-tool-note { margin: 6px 0 0; font-size: 12.5px; color: var(--t-dim); }
.ns-wheel { display: block; width: min(240px, 70vw); margin: 0 auto; font-family: inherit; }
.ns-wheel-out { fill: var(--t-btn); stroke: var(--t-line); }
.ns-wheel-in { fill: var(--t-glow); stroke: var(--t-btn-line); }
.ns-wheel-plain { fill: var(--t-fg); font-size: 13px; }
.ns-wheel-c { fill: var(--t-dim); font-size: 12px; }
.ns-wheel-c.lit { fill: var(--t-alert); font-weight: 700; font-size: 14px; }
.ns-wheel-arm { stroke: var(--t-alert); stroke-width: 1.5; stroke-dasharray: 3 3; }
.ns-wheel-n { fill: var(--t-bright); font-size: 15px; }
.ns-strips { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; align-items: center; overflow-x: auto; padding-bottom: 4px; }
.ns-strip { display: flex; gap: 2px; }
.ns-strip span { flex: 0 0 auto; width: 19px; text-align: center; padding: 2px 0; border-radius: 3px; font-size: 13px; background: var(--t-btn); }
.ns-strip.mixed span.key { color: var(--t-partner); }
.ns-strip span.lit { background: var(--t-alert); color: var(--t-bg); font-weight: 700; }
.ns-strip-label { font-size: 11.5px; color: var(--t-dim); }
.ns-numstrip, .ns-revstrip { display: flex; flex-wrap: wrap; gap: 3px; }
.ns-numstrip span { display: grid; place-items: center; width: 30px; padding: 2px 0; border-radius: 4px; background: var(--t-btn); }
.ns-numstrip b { font-size: 12px; font-weight: 600; } .ns-numstrip i { font-style: normal; font-size: 11px; color: var(--t-dim); }
.ns-revstrip span { min-width: 18px; padding: 2px 3px; text-align: center; border-radius: 3px; background: var(--t-btn); }
.ns-numstrip span.lit, .ns-revstrip span.lit { background: var(--t-alert); color: var(--t-bg); }
.ns-numstrip span.lit i { color: var(--t-bg); }
.ns-grid-wrap { overflow-x: auto; }
.ns-grid { border-collapse: collapse; margin: 0 auto; }
.ns-grid th, .ns-grid td { width: 28px; height: 26px; text-align: center; border: 1px solid var(--t-line); font-size: 14px; }
.ns-grid th { color: var(--t-partner); font-weight: 600; }
.ns-grid th small { display: block; font-size: 10px; color: var(--t-dim); font-weight: 400; }
.ns-grid td.lit { background: var(--t-alert); color: var(--t-bg); font-weight: 700; }
.ns-bench-boxes { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px; margin-top: 12px; }
.ns-cell { display: grid; justify-items: center; gap: 1px; }
.ns-cell-key { min-height: 14px; font-size: 10.5px; color: var(--t-partner); }
.ns-cell-c { font-size: 12px; color: var(--t-dim); }
.ns-box { width: 30px; min-height: 34px; padding: 0; text-align: center; border: 1px solid var(--t-btn-line); border-radius: 5px;
  background: var(--t-btn); color: var(--t-bright); font: inherit; font-size: 17px; text-transform: uppercase; }
.ns-box:focus { outline: 2px solid var(--t-focus); border-color: var(--t-fg); }
.ns-fixed { align-self: flex-end; padding: 0 2px 8px; color: var(--t-dim); }
.ns-bench-say { min-height: 1.2em; margin: 8px 0 0; font-size: 13px; color: var(--t-alert); }
.ns-bench-foot { display: flex; justify-content: flex-end; }
/* the race's network map (a night screen, like the City camera) */
.ns-net h2 { display: flex; justify-content: space-between; gap: 8px; }
.ns-net-until { font-family: var(--font-mono, monospace); font-size: 13px; color: #ffb35c; }
.ns-netmap { display: block; width: 100%; border-radius: 8px; background: #05080f; }
.ns-link-line { stroke: #22324d; stroke-width: 1.4; }
.ns-link-line.hot { stroke: #6b3a1a; stroke-width: 2.2; }
.ns-packet { fill: #5f86c2; } .ns-packet.hot { fill: #ffb35c; }
.ns-node circle { fill: #0f1a2d; stroke: #5f86c2; stroke-width: 1.4; }
.ns-node text { fill: #b9cbe6; font-size: 12.5px; }
.ns-node:not(.out) { cursor: pointer; }
.ns-node.picked circle { fill: #3a1b0b; stroke: #ffb35c; stroke-width: 2.2; }
.ns-node.out circle { fill: #1a0f0a; stroke: #6b3a1a; }
.ns-node:focus-visible circle { stroke: #ffffff; }
.ns-net-foot, .ns-tl-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 8px; font-size: 13px; }
/* the inside incident's timeline */
.ns-tl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ns-tl-col { display: grid; align-content: start; gap: 4px; min-width: 0; }
.ns-tl-col h3 { margin: 0 0 2px; font-size: 12.5px; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.ns-tl-item { display: grid; gap: 1px; min-height: 0; padding: 5px 7px; text-align: left; border: 1px solid var(--border);
  border-radius: 6px; background: transparent; box-shadow: none; color: inherit; font-size: 12.5px; }
.ns-tl-item b { font-variant-numeric: tabular-nums; font-size: 12px; }
.ns-tl-item span { overflow-wrap: anywhere; color: var(--muted); }
.ns-tl-item.picked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ns-tl-ok { color: var(--text); }
@media (max-width: 520px) { .ns-tl { grid-template-columns: 1fr; } }
/* Friends tonight (nightshift.js renderFriends) */
.ns-friends { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.ns-friends li { display: flex; align-items: center; gap: 9px; padding: 2px 0; }
.ns-friends li.me .ns-f-name { font-weight: 700; }
.ns-f-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-f-what { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.ns-f-beat { margin: 8px 0 0; font-size: 13px; }
.ns-f-week { margin: 6px 0 0; font-size: 12.5px; }
/* Shared shifts (nightshift-rooms.js): the lobby, a room's bar over the terminal, its chat beside */
.ns-lobby, .ns-room { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); }
.ns-lobby h3, .ns-lobby h4 { margin: 0; }
.ns-lobby h4 { font-size: 14px; margin-top: 4px; }
.ns-lobby p, .ns-room p { margin: 0; }
.ns-lobby .pt-code { align-items: center; flex-wrap: wrap; }
/* The Case Files panel (nightshift.js renderCaseBox): each case, read alone or in a room; rooms reading now */
.ns-cb-case { display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
.ns-cb-case > strong { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 19px; }
.ns-cb-meta, .ns-cb-note { font-size: 13px; }
.ns-cb-case p { max-width: 70ch; line-height: 1.5; }
.ns-cb-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ns-cb-locked { font-weight: 600; }
.ns-modes { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.ns-modes legend { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.ns-mode { display: block; font-size: 13.5px; line-height: 1.4; cursor: pointer; }
.ns-mode input { margin: 0 6px 0 0; vertical-align: -2px; }
.ns-room-info { font-size: 13.5px; line-height: 1.5; }
.ns-room-how { color: var(--text); font-weight: 600; }
.ns-desk { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.ns-desk-street { background: color-mix(in srgb, var(--accent-soft) 40%, var(--raised)); color: var(--text); }
.ns-side > * { min-width: 0; }
.ns-room-chat .pt-chat { border: 0; padding: 0; background: none; }
.ns-room-chat .pt-chat-form { display: flex; gap: 6px; }
.ns-room-chat .pt-chat-form input { flex: 1; min-width: 0; width: auto; }
.ns-room-chat .pt-chat-list { height: 220px; flex: none; }
.ns-map, .ns-file { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.ns-map li { display: grid; grid-template-columns: 14px 1fr auto; gap: 6px; align-items: baseline; }
.ns-map .taken { color: var(--danger, #d9534f); }
.ns-city-state { font-size: 12px; color: var(--muted); }
.ns-map .taken .ns-city-state { color: inherit; }
.ns-case { display: grid; gap: 1px; padding: 6px 0; border-top: 1px solid var(--border); color: var(--muted); }
.ns-case:first-child { border-top: 0; padding-top: 0; }
.ns-case strong { font-size: 14px; }
.ns-case.caught { color: var(--text); }
.ns-case-title { font-size: 13px; }
.ns-case-about { font-size: 12px; color: var(--muted); }
.ns-case-n { font-size: 12px; color: var(--good); }
/* the case file's portraits (games.nightshift.portraits): on navy, a dark silhouette until caught */
.ns-case.pic { grid-template-columns: 52px minmax(0, 1fr); align-items: start; column-gap: 10px; }
.ns-case-text { display: grid; gap: 1px; min-width: 0; }
.ns-case-frame { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; display: block;
  background: radial-gradient(circle at 50% 40%, #1d2c5a, #0b1430 75%); border: 1px solid var(--border); }
.ns-case-pic { width: 100%; height: 100%; object-fit: cover; display: block; }
.ns-case:not(.caught) .ns-case-frame { background: radial-gradient(circle at 50% 40%, #33467c, #16204a 75%); }
.ns-case:not(.caught) .ns-case-pic { filter: brightness(0); opacity: .8; }
.ns-file-count { font-family: var(--font-body, inherit); font-size: 12px; font-weight: 500; }
@media (max-width: 820px) {
  .ns-board { grid-template-columns: 1fr; }
  .ns-screen { height: 52vh; }
  .ns-terminal { font-size: 13px; }
}

/* ── Night Shift's look (decorations: server/decor.py, nightshift.js applyLook) ── */
@font-face { font-family: "VT323"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/vt323-latin.woff2") format("woff2"); }
@font-face { font-family: "Press Start 2P"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/press-start-2p-latin.woff2") format("woff2"); }
@font-face { font-family: "Courier Prime"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/courier-prime-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/ibm-plex-mono-latin.woff2") format("woff2"); }
.ns-terminal[data-font="vt323"] { font-family: "VT323", ui-monospace, Menlo, monospace; font-size: 19px; line-height: 1.3; }
.ns-terminal[data-font="pixel"] { font-family: "Press Start 2P", ui-monospace, Menlo, monospace; font-size: 10.5px; line-height: 2; }
.ns-terminal[data-font="typewriter"] { font-family: "Courier Prime", "Courier New", monospace; font-size: 15px; }
.ns-terminal[data-font="plex"] { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; }
.ns-terminal[data-font] .ns-verbs button { font-size: 0.9em; }
/* themes: the terminal's colors */
.ns-terminal[data-theme="amber"] { --t-bg: #120b02; --t-glow: #1f1405; --t-line: #3d2a0c; --t-fg: #ffbf52; --t-dim: #a77b35;
  --t-bright: #ffe6b8; --t-partner: #ffd98a; --t-rogue: #ff7f5c; --t-alert: #ff9b2f; --t-win: #fff1c7;
  --t-btn: #231606; --t-btn-line: #4a3210; --t-btn-hover: #2f1d07; --t-focus: #7a5418; }
.ns-terminal[data-theme="ice"] { --t-bg: #06101c; --t-glow: #0c1a2c; --t-line: #17324f; --t-fg: #a3d6ff; --t-dim: #6489ad;
  --t-bright: #ecf7ff; --t-partner: #7cf2ff; --t-rogue: #ff94bd; --t-alert: #ffd56e; --t-win: #ffffff;
  --t-btn: #0d1c2e; --t-btn-line: #23466b; --t-btn-hover: #12253b; --t-focus: #2f5f8f; }
.ns-terminal[data-theme="synthwave"] { --t-bg: #140924; --t-glow: #241040; --t-line: #3d1d61; --t-fg: #ff8ddb; --t-dim: #a46ec4;
  --t-bright: #ffe4f6; --t-partner: #7feaff; --t-rogue: #ffd166; --t-alert: #ff5f80; --t-win: #fff4ad;
  --t-btn: #22103a; --t-btn-line: #4f2a7a; --t-btn-hover: #2c1549; --t-focus: #7a3fb0; }
.ns-terminal[data-theme="paper"] { --t-bg: #f3ead4; --t-glow: #fbf5e6; --t-line: #d8c8a4; --t-fg: #2e2a23; --t-dim: #8a7c60;
  --t-bright: #111; --t-partner: #1d5d8a; --t-rogue: #a3262d; --t-alert: #b04a08; --t-win: #6b3d00;
  --t-btn: #ebdfc2; --t-btn-line: #cdb98d; --t-btn-hover: #e3d4b0; --t-focus: #b59b62; box-shadow: inset 0 0 40px rgba(120, 90, 30, .12); }
.ns-terminal[data-theme="retro"] { --t-bg: #0000a8; --t-glow: #0000a8; --t-line: #5555ff; --t-fg: #f2f2f2; --t-dim: #aab2ff;
  --t-bright: #ffffff; --t-partner: #55ffff; --t-rogue: #ff55ff; --t-alert: #ffff55; --t-win: #ffff55;
  --t-btn: #0000c8; --t-btn-line: #5555ff; --t-btn-hover: #1a1ad8; --t-focus: #aab2ff; box-shadow: none; }
/* screen effects: CRT scanlines and glow, the alert flicker (the boot-up is in nightshift.js) */
.ns-terminal[data-fx~="crt"] .ns-screen, .ns-terminal[data-fx~="crt"] .ns-input input {
  text-shadow: 0 0 5px color-mix(in srgb, currentColor 55%, transparent); }
.ns-terminal[data-fx~="crt"]::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 62%, rgba(0, 0, 0, .32) 100%); }
.ns-terminal[data-theme="paper"][data-fx~="crt"]::after { background: repeating-linear-gradient(to bottom, rgba(90, 60, 10, .07) 0 1px,
  transparent 1px 3px), radial-gradient(ellipse at center, transparent 65%, rgba(90, 60, 10, .14) 100%); }
.ns-screen.ns-flickering { animation: ns-flicker .7s linear 1; }
@keyframes ns-flicker { 0%, 100% { opacity: 1; filter: none; } 8% { opacity: .55; } 16% { opacity: 1; } 28% { opacity: .7; }
  40% { opacity: 1; filter: brightness(1.35); } 55% { opacity: .85; } 70% { filter: none; } }
/* the cursor: drawn over the line (nightshift.js caret), the input's own hidden */
.ns-field { position: relative; flex: 1; min-width: 0; display: flex; }
.ns-field input { width: 100%; }
.ns-terminal[data-cursor] .ns-input input { caret-color: transparent; }
.ns-caret { position: absolute; left: 0; top: 50%; display: none; height: 1.25em; transform: translateY(-50%);
  background: var(--t-fg); opacity: .75; pointer-events: none; animation: ns-blink-caret 1.05s steps(1) infinite; }
.ns-terminal[data-cursor="underline"] .ns-caret { height: 2px; top: auto; bottom: 5px; transform: none; opacity: .95; }
.ns-terminal[data-cursor="bar"] .ns-caret { opacity: .95; }
.ns-caret.typing { animation-delay: .5s; }
@keyframes ns-blink-caret { 50% { opacity: 0; } }
/* the videos' offer (a second chance; the prize doubled) */
.ns-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 12px 10px; padding: 8px 12px;
  border: 1px solid var(--t-alert); border-radius: 8px; color: var(--t-bright); background: color-mix(in srgb, var(--t-alert) 12%, transparent); }
.ns-offer strong { color: var(--t-alert); }
.ns-offer-note { font-size: 12px; color: var(--t-dim); }
.ns-cb-plus { margin: 4px 0 8px; font-weight: 600; }
/* picture dividers (nightshift-dividers.js): the theme's text and alert colors */
.ns-terminal { --d-main: var(--t-fg); --d-accent: var(--t-alert); }
.ns-divider { color: var(--t-fg); animation: ns-in .16s ease-out both; }
.ns-divider svg { display: block; width: 100%; height: 100%; }
.ns-divider.full { height: 44px; max-width: 640px; margin: 12px auto 6px; }
.ns-divider.slim { display: flex; align-items: center; gap: 10px; height: 22px; max-width: 520px; margin: 10px auto 0; opacity: .85; }
.ns-divider.slim::before, .ns-divider.slim::after { content: ""; flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, var(--t-dim)); }
.ns-divider.slim::after { background: linear-gradient(to left, transparent, var(--t-dim)); }
.ns-divider.slim svg { flex: 0 0 auto; width: 81px; }
.ns-divider + .ns-cmd { margin-top: 4px; }
.dc-divider { padding: 0 10px; background: #0a120e; --d-main: #b9f3c6; --d-accent: #ffcb6b; --t-bg: #0a120e; }
.dc-divider svg { display: block; width: 100%; height: 44px; }
.dc-divider.dc-stack { flex-direction: column; justify-content: center; gap: 2px; }
.dc-divider.dc-stack > .dc-pic { height: 26px; width: 100%; padding: 0; background: transparent; }
.dc-divider.dc-stack svg { height: 26px; }
.ns-fireworks { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .ns-caret { animation: none; } }
/* the shop's previews of them (decor.js preview) */
.dc-terminal::after { content: ">_ ok"; padding: 10px 16px; border-radius: 6px; font: 600 16px ui-monospace, Menlo, monospace; }
.dc-terminal[data-style="amber"]::after { background: #120b02; color: #ffbf52; }
.dc-terminal[data-style="ice"]::after { background: #06101c; color: #a3d6ff; }
.dc-terminal[data-style="synthwave"]::after { background: #140924; color: #ff8ddb; }
.dc-terminal[data-style="paper"]::after { background: #f3ead4; color: #2e2a23; border: 1px solid #d8c8a4; }
.dc-terminal[data-style="retro"]::after { background: #0000a8; color: #ffff55; }
.dc-termfx::after { padding: 10px 14px; border-radius: 6px; background: #0a120e; color: #b9f3c6; font: 600 14px ui-monospace, Menlo, monospace; }
.dc-termfx[data-style="crt"]::after { content: "CRT"; text-shadow: 0 0 6px #b9f3c6;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .35) 0 1px, transparent 1px 3px), #0a120e; }
.dc-termfx[data-style="flicker"]::after { content: "ALERT!"; color: #ffcb6b; animation: ns-flicker 2.4s linear infinite; }
.dc-termfx[data-style="boot"]::after { content: "BOOT ··· OK"; }
.dc-cursor::after { font: 700 30px ui-monospace, Menlo, monospace; color: var(--accent-ink); animation: ns-blink-caret 1.05s steps(1) infinite; }
.dc-cursor[data-style="block"]::after { content: ">█"; } .dc-cursor[data-style="underline"]::after { content: ">_"; }
.dc-cursor[data-style="bar"]::after { content: ">▍"; }
.dc-prompt::after { content: "you@night-shift ❯"; font: 600 14px ui-monospace, Menlo, monospace; color: var(--accent-ink); }
.dc-termfont::after { content: "Aa >_ 42"; font-size: 22px; color: var(--accent-ink); }
.dc-termfont[data-style="vt323"]::after { font-family: "VT323", monospace; font-size: 30px; }
.dc-termfont[data-style="pixel"]::after { font-family: "Press Start 2P", monospace; font-size: 13px; }
.dc-termfont[data-style="typewriter"]::after { font-family: "Courier Prime", monospace; }
.dc-termfont[data-style="plex"]::after { font-family: "IBM Plex Mono", monospace; }
.dc-keysound::after { content: "⌨ ♪"; font-size: 28px; color: var(--accent-ink); }
.dc-winfx::after { content: "✦ ✧ ✦"; font-size: 28px; color: #e8b84a; letter-spacing: 4px; }
.dc-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; }
.dc-options select { padding: 2px 6px; }
@media (prefers-reduced-motion: reduce) { .dc-termfx[data-style="flicker"]::after, .dc-cursor::after { animation: none; } }

/* ── The global chat (global-chat.js): the top bar's button and the box in the corner ─────────── */
.room-toggle { position: relative; padding: 6px 8px; line-height: 0; }
.room-toggle .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linejoin: round; stroke-linecap: round; }
.room-toggle.active { color: var(--accent-ink); }
.room-unread { position: absolute; top: 0; inset-inline-end: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: var(--accent-text); font-size: 10px; font-weight: 700; line-height: 16px; }
.room { position: fixed; z-index: 30; inset-inline-end: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(12px, env(safe-area-inset-bottom, 0px)); width: min(360px, calc(100vw - 24px)); height: min(480px, 70vh);
  display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow); transition: background .2s; font-size: 13.5px; }
/* solid while in use (Firefox showed the page through a 96-97% mix) */
.room:hover, .room:focus-within { background: var(--surface); }
.room[hidden] { display: none; }
.room-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--border); }
.room-head strong { font-family: var(--font-display); font-size: 14px; }
.room-head .muted { flex: 1; font-size: 12px; }
.room-head button { padding: 2px 8px; }
.room-intro { padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--accent-soft); font-size: 12.5px; }
.room-intro p { margin: 0 0 6px; }
.room-messages { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 6px 8px; list-style: none;
  display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.room-msg { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.room-msg[hidden] { display: none; }
.room-msg.who-system { justify-content: center; text-align: center; font-size: 12px; color: var(--muted); padding: 2px 8px; }
.room-avatar { flex: none; width: 26px; height: 26px; border-radius: 50%; object-fit: cover; object-position: 50% 15%;
  background: var(--raised); }
.room-letter { display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: #6b7a99; }
.room-letter[data-hue="0"] { background: #c0634a; } .room-letter[data-hue="1"] { background: #4f8a5b; }
.room-letter[data-hue="2"] { background: #4a6fc0; } .room-letter[data-hue="3"] { background: #9a5ab0; }
.room-letter[data-hue="4"] { background: #b0863a; } .room-letter[data-hue="5"] { background: #3a95a0; }
.room-body { min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.room-name { display: inline; min-height: 0; height: auto; padding: 0; margin-inline-end: 6px; border: 0; background: none;
  color: var(--accent-ink);
  font: inherit; font-weight: 600; cursor: pointer; }
#room .room-name { min-height: 0; }   /* (a name in a line of text, not a 44 px touch button: the phone rule's
                                         button:not(…) outranks a class) */
.room-msg.mine .room-name { color: var(--text); cursor: default; }
.room-msg.who-character .room-name { color: var(--good); }
.room-tag { margin-inline-start: 4px; padding: 0 4px; border-radius: 4px; background: var(--raised); color: var(--muted);
  font-size: 10px; font-weight: 700; letter-spacing: .04em; vertical-align: 1px; }
.room-tag.rogue { background: var(--danger); color: var(--on-danger); }
.room-text { color: var(--text); }
.room-menu { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--border);
  background: var(--raised); }
.room-menu p { flex-basis: 100%; margin: 0; font-size: 12.5px; }
.room-note { margin: 0; padding: 6px 12px; font-size: 12.5px; border-top: 1px solid var(--border); color: var(--muted); }
.room-note[data-kind="good"] { color: var(--good); }
.room-note[data-kind="bad"] { color: var(--bad); }
.room-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--border); }
.room-form input { flex: 1; min-width: 0; }
/* With global_chat.make_room (off by default), wide windows make room for the open box: the tabs'
   content moves left of it (it covered the Text tab's Send button at 1440 px). Otherwise, and on
   narrower windows, it floats over the page, and the × closes it. */
@media (min-width: 1100px) {
  html.room-open main { padding-inline-end: 384px; }
}
@media (max-width: 600px) {
  .room { inset-inline-start: max(8px, env(safe-area-inset-left, 0px)); inset-inline-end: max(8px, env(safe-area-inset-right, 0px));
    bottom: max(8px, env(safe-area-inset-bottom, 0px)); width: auto; height: 62vh; }
  /* solid on a phone: no hover to make it so, and the page behind made it hard to read */
  .room { background: var(--surface); }
  .room-form input { font-size: 16px; }   /* (no zoom on focus in iOS) */
}
/* The chat button made the phone top bar 23 px too wide at 390 px (it already was 8 px at 360): the tabs
   sit closer, the button is compact, and below that the tabs scroll on their own instead of pushing
   the credits and the account off the screen. */
@media (max-width: 430px) {
  .tabs { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: none; padding: 0 3px; }
  .room-toggle { padding: 4px 5px; }
}

/* ── The garden's additions (2026-11-20, garden.js): the level, Hana's gift and sharing, the rare
   visitors, locked and special seeds, complete sets, friends and reminders, a friend's garden ── */
.garden-level { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: -2px 0 0; font-size: 13px; }
.garden.has-world .garden-level { text-shadow: 0 1px 3px var(--bg), 0 0 12px var(--bg); }
.gl-bar { width: 90px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--border) 80%, transparent);
  overflow: hidden; }
.gl-fill { display: block; height: 100%; background: var(--good); border-radius: 3px; }
.garden-extras { display: flex; flex-wrap: wrap; gap: 6px; }
.gs-rare { position: absolute; z-index: 6; width: 9%; aspect-ratio: 1; padding: 0; border: 0; background: none;
  cursor: pointer; filter: drop-shadow(0 0 6px rgb(255 240 170 / .9)); }
.gs-rare img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.gs-rare.gs-hummingbird { width: 7%; animation: gs-hover 1.6s ease-in-out infinite; }
.gs-rare.gs-hedgehog { animation: gs-trundle 3.4s ease-in-out infinite; }
.gs-rare:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes gs-hover { 0%, 100% { transform: translate(0, 0) rotate(-3deg); } 25% { transform: translate(3px, -6px) rotate(2deg); }
  50% { transform: translate(-2px, -2px) rotate(-1deg); } 75% { transform: translate(2px, -8px) rotate(3deg); } }
@keyframes gs-trundle { 0%, 100% { transform: translateX(0) scaleX(-1); } 45% { transform: translateX(14px) scaleX(-1) translateY(-1px); }
  55% { transform: translateX(14px) scaleX(-1); } }
@media (prefers-reduced-motion: reduce) { .gs-rare { animation: none !important; } }
.seed.locked { filter: grayscale(.8); }
.seed .seed-way { font-size: 11px; color: var(--muted); }
.seed.mystery { border-style: dashed; border-color: var(--accent); }
.book-card.complete { box-shadow: inset 0 0 0 2px #d4a530; }
button.book-card { font: inherit; color: inherit; cursor: pointer; }
.garden-settings { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); }
.garden-settings h3 { margin: 0; font-size: 15px; }
.gset-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.gset-note { font-size: 13px; }
/* a friend's garden (GardenVisit), from the global chat */
.garden-visit { width: min(560px, calc(100vw - 32px)); max-height: 80vh; padding: 16px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.garden-visit::backdrop { background: rgb(0 0 0 / .45); }
.gvisit-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gvisit-head h2 { margin: 0; font-size: 18px; font-family: var(--font-display); }
.gvisit-pots { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 10px; }
.gvisit-pot { display: grid; justify-items: center; gap: 3px; padding: 8px 4px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); font-size: 13px; text-align: center; }
.gvisit-pot img { width: 64px; height: 85px; object-fit: contain; }
.gvisit-pot.empty { align-content: center; min-height: 80px; }
.gvisit-note { min-height: 1.4em; margin: 10px 0 0; font-size: 14px; color: var(--good); }
/* Achievements (achievements.js; games.achievements): gold for the honours, the games' own art behind the numbers */
:root { --gold: #e9c46a; --gold-deep: #b7862c; --gold-soft: rgb(233 196 106 / .14); }
:root[data-theme="calm"] { --gold: #b8892b; --gold-deep: #8a6418; --gold-soft: rgb(184 137 43 / .12); }
.ach-dialog { width: min(680px, calc(100vw - 32px)); }
.ach-hero { display: grid; grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: "trophy face who" "stats stats stats";
  align-items: center; gap: 10px 12px; margin: 12px 0 4px; padding: 14px; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--border));
  background: radial-gradient(120% 140% at 0% 0%, var(--gold-soft), transparent 60%), var(--raised); }
.ach-hero-trophy { grid-area: trophy; width: 58px; height: 58px; filter: drop-shadow(0 3px 8px rgb(0 0 0 / .35)); }
.ach-hero .room-face { grid-area: face; width: 48px; height: 48px; font-size: 20px; flex: none; }
.ach-who-words { grid-area: who; display: grid; gap: 2px; min-width: 0; }
.ach-who-words strong { font-family: var(--font-display); font-size: 19px; overflow-wrap: anywhere; }
.ach-stats { grid-area: stats; display: flex; flex-wrap: wrap; gap: 8px; }
.ach-stat { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); background: var(--gold-soft); }
.ach-stat b { font-family: var(--font-display); font-size: 17px; color: var(--gold); font-variant-numeric: tabular-nums; }
.ach-stat small { font-size: 12.5px; color: var(--muted); }
@media (min-width: 560px) {
  .ach-hero { grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "trophy face who stats"; }
  .ach-stats { flex-direction: column; align-items: stretch; gap: 6px; }
}
.ach-sub { margin: 18px 0 8px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ach-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0; }
.ach-count { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px;
  min-height: 96px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--raised); }
.ach-count.has-art { border-color: color-mix(in srgb, var(--gold) 35%, var(--border));
  background: linear-gradient(180deg, rgb(10 12 16 / .05) 0%, rgb(10 12 16 / .55) 45%, rgb(10 12 16 / .92) 100%), var(--art) center / cover; }
.ach-count dt { position: relative; font-size: 12.5px; color: var(--muted); }
.ach-count dd { order: -1; position: relative; margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.1;
  font-variant-numeric: tabular-nums; }
.ach-count.has-art dt { color: rgb(236 238 242 / .82); }
.ach-count.has-art dd { color: #fff; text-shadow: 0 2px 8px rgb(0 0 0 / .6); }
.ach-count.none { opacity: .62; }
.ach-count.none.has-art { filter: grayscale(.85); }
.ach-count.none dd { font-weight: 600; }
.ach-badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ach-badge { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--raised); min-width: 0; }
.ach-badge.earned { border-color: color-mix(in srgb, var(--gold) 55%, var(--border));
  background: linear-gradient(135deg, var(--gold-soft), transparent 70%), var(--raised); }
.ach-medal-pic, .ach-medal { width: 48px; height: 48px; flex: none; border-radius: 50%; }
.ach-badge.earned .ach-medal-pic { box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 70%, transparent), 0 4px 12px rgb(0 0 0 / .35); }
.ach-badge:not(.earned) .ach-medal-pic { filter: grayscale(1) brightness(.75); opacity: .7; }
.ach-medal { display: grid; place-items: center; border: 2px solid var(--gold); color: var(--gold); font-size: 20px; background: var(--gold-soft); }
.ach-badge:not(.earned) .ach-medal { border-color: var(--border); color: var(--muted); background: transparent; }
.ach-badge-text { display: grid; gap: 2px; min-width: 0; }
.ach-badge-text strong { font-size: 14px; }
.ach-badge-text small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.ach-bar { display: block; height: 5px; margin-top: 3px; border-radius: 3px; background: var(--border); overflow: hidden; }
.ach-bar-fill { display: block; height: 100%; width: var(--done, 0%); border-radius: 3px; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }
.ach-bar-n { font-variant-numeric: tabular-nums; }
.ach-share { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 16px 0 0; font-size: 13.5px; }
.ach-copied { overflow-wrap: anywhere; }
.ach-trophy-drawn { display: grid; place-items: center; border-radius: 50%; color: var(--gold);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--gold) 35%, transparent), var(--gold-soft) 70%);
  border: 2px solid var(--gold); }
.ach-trophy-drawn svg { width: 60%; height: 60%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* the Games tab's way in: a gold-edged banner with a sheen passing over it */
.ach-banner { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; overflow: hidden;
  border: 2px solid transparent; border-radius: 14px; color: var(--text); text-align: left; cursor: pointer;
  background: linear-gradient(120deg, var(--gold-soft), transparent 55%) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,   /* (a plain colour can't be a middle layer) */
    linear-gradient(120deg, var(--gold), var(--accent) 45%, var(--gold-deep)) border-box; }
.ach-banner::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / .16) 50%, transparent 65%); transform: translateX(-100%); }
.ach-banner:hover::after, .ach-banner:focus-visible::after { animation: ach-sheen 1.1s ease; }
@keyframes ach-sheen { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .ach-banner:hover::after, .ach-banner:focus-visible::after { animation: none; } }
.ach-banner:hover { box-shadow: 0 6px 20px rgb(0 0 0 / .3), 0 0 0 1px var(--gold-soft); }
.ach-banner-trophy { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 2px 6px rgb(0 0 0 / .35)); }
.ach-banner-words { display: grid; gap: 1px; min-width: 0; flex: 1; }
.ach-banner-words strong { font-family: var(--font-display); font-size: 17px; }
.ach-banner-words span { font-size: 13px; color: var(--muted); }
.ach-banner-medals { display: flex; flex: none; }
.ach-banner-medals img { width: 34px; height: 34px; border-radius: 50%; margin-left: -10px; box-shadow: 0 0 0 2px var(--surface), 0 2px 6px rgb(0 0 0 / .35); }
.ach-banner-medals img:first-child { margin-left: 0; }
.ach-banner-go { flex: none; font-size: 26px; line-height: 1; color: var(--gold); }
@media (max-width: 420px) { .ach-banner-medals { display: none; } }
.pt-chip-name.ach-link { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
/* a flower shown in the global chat */
.room-card { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 4px 8px 4px 4px; width: fit-content;
  border: 1px solid var(--border); border-radius: 10px; background: var(--raised); font-size: 12.5px; font-weight: 600; }
.room-card img { width: 36px; height: 48px; object-fit: contain; }
.room-card.rare-hybrid { border-color: #d4a530; }
.room-card.rare-variety { border-color: var(--accent); }

/* ── Paint together (paint.js, 2026-11-21): the lobby, the room's tools, the painting ── */
.pt-intro { margin: 0 0 10px; }
.pt-start { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.pt-start select { max-width: 200px; }
/* A page of one's own (paint.js ownBox; games.paint.own_pages) */
.pt-own { display: grid; gap: 8px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; }
.pt-own h3 { margin: 0; font-size: 15px; }
.pt-own h4 { margin: 6px 0 4px; font-size: 13.5px; }
.pt-own > p { margin: 0; }
.pt-own-theme { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-own-theme input { flex: 1 1 220px; min-width: 0; }
.pt-own-pick summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.pt-own-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin: 8px 0; }
.pt-own-thumb { padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; aspect-ratio: 1; overflow: hidden; cursor: pointer; }
.pt-own-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pt-own-thumb.on { border-color: var(--accent); }
.pt-own-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pt-own-up { display: inline-flex; align-items: center; cursor: pointer; border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; font-size: 13.5px; }
.pt-own-up input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pt-own-status { margin: 0; min-height: 1.3em; font-size: 14px; }
.pt-own-made { display: grid; justify-items: start; gap: 6px; margin: 0; }
.pt-own-made img { max-width: min(260px, 100%); border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.pt-own-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-own-page { display: grid; gap: 4px; justify-items: center; font-size: 12.5px; text-align: center; }
.pt-own-page img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.pt-code { display: flex; gap: 6px; }
.pt-code input { width: 8.5em; text-transform: uppercase; letter-spacing: .08em; }
.pt-mine { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.pt-mine h3 { flex-basis: 100%; margin: 0; font-size: 15px; }
.pt-open { display: grid; gap: 6px; margin-bottom: 14px; }
.pt-open h3 { margin: 0; font-size: 15px; }
.pt-open p { margin: 0; }
.pt-room { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--raised); }
.pt-room img { flex: none; width: 42px; height: 56px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border);
  background: #fbf7ee; }
.pt-room-text { display: grid; flex: 1; min-width: 0; font-size: 13px; }
.pt-room-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pt-card { margin: 0; display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.pt-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); background: #fbf7ee; }
.pt-info { margin: 0 0 4px; font-size: 13px; }
.pt-members { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13px; }
.pt-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; border-radius: 999px; background: var(--raised);
  border: 1px solid var(--border); }
.pt-kick { padding: 0 4px; min-height: 0 !important; line-height: 1; }
.pt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.pt-swatches { display: flex; flex-wrap: wrap; gap: 4px; }
.pt-swatch { width: 26px; height: 26px; min-height: 0 !important; padding: 0; border-radius: 50%; border: 2px solid var(--border);
  background: var(--sw); box-shadow: inset 0 0 0 2px rgb(255 255 255 / .35); }
.pt-swatch.on { border-color: var(--text); transform: scale(1.12); }
.pt-group { display: flex; gap: 2px; }
.pt-group button.on, .pt-eraser.on { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.pt-group.idle { opacity: .45; }
.pt-stage.erasing .pt-preview { cursor: cell; }
.pt-lines { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.pt-stage { position: relative; width: 100%; max-width: 640px; margin: 0 auto; aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden;
  box-shadow: var(--shadow); background: #fbf7ee; }
.pt-stage canvas, .pt-stage img { position: absolute; inset: 0; width: 100%; height: 100%; }
.pt-lineart { mix-blend-mode: multiply; pointer-events: none; user-select: none; }
.pt-preview { touch-action: none; cursor: crosshair; }
.pt-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.pt-note { min-height: 1.4em; margin: 8px 0 0; text-align: center; font-size: 14px; }
.pt-note[data-kind="bad"] { color: var(--bad); }
.pt-done { font-weight: 600; color: var(--good); }
.pt-finished { display: block; width: 100%; max-width: 560px; margin: 8px auto 12px; border-radius: 6px; box-shadow: var(--shadow); }
@media (max-width: 600px) {
  .pt-swatch { width: 30px; height: 30px; }
  .pt-bar { gap: 6px 8px; }
}

/* ── Friends (friends.js, 2026-11-21): the count on the account button, the list, pop-ups ── */
.account summary { position: relative; }
.account-badge, .friends-count { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent);
  color: var(--accent-text); font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.account-badge { position: absolute; top: -4px; inset-inline-start: 22px; }
.friends-count { display: inline-block; margin-inline-start: 4px; }
.account-menu #open-friends { width: 100%; }
.friends-dialog { max-width: 520px; overflow-y: auto; }
.friends-body { display: grid; gap: 14px; margin-top: 8px; }
.fr-section { display: grid; gap: 6px; }
.fr-section h3 { margin: 0; font-size: 14px; }
.fr-section > p { margin: 0; font-size: 13px; }
.fr-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--raised); }
.fr-who { display: grid; flex: 1; min-width: 0; font-size: 13px; }
.fr-who strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.fr-code { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.fr-code code { padding: 2px 8px; border-radius: 6px; background: var(--raised); border: 1px solid var(--border);
  font-size: 15px; letter-spacing: .12em; }
.fr-add { display: flex; gap: 6px; }
.fr-add input { width: 11em; text-transform: uppercase; letter-spacing: .08em; }
.friends-dialog .gvisit-note[data-kind="bad"] { color: var(--bad); }
.toasts { position: fixed; z-index: 60; inset-inline-start: max(12px, env(safe-area-inset-left, 0px)); bottom: max(12px, env(safe-area-inset-bottom, 0px));
  display: grid; gap: 8px; width: min(320px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-size: 14px; }
.toast p { margin: 0 0 8px; }
.toast-acts { display: flex; gap: 6px; }

/* Paint together: the room chat beside the painting, friends on the painters, inviting */
.pt-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 250px); gap: 12px; align-items: stretch; }
.pt-main.solo { grid-template-columns: minmax(0, 1fr); }
.pt-chat { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--raised); }
.pt-chat-head { display: flex; align-items: baseline; gap: 6px; padding: 8px 10px 4px; font-size: 13px; }
.pt-chat-list { flex: 1 1 0; height: 0; min-height: 120px; overflow-y: auto; display: grid; align-content: start; gap: 4px;
  padding: 4px 10px; font-size: 13.5px; overflow-wrap: anywhere; }
.pt-msg { margin: 0; line-height: 1.35; }
.pt-report { min-height: 0 !important; padding: 0 4px; margin-left: 2px; font-size: 11px; opacity: .55; }
.pt-report:hover, .pt-report:focus-visible { opacity: 1; }
.pt-chat-empty { margin: 0; font-size: 13px; }
.pt-chat-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--border); }
.pt-chat-form input { flex: 1; min-width: 0; }
.pt-friend { color: var(--accent); }
.pt-invite { display: grid; gap: 6px; max-width: 520px; margin: 10px auto 0; }
.pt-invite h3 { margin: 0; font-size: 15px; }
.pt-invite p { margin: 0; }
@media (max-width: 900px) {
  .pt-main { grid-template-columns: minmax(0, 1fr); }
  .pt-chat-list { flex: none; height: 170px; }
}

/* ── Avatar frames, fancier (decor.fancy_frames, 2026-11-21) ──
   A ring drawn around the picture (::before: a padded box masked to its padding, so it follows the
   picture's corners at any size): gold with a glint going round and a twinkle, flowers turning with a
   blossom, neon in two colors with a pulsing glow. Still for those who ask for less motion.
   (data-frames="plain" on the page: the thin still rings above, as before.) */
@property --fr-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
:root:not([data-frames="plain"]) .avatar[data-frame] { position: relative; overflow: visible; box-shadow: none; }
:root:not([data-frames="plain"]) .avatar[data-frame]::before {
  content: ""; position: absolute; inset: -16%; padding: 11%; border-radius: inherit; pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: fr-turn 4s linear infinite;
}
.avatar[data-frame]::after { pointer-events: none; }
:root:not([data-frames="plain"]) .avatar[data-frame="gold"]::before {
  background: conic-gradient(from var(--fr-a), #8a5a0c, #d9a73a 10%, #fff7cf 15%, #f1cf6b 20%, #9a6d12 38%, #e2b440 55%,
    #8a5a0c 70%, #f6d77a 86%, #8a5a0c);
}
:root:not([data-frames="plain"]) .avatar[data-frame="gold"]::after {
  content: "✦"; position: absolute; top: -34%; right: -30%; font-size: .86em; line-height: 1; color: #fff3b8;
  text-shadow: 0 0 4px #f1cf6b; animation: fr-twinkle 2.6s ease-in-out infinite;
}
:root:not([data-frames="plain"]) .avatar[data-frame="flowers"]::before {
  background: repeating-conic-gradient(from var(--fr-a), #ff8fbd 0 22deg, #ffe08a 22deg 45deg, #8fe0a0 45deg 67deg,
    #b9a7ff 67deg 90deg);
  animation-duration: 12s;
}
:root:not([data-frames="plain"]) .avatar[data-frame="flowers"]::after {
  content: "✿"; position: absolute; bottom: -34%; right: -28%; font-size: .95em; line-height: 1; color: #ff7fb5;
  text-shadow: 0 0 2px #fff; animation: fr-bob 3.2s ease-in-out infinite;
}
:root:not([data-frames="plain"]) .avatar[data-frame="neon"]::before {
  background: conic-gradient(from var(--fr-a), #59f3ff, #4f7dff, #ff4fd8, #ffe14f, #59f3ff);
  animation-duration: 2.8s;
}
:root:not([data-frames="plain"]) .avatar[data-frame="neon"] { animation: fr-glow 2.4s ease-in-out infinite; }
/* (the star and the blossom: sized with the picture's letter, so they show on the small faces in rooms too;
   a little bigger there, to be seen) */
:root:not([data-frames="plain"]) .avatar.small[data-frame]::after,
:root:not([data-frames="plain"]) .avatar.tiny[data-frame]::after { font-size: 1.12em; }
/* Laurel, Frost and Galaxy (2026-11-25): the ring as above, and an animated picture on ::after drawn round the
   face at any size (web/sprites/decor/frames/<style>.svg, made by scripts/sprites/decor_frames.py; a still one
   for less motion, below) */
:root:not([data-frames="plain"]) .avatar[data-frame="laurel"]::after,
:root:not([data-frames="plain"]) .avatar[data-frame="frost"]::after,
:root:not([data-frames="plain"]) .avatar[data-frame="galaxy"]::after {
  content: ""; position: absolute; inset: -35%; background: center / 100% 100% no-repeat;
}
:root:not([data-frames="plain"]) .avatar[data-frame="laurel"]::after { background-image: url(/sprites/decor/frames/laurel.svg); }
:root:not([data-frames="plain"]) .avatar[data-frame="frost"]::after { background-image: url(/sprites/decor/frames/frost.svg); }
:root:not([data-frames="plain"]) .avatar[data-frame="galaxy"]::after { background-image: url(/sprites/decor/frames/galaxy.svg); }
:root:not([data-frames="plain"]) .avatar[data-frame="laurel"]::before {
  inset: -10%; padding: 4%;
  background: conic-gradient(from var(--fr-a), #8a5a0c, #f1cf6b 15%, #fff3c4 22%, #f1cf6b 30%, #9a6d12 50%, #e2b440 70%,
    #8a5a0c);
  animation-duration: 9s;
}
:root:not([data-frames="plain"]) .avatar[data-frame="frost"]::before {
  background: conic-gradient(from var(--fr-a), #ffffff, #bfe9ff 12%, #6fb6ec 25%, #e9f8ff 37%, #8ccff5 50%, #ffffff 62%,
    #5aa2dd 75%, #cfeeff 87%, #ffffff);
  animation-duration: 14s;
}
:root:not([data-frames="plain"]) .avatar[data-frame="galaxy"]::before {
  background: conic-gradient(from var(--fr-a), #1a0b3d, #5b2bd6, #ff5fb8, #ffb86b 32%, #3b6cff 50%, #1a0b3d 62%, #9b4dff 80%,
    #1a0b3d);
  animation-duration: 20s;
}
:root:not([data-frames="plain"]) .avatar[data-frame="galaxy"] { box-shadow: 0 0 10px 1px rgb(155 77 255 / .45); }
@keyframes fr-turn { to { --fr-a: 360deg; } }
@keyframes fr-twinkle { 0%, 100% { opacity: .35; transform: scale(.7) rotate(0deg); } 50% { opacity: 1; transform: scale(1.15) rotate(45deg); } }
@keyframes fr-bob { 0%, 100% { transform: translateY(0) rotate(-10deg); } 50% { transform: translateY(-2px) rotate(12deg); } }
@keyframes fr-glow { 0%, 100% { box-shadow: 0 0 6px 1px rgb(89 243 255 / .55); } 50% { box-shadow: 0 0 13px 4px rgb(255 79 216 / .5); } }
@media (prefers-reduced-motion: reduce) {
  .avatar[data-frame], .avatar[data-frame]::before, .avatar[data-frame]::after { animation: none !important; }
  :root:not([data-frames="plain"]) .avatar[data-frame="laurel"]::after { background-image: url(/sprites/decor/frames/laurel-still.svg); }
  :root:not([data-frames="plain"]) .avatar[data-frame="frost"]::after { background-image: url(/sprites/decor/frames/frost-still.svg); }
  :root:not([data-frames="plain"]) .avatar[data-frame="galaxy"]::after { background-image: url(/sprites/decor/frames/galaxy-still.svg); }
}

/* Pictures in rooms (rooms.js: the chips, the chat lines, the friends list) */
.room-face.small { width: 22px; height: 22px; font-size: 11px; }
.room-face.tiny { width: 18px; height: 18px; font-size: 10px; margin-top: 1px; }
.pt-chip { gap: 5px; padding: 2px 8px 2px 3px; }
:root:not([data-frames="plain"]) .pt-chip:has(> .avatar[data-frame]) { gap: 9px; padding: 5px 9px 5px 7px; }   /* (room for the ring and the extras) */
.cr-faces { display: flex; flex: none; gap: 9px; padding: 3px 6px 3px 4px; }
.pt-chip .pt-chip-name { white-space: nowrap; }
/* Who's in a room, bigger (2026-11-25): paint, cryptogram and Night Shift rooms */
.pt-members { gap: 8px; font-size: 15px; }
.pt-members .pt-chip { gap: 7px; padding: 4px 12px 4px 4px; }
:root:not([data-frames="plain"]) .pt-members .pt-chip:has(> .avatar[data-frame]) { gap: 11px; padding: 7px 12px 7px 9px; }
.pt-members .room-face.small { width: 32px; height: 32px; font-size: 14px; }
.pt-members .pt-kick { font-size: 16px; padding: 2px 6px; }
.pt-msg { display: flex; align-items: flex-start; gap: 6px; }
:root:not([data-frames="plain"]) .pt-msg:has(> .avatar[data-frame]) { gap: 10px; }
:root:not([data-frames="plain"]) .pt-chat-list { padding-top: 8px; gap: 6px; }   /* (the first line's ring and star) */
.pt-msg p { margin: 0; flex: 1; min-width: 0; line-height: 1.35; }
.pt-room > .avatar { flex: none; }

/* Cryptogram rooms (crypto-rooms.js) */
.cr-lobby { display: grid; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.cr-lobby.cr-page { margin-top: 4px; padding-top: 0; border-top: 0; }   /* (the game's first page) */
.cr-start { margin-bottom: 0; }
.cr-lobby .pt-code { align-items: center; flex-wrap: wrap; }
.cr-others { justify-self: start; }
.cr-lobby h3, .cr-lobby h4 { margin: 0; }
.cr-lobby h4 { font-size: 14px; margin-top: 4px; }
.cr-lobby p { margin: 0; }
.cr-main { grid-template-columns: minmax(0, 1fr) minmax(200px, 240px); }
.cr-puzzle { min-width: 0; display: grid; gap: 10px; align-content: start; }
.cr-puzzle .crypto-board { margin: 0; }
.cr-main .pt-chat-list { min-height: 220px; }
#cr-members .pt-chip { box-shadow: inset 0 -2px 0 var(--who, transparent); }
.cc.by input.cc-in { border-bottom-color: var(--who); box-shadow: inset 0 -3px 0 -1px var(--who); }
.cr-prizes { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.cr-prizes li { display: flex; align-items: center; gap: 6px; }
.cr-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--who); flex: none; }
@media (max-width: 900px) {
  .cr-main { grid-template-columns: minmax(0, 1fr); }
  .cr-main .pt-chat-list { min-height: 0; height: 160px; }
}

/* The true ending's case board (nightshift.js endBoard; games.nightshift.cases.ending_board), over the terminal: a
   paper case file, the reason and the two pieces of evidence pinned up in turn, red thread drawn from each to the
   accused, then a rubber stamp and a knock. A paper thing, so one look in every theme and terminal look. */
.ns-endboard { --eb-paper: #efe7d4; --eb-paper-2: #e2d5b8; --eb-ink: #2a2118; --eb-dim: #6f5f4a; --eb-red: #a3211b;
  --eb-card: #fbf7ec; --eb-grain: url("sprites/nightshift/stamp-grain.svg");   /* (the stamp's ink: a file, as the page's policy wants) */
  position: absolute; inset: 0; z-index: 6; display: flex; padding: 14px; overflow-y: auto; opacity: 0;
  background: rgba(3, 7, 5, .74); }
.ns-endboard.go { animation: eb-fade .35s ease-out forwards; }
.ns-endboard.away { animation: eb-out .22s ease-in forwards; }
@keyframes eb-fade { to { opacity: 1; } }
@keyframes eb-out { from { opacity: 1; } to { opacity: 0; } }
.ns-eb-file { position: relative; display: grid; width: min(700px, 100%); margin: auto; padding: 16px 20px 14px; border-radius: 3px;
  background: radial-gradient(90% 60% at 20% 10%, rgba(255, 255, 255, .35), transparent 70%), linear-gradient(170deg, var(--eb-paper), var(--eb-paper-2));
  color: var(--eb-ink); box-shadow: 0 18px 44px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(60, 40, 20, .12);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; opacity: 0; transform: translateY(14px); }
.go .ns-eb-file { animation: eb-rise .45s .1s cubic-bezier(.2, .8, .2, 1) forwards, eb-shake .22s 3.45s ease-out; }
@keyframes eb-rise { to { opacity: 1; transform: none; } }
@keyframes eb-shake { 30% { transform: translate(1.5px, 2.5px); } 65% { transform: translate(-1px, -1px); } 100% { transform: none; } }
.ns-eb-kicker { margin: 0; font: 600 11px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .14em;
  text-transform: uppercase; color: var(--eb-dim); }
.ns-eb-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.ns-eb-card, .ns-eb-name { --tilt: 0deg; position: relative; margin: 0; background: var(--eb-card); border-radius: 2px;
  box-shadow: 0 2px 7px rgba(40, 25, 10, .22); opacity: 0; transform: rotate(var(--tilt)) translateY(-16px); }
.ns-eb-card { padding: 18px 12px 12px; font-size: 13.5px; line-height: 1.45; }
.go .ns-eb-card, .go .ns-eb-name { animation: eb-pin .38s calc(.55s + var(--i) * .3s) cubic-bezier(.3, 1.4, .5, 1) forwards; }
@keyframes eb-pin { to { opacity: 1; transform: rotate(var(--tilt)); } }
.ns-eb-card figcaption, .ns-eb-name small { font: 600 10.5px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .12em; text-transform: uppercase; color: var(--eb-red); }
.ns-eb-card figcaption { margin-bottom: 4px; }
.ns-eb-card p { margin: 0; }
.ns-eb-pin { position: absolute; top: 6px; left: 50%; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f3958b, #b8322a 55%, #5e110d); box-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.ns-eb-name { justify-self: center; display: grid; gap: 2px; max-width: 100%; margin: 40px 0 6px; padding: 18px 30px 12px; text-align: center; }
.ns-eb-name small { color: var(--eb-dim); }
.ns-eb-name strong { font-family: var(--font-display); font-size: 25px; letter-spacing: .02em; text-wrap: balance; }
.ns-eb-threads { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ns-eb-threads path { fill: none; stroke: var(--eb-red); stroke-width: 1.7; stroke-linecap: round; opacity: .9;
  stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.go .ns-eb-threads path { animation: eb-thread .5s calc(1.85s + var(--i) * .4s) ease-in-out forwards; }
@keyframes eb-thread { to { stroke-dashoffset: 0; } }
.ns-eb-stamp { position: absolute; right: 6%; top: 40%; padding: 7px 16px 5px; border: 4px solid var(--eb-red); border-radius: 6px;
  box-shadow: inset 0 0 0 2px var(--eb-paper), inset 0 0 0 4px var(--eb-red); color: var(--eb-red);
  font: 800 clamp(24px, 5.5vw, 40px)/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
  mix-blend-mode: multiply; -webkit-mask-image: var(--eb-grain); mask-image: var(--eb-grain);
  opacity: 0; transform: rotate(-11deg) scale(2.4); pointer-events: none; }
.go .ns-eb-stamp { animation: eb-stamp .17s 3.3s cubic-bezier(.55, 0, 1, .45) forwards; }
@keyframes eb-stamp { to { opacity: .9; transform: rotate(-11deg) scale(1); } }
.ns-eb-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 0 0;
  padding-top: 10px; border-top: 1px dashed rgba(60, 40, 20, .3); color: var(--eb-dim); font-size: 13.5px; opacity: 0; }
.go .ns-eb-foot { animation: eb-fade .4s 3.75s forwards; }
.ns-eb-close { min-height: 34px; padding: 4px 14px; border: 1px solid var(--eb-ink); border-radius: 4px; background: transparent;
  color: var(--eb-ink); font: inherit; box-shadow: none; cursor: pointer; }
.ns-eb-close:hover { background: rgba(60, 40, 20, .08); }
.ns-eb-close:focus-visible { outline: 2px solid var(--eb-red); outline-offset: 2px; }
@media (max-width: 560px) {
  .ns-eb-file { padding: 14px 14px 12px; }
  .ns-eb-cards { grid-template-columns: minmax(0, 1fr); width: 86%; gap: 10px; }
  .ns-eb-card .ns-eb-pin { top: 50%; left: auto; right: -5.5px; margin: -5.5px 0 0; }   /* (threads down the right side) */
  .ns-eb-name { margin-top: 26px; }
  .ns-eb-stamp { right: 4%; top: auto; bottom: 22%; }
}
@media (prefers-reduced-motion: reduce) {
  .ns-endboard.go, .go .ns-eb-file, .go .ns-eb-foot { animation: none; opacity: 1; transform: none; }
  .go .ns-eb-card, .go .ns-eb-name { animation: none; opacity: 1; transform: rotate(var(--tilt)); }
  .go .ns-eb-threads path { animation: none; stroke-dashoffset: 0; }
  .go .ns-eb-stamp { animation: none; opacity: .9; transform: rotate(-11deg); }
}
/* Haggle: the merchant's mood, told after the deal (games.haggle.moods) */
.hg-mood-told { margin: 4px 0 0; font-style: italic; color: var(--muted); }

/* What waits in the games (game-notes.js; games.notes): a dot and a count on the tab, the game's card marked */
.tabs button { position: relative; }
.tabs button.has-note { color: var(--text); }
.tabs button.has-note::after { content: attr(data-notes); position: absolute; top: 4px; inset-inline-end: 4px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 8px; background: var(--danger); color: var(--on-danger); font-size: 10.5px; font-weight: 700;
  line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--bg); animation: note-pulse 2.4s ease-in-out 3; }
@keyframes note-pulse { 50% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .tabs button.has-note::after { animation: none; } }
.game-card.gc-has-note { position: relative; border-color: color-mix(in srgb, var(--danger) 55%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent); }
.game-card.gc-has-note::after { content: ""; position: absolute; top: 10px; right: 10px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 0 2px var(--surface); }
/* Hana at the side of the page with the garden's news: slides in from the right edge */
.hana-pop { position: fixed; z-index: 70; right: max(8px, env(safe-area-inset-right, 0px)); bottom: max(96px, calc(env(safe-area-inset-bottom, 0px) + 96px));
  display: flex; align-items: flex-end; gap: 4px; max-width: min(380px, calc(100vw - 16px)); pointer-events: none;
  transform: translateX(calc(100% + 24px)); opacity: 0; transition: transform .38s cubic-bezier(.2, .9, .3, 1.15), opacity .25s ease; }
.hana-pop.in { transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .hana-pop { transform: none; transition: opacity .2s; } }
.hana-pop > * { pointer-events: auto; }
.hana-pop-fact > * { cursor: pointer; }   /* (a plant fact: a tap closes it, 2026-11-26) */
.hana-pop-face { width: 104px; height: auto; flex: none; filter: drop-shadow(0 6px 14px rgb(0 0 0 / .35)); margin-bottom: -6px; }
.hana-pop-bubble { position: relative; display: grid; gap: 6px; padding: 10px 12px; margin-bottom: 44px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); min-width: 0; }
.hana-pop-bubble::after { content: ""; position: absolute; right: -7px; bottom: 18px; width: 12px; height: 12px; transform: rotate(45deg);
  background: var(--surface); border-right: 1px solid var(--border); border-top: 1px solid var(--border); }
.hana-pop-bubble strong { font-family: var(--font-display); font-size: 14px; color: var(--good); }
.hana-pop-bubble p { margin: 0; font-size: 14px; line-height: 1.4; }
.hana-pop-acts { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 480px) { .hana-pop-face { width: 76px; } .hana-pop-bubble { margin-bottom: 30px; } }

/* A reply ready while elsewhere (app.js replyDone; ui.reply_notes): the tab's green dot, a card at the top right */
.tabs button.has-ready::before { content: ""; position: absolute; top: 7px; inset-inline-start: 8px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--good); box-shadow: 0 0 0 2px var(--bg); }
.ready-pop { position: fixed; z-index: 70; top: max(68px, calc(env(safe-area-inset-top, 0px) + 68px)); inset-inline-end: max(12px, env(safe-area-inset-right, 0px));
  display: flex; align-items: center; gap: 8px; max-width: min(380px, calc(100vw - 24px)); padding: 10px 10px 10px 14px;
  border: 1px solid color-mix(in srgb, var(--good) 45%, var(--border)); border-radius: 12px; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow); transform: translateY(-12px); opacity: 0; transition: transform .25s ease, opacity .25s ease; }
.ready-pop.in { transform: none; opacity: 1; }
.ready-pop-text { display: grid; gap: 2px; min-width: 0; }
.ready-pop-text strong { color: var(--good); font-size: 14px; }
.ready-pop-text span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ready-pop-x { flex: none; padding: 2px 8px; }
.pf-state.off { color: var(--danger); }

/* The leaderboard (leaderboard.js; games.leaderboard): as the achievements: gold, the games' art, a podium */
.lb-banner { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; overflow: hidden;
  border: 2px solid transparent; border-radius: 14px; color: var(--text); text-align: left; cursor: pointer;
  background: linear-gradient(120deg, transparent 40%, var(--gold-soft)) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(120deg, var(--gold-deep), var(--gold) 55%, var(--accent)) border-box; }
.lb-banner::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / .16) 50%, transparent 65%); transform: translateX(-100%); }
.lb-banner:hover::after, .lb-banner:focus-visible::after { animation: ach-sheen 1.1s ease; }
@media (prefers-reduced-motion: reduce) { .lb-banner:hover::after, .lb-banner:focus-visible::after { animation: none; } }
.lb-banner:hover { box-shadow: 0 6px 20px rgb(0 0 0 / .3), 0 0 0 1px var(--gold-soft); }
.lb-banner-icon { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%; font-size: 24px;
  border: 2px solid var(--gold); background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--gold) 35%, transparent), var(--gold-soft) 70%); }
.lb-banner-words { display: grid; gap: 1px; flex: 1; min-width: 0; }
.lb-banner-words strong { font-family: var(--font-display); font-size: 17px; }
.lb-banner-words span { font-size: 13px; color: var(--muted); }
.lb-banner-medals { flex: none; font-size: 22px; letter-spacing: -4px; }
@media (max-width: 420px) { .lb-banner-medals { display: none; } }
.lb-dialog { width: min(900px, calc(100vw - 32px)); }
.lb-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "trophy words" "stats stats"; align-items: center;
  gap: 10px 14px; margin: 12px 0 14px; padding: 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--border));
  background: radial-gradient(120% 140% at 0% 0%, var(--gold-soft), transparent 60%), var(--raised); }
.lb-hero-trophy { grid-area: trophy; width: 58px; height: 58px; filter: drop-shadow(0 3px 8px rgb(0 0 0 / .35)); }
.lb-hero-words { grid-area: words; display: grid; gap: 2px; min-width: 0; }
.lb-hero-words p { margin: 0; }
.lb-when { font-family: var(--font-display); font-size: 21px; color: var(--gold); }
.lb-hero-stats { grid-area: stats; display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 620px) { .lb-hero { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "trophy words stats"; }
  .lb-hero-stats { flex-direction: column; align-items: stretch; gap: 6px; } }
.lb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.lb-board { display: grid; align-content: start; border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--border)); border-radius: 14px;
  background: var(--raised); overflow: hidden; min-width: 0; }
.lb-board.none { border-color: var(--border); }
.lb-board-top { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 64px;
  padding: 10px 12px 8px; }
.lb-board-top.has-art { min-height: 84px; background: linear-gradient(180deg, rgb(10 12 16 / .05), rgb(10 12 16 / .82)), var(--art) center / cover; }
.lb-board.none .lb-board-top.has-art { filter: grayscale(.8); opacity: .8; }
.lb-board-top h3 { margin: 0; font-size: 14.5px; line-height: 1.25; }
.lb-board-top.has-art h3 { color: #fff; text-shadow: 0 2px 8px rgb(0 0 0 / .6); }
.lb-players { flex: none; font-size: 11.5px; color: var(--muted); }
.lb-board-top.has-art .lb-players { color: rgb(236 238 242 / .8); }
.lb-empty { margin: 0; padding: 12px; font-size: 13px; color: var(--muted); }
.lb-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 6px; padding: 12px 10px 0; }
.lb-step { display: grid; justify-items: center; gap: 2px; min-width: 0; text-align: center; }
.lb-step.empty { visibility: hidden; }
.lb-medal { font-size: 26px; line-height: 1; }
.lb-step.place-1 .lb-medal { font-size: 32px; }
.lb-step .lb-name { max-width: 100%; font-size: 13px; font-weight: 600; }
.lb-step-value { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold); }
.lb-block { display: grid; place-items: center; width: 100%; margin-top: 4px; border-radius: 8px 8px 0 0; font-family: var(--font-display);
  font-weight: 700; color: color-mix(in srgb, var(--text) 70%, transparent); background: linear-gradient(180deg, var(--gold-soft), transparent); }
.lb-step.place-1 .lb-block { height: 46px; background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 45%, transparent), var(--gold-soft)); }
.lb-step.place-2 .lb-block { height: 32px; background: linear-gradient(180deg, rgb(192 198 210 / .45), rgb(192 198 210 / .1)); }
.lb-step.place-3 .lb-block { height: 22px; background: linear-gradient(180deg, rgb(205 127 50 / .45), rgb(205 127 50 / .1)); }
.lb-step.you .lb-name { color: var(--accent-ink); }
.lb-rows { list-style: none; margin: 0; padding: 8px 10px 10px; display: grid; gap: 3px; border-top: 1px solid var(--border); }
.lb-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 8px; font-size: 13.5px; }
.lb-row.you { background: var(--accent-soft); }
.lb-rank { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-link { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: 3px; }
.lb-step .lb-link { font-weight: 600; }
.lb-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.lb-gap { text-align: center; color: var(--muted); font-size: 12px; }
.lb-market { margin-top: 6px; }
.lb-items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.lb-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "what price" "what who"; gap: 0 8px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--raised); }
.lb-item.you { border-color: var(--accent); }
.lb-item-what { grid-area: what; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "e n" "e m"; column-gap: 8px; align-items: center; min-width: 0; }
.lb-emoji { grid-area: e; font-size: 24px; }
.lb-item-what strong { grid-area: n; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-item-what small { grid-area: m; font-size: 12px; }
.lb-item-price { grid-area: price; text-align: right; white-space: nowrap; }
.lb-item-price b { color: var(--gold); font-family: var(--font-display); font-size: 17px; }
.lb-item-who { grid-area: who; text-align: right; font-size: 12px; color: var(--muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* Messages in a small window (popup.js; ui.popups): the first-week gift first */
.popup { width: min(340px, calc(100vw - 32px)); padding: 26px 22px 20px; border: 1px solid var(--border); border-radius: 22px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow); text-align: center; }
.popup[open] { display: grid; justify-items: center; gap: 8px; animation: popup-in .28s cubic-bezier(.2, .9, .3, 1.2); }
.popup::backdrop { background: rgb(0 0 0 / .45); }
@keyframes popup-in { from { opacity: 0; transform: translateY(10px) scale(.94); } }
@media (prefers-reduced-motion: reduce) { .popup[open] { animation: none; } }
.popup-art { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; margin-bottom: 4px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%); }
.popup-icon { font-size: 46px; line-height: 1; }
.popup h2 { margin: 0; font-family: var(--font-display); font-size: 22px; text-wrap: balance; }
.popup-body { margin: 0; line-height: 1.45; text-wrap: pretty; }
.popup-small { margin: 0; color: var(--muted); font-size: 13px; }
.popup-amount { margin: 0; padding: 3px 14px; border-radius: 999px; font-family: var(--font-display); font-size: 18px;
  font-weight: 700; color: var(--gold); background: var(--gold-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 45%, transparent); }
:root[data-theme="calm"] .popup-amount { color: var(--gold-deep); }
.popup-ok { margin-top: 10px; min-width: 140px; }
.popup-actions { display: grid; gap: 8px; width: 100%; margin-top: 10px; }   /* a question's answers */
.borrow-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
/* a gift: gold */
.popup-gift { border-color: color-mix(in srgb, var(--gold) 50%, var(--border));
  background: radial-gradient(120% 70% at 50% 0%, var(--gold-soft), transparent 70%), var(--surface); }
.popup-gift .popup-art { background: radial-gradient(circle, color-mix(in srgb, var(--gold) 30%, transparent), transparent 70%); }

/* Kept chats (2026-11-25; text_chats, app.js "Chats"): the Text tab's earlier conversations under its toolbar */
.chats-list { margin: 0 0 10px; padding: 8px; max-height: 320px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); }
.chats-list > p { margin: 6px 8px; }
.chats-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.chats-item { display: flex; align-items: center; gap: 8px; padding: 2px 4px 2px 0; border-radius: 8px; }
.chats-item:hover, .chats-item.current { background: var(--raised); }
.chats-open-one { flex: 1; min-width: 0; padding: 7px 10px; border: 0; background: none; color: var(--text); font: inherit;
  text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.chats-item.current .chats-open-one { font-weight: 600; }
.chats-when { flex: none; font-size: 12.5px; }
.chats-del { flex: none; min-height: 0 !important; padding: 2px 8px; }
.chats-note { margin: 4px 0 10px; font-size: 13px; text-align: center; }
.chat-private.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft, transparent); }
.chats-lock { flex: none; min-height: 0 !important; padding: 2px 8px; }
.chats-ask { margin: 4px 6px 8px; }
.chats-ask-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 6px 4px; }

/* Suggestions (2026-11-25; profile.js suggestSection): the profile's last card, its own look: a soft glow of the
   accent, a lit bulb, kinds as chips, a counter in the box, the person's earlier ones as small cards with their status */
.profile-page .pf-suggest {
  position: relative; display: grid; gap: 14px; margin-top: 26px; padding: 22px 22px 20px; border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border));
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(90% 80% at 100% 100%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%),
    var(--surface);
  box-shadow: 0 10px 30px -18px color-mix(in srgb, var(--accent) 60%, transparent), var(--shadow, none);
}
.pf-suggest p { margin: 0; }
.pf-suggest-top { display: flex; gap: 14px; align-items: flex-start; }
.pf-suggest-light { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; font-size: 24px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 45%, transparent), color-mix(in srgb, var(--accent) 10%, transparent) 70%);
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 45%, transparent); animation: pf-glow 3.2s ease-in-out infinite; }
@keyframes pf-glow { 50% { box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 65%, transparent); } }
.pf-suggest-words { display: grid; gap: 4px; min-width: 0; }
.pf-suggest h2 { margin: 0; font-family: var(--font-display); font-size: 20px; }
.pf-suggest-lead { color: var(--muted); line-height: 1.5; }
.pf-suggest-form { display: grid; gap: 10px; }
.pf-suggest-kinds { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-suggest-kind { min-height: 0 !important; padding: 7px 14px; border-radius: var(--radius-pill, 999px); font-size: 14px;
  border: 1px solid var(--border); background: var(--raised); color: var(--text); cursor: pointer; }
.pf-suggest-kind:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.pf-suggest-kind.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.pf-suggest-box { position: relative; }
.pf-suggest-text { width: 100%; min-height: 110px; resize: vertical; font: inherit; line-height: 1.5; padding: 12px 14px 26px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.pf-suggest-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.pf-suggest-count { position: absolute; inset-inline-end: 12px; bottom: 9px; font-size: 12px; color: var(--muted); pointer-events: none; }
.pf-suggest-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.pf-suggest-left { font-size: 13px; color: var(--muted); }
.pf-suggest-send { padding: 9px 20px; border-radius: var(--radius-pill, 999px); font-weight: 600; }
.pf-suggest-said-note { min-height: 0; font-size: 14px; }
.pf-suggest-said-note:empty { display: none; }
.pf-suggest-said-note.good { color: var(--good); }
.pf-suggest-said-note.bad { color: var(--bad); }
.pf-suggest-yours { margin: 6px 0 0; font-size: 14px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.pf-suggest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pf-suggest-item { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--raised) 85%, transparent); }
.pf-suggest-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.pf-suggest-status { padding: 2px 10px; border-radius: var(--radius-pill, 999px); font-size: 12px; font-weight: 700;
  background: var(--raised); color: var(--muted); border: 1px solid var(--border); }
.pf-suggest-status.st-read { color: var(--text); }
.pf-suggest-status.st-planned { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.pf-suggest-status.st-done { color: var(--good); border-color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.pf-suggest-status.st-declined { opacity: .75; }
.pf-suggest-meta { color: var(--muted); }
.pf-suggest-said { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.pf-suggest-answer { display: grid; gap: 3px; padding: 9px 12px; border-radius: 12px; border-inline-start: 3px solid var(--accent);
  background: var(--accent-soft); }
.pf-suggest-answer-who { font-size: 12px; font-weight: 700; color: var(--accent-ink); }
@media (prefers-reduced-motion: reduce) { .pf-suggest-light { animation: none; } }
@media (max-width: 520px) { .profile-page .pf-suggest { padding: 18px 16px; } .pf-suggest-light { width: 40px; height: 40px; font-size: 20px; } }
.account-menu .suggest-btn { border-color: var(--accent); color: var(--accent-ink, var(--accent)); background: var(--accent-soft, transparent); }

/* ── Languages (2026-11-26; web/i18n.js, server/i18n.py, ui.languages) ─────────────────
   The language button beside the account (signed in or not): the first of the right-hand group pushes them to the
   end, as the credits and the account do. */
.lang { position: relative; margin-inline-start: auto; }
.credits:not([hidden]) ~ .lang, .topbar-signin:not([hidden]) ~ .lang { margin-inline-start: 0; }
.lang:not([hidden]) ~ .account { margin-inline-start: 0; }
.lang summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; height: 40px;
  padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface);
  font-size: 13px; font-weight: 600; white-space: nowrap; }
.lang summary::-webkit-details-marker { display: none; }
.lang-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 20; display: grid; gap: 4px;
  min-width: 150px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgb(0 0 0 / .12); }
.lang:not([open]) .lang-menu { display: none; }
.lang-menu button { justify-content: start; text-align: start; }
.lang-menu button.on { border-color: var(--accent); color: var(--accent-ink); }
@media (max-width: 600px) { .lang summary { padding: 0 9px; } .lang-code { display: none; } }
/* Right to left (the Arabic page): code stays left to right; people's and the model's words take their own direction,
   paragraph by paragraph (an English reply reads left to right inside the Arabic page). The games' panels are left to
   right until their texts are translated (i18n.js). */
[dir="rtl"] :is(pre, code, kbd, samp) { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] pre { text-align: left; }
[dir="rtl"] .msg .body, [dir="rtl"] .msg .body :is(p, li, h1, h2, h3, h4, h5, h6, blockquote, td, th, dd, dt),
[dir="rtl"] .room-text, [dir="rtl"] .pf-suggest-said, [dir="rtl"] .pf-suggest-answer p { unicode-bidi: plaintext; text-align: start; }

/* ── sharing, invites, the community gallery (2026-11-27; community.js) ── */
.gallery-head { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin: 20px 0 8px; }
.gallery-head .section-title { margin: 0; }
.gallery-switch { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-pill); overflow: hidden; }
.gallery-switch button { border: 0; border-radius: 0; background: transparent; color: var(--text); padding: 6px 14px;
  min-height: 36px; font-weight: 500; }
.gallery-switch button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.community { display: grid; gap: 12px; }
.cm-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cm-chips button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.cm-lead { margin: 0; }
.cm-note { margin: 0; color: var(--good); }
.cm-note.bad, .viewer-note.bad { color: var(--bad); }
.cm-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.cm-card { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; }
.cm-card img { width: 100%; aspect-ratio: 1; object-fit: cover; cursor: zoom-in; display: block;
  background: repeating-conic-gradient(rgb(128 128 128 / .18) 0% 25%, transparent 0% 50%) 0 0 / 20px 20px; }
.cm-cap { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px 0; font-size: 13px; min-width: 0; }
.cm-by { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-status { color: var(--muted); text-align: end; }
.cm-reacts { display: flex; gap: 4px; flex-wrap: wrap; padding: 8px 8px 10px; }
.cm-react { display: inline-flex; align-items: center; gap: 3px; padding: 4px 8px; min-height: 34px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--raised); font-size: 14px; }
.cm-react[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.cm-react:disabled { opacity: .7; cursor: default; }
.cm-n { min-width: 1ch; font-variant-numeric: tabular-nums; color: var(--muted); }
.cm-tools { display: flex; gap: 12px; padding: 0 10px 10px; font-size: 13px; }
.cm-viewer { max-width: min(92vw, 900px); background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; }
.cm-viewer img { max-height: 72vh; max-width: 100%; display: block; margin: 0 auto; border-radius: 8px; }
.cm-viewer .cm-big-by { margin: 10px 0 0; }
.cm-viewer .cm-close { margin-top: 8px; }
.viewer-note { margin: 8px 0 0; color: var(--muted); }
.share-box { display: grid; gap: 8px; margin-top: 10px; }
.share-row { display: flex; gap: 6px; min-width: 0; }
.share-link { flex: 1; min-width: 0; font-size: 14px; }
.share-apps { display: flex; gap: 6px; flex-wrap: wrap; }
.pf-invite-lead { margin: 0 0 4px; }
