/* ═══════════════════════════════════════════════════════════════════════════
   THEME — this is your file, José.

   Every colour, size and speed the app's chrome uses is a variable in here.
   Change a value, save, press F5. Nothing else needs touching, and you cannot
   break a page from this file — the worst case is that it looks wrong and you
   undo it.

   The rule that makes this safe: no other stylesheet in web/ contains a
   colour of the app's own. They only ever refer to the names below. So if a
   colour exists, it is here. (The one exception by design is a colour a
   teacher PICKS for an announcement — that is part of the announcement.)

   Ported from Chess Bender's theme.css on 2026-10-01, with its names
   unchanged, so a page written against Chess Bender's variables works here as
   it did there. What went is everything a chessboard needed: the square
   colours, the board palettes, the pieces, the highlights, the arrows, the
   drag lift, the board's size and frame, and which side a line was for.

   THE NAMES OTHER PAGES USE — keep these stable:

     chrome      --ui-bg --ui-panel --ui-line --ui-text --ui-dim
                 --ui-accent --ui-accent-text --ui-btn --ui-btn-hover
                 --ui-input-bg --ui-radius --ui-font --ui-mono
     status      --status-up --status-down --due-now --due-later
     studying    --learn-right --learn-wrong --learn-shown --learn-xp
                 --lvl-0 … --lvl-4 (Difficult … Mastered)
     Pro         --pro-gold --pro-gold-dim --pro-gold-text --ui-gold --ui-gold-text
     surfaces    --card-shadow (and its old name --board-shadow)
     sizing      --text-min --touch-target
     motion      --anim-move --anim-fade --anim-ease
     brand       --logo-mark
   ══════════════════════════════════════════════════════════════════════════ */

/* ── SCREEN SIZE ────────────────────────────────────────────────────────────
   How much bigger the whole app is drawn on a big monitor. Added to Chess
   Bender 2026-09-14.

   Everything in the app — text, spacing, panels — is measured in rem, and
   1rem is the size of the root font set just below. So growing that one
   number grows the whole page together, the way zooming would, instead of
   leaving laptop-sized text floating in an ocean of empty screen.

   On a window up to --ui-scale-start wide, nothing changes: 1rem is 16px and
   every size is exactly what it was. Past it, the page grows steadily until it
   reaches --ui-scale-max. With the values below:

     1440px wide and under   laptop size    (text 14px)
     1920px (a 1080p screen) 1.10×          (text 15.4px)
     2560px (a 1440p screen) 1.23×          (text 17.3px)
     3840px (a 4K screen)    1.50×          (text 21px) — the cap

   The three knobs:
     --ui-scale-start  the window width where growing begins
     --ui-scale-rate   how many px of extra width add 1px to the root font.
                       Smaller grows faster: 200 reaches the cap around 3040px.
     --ui-scale-max    the cap, as a percentage of normal size

   Browser zoom (Ctrl + scroll) still works on top of this, and it is the way
   to make things bigger or smaller by hand. The "100% +" at the front of the
   formula is what keeps zoom working at all — do not remove it; a formula made
   only of vw would ignore zoom entirely.

   The percentages are of the BROWSER's own text size, so someone who set their
   browser text larger still gets it, on every screen.

   Media queries are not affected: they measure the window in px, which does
   not change when the page scales. */
:root {
  --ui-scale-start: 1440px;
  --ui-scale-rate: 300;
  --ui-scale-max: 150%;
}

html {
  font-size: clamp(100%, calc(100% + (100vw - var(--ui-scale-start)) / var(--ui-scale-rate)), var(--ui-scale-max));
}

/* ── TOUCH SCREENS ──────────────────────────────────────────────────────────
   Phones and tablets, where a finger is the pointer.

   `pointer: coarse` is true for a touchscreen and false for a mouse or a
   trackpad, so a laptop never sees any of this.

   --touch-target is how tall the small controls become: 2.75rem is 44px, the
   size Apple and Google both recommend for something a thumb has to hit.

   Text in a box is at least 16px on a touchscreen for a different reason:
   Safari on an iPhone ZOOMS THE WHOLE PAGE when you tap into a box whose text
   is smaller than that, and leaves you zoomed in. A student typing an answer
   on a phone would have the page jump on every single item. */
