/* drilleditor.com: the look every page shares (the scoreboard). The editor at /app/ has its own styles. */

/* ---- type: the scoreboard face, ours, from this server ---- */
@font-face { font-family: "Doto"; src: url("/fonts/doto.woff2?v=2") format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: "Bitcount"; src: url("/fonts/bitcount.woff2?v=1") format("woff2"); font-weight: 700; font-display: block; }   /* the home page's headline (--face-lead); made by tools/make-font.py */   /* ?v=: raise it (here and in every page's preload) when the font changes, or phones keep the old one */
@font-face { font-family: "Barlow"; src: url("data:font/woff2;base64,d09GMgABAAAAAAxMABEAAAAAGPQAAAvwAAFocgAAAAAAAAAAAAAAAAAAAAAAAAAAGhwbgXIcKgZgAGwIgSAJnBURCAqKVIk0ATYCJAMoCxYABCAFBgcgDIFWGxIXUZSQVgLZzwPbPcodLEVG3g87YhilbZrm6yHejpBk1n+e3/b92vucc4FLioQ2LXbBFaOAFwUvOnWmceqHvh8ROpX+rCT/YQGstOmdGQKoGc297WiLKkAbINA7VCdNGegfdb0fLCogBY5yAySHyCEtBUH6KGWdLepX1O6qkcP2/Fxp3/z8MksE4QDtCV1jsi/ZNj/JAWf3iHLHuy0rQoUgUTGnuwUg1bOtkK2wlbbWn8LwgtdBLOJ5SBmeKYXeHl4YBMCGnsPtyQUIChbQpwA6IugAj02kN8JxfM/5k3BAAsADwzt24Oy00AyAQZBgxVeS58CIQwJoQx8YWmcb/8AsnXjyEsTllfQsBeAI1OkjiqSwfkFJ3+5vfS3Fv/N21bNU1gVwVClX8DMkVVrlgDod2qaMId6hbIXZjSTrnIMCuMD7ArOxtBMd1AHaw4Q5Ca+0cX0qj1UEcF78stgXZA7/wgdRkZ93AtIVMNAc6oEA9ZLIFbjhkjVZAOPYjyM4jlM4i/OS7SWAsfi/YPFHXvQmr/Mar7JkMcLMLWvH8EcBKtIN+vaZnWe0/zw8AvBU8V+QuxlAwSkh3fsCLrCeehZARaA4yh8t/pO/wiadV+ynLxdpOgfvbrS5CwRu0yJLz3+jcfkc7fqvRN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OUSDwFyLT9SB288+jU+uz60QPZRfpvfWBKdXYEo9ifFuBBUaTh5i2GbkgLlFi8kyk9Kjt8hySuuSDVyrave3pV50rzpWrauWVc2AglVSST6MOdcTPgMBjK1E6L51uWXjvhyk/SJe+LQZ7TiM5StX6rotnjXPgeSRvH0bE3n2xIYtzUNam4xzhVKOhqepePfywRVei39M7dcwNgYAAA==") format("woff2"); font-weight: 600; font-display: block; }   /* the name beside the mark: Barlow SemiBold, its letters only (tools/make-font.py barlow) */

/* ---- colours: one set for daylight and floodlights; the switch only changes color-scheme ---- */
/* the night ground, ink, soft and dots, the dark ink and amber (and app.css's paper and lime) are the editor's too: it is one file with its
   own copies, so change one, change every copy tests/site/05-shared-colours.js names */