:root {
  --touch-target: 2.75rem;
}

/* ── SMALLEST TEXT ON A PHONE ───────────────────────────────────────────────
   The app's smallest text — the uppercase section labels ("ACCOUNT", "STUDY"),
   weekday letters, table headers, tags — is 10–11px, a compact style that
   reads fine on a laptop and is hard on a phone.

   Every one of those sizes is written as max(<its own size>, var(--text-min)).
   --text-min is 0 everywhere, so max() just gives back the size it was given
   and nothing changes; on a window 700px wide or narrower it is 0.75rem (12px),
   and anything smaller comes up to that.

   Change 0.75rem below to move the floor. The 700px is a window width and has
   to be typed as a number: a media query cannot read a variable. */
:root {
  --text-min: 0px;
}
@media (max-width: 700px) {
  :root { --text-min: 0.75rem; }
}
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
  select,
  textarea {
    font-size: max(1rem, 16px);
    min-height: var(--touch-target);
  }
  /* Padding, not display:flex — a flex summary loses its ▶ marker, which is the
     only thing telling you the row opens. 21px of text plus this is about 44. */
  summary {
    padding-block: calc((var(--touch-target) - 1.3rem) / 2);
  }
  /* flex: none as well — in a flex row the box was squeezed back to 13px wide
     by its own line of text. */
  input[type="checkbox"],
  input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    flex: none;
  }
  /* Buttons are deliberately NOT forced taller here: rows of small buttons
     laid out to fit (weekday pickers, toolbars) break under one blanket
     min-height. */
}

/* ── THE APP'S TYPEFACE ─────────────────────────────────────────────────────
   Nunito, a rounded Google Font (SIL Open Font License, assets/fonts/OFL.txt),
   from the students' feedback of 2026-10-18: "tipografías raras". The files
   are IN the app, never fetched from Google: the program works offline, and a
   font that loads late redraws every page. One variable file per alphabet
   holds every weight from 200 to 1000; "latin" has English and Spanish
   (á é í ó ú ü ñ ¿ ¡), "latin-ext" the rest of the accented letters a name can
   have. A letter Nunito does not draw (an IPA symbol) comes from the next font
   in --ui-font. Files: @fontsource-variable/nunito 5.3.0. */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("/assets/fonts/nunito-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: "Nunito";
  font-style: italic;
  font-display: swap;
  font-weight: 200 1000;
  src: url("/assets/fonts/nunito-latin-wght-italic.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: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("/assets/fonts/nunito-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: "Nunito";
  font-style: italic;
  font-display: swap;
  font-weight: 200 1000;
  src: url("/assets/fonts/nunito-latin-ext-wght-italic.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;
}

:root {
  /* ── MOTION ─────────────────────────────────────────────────────────────
     Set these to 0s to turn animation off entirely. */
  --anim-move: 0.18s;
  --anim-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --anim-fade: 0.16s;

  /* ── APP CHROME ─────────────────────────────────────────────────────────
     Everything that is the app's own UI: page background, panels, text,
     buttons. A deep indigo ground with a violet brand accent — Midnight, the
     default theme. Brighter and roomier since the 2026-10-13 redesign (José:
     "small text, no catchy visuals, and lots of empty space"; drawn first in
     Claude Design, "Language Bender redesign"). */
  --ui-bg: #0e0f1d;
  --ui-panel: #181a2e;
  /* A surface inside a panel: a stat box, a row, a segmented control. */
  --ui-panel-2: color-mix(in srgb, var(--ui-text) 6%, var(--ui-panel));
  --ui-line: #2a2d48;
  --ui-text: #f2f3fb;
  --ui-dim: #a7acc8;
  --ui-accent: #8b7cf6;
  --ui-accent-text: #ffffff;
  /* The accent as a FILL under --ui-accent-text (Start, the tab you are on),
     the raised edge under such a button, and a tinted surface. Every theme
     gets these from its own accent; Midnight and Glass set their own just
     below this block, because white on their bright violet is too faint. */
  --ui-accent-fill: var(--ui-accent);
  --ui-accent-deep: color-mix(in srgb, var(--ui-accent) 58%, #000);
  --ui-accent-soft: color-mix(in srgb, var(--ui-accent) 20%, var(--ui-panel));

  /* ── TYPE ───────────────────────────────────────────────────────────────
     Nunito everywhere — text, headings and the big numbers — from the files
     in assets/fonts (the @font-face rules above), so it looks the same on
     Windows, Ubuntu and the phone, offline. Until 2026-10-18 these were
     Windows' own Segoe UI and the condensed Bahnschrift for numbers, which
     the students found odd. Where numbers have to line up (a counter, a
     timer) the rule adds font-variant-numeric: tabular-nums. The system's own
     UI font is only the fallback now. */
  --ui-display: "Nunito", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --ui-num: "Nunito", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  /* The body text size of the study screens, and the larger radius of a card. */
  --ui-text-size: 1.0625rem;
  --ui-radius-lg: 1.375rem;
  /* How far a raised button stands up from the page. */
  --ui-lift: 0.3125rem;

  /* ── THE THREE KINDS ────────────────────────────────────────────────────
     Grammar, pronunciation and vocabulary each have a colour, used on the
     Activities tab, the Today shortcuts and an activity's progress bar.
       --kind-*        the fill (a button, a big icon)
       --kind-*-ink    text ON that fill (dark: white on these is unreadable)
       --kind-*-deep   the raised edge under the fill
       --kind-*-soft   a tinted surface
       --kind-*-text   the colour as text on the page */
  --kind-grammar: #4d8dff;
  --kind-grammar-ink: #0b1226;
  --kind-grammar-deep: #2a5fc4;
  --kind-grammar-soft: #172747;
  --kind-grammar-text: #8cb4ff;
  --kind-pronunciation: #ff8a3d;
  --kind-pronunciation-ink: #1f1005;
  --kind-pronunciation-deep: #c55f1c;
  --kind-pronunciation-soft: #2c1d12;
  --kind-pronunciation-text: #ffb27a;
  --kind-vocabulary: #19c3a0;
  --kind-vocabulary-ink: #04201a;
  --kind-vocabulary-deep: #0c8a70;
  --kind-vocabulary-soft: #102925;
  --kind-vocabulary-text: #5fe0c3;

  /* The logo, as an image the theme chooses. The bubble in the middle of the
     mark is near-black as drawn; on #12131c that is a hole in a purple cloud,
     so a dark page gets the copy with the bubble in white. The light themes
     set the other one below. See test/shell/make-icons.mjs. */
  --logo-mark: url("/assets/logo-mark-dark.svg");

  /* Pro. Gold, because that is what José asked for in Chess Bender and
     because it is the one colour in this palette not already carrying a
     meaning — violet is the accent, green is a right answer, red is a wrong
     one. It marks a feature that exists and is paid for, never a warning. See
     role.css. */
  --pro-gold: #e3b341;
  --pro-gold-dim: #6b5316;
  --pro-gold-text: #1b1405;
  /* Gold as a FILL for everybody's buttons, separate from --pro-gold, which
     means "this is a Pro feature". --ui-gold-text is the text on it. */
  --ui-gold: #e3b341;
  --ui-gold-text: #1b1405;
  /* Controls: buttons, their hover, and the inside of a text box. A control
     needs real fill — a colour clearly lighter than the panel it sits on —
     or it reads as a border floating on the background rather than a
     pressable thing. */
  --ui-btn: #262a45;
  --ui-btn-hover: #31355a;
  --ui-input-bg: #121327;
  /* The backend status light, and anything else that is simply up or down. */
  --status-up: #3ecf8e;
  --status-down: #f0605a;
  --ui-radius: 0.75rem;
  --ui-font: "Nunito", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --ui-mono: "Cascadia Code", "SF Mono", Consolas, monospace;

  /* The shadow under a raised surface — a flashcard, a dialog. It was
     --board-shadow in Chess Bender, the shadow under the board, and that name
     still works so a rule ported from there keeps its shadow. */
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --board-shadow: var(--card-shadow);

  /* What the BROWSER draws — scrollbars, the list a <select> opens, date
     pickers, the inside of a checkbox — follows this, not the variables
     above. Without it a dark theme had white scrollbars down every panel.
     Every theme below says which kind it is. */
  color-scheme: dark;

  /* ── STUDYING ───────────────────────────────────────────────────────────
     The seven level colours run cold to warm, Difficult to Mastered. They are
     the fastest thing to read on a crowded list, so keep them distinguishable
     from each other rather than pretty in isolation. */
  --lvl-0: #f0605a;   /* Difficult */
  --lvl-1: #f2994a;
  --lvl-2: #f2c94c;
  --lvl-3: #4fd17c;
  --lvl-4: #9b7cf2;   /* Mastered (five levels since 2026-10-21) */

  /* The answers. Green means right; red means try again; amber means the app
     had to show it to you. --learn-xp is the colour of points earned. */
  --learn-right: #3ecf8e;
  --learn-wrong: #f0605a;
  --learn-shown: #f2a341;
  --learn-xp: #f2c94c;

  /* Due now is the only thing on the page allowed to shout. */
  --due-now: #f0605a;
  --due-later: #949ab0;
}

/* Midnight's and Glass's violet, as a fill: a deeper one, so white reads on it. */
:root:not([data-theme]),
:root[data-theme="dark"],
:root[data-theme="glass"] {
  --ui-accent-fill: #6553e8;
  --ui-accent-deep: #3f30b0;
  --ui-accent-soft: #262158;
}

/* Respect the reader's motion preference. Leave this alone unless you have a
   reason — it is an accessibility setting, not a style choice. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --anim-move: 0s;
    --anim-fade: 0s;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   LIGHT THEME

   Everything above is the dark theme (Midnight). This block is the light one
   (Daylight).

   Settings → Appearance switches between them, and "Follow my system" tracks
   the OS. appearance.js writes data-theme onto <html>; nothing else changes.

   Every colour here is the counterpart of one above. If you add a variable up
   there and it needs to differ on light, add it here too — a missing one is
   not an error, it just stays dark and will look wrong on white.
   ══════════════════════════════════════════════════════════════════════════ */

/* Parchment is a light theme too: it starts from everything in this block and
   changes only its own colours, in its block further down. */
:root[data-theme="light"],
:root[data-theme="parchment"] {
  color-scheme: light;
  /* A cool off-white rather than pure #fff: a full-brightness white page is
     glare, not contrast. */
  --ui-bg: #f5f6fb;
  --ui-panel: #ffffff;
  --ui-line: #dfe2ee;
  --ui-text: #181a24;
  --ui-dim: #5c6178;
  --ui-accent: #5b46e0;
  --ui-accent-text: #ffffff;
  /* The near-black bubble, which is the logo as drawn. */
  --logo-mark: url("/assets/logo-mark.svg");
  /* Darker on white: #e3b341 on a light panel is a highlighter, not a border. */
  --pro-gold: #a97b12;
  --pro-gold-dim: #f0dfb0;
  --pro-gold-text: #2b2007;
  /* A brighter gold than --pro-gold here, because this one is a FILL with dark
     text on it, not a border on white. */
  --ui-gold: #e0ab3a;
  --ui-gold-text: #1f1605;
  --ui-btn: #eef0f8;
  --ui-btn-hover: #e2e5f3;
  --ui-input-bg: #ffffff;
  --status-up: #1f9d68;
  --status-down: #d6453f;

  /* The level colours, darkened until each one passes as text on white. The
     dark-theme values are tuned for a near-black background and turn to pastel
     mush on this one. */
  --lvl-0: #d6453f;
  --lvl-1: #c17a1f;
  --lvl-2: #a68a16;
  --lvl-3: #1f9d68;
  --lvl-4: #6a4fd6;

  --learn-right: #1f9d68;
  --learn-wrong: #d6453f;
  --learn-shown: #b3701a;
  --learn-xp: #9c7c17;

  --due-now: #d6453f;
  --due-later: #5c6178;

  /* The kinds' fills stay; their tints and text darken for white. */
  --kind-grammar-soft: #e4edff;
  --kind-grammar-text: #1f5fd6;
  --kind-pronunciation-soft: #ffeadb;
  --kind-pronunciation-text: #ad4f0e;
  --kind-vocabulary-soft: #d8f5ee;
  --kind-vocabulary-text: #0b7461;

  /* A shadow tuned for a dark page disappears on a light one. */
  --card-shadow: 0 10px 28px rgba(20, 22, 50, 0.12);
}


/* ══════════════════════════════════════════════════════════════════════════
   MORE THEMES

   Beside Dark (called Midnight in Settings) and Light (Daylight). Pick one in
   Settings → Appearance. A block only says what it changes, and everything it
   leaves out comes from the theme it is built on —

     Walnut, Emerald   built on the dark theme, the :root block
     Parchment         built on the light theme, the block above

   Glass, which is a picture more than a palette, has a section of its own
   below.

   So the level colours, the answer colours and the rest that were tuned for a
   dark or a light page stay tuned. To add one: copy a block, rename it, and
   add a line to THEMES in theme.mjs (theme-boot.js's THEME_IDS has to know it
   too, before the first paint — test/shell/theme.test.mjs checks all three).

   The accent is the one colour per theme that means "press here": the Start
   button's fill, the tab you are on, the switch that is on. It is never red
   or gold, because red is "due now" and gold is "Pro".
   ══════════════════════════════════════════════════════════════════════════ */

/* Walnut — warm dark wood, cream text, a copper accent. A library at night. */
:root[data-theme="walnut"] {
  --ui-bg: #17120e;
  --ui-panel: #211a15;
  --ui-line: #3a2e25;
  --ui-text: #f4ece2;
  --ui-dim: #b5a592;
  --ui-accent: #e0834e;
  /* Dark on copper: white on it is 2.9:1 and fails as text. */
  --ui-accent-text: #1d1107;
  --ui-btn: #2e241d;
  --ui-btn-hover: #3a2e25;
  --ui-input-bg: #130f0c;
  --status-up: #5cc98f;
  --card-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

/* Emerald — green baize with ivory. The accent is the ivory: buttons read
   like the white keys of a piano, and nothing green is left to be confused
   with a right answer. */
:root[data-theme="emerald"] {
  --ui-bg: #0e1814;
  --ui-panel: #14231d;
  --ui-line: #24382f;
  --ui-text: #e3ece6;
  --ui-dim: #92a99c;
  --ui-accent: #eadfc3;
  --ui-accent-text: #14231d;
  --ui-btn: #1c3028;
  --ui-btn-hover: #243a31;
  --ui-input-bg: #0b1411;
  --card-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

/* Parchment — old paper, brown ink, and ink-blue for what you press. A light
   theme that is warm rather than white. */
:root[data-theme="parchment"] {
  --ui-bg: #f3eee3;
  --ui-panel: #fbf8f1;
  --ui-line: #e0d6c2;
  --ui-text: #2b2219;
  --ui-dim: #6b5d4b;
  --ui-accent: #2e4a7d;
  --ui-accent-text: #ffffff;
  --ui-btn: #efe8d8;
  --ui-btn-hover: #e5dcc7;
  --ui-input-bg: #fffdf8;
  --due-later: #6b5d4b;
  --card-shadow: 0 2px 14px rgba(60, 40, 20, 0.16);
}

/* ══════════════════════════════════════════════════════════════════════════
   GLASS

   See-through panels over a picture, like Lichess's transparent theme. José
   chose the look for Chess Bender on 2026-09-30: the Midnight colours, with
   every panel made of smoked glass and a picture behind the whole app. Built
   on the dark theme (the :root block) like Walnut and Emerald: only what
   differs is in the block below.

   Three of its variables are not colours. appearance.js sets them from
   Settings → Appearance whenever Glass is on (theme-boot.js before the first
   paint), so the values here are only what a page shows before that:

     --glass-picture   url("/assets/backgrounds/<name>.jpg"), or none
     --glass-dim       how much darker the picture is drawn: 0 to 0.68
     --glass-alpha     how solid the panels are: 0.25 to 0.92

   --glass-blur is yours: how much a panel blurs what is behind it.
   ══════════════════════════════════════════════════════════════════════════ */

:root[data-theme="glass"] {
  --glass-picture: none;
  --glass-dim: 0.38;
  --glass-alpha: 0.58;
  --glass-blur: 14px;
  --ui-bg: rgba(10, 11, 16, 0.42);
  --ui-panel: rgba(20, 21, 32, var(--glass-alpha));
  --ui-line: rgba(255, 255, 255, 0.1);
  --ui-text: #f4f5fa;
  --ui-dim: rgba(233, 236, 246, 0.74);
  --ui-accent: #8b7cf6;
  --ui-accent-text: #ffffff;
  --ui-btn: rgba(255, 255, 255, 0.09);
  --ui-btn-hover: rgba(255, 255, 255, 0.15);
  --ui-input-bg: rgba(8, 9, 14, 0.5);
  --card-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  /* The menu drawer slides over whatever is on screen, so it is nearly solid:
     glass over a busy page is a page you cannot read the menu on. */
  --drawer-bg: rgba(14, 15, 22, 0.9);
  background: #0b0c12;
}

/* The picture. Every tab is its own document in an iframe, and a blur cannot
   see out of a frame into the page around it, so each document paints its OWN
   copy, fixed behind everything — sized to the whole window and pulled back
   by where this frame sits in it (appearance.js, frameGeometry), so the shell's
   copy and every tab's meet with no seam. The file is downloaded once. */
:root[data-theme="glass"]::before {
  content: "";
  position: fixed;
  z-index: -1;
  left: var(--glass-left, 0px);
  top: var(--glass-top, 0px);
  width: var(--glass-width, 100vw);
  height: var(--glass-height, 100vh);
  background:
    linear-gradient(rgba(6, 7, 12, var(--glass-dim)), rgba(6, 7, 12, var(--glass-dim))),
    var(--glass-picture) center / cover no-repeat,
    #12131c;
  pointer-events: none;
}

/* A page's own background would cover the picture; the panels on it are what
   carry the glass. */
:root[data-theme="glass"] body { background: transparent; }

/* The frosting: what is behind a panel is blurred, so text on it stays easy to
   read however busy the picture. The big surfaces only — a blur is paid for
   by the graphics card, and a hundred small ones would be felt.

   `.lb-glass` is the hook for a page of another area: put it on a large
   surface of your own and it frosts like a panel does. The other names are the
   surfaces Chess Bender's screens had that a study screen ported from them may
   still use. */
:root[data-theme="glass"] :is(.lb-glass, .shell-bar, .navdrawer, .panel, .card, .weeklog, .summary,
  .ovbig, .ovlevel, .bar, .qrow, .qreview, .startopt, .signin-card, .learnsettings,
  .levelshelp) {
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
}

/* The Start buttons' text, solid under Glass: white on the violet Review,
   the page's text on the see-through Learn new. (Until 2026-10-13 this was
   dark text, from when Start was a light button — on the redesign's violet
   it made "Learn new" all but invisible.) */
:root[data-theme="glass"] .startbtn { color: #ffffff; }
:root[data-theme="glass"] .startbtn.learn { color: var(--ui-text); background: var(--ui-panel); }

/* A dialog sits on top of everything and has to read as being on top: nearly
   solid, over a dimmed page. */
:root[data-theme="glass"] dialog {
  background-color: rgba(16, 17, 26, 0.94);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
}
:root[data-theme="glass"] dialog::backdrop { background: rgba(0, 0, 0, 0.45); }

/* ══════════════════════════════════════════════════════════════════════════
   WHAT EVERY PAGE GETS FROM THE THEME

   Three things the browser draws by itself, told to use the theme's colours
   instead of its own. Any page that styles one of them itself still wins.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Checkboxes, radio buttons, sliders and progress bars, in the accent. */
  accent-color: var(--ui-accent);
  /* Scrollbars in the theme's line colour, on a transparent track. */
  scrollbar-color: var(--ui-line) transparent;
}

/* The keyboard's focus ring — the default for every button, link and field, so
   none is left with the browser's own. */
:focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 2px;
}

/* Text you select with the mouse. */
::selection {
  background: color-mix(in srgb, var(--ui-accent) 35%, transparent);
}
/* Buttons and text boxes in the app's typeface. The browser gives them the
   system's own font, not the page's, so any control a page did not style
   itself was still in Segoe UI after Nunito came in (2026-10-18). */
button, input, select, textarea { font-family: inherit; }

/* The browser's own [hidden] rule is display:none, but ANY display declaration
   in a stylesheet beats it — which is how a card with display:grid stayed on
   screen for hours in Chess Bender while its .hidden property read true.
   Restated here, for every page, so setting .hidden always actually hides. */
[hidden] { display: none !important; }