:root {
  --cb-row: 3rem;
  --list-shadow: 0 8px 24px rgb(0 0 0 / .18);   /* a list or a panel that opens over the page */
  --chosen-mix: 12%;   /* how much of the club colour tints a one-pick list's chosen row and the rail's current section */
  --open-mix: 4%;   /* an open row's tint: a large area, so only a hint in daylight; its 2 px line and bold name say it is open (the coach, 26 Nov) */
  --open-reach: .75rem;   /* how far an open row's tint and line reach past its content on each side, so neither touches the date tile or the ⌄ (the coach, 26 Nov: "abos sānos") */
  color-scheme: light dark;
  --page: light-dark(#e9ecef, #0e1012);
  --grid: light-dark(#c9ced4, #24282d);
  --ink: light-dark(#111315, #e8e6e1);
  --soft: light-dark(#4b5157, #a3a8ad);
  --head: var(--ink);
  --acc: light-dark(#111315, #ffb547);
  --btn: light-dark(#111315, #ffb547);
  --btn-ink: light-dark(#ffffff, #111315);
  --btn-dot: light-dark(#ffb000, #111315);
  --frame: light-dark(#111315, #3a3f45);
  --lamp: light-dark(transparent, #ffd36b);
  --glow: none;
  --glow-on: 0 0 .05em rgb(255 176 0 / .75), 0 0 .12em rgb(255 176 0 / .25);   /* the floodlit headline's glow: a bright core, little spread */
  /* Separate surfaces for panels, inset fields and quiet buttons; control edges clear 3:1 in both themes. */
  --r: 6px;
  --dot-step: 18px;   /* the dot grid's step, the same in the editor (drill-editor.css --dot-step; tests/site/05) */
  --panel: light-dark(#ffffff, #16191c);
  --qb: light-dark(#e0e4e7, #25292d);
  --field-bg: light-dark(#f2f4f5, #101315);
  --field-line: light-dark(#70777d, #858e96);
  --quiet-edge: light-dark(#70777d, #858e96);
  --edge: light-dark(#c4c9cd, #454b51);
  --pop: light-dark(#ffffff, #292d31);
  --field-h: 2.75rem;
  --ract-gap: 1.6rem;   /* between an open row's action words (.ract), and once more before what takes the thing away */
  --apart: 1rem;   /* the extra gap before a button that takes the thing away (Cancel and Delete in a calendar row, Delete group): apart, on the same left run (golden rule 1.8) */
  --bad: light-dark(#b42318, #ff7b6e);

  /* named once, used everywhere (a new rule takes the name where one exists): corners, the scoreboard face, and the ink's thin tints.
     The tints carry :root's ink, so an element that sets its own --ink must not use them */
  --r-xs: 2px; --r-s: 6px; --r-l: 10px; --pill: 999px;
  --face: "Doto", ui-monospace, monospace;
  --face-lead: "Bitcount", ui-monospace, monospace;   /* the home page's headline: Bitcount Single 500, its round dots (the coach, 14 Nov: bolder than Doto, and a colon that reads) */
  --gutter: max(1.25rem, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));   /* the page's side gutter, clear of a phone's notch held sideways (the insets count only on a page with viewport-fit=cover: the club page) */
  --tint: color-mix(in oklch, var(--ink) 10%, transparent);         /* hover and open fills */
  --line-thin: color-mix(in oklch, var(--ink) 15%, transparent);    /* dividers */
  --line: color-mix(in oklch, var(--ink) 18%, transparent);         /* edges of rows, tiles, the popup's bar */
  --line-strong: color-mix(in oklch, var(--ink) 25%, transparent);  /* the tabs' line, account rules */
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
/* what colours can't say: the headline's glow, and which pictures show */
:root .only-dark { display: none; }   /* :root: stronger than rules that show images */
:root[data-theme="dark"] { --glow: var(--glow-on); }
:root[data-theme="dark"] .only-light { display: none; }
:root[data-theme="dark"] .only-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --glow: var(--glow-on); }
  :root:not([data-theme="light"]) .only-light { display: none; }
  :root:not([data-theme="light"]) .only-dark { display: block; }
}

/* a club's surfaces are the neutral ones in both themes (the coach, 26 Nov: "tumšo fona krāsu neliekam zaļganu"); its colour is on fills,
   text shades and the open and chosen rows' tint */
/* Slice 6 (B): one pale-safe colour for selected list rows and open content rows. */
:root, #kb { --club-tint: light-dark(var(--club-tint-l, var(--head)), var(--club-tint-d, var(--head))); }
:root[data-theme="dark"] { --chosen-mix: 10%; --open-mix: 10%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chosen-mix: 10%; --open-mix: 10%; } }

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }   /* a double tap never zooms the page (iPad); a pinch still does */
body {
  margin: 0; min-height: 100svh; display: flex; flex-direction: column;
  font: 400 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
  background: var(--page) radial-gradient(circle, var(--grid) 1px, transparent 1.5px) 0 0 / var(--dot-step) var(--dot-step);   /* the scoreboard's dot grid */
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
html.lv-wait body { visibility: hidden; }   /* Latvian, until i18n.js has turned the words (the head script and site.js); the page's ground still shows */
a { color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 4px; }
.wrap { width: min(100% - 2 * var(--gutter), 72rem); margin-inline: auto; }
h1 {
  margin: 0 auto .5em; max-width: 19ch; font: 700 clamp(2.4rem, 1.2rem + 4.6vw, 5.4rem)/1.05 var(--face);
  color: var(--head); text-wrap: balance; letter-spacing: -.01em;
}

.hero h1 { font-family: var(--face-lead); color: var(--acc); text-shadow: var(--glow); }   /* only the home headline glows */

/* ---- top bar ---- */
.top { display: flex; align-items: center; gap: 1rem; padding-block: 1.25rem; }
.brand { display: flex; align-items: center; gap: .6rem; font: 600 1.25rem/1.5 "Barlow", system-ui, sans-serif; white-space: nowrap; text-decoration: none; margin-inline-end: auto; min-block-size: 3.25rem; }   /* the floodlight switch's height: the name paints first, alone, and holds the row (top.js adds the rest) */
.brand svg { width: 2.75rem; height: auto; flex: none; }   /* 44 px: the mark's 11 dots on whole pixels, 4 px each */
.toplink { font-weight: 600; text-decoration: none; }
.btn {
  display: inline-flex; align-items: center; gap: .6em; padding: .7em 1.2em; border-radius: var(--r);
  background: var(--btn); color: var(--btn-ink); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.lights {
  position: relative; width: 3.25rem; height: 3.25rem; flex: none; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid var(--ink); background: var(--panel); color: var(--ink);
}
.lights svg { width: 62%; height: auto; display: block; margin: auto; }
.lights .lamp { fill: var(--lamp); stroke: currentColor; stroke-width: 1.4; }
/* ---- the one lit door (the top bar's, and the home page's pair): the editor (ink; in floodlights amber) and the quiet dashboard (soft fill, ink icon, 3:1 edge).
   Each has its icon, label and helper line; only the editor has the scoreboard bulb. The pair shares one row height
   and stacks full width under ~30rem (a wrapping row). In the top bar: no helper line, and up to 760 px the icon alone ---- */
.door {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; align-content: center; column-gap: .9em;
  padding: .8em 1.1em; border: 2px solid var(--d-edge, var(--d-bg)); border-radius: var(--r);
  background: var(--d-bg); color: var(--d-ink); text-align: start; text-decoration: none; line-height: 1.3;
}
.door-edit { --d-bg: var(--btn); --d-ink: var(--btn-ink); --d-soft: light-dark(#c8ccd0, #3f444a); --d-dot: var(--btn-dot); }
.door-dash { --d-bg: var(--qb); --d-ink: var(--ink); --d-soft: var(--soft); --d-dot: var(--ink); --d-edge: var(--field-line); }
.door > svg { grid-row: 1 / 3; block-size: 1.75em; inline-size: auto; color: var(--d-dot); }
.door .dl { grid-column: 2; font-weight: 700; }
.door .dh { grid-column: 2; color: var(--d-soft); font-size: .88em; }
.door-edit::after { content: ""; grid-column: 3; grid-row: 1 / 3; width: .55em; height: .55em; border-radius: 50%; background: var(--d-dot); }
.door:focus-visible { outline-color: var(--ink); }   /* the page's ink: the ring shows on the page beside either fill */
.door:active { background-color: color-mix(in oklch, var(--d-bg) 85%, var(--d-ink)); }
@media (hover: hover) and (pointer: fine) { .door:hover:not(:active) { background-color: color-mix(in oklch, var(--d-bg) 92%, var(--d-ink)); } }
.doors { display: flex; flex-wrap: wrap; gap: .9rem; inline-size: min(100%, 46rem); }
.doors > .door { flex: 1 1 14rem; font-size: clamp(1rem, .9rem + .5vw, 1.15rem); }
.top .door { min-block-size: var(--field-h); grid-template-columns: max-content 1fr auto; padding: .3em .5em; column-gap: .55em; font-size: .9rem; white-space: nowrap; }   /* keep the icon's width; less side padding makes room for the bulb beside Latvian words at 761 px */
.top .door .dl { font-weight: 600; }
.top .door > svg { block-size: 1.2em; }
.langsw { min-inline-size: 2.75rem; block-size: 2.75rem; flex: none; padding: 0 .4rem; border: 0; border-radius: 4px; background: transparent; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }   /* LV / EN */

/* ---- footer ---- */
footer { padding-block: 1.5rem 2rem; text-align: center; color: var(--soft); font-size: .9rem; }
footer a { text-decoration: none; }

/* ---- fields and selects (dashboard, account, dialogs): one rule for every field, today's and tomorrow's; never paste a recipe on an id.
   :where keeps it light (0,1,0), so a page's layout rules (flex, widths) and #clock's own digits win over it ---- */
:is(.dash, .acct, dialog) :where(input:not([type=checkbox], [type=color]), select, textarea) {
  min-block-size: var(--field-h); padding: .3em .6em; font: inherit; font-size: 1rem; font-weight: 400; color: var(--ink);
  background-color: var(--field-bg); border: 0; border-block-end: 1.5px solid var(--field-line); border-radius: var(--r);   /* the line: 3:1 on the panel, the fill alone isn't */
}
:is(.dash, .acct, dialog) :where(input:not([type=checkbox], [type=color]), select, textarea):where(:focus-visible) {
  outline: 2px solid var(--head); outline-offset: 0; background-color: color-mix(in srgb, var(--field-bg) 50%, var(--page));
}
dialog :where(input:not([type=checkbox], [type=color]), select, textarea):focus-visible { outline-color: var(--away); }
:is(.dash, .acct, dialog) ::placeholder { color: var(--soft); opacity: 1; }   /* 5.6:1 on the fill; the browser's grey is under 4.5 */
/* the native list stays (the iPhone wheel); the groups button's ▾ triangle drawn in the text colour, so both themes and every club work */
:is(.dash, .acct, dialog) select {
  appearance: none; padding-inline-end: 2.5em;
  background-image: conic-gradient(from 315deg at 50% 100%, currentColor 90deg, transparent 0);
  background-position: right 1em center; background-size: .8em .4em; background-repeat: no-repeat;
}
/* a colour: a round swatch, the colour fills it, a thin ring off its edge */
:is(.dash, .acct, dialog) input[type=color] {
  inline-size: var(--field-h); block-size: var(--field-h); padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  box-shadow: 0 0 0 2px var(--page), 0 0 0 3.5px var(--field-line);
}
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
input[type=color]::-moz-color-swatch { border: 0; border-radius: 50%; }
@media (hover: hover) and (pointer: fine) {
  :is(.dash, .acct, dialog) :where(input:not([type=checkbox], [type=color]), select, textarea):where(:hover:not(:focus-visible)) { background-color: color-mix(in srgb, var(--ink) 10%, var(--field-bg)); }
}
@media (forced-colors: active) {   /* fills vanish there: edges and the ring set explicitly */
  :is(.dash, .acct, dialog) :where(input:not([type=checkbox], [type=color]), select, textarea) { border: 1px solid ButtonBorder; }
  :is(.dash, .acct, dialog) :where(input:not([type=checkbox], [type=color]), select, textarea):where(:focus-visible) { outline-color: Highlight; }
  :is(.dash, .acct, dialog) select { appearance: auto; background-image: none; }
  :is(.dash, .acct, dialog) :is(.sagain:not(:disabled), .btn.ghost, .smove, .steps button, #dayList .clear, .popbar button, .pmore > summary, input[type=color]) { border: 1px solid ButtonBorder; }   /* #dayList: its weight beats the page's own rules */
}

/* One action-button shape, including filled actions. Choices and list rows keep their own rules until slices 7 and 8.
   :is gives this more weight than the page's generic button reset, without an id or !important. */
:is(.dash, .acct, dialog) :is(.btn, .sagain, .gaddp, .smove, .nopen, .es-go, .steps button, :where(#dayList) .clear, .popbar button, .pmore > summary, .calhead button, .kbmore) {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-block-size: var(--field-h); padding: .2em 1em;
  border: 0; border-radius: var(--r); font-family: inherit; font-size: .9rem; font-weight: 600; line-height: 1.3; cursor: pointer; text-decoration: none;   /* a link drawn as a button (Atvērt redaktorā) is a button: no underline */
}
:is(.dash, .acct, dialog) :is(.steps button, :where(#dayList) .clear, .popbar button, .pmore > summary, .calhead button, .kbmore, :where(#wPrev, #wNext)) { inline-size: var(--field-h); padding: 0; font-size: 1.3rem; line-height: 1; } /* Icon-only actions (‹ › + − ⋯): square targets, one glyph size (at .9rem the glyph was a speck, 24 Nov). */
:is(.dash, .acct, dialog) :is(.sagain, .gaddp, .smove, .es-go) { color: var(--ink); background: var(--qb); }

:is(.dash, .acct, dialog) :is(.sagain, .gaddp, .smove, .es-go, .dash .btn, .btn.ghost, .steps button, #dayList .clear, .popbar button, .pmore > summary):where(:not(:disabled, [aria-disabled="true"], [aria-pressed="true"], .done, .wsave, .wcgo, .planbar > .btn, #pop .libadd, :is(#list, #week) .scards .scopy)) { box-shadow: inset 0 0 0 1px var(--quiet-edge); }
:is(.dash, .acct, dialog) :is(.sagain, .gaddp, .smove, .es-go, .dash .btn, .btn.ghost, .steps button, #dayList .clear, .popbar button, .pmore > summary):where(:not(:disabled, [aria-disabled="true"], [aria-pressed="true"], .done, .wsave, .wcgo, .planbar > .btn, #pop .libadd, :is(#list, #week) .scards .scopy)):active { background: color-mix(in srgb, var(--ink) 4%, var(--qb)); }
@media (hover: hover) and (pointer: fine) { :is(.dash, .acct, dialog) :is(.sagain, .gaddp, .smove, .es-go, .dash .btn, .btn.ghost, .steps button, #dayList .clear, .popbar button, .pmore > summary):where(:not(:disabled, [aria-disabled="true"], [aria-pressed="true"], .done, .wsave, .wcgo, .planbar > .btn, #pop .libadd, :is(#list, #week) .scards .scopy)):hover:not(:active) { background: color-mix(in srgb, var(--ink) 2%, var(--qb)); } }
@media (forced-colors: active) { :is(.dash, .acct, dialog) :is(.sagain, .gaddp, .smove, .es-go, .dash .btn, .btn.ghost, .steps button, #dayList .clear, .popbar button, .pmore > summary):where(:not(:disabled, [aria-disabled="true"], [aria-pressed="true"], .done, .wsave, .wcgo, .planbar > .btn, #pop .libadd, :is(#list, #week) .scards .scopy)) { border: 1px solid ButtonBorder; } }

/* Row 11 (A): navigation is quiet where the screen has its own main action. Home keeps its editor door. */
body:has(.dash, .acct) .top .door-edit { --d-bg: var(--qb); --d-ink: var(--ink); --d-dot: var(--ink); --d-edge: var(--quiet-edge); }
body:has(.dash, .acct) .top .door-edit::after { display: none; }
body:has(.dash [data-sec="drills"].on, .dash:not(.club) #drillsView:not([hidden])):not(:has(#dBar:not([hidden]))) .top .door-edit { --d-bg: var(--btn); --d-ink: var(--btn-ink); --d-dot: var(--btn-dot); --d-edge: var(--btn); }
/* The one action takes precedence over quiet hover/press. Existing filled confirmations and sheet editors remain. */
:root :is(
  .club #groups:not(:has(.gform, .wsave)) #gNew,
  .club #groups:not(:has(.wsave)) .gform > button[type="submit"],
  #players:not(:has(.plform, #plSave, .plbox)) #plAdd,
  #players .plform button[type="submit"], #plSave,
  #people #pInvite button[type="submit"], #today #tPlan,
  #kb .btn, #kb:not(:has(:is(.kbedit, .kbmove):not([hidden]) .btn)) .kbdone,   /* the sheet: Gatavs, unless Kopēt, Mainīt's or Kad's Save shows */
  .dash:not(.club) #sessionsView:not(:has(.planbar:not([hidden]), .wsave)) #put,
  #dBar:not([hidden]) #dBack,
  .dash .wsave, .dash .wcgo,
  .acct #nameForm button[type="submit"]
) { color: var(--on-fill, var(--on-ink, var(--btn-ink))); background: var(--fill, var(--acc)); box-shadow: none; }

/* ---- a phone ---- */
@media (max-width: 640px) {
  .toplink { display: none; }   /* no room: Account is in the footer */
  .top { gap: .4rem; } .langsw { min-inline-size: 2.25rem; } .brand { font-size: 1rem; gap: .4rem; min-block-size: 2.75rem; }   /* room for LV / EN, the name on one line */
  .lights { width: 2.75rem; height: 2.75rem; }
}
@media (max-width: 760px) {   /* the doors' words don't fit beside Account (Latvian): the icon alone, its aria-label and title name it */
  .top .door { grid-template-columns: auto; inline-size: var(--field-h); block-size: var(--field-h); padding: 0; place-content: center; }
  .top .door .dl { display: none; }
  .top .door-edit::after { display: none; }
}
@media (max-width: 359px) {
  .brand { font-size: 0; }   /* the smallest phones: the pitch alone (its aria-label names it), so the top bar stays one row */
}

/* ---- motion only for those who haven't asked for less; hover only where there is a mouse ---- */
@media (prefers-reduced-motion: no-preference) {
  /* the soft fade between pages (@view-transition) is in each page's head, not here: from this file the next page often missed it */
  .btn, .lights, .door, .kbdone { transition: transform .12s ease-out, background-color .25s, color .25s; }
  .btn:active, .lights:active, .door:active, .kbdone:active { transform: scale(.97); }   /* .kbdone: the sheet's Gatavs, filled while it is the main button */
  .lights .lamp, h1 { transition: fill .35s ease-out, color .35s ease-out, text-shadow .35s ease-out; }
  /* a press going dark: the lamps warm up one after another, with a flicker (site.js puts .warm on for a moment) */
  .lights.warm .lamp { animation: lamp-on .42s ease-out both; transition: none; }
  .lights.warm .lamp:nth-of-type(2) { animation-delay: 50ms; } .lights.warm .lamp:nth-of-type(3) { animation-delay: 100ms; }
  .lights.warm .lamp:nth-of-type(4) { animation-delay: 150ms; } .lights.warm .lamp:nth-of-type(5) { animation-delay: 200ms; } .lights.warm .lamp:nth-of-type(6) { animation-delay: 250ms; }
}
@keyframes lamp-on { 0% { fill-opacity: 0; } 25% { fill-opacity: 1; } 40% { fill-opacity: .2; } 55% { fill-opacity: .9; } 70% { fill-opacity: .5; } 100% { fill-opacity: 1; } }
/* the soft fade between pages (opted into in each page's head): .18 s, paused while the new page holds it (vt-hold, its head and core.js) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
:root.vt-hold::view-transition-old(root), :root.vt-hold::view-transition-new(root) { animation-play-state: paused; }
/* the switch's press: the new look spreads from it in a circle (site.js animates it) over the old one, which stays still; clicks go through.
   Scoped to .flood, so the soft fade between pages is untouched */
:root.flood::view-transition-old(root), :root.flood::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
:root.flood::view-transition { pointer-events: none; }
:root.flood :not(.lamp) { transition: none !important; }   /* the circle is the change: colours inside it don't fade too (the lamps going out still do) */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { filter: brightness(1.15); }
  .lights:hover, .langsw:hover { background-image: linear-gradient(var(--tint), var(--tint)); }
  footer a:hover, .prose a:hover { text-decoration-thickness: 2px; }
  .toplink:hover { text-decoration: underline; }
}

/* ---- iPhones on iOS 16 (Safari before 17.5 has no light-dark()): the same colours, the page's switch (data-theme) first, the device's choice only
   without it. var(--day-off, A) var(--night-off, B) gives A in daylight and B in floodlights: in floodlights --day-off is set empty (its A goes),
   in daylight --night-off (its B goes); an unset one gives its value. Plain colours where a mix carries meaning (color-mix() needs 16.2).
   Last in the file: a custom property's light-dark() is kept by those browsers, so this must come after it. New browsers skip the block ---- */
@supports not (color: light-dark(#000, #fff)) {
  :root { --night-off: ; }
  :root[data-theme="dark"] { --day-off: ; --night-off: initial; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --day-off: ; --night-off: initial; } }
  :root {
    --page: var(--day-off, #e9ecef) var(--night-off, #0e1012);
    --grid: var(--day-off, #c9ced4) var(--night-off, #24282d);
    --ink: var(--day-off, #111315) var(--night-off, #e8e6e1);
    --soft: var(--day-off, #4b5157) var(--night-off, #a3a8ad);
    --acc: var(--day-off, #111315) var(--night-off, #ffb547);
    --btn: var(--day-off, #111315) var(--night-off, #ffb547);
    --btn-ink: var(--day-off, #ffffff) var(--night-off, #111315);
    --btn-dot: var(--day-off, #ffb000) var(--night-off, #111315);
    --frame: var(--day-off, #111315) var(--night-off, #3a3f45);
    --panel: var(--day-off, #ffffff) var(--night-off, #16191c);
    --qb: var(--day-off, #e0e4e7) var(--night-off, #25292d);
    --field-bg: var(--day-off, #f2f4f5) var(--night-off, #101315);
    --field-line: var(--day-off, #70777d) var(--night-off, #858e96);
    --quiet-edge: var(--day-off, #70777d) var(--night-off, #858e96);
    --edge: var(--day-off, #c4c9cd) var(--night-off, #454b51);
    --pop: var(--day-off, #ffffff) var(--night-off, #292d31);
    --lamp: var(--day-off, transparent) var(--night-off, #ffd36b);
    --bad: var(--day-off, #b42318) var(--night-off, #ff7b6e);

    --tint: var(--day-off, rgb(17 19 21 / .1)) var(--night-off, rgb(232 230 225 / .1));
    --line-thin: var(--day-off, rgb(17 19 21 / .15)) var(--night-off, rgb(232 230 225 / .15));
    --line: var(--day-off, rgb(17 19 21 / .18)) var(--night-off, rgb(232 230 225 / .18));
    --line-strong: var(--day-off, rgb(17 19 21 / .25)) var(--night-off, rgb(232 230 225 / .25));
  }
  :root, #kb { --club-tint: var(--day-off, var(--club-tint-l, var(--head))) var(--night-off, var(--club-tint-d, var(--head))); }
  .door-edit { --d-soft: var(--day-off, #c8ccd0) var(--night-off, #3f444a); }   /* the other door colours use the root fallbacks */
}

@supports not (color: color-mix(in oklch, #000 95%, #fff)) {
  :root.inclub, #kb {
    --panel: var(--day-off, #ffffff) var(--night-off, #16191c);
    --qb: var(--day-off, #e0e4e7) var(--night-off, #25292d);
    --field-bg: var(--day-off, #f2f4f5) var(--night-off, #101315);
    --field-line: var(--day-off, #70777d) var(--night-off, #858e96);
    --quiet-edge: var(--day-off, #70777d) var(--night-off, #858e96);
    --edge: var(--day-off, #c4c9cd) var(--night-off, #454b51);
    --pop: var(--day-off, #ffffff) var(--night-off, #292d31);
  }
}
