/* Scoreboard redesign (direction 1a): the design tokens. Every colour of the new stylesheets is declared here and nowhere
   else (ScoreboardStylesheetTests). The legacy tokens.css one folder up is a separate system; a page never loads both.

   Brand inputs, written by the server in the nonced style block of Views/Shared/Sb/_Layout.cshtml:
     --brand     the domain's primary colour
     --brand-on  text on --brand: #FFFFFF, or #111316 when white gives under 3:1 (PortalBranding.OnBrand)
     --brand-hover  the hover fill of a primary button, moved away from --brand-on (PortalBranding.BrandHover)
     --brand-2   the domain's secondary colour, used sparingly
   The values below are only the fallback for a page without that block.

   Buttons (guide walkthrough F3, F6 and F25): no button has a transparent or near-page fill. --btn-bg is the solid fill
   of every non-primary button (default, outline, quiet, menu, icon) and --btn-bg-hover its hover, one step darker. In
   the light theme the fill is the light grey #E3E7EB, so a button stands out on the #F3F4F5 page and on the #FFFFFF
   cards and grid rows (F25: a white button vanished on a white row); --btn-tint and
   --btn-tint-hover fill the grid row text buttons and mark a pressed toolbar button or the current page of a pager.
   --danger-bg, --danger-bg-hover and --danger-on are the solid red delete button and its white text: at least 4:1
   with the text, and in the dark theme at least 3:1 against the dark page and cards, so each theme has its own red.

   Theme: <html data-theme="dark|light">. Without the attribute the device setting applies. Status colours never come
   from the brand colour, and a state always has a word and a symbol as well as a colour. */

:root {
  --brand: #BF6624;
  --brand-on: #FFFFFF;
  --brand-hover: color-mix(in oklch, var(--brand) 88%, black);
  --brand-2: #3A6FD8;

  /* the text of the delete button in both themes; its red is in each theme block */
  --danger-on: #FFFFFF;

  /* type */
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-xs: .75rem;    /* 12, only uppercase labels */
  --fs-sm: .8125rem;  /* 13 */
  --fs-md: .9375rem;  /* 15, body */
  --fs-lg: 1.0625rem; /* 17 */
  --fs-xl: 1.25rem;   /* 20 */
  --fs-d1: 1.5rem;    /* display sizes use --font-display */
  --fs-d2: 2rem;
  --fs-d3: 2.625rem;
  --fs-d4: 3rem;
  --lh-tight: 1.1;
  --lh-body: 1.45;
  --tracking-label: .08em;

  /* spacing (4px grid) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --page-pad: clamp(16px, 3vw, 40px);
  --page-max: 1440px;

  /* radius */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 10px;
  --r-pill: 999px;

  /* sizes */
  --tap: 44px;          /* minimum touch target */
  --control-h: 44px;
  --header-h: 64px;
  --header-h-phone: 56px;
  --cell-py: var(--sp-3);
  --cell-px: var(--sp-4);

  /* motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 140ms;

  /* fixed inks: the text on a medal disc is dark in both themes; print is black on white */
  --medal-ink: #111316;
  /* Guide walkthrough round 17, F105 (style B, every page with a medal disc): a light fill, a strong coloured ring and the
     dark number, the same in both themes (Marko's values). The number on the fill: gold 14.6:1, silver 15.0:1, bronze
     13.0:1. The ring only frames the disc (the number and its name carry the place): 2.9 to 3.8:1 against the light page
     and cards, 4.1 to 5.7:1 against the dark ones. --medal-1 also draws the border of a final fight in the back office. */
  --medal-1: #B8860B;
  --medal-2: #7D8791;
  --medal-3: #B87333;
  --medal-1-fill: #F7E3A3;
  --medal-2-fill: #E3E7EB;
  --medal-3-fill: #F2D2B6;
  /* Public redesign task 6 (spec 6.1, decision C9): the filled medal coins of the public shell (components.css), 36px,
     a gradient from the light stop at the upper left to the dark stop, the same in both themes, with the dark number
     (--medal-ink). The dark number on the light and the dark stop: gold 12.8:1 and 6.4:1, silver 15.7:1 and 6.9:1, bronze
     11.8:1 and 5.6:1, so at least 4.5:1 on the whole coin. The shadow and the tints of the placings strip are in each
     theme block. */
  --coin-size: 36px;
  --coin-1-light: #F5D36A;
  --coin-1-dark: #C1901A;
  --coin-2-light: #E9ECEF;
  --coin-2-dark: #959FA9;
  --coin-3-light: #F2C6A0;
  --coin-3-dark: #C27E45;
  /* Guide walkthrough round 18, F109 (mockup f109-mockups/seed-lines.html, option A): the seed place badge of a first-round
     line on the organizer and administrator draft diagram (draw.css .seed-place), the same in both themes. Seeds 1-4: white
     on #BF6624, 4.1:1; seeds 5-8: #1B2129 on #F2C9A8, 10.6:1. The strong fill is 4.2:1 against the dark cards. F113: the
     lines 9 and up (every first-round line has a number now): #1B2129 on #E3E7EB, 13.0:1. */
  --seed-place-strong-bg: #BF6624;
  --seed-place-strong-ink: #FFFFFF;
  --seed-place-light-bg: #F2C9A8;
  --seed-place-light-ink: #1B2129;
  --seed-place-grey-bg: #E3E7EB;
  --seed-place-grey-ink: #1B2129;
  --print-bg: #FFFFFF;
  --print-ink: #000000;

  /* the diploma page preview of the back office (backoffice.css .dcanvas): paper, ink and the guide lines on it, the
     same in both themes because they stand for the printed page */
  --paper: #FFFFFF;
  --paper-ink: #111316;
  --paper-grid: rgba(17, 19, 22, .06);
  --paper-line: rgba(17, 19, 22, .35);
  --paper-veil: rgba(255, 255, 255, .4);

  /* the poster of the public tournament list (components.css .t-row__lens and .poster-zoom): the magnifier veil on the
     thumbnail and the dark dialog of the enlarged poster, the same in both themes (the picture is on dark in both) */
  --poster-lens-veil: rgba(17, 19, 22, .55);
  --poster-lens-ink: #FFFFFF;
  --poster-backdrop: rgba(10, 12, 14, .86);
  --poster-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  --poster-caption-ink: #F1F2F3;
  --poster-caption-muted: #C9CED3;
  --poster-close-bg: rgba(24, 27, 31, .8);
  --poster-close-bg-hover: #2C3138;
  --poster-close-border: rgba(255, 255, 255, .35);
  --poster-close-ink: #FFFFFF;

  /* Public redesign (spec 3.3 and 4.2): the colour fade over the photo behind the public shell (base.css), in the page
     colour of the theme: the mockup values, from almost the page colour at the left (96%) to almost clear at the right
     (5%), so the fighter stays clear, and stronger towards the bottom; and the soft blur behind the translucent surfaces.
     The photo and the surfaces are in each theme block. Decision 2026-10-25 (spec 4.1): text does not stand straight on
     the photo over the fighter; the draw card, the pager, the footer and the other texts the contrast check of
     public-backdrop.test.cjs found there have a translucent surface instead of a stronger fade. */
  --backdrop-fade-x: linear-gradient(90deg, color-mix(in srgb, var(--bg) 96%, transparent) 0%, color-mix(in srgb, var(--bg) 80%, transparent) 35%, color-mix(in srgb, var(--bg) 35%, transparent) 65%, color-mix(in srgb, var(--bg) 5%, transparent) 100%);
  --backdrop-fade-y: linear-gradient(180deg, color-mix(in srgb, var(--bg) 10%, transparent) 0%, color-mix(in srgb, var(--bg) 55%, transparent) 70%, color-mix(in srgb, var(--bg) 90%, transparent) 100%);
  --glass-blur: blur(10px);

  /* Guide walkthrough round 29, F166: the round glossy flag (the "flag ball" of the info screen medalists, wall.css
     .wall-ball, and the club cell of the public medals by club table, rankings.css .flag-ball): the light spot at the
     upper left, the dark shade at the bottom, the dark edge, the thin light rim and the drop shadow. The same in both
     themes, because they light a flag picture, not the page; the info screen reads the same values. The light rim is
     the info screen's only: the public ball sits on the light or dark page and takes the decorative hairline there. */
  --ball-rim: rgba(255, 255, 255, .22);
  --ball-spot: rgba(255, 255, 255, .85);
  --ball-spot-2: rgba(255, 255, 255, .35);
  --ball-spot-0: rgba(255, 255, 255, 0);
  --ball-dark: rgba(0, 0, 0, .55);
  --ball-dark-0: rgba(0, 0, 0, 0);
  --ball-edge: rgba(0, 0, 0, .35);
  --ball-drop: rgba(0, 0, 0, .3);
}

/* A phone (spec 3.3): the photo is anchored right behind the text, so the fade is a little stronger at every stop, and
   still light enough that the fighter stays clear. */
@media (max-width: 760px) {
  :root {
    --backdrop-fade-x: linear-gradient(90deg, color-mix(in srgb, var(--bg) 96%, transparent) 0%, color-mix(in srgb, var(--bg) 84%, transparent) 35%, color-mix(in srgb, var(--bg) 45%, transparent) 65%, color-mix(in srgb, var(--bg) 15%, transparent) 100%);
    --backdrop-fade-y: linear-gradient(180deg, color-mix(in srgb, var(--bg) 25%, transparent) 0%, color-mix(in srgb, var(--bg) 65%, transparent) 70%, color-mix(in srgb, var(--bg) 92%, transparent) 100%);
  }
}

/* ---------- DARK (the public default, for the venue) ---------- */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111316;
  --bg-sunken: #0E1013;
  --bg-header: #0B0D0F;
  --surface: #181B1F;
  --field-bg: #181B1F;       /* text fields and selects */
  --surface-2: #20242A;
  --surface-3: #2C3138;
  /* --line and --line-strong are the hand-off hairlines of decorative separators (rows, cards, dividers, header rules);
     the owner keeps them light (2026-10-04). A line that carries meaning uses a 3:1 token: --control-border for
     inputs, selects and buttons, --connector-strong for bracket connectors and loser paths. */
  --line: #2C3138;
  --line-strong: #3A4049;
  --connector: #4A515B;
  --control-border: #7A828C;      /* 3.4:1 on --surface-3, 4.4:1 on --surface */
  --connector-strong: #6B737C;    /* 3.9:1 on --bg, 3.6:1 on --surface */
  --text: #F1F2F3;
  --text-2: #C9CED3;
  --muted: #A2A9B1;      /* 7.8:1 on --bg */
  --faint: #8A929B;      /* 5.5:1 on --surface: losers, placeholders */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 8px 28px rgba(0, 0, 0, .45);
  --shadow-up: 0 -6px 18px rgba(0, 0, 0, .4);   /* a sticky bar at the bottom of the window */
  --shadow-card: 0 4px 12px rgba(0, 0, 0, .35);  /* a fight card on a phone (guide walkthrough F174, Kartica K2) */
  --overlay: rgba(5, 6, 8, .72);
  /* Public redesign (spec 3 and 4): the photo behind the public shell (wide above 1100px, narrow below; the version is in
     the file name) and the translucent public surfaces over it: --surface, --bg-header and --bg-sunken with the photo
     showing through. The opacities passed the contrast check of public-backdrop.test.cjs (every text at least 4.5:1, large
     text 3:1, over the lightest and the darkest part of the photo). */
  --backdrop-wide: url("../../img/backdrop/hall-dark-v1-wide.webp");
  --backdrop-narrow: url("../../img/backdrop/hall-dark-v1-narrow.webp");
  /* Decision 2026-10-25 (spec 4.1): the two smoke trails over the fade, in the photo's box (base.css): the kick trail
     flows left from the kicking foot, the low sweep trail along the floor from the standing foot. The dark files are light
     smoke on black, drawn with screen, so the black adds nothing. */
  --backdrop-trail-kick-wide: url("../../img/backdrop/trail-kick-dark-v1-wide.webp");
  --backdrop-trail-kick-narrow: url("../../img/backdrop/trail-kick-dark-v1-narrow.webp");
  --backdrop-trail-sweep-wide: url("../../img/backdrop/trail-sweep-dark-v1-wide.webp");
  --backdrop-trail-sweep-narrow: url("../../img/backdrop/trail-sweep-dark-v1-narrow.webp");
  --backdrop-trail-blend: screen;
  /* The trail veil lies over the trails and lowers them on the text side only (the left 40%, clear from 60%), so the
     large headings that stand straight on the photo (the list tabs, the draw heading) keep 3:1 over the brightest smoke
     (public-backdrop.test.cjs). The light trails keep that without a veil. */
  --backdrop-trail-veil: linear-gradient(90deg, color-mix(in srgb, var(--bg) 30%, transparent) 0%, color-mix(in srgb, var(--bg) 30%, transparent) 40%, transparent 60%);
  --surface-glass: rgba(24, 27, 31, .68);
  --surface-glass-strong: rgba(11, 13, 15, .82);
  --bg-sunken-glass: rgba(14, 16, 19, .68);

  --brand-text: color-mix(in oklch, var(--brand) 62%, white);   /* links, active text */
  --brand-tint: color-mix(in oklch, var(--brand) 16%, transparent);
  --brand-tint-2: color-mix(in oklch, var(--brand) 10%, transparent);
  --focus: color-mix(in oklch, var(--brand) 55%, white);
  /* --brand-line: a brand state line (my fight, the chosen category). Its 3:1 relies on the domain brand guard,
     BrandColorContrast.Passes (Domain/Services/BrandColorContrast.cs): a saved brand reaches 3:1 (MinimumRatio)
     against the light and dark page and card colours. The mix moves the brand away from the page (towards white
     here, towards black in light), so the line keeps at least that; sweep-edges.test.cjs checks four brands. */
  --brand-line: color-mix(in oklch, var(--brand) 55%, white);

  /* buttons: a solid surface lighter than the page and the cards (--surface-3), a lighter one on hover; text 11.7:1 and
     9.3:1. The row text button tint is solid too (mixed into the card colour, not into transparent). */
  --btn-bg: #2C3138;
  --btn-bg-hover: #3A4049;
  --btn-tint: color-mix(in oklch, var(--brand) 22%, #181B1F);
  --btn-tint-hover: color-mix(in oklch, var(--brand) 34%, #181B1F);
  /* the delete button: white on #D92D20 is 4.8:1 and the red is 3.6:1 on the cards and 3.9:1 on the page; the darker
     hover #C62C20 keeps 5.5:1, 3.1:1 and 3.3:1 */
  --danger-bg: #D92D20;
  --danger-bg-hover: #C62C20;

  /* status: fg and bg pairs, all at least 4.5:1 (the hand-off values) */
  --st-live-fg: #FF7A6E;
  --st-live-bg: #3A1614;
  --st-live-dot: #FF5D52;
  --st-open-fg: #6EE7A0;
  --st-open-bg: #12301F;
  --st-closed-fg: #B4BAC1;
  --st-closed-bg: #26292E;
  --st-done-fg: #9CC2FF;
  --st-done-bg: #15233D;
  --st-warn-fg: #F5C451;   /* moved, pending */
  --st-warn-bg: #3A2E10;
  --st-info-fg: #C4B0FF;   /* referred to administrator */
  --st-info-bg: #2A2140;
  --st-ok-fg: #6EE7A0;     /* approved, active, finished fight */
  --st-ok-bg: #12301F;
  --st-bad-fg: #FF8A80;    /* rejected, disqualified, error */
  --st-bad-bg: #3A1614;
  --st-neutral-fg: #B4BAC1;
  --st-neutral-bg: #26292E;
  --win: #6EE7A0;
  /* Guide walkthrough F177 (mockup round-31/mockups/f177.html V4): the fill and the left bar of a winner side of a draw
     card (draw.css). The fill is about 11% of the win green, so --text keeps more than 10:1 and --muted more than 5:1
     on it; the bar is a 3:1 line on --surface. */
  --win-bg: rgba(110, 231, 160, .11);
  --win-line: #3FAF78;

  /* contest colours: defaults; a tournament page sets its own in a nonced style block or through data-css-vars */
  --contest-a: #4C8DFF;
  --contest-b: #FF4D4D;

  --medal-4: #6B737C;
  /* Public redesign task 6: the soft shadow under a medal coin, and the light tint of the first three places in the
     placings strip (draw-tabs.css): the ring colour at 16% over the dark glass, so the light text keeps its contrast. */
  --coin-shadow: 0 2px 6px rgba(0, 0, 0, .5);
  --coin-1-tint: color-mix(in srgb, var(--medal-1) 16%, transparent);
  --coin-2-tint: color-mix(in srgb, var(--medal-2) 16%, transparent);
  --coin-3-tint: color-mix(in srgb, var(--medal-3) 16%, transparent);

  /* the palette of the tournament description (rich text): readable on --surface in each theme */
  --palette-red: oklch(0.78 0.13 27);
  --palette-orange: oklch(0.78 0.10 50);
  --palette-amber: oklch(0.78 0.08 75);
  --palette-green: oklch(0.78 0.09 150);
  --palette-teal: oklch(0.78 0.06 190);
  --palette-blue: oklch(0.78 0.10 255);
  --palette-indigo: oklch(0.78 0.11 280);
  --palette-purple: oklch(0.78 0.12 310);
  --palette-pink: oklch(0.78 0.13 350);
  --palette-slate: oklch(0.78 0.02 255);
}

/* ---------- LIGHT ---------- */
[data-theme="light"] {
  color-scheme: light;
  --bg: #F3F4F5;
  --bg-sunken: #ECEEF0;
  --bg-header: #FFFFFF;
  --surface: #FFFFFF;
  --field-bg: #FDFDFD;       /* text fields and selects: a tiny step off the browser's white; the product look comes from their border and padding */
  --surface-2: #F1F3F5;
  --surface-3: #E3E7EB;
  --line: #DADFE4;
  --line-strong: #B9C0C8;
  --connector: #9AA3AD;
  --control-border: #7A828B;      /* 3.1:1 on --surface-3, 3.4:1 on --bg-sunken, 3.9:1 on --surface */
  --connector-strong: #7A828B;
  --text: #111316;
  --text-2: #2E343B;
  --muted: #525A63;      /* 6.3:1 on --bg */
  --faint: #636B74;      /* 5.4:1 on --surface */
  --shadow-1: 0 1px 2px rgba(17, 19, 22, .06);
  --shadow-2: 0 10px 30px rgba(17, 19, 22, .16);
  --shadow-up: 0 -6px 18px rgba(17, 19, 22, .08);
  --shadow-card: 0 3px 10px rgba(0, 0, 0, .12);
  --overlay: rgba(17, 19, 22, .5);
  /* the photo and the translucent public surfaces (see the dark block); the cards 70% and the head 78%, not the 62% of the
     mockup, so the muted text (--muted) keeps 4.5:1 over the darkest part of the light photo (the belt and the hair; 70%
     since hall-light-v2, 2026-10-25) */
  --backdrop-wide: url("../../img/backdrop/hall-light-v2-wide.webp");
  --backdrop-narrow: url("../../img/backdrop/hall-light-v2-narrow.webp");
  /* the two smoke trails (see the dark block): the light files are dark smoke on white, drawn with multiply, so the
     white adds nothing */
  --backdrop-trail-kick-wide: url("../../img/backdrop/trail-kick-light-v1-wide.webp");
  --backdrop-trail-kick-narrow: url("../../img/backdrop/trail-kick-light-v1-narrow.webp");
  --backdrop-trail-sweep-wide: url("../../img/backdrop/trail-sweep-light-v1-wide.webp");
  --backdrop-trail-sweep-narrow: url("../../img/backdrop/trail-sweep-light-v1-narrow.webp");
  --backdrop-trail-blend: multiply;
  --backdrop-trail-veil: none;
  --surface-glass: rgba(255, 255, 255, .70);
  --surface-glass-strong: rgba(255, 255, 255, .82);
  --bg-sunken-glass: rgba(236, 238, 240, .78);

  --brand-text: color-mix(in oklch, var(--brand) 72%, black);
  --brand-tint: color-mix(in oklch, var(--brand) 13%, white);
  --brand-tint-2: color-mix(in oklch, var(--brand) 7%, white);
  --focus: color-mix(in oklch, var(--brand) 80%, black);
  --brand-line: color-mix(in oklch, var(--brand) 80%, black);

  /* buttons (F25): the light grey #E3E7EB with the grey border, which stands out on the #F3F4F5 page and on the #FFFFFF
     cards and grid rows; the hover is one step darker; the row text button tint is a solid brand tint */
  --btn-bg: #E3E7EB;
  --btn-bg-hover: #D3D9DF;
  --btn-tint: color-mix(in oklch, var(--brand) 13%, white);
  --btn-tint-hover: color-mix(in oklch, var(--brand) 22%, white);
  /* the delete button: white on #B42318 is 6.6:1, on the darker hover #8F1C13 9.0:1; the red is 6.0:1 on the page */
  --danger-bg: #B42318;
  --danger-bg-hover: #8F1C13;

  --st-live-fg: #B42318;
  --st-live-bg: #FDE8E6;
  --st-live-dot: #E5372A;
  --st-open-fg: #12703F;
  --st-open-bg: #E2F4E9;
  --st-closed-fg: #4F5862;
  --st-closed-bg: #E9ECEF;
  --st-done-fg: #1F4FA3;
  --st-done-bg: #E3ECFB;
  --st-warn-fg: #7A5300;
  --st-warn-bg: #FFF1D2;
  --st-info-fg: #5B3FA6;
  --st-info-bg: #EEE8FB;
  --st-ok-fg: #12703F;
  --st-ok-bg: #E2F4E9;
  --st-bad-fg: #B42318;
  --st-bad-bg: #FDE8E6;
  --st-neutral-fg: #4F5862;
  --st-neutral-bg: #E9ECEF;
  --win: #12703F;
  /* F177: the light green fill (--muted 6:1 and the crown 5.3:1 on it) and the bar in the win green. */
  --win-bg: #E3F3E9;
  --win-line: #12703F;

  --contest-a: #2563EB;
  --contest-b: #DC2626;

  --medal-4: #636B74;
  /* the coin shadow and the strip tints (see the dark block): the light medal fills at 70%, which keep the dark text and
     the muted club text above 4.5:1 even where the fill covers the glass fully */
  --coin-shadow: 0 2px 6px rgba(17, 19, 22, .25);
  --coin-1-tint: color-mix(in srgb, var(--medal-1-fill) 70%, transparent);
  --coin-2-tint: color-mix(in srgb, var(--medal-2-fill) 70%, transparent);
  --coin-3-tint: color-mix(in srgb, var(--medal-3-fill) 70%, transparent);
  --palette-red: oklch(0.50 0.19 27);
  --palette-orange: oklch(0.52 0.15 50);
  --palette-amber: oklch(0.52 0.12 75);
  --palette-green: oklch(0.48 0.13 150);
  --palette-teal: oklch(0.48 0.09 190);
  --palette-blue: oklch(0.48 0.15 255);
  --palette-indigo: oklch(0.45 0.17 280);
  --palette-purple: oklch(0.47 0.18 310);
  --palette-pink: oklch(0.50 0.19 350);
  --palette-slate: oklch(0.45 0.03 255);
}

/* ---------- SYSTEM: no data-theme attribute and a light device setting ---------- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #F3F4F5;
    --bg-sunken: #ECEEF0;
    --bg-header: #FFFFFF;
    --surface: #FFFFFF;
    --field-bg: #FDFDFD;
    --surface-2: #F1F3F5;
    --surface-3: #E3E7EB;
    --line: #DADFE4;
    --line-strong: #B9C0C8;
    --connector: #9AA3AD;
    --control-border: #7A828B;
    --connector-strong: #7A828B;
    --text: #111316;
    --text-2: #2E343B;
    --muted: #525A63;
    --faint: #636B74;
    --shadow-1: 0 1px 2px rgba(17, 19, 22, .06);
    --shadow-2: 0 10px 30px rgba(17, 19, 22, .16);
    --shadow-up: 0 -6px 18px rgba(17, 19, 22, .08);
    --shadow-card: 0 3px 10px rgba(0, 0, 0, .12);
    --overlay: rgba(17, 19, 22, .5);
    --backdrop-wide: url("../../img/backdrop/hall-light-v2-wide.webp");
    --backdrop-narrow: url("../../img/backdrop/hall-light-v2-narrow.webp");
    --backdrop-trail-kick-wide: url("../../img/backdrop/trail-kick-light-v1-wide.webp");
    --backdrop-trail-kick-narrow: url("../../img/backdrop/trail-kick-light-v1-narrow.webp");
    --backdrop-trail-sweep-wide: url("../../img/backdrop/trail-sweep-light-v1-wide.webp");
    --backdrop-trail-sweep-narrow: url("../../img/backdrop/trail-sweep-light-v1-narrow.webp");
    --backdrop-trail-blend: multiply;
    --backdrop-trail-veil: none;
    --surface-glass: rgba(255, 255, 255, .70);
    --surface-glass-strong: rgba(255, 255, 255, .82);
    --bg-sunken-glass: rgba(236, 238, 240, .78);
    --brand-text: color-mix(in oklch, var(--brand) 72%, black);
    --brand-tint: color-mix(in oklch, var(--brand) 13%, white);
    --brand-tint-2: color-mix(in oklch, var(--brand) 7%, white);
    --focus: color-mix(in oklch, var(--brand) 80%, black);
    --brand-line: color-mix(in oklch, var(--brand) 80%, black);
    /* buttons (F25): the same light grey fill and darker hover as the light block above */
    --btn-bg: #E3E7EB;
    --btn-bg-hover: #D3D9DF;
    --btn-tint: color-mix(in oklch, var(--brand) 13%, white);
    --btn-tint-hover: color-mix(in oklch, var(--brand) 22%, white);
    --danger-bg: #B42318;
    --danger-bg-hover: #8F1C13;
    --st-live-fg: #B42318;
    --st-live-bg: #FDE8E6;
    --st-live-dot: #E5372A;
    --st-open-fg: #12703F;
    --st-open-bg: #E2F4E9;
    --st-closed-fg: #4F5862;
    --st-closed-bg: #E9ECEF;
    --st-done-fg: #1F4FA3;
    --st-done-bg: #E3ECFB;
    --st-warn-fg: #7A5300;
    --st-warn-bg: #FFF1D2;
    --st-info-fg: #5B3FA6;
    --st-info-bg: #EEE8FB;
    --st-ok-fg: #12703F;
    --st-ok-bg: #E2F4E9;
    --st-bad-fg: #B42318;
    --st-bad-bg: #FDE8E6;
    --st-neutral-fg: #4F5862;
    --st-neutral-bg: #E9ECEF;
    --win: #12703F;
    --win-bg: #E3F3E9;
    --win-line: #12703F;
    --contest-a: #2563EB;
    --contest-b: #DC2626;
    --medal-4: #636B74;
    --coin-shadow: 0 2px 6px rgba(17, 19, 22, .25);
    --coin-1-tint: color-mix(in srgb, var(--medal-1-fill) 70%, transparent);
    --coin-2-tint: color-mix(in srgb, var(--medal-2-fill) 70%, transparent);
    --coin-3-tint: color-mix(in srgb, var(--medal-3-fill) 70%, transparent);
    --palette-red: oklch(0.50 0.19 27);
    --palette-orange: oklch(0.52 0.15 50);
    --palette-amber: oklch(0.52 0.12 75);
    --palette-green: oklch(0.48 0.13 150);
    --palette-teal: oklch(0.48 0.09 190);
    --palette-blue: oklch(0.48 0.15 255);
    --palette-indigo: oklch(0.45 0.17 280);
    --palette-purple: oklch(0.47 0.18 310);
    --palette-pink: oklch(0.50 0.19 350);
    --palette-slate: oklch(0.45 0.03 255);
  }
}

/* ---------- CATEGORY TREE LEVELS (guide walkthrough F11, F13) ----------
   Every level of a category tree has its own row tint and a 4px bar on the left: the builder tree (backoffice.css, tree
   table) and the read-only categories of a catalogue page (backoffice.css, .ctree). Level 1 is blue, level 2 violet,
   level 3 magenta and level 4 slate grey; level 5 starts again at level 1. No level is teal or green, so no level looks
   like a status (red, green or amber) or like the green mark of a row that was just saved (backoffice.css, saved).
   --text and --muted keep at least 4:1 on every tint. --tree-lv-hover lies over a tint on hover. */
:root,
[data-theme="dark"] {
  --tree-lv1-bg: #1B2638;
  --tree-lv1-bar: #6E9BEF;
  --tree-lv2-bg: #261F38;
  --tree-lv2-bar: #A68BEA;
  --tree-lv3-bg: #33182B;
  --tree-lv3-bar: #E583C4;
  --tree-lv4-bg: #1F242C;
  --tree-lv4-bar: #8C9AB0;
  --tree-lv-hover: rgba(255, 255, 255, .07);
}

[data-theme="light"] {
  --tree-lv1-bg: #E8EEF8;
  --tree-lv1-bar: #3A6FD8;
  --tree-lv2-bg: #F1ECFA;
  --tree-lv2-bar: #7A5BC7;
  --tree-lv3-bg: #F8EAF3;
  --tree-lv3-bar: #B23A85;
  --tree-lv4-bg: #ECEFF3;
  --tree-lv4-bar: #5B6B82;
  --tree-lv-hover: rgba(17, 19, 22, .06);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --tree-lv1-bg: #E8EEF8;
    --tree-lv1-bar: #3A6FD8;
    --tree-lv2-bg: #F1ECFA;
    --tree-lv2-bar: #7A5BC7;
    --tree-lv3-bg: #F8EAF3;
    --tree-lv3-bar: #B23A85;
    --tree-lv4-bg: #ECEFF3;
    --tree-lv4-bar: #5B6B82;
    --tree-lv-hover: rgba(17, 19, 22, .06);
  }
}

/* ---------- PUBLIC BACKDROP FALLBACKS (public redesign, spec 4.3) ----------
   Set on the public shell body, so they win over the theme blocks on <html> for everything inside it. A browser without
   backdrop-filter shows the photo sharp, so its surfaces are stronger (about 90%). A device that asks for reduced
   transparency gets the solid surfaces and no blur; the photo and the smoke trails stay (base.css). Forced colours get
   solid surfaces and no photo and no trails (base.css). The trails do not change without backdrop-filter. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .shell--public {
    --surface-glass: color-mix(in srgb, var(--surface) 90%, transparent);
    --surface-glass-strong: color-mix(in srgb, var(--bg-header) 92%, transparent);
    --bg-sunken-glass: color-mix(in srgb, var(--bg-sunken) 90%, transparent);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .shell--public {
    --surface-glass: var(--surface);
    --surface-glass-strong: var(--bg-header);
    --bg-sunken-glass: var(--bg-sunken);
    --glass-blur: none;
  }
}

@media (forced-colors: active) {
  .shell--public {
    --surface-glass: var(--surface);
    --surface-glass-strong: var(--bg-header);
    --bg-sunken-glass: var(--bg-sunken);
    --glass-blur: none;
  }
}

/* ---------- BACK-OFFICE DENSITY: the same tokens, denser rows and controls for desktop work ---------- */
.shell--office {
  --fs-md: .875rem;
  --control-h: 38px;
  --header-h: 56px;
  --cell-py: var(--sp-2);
  --cell-px: var(--sp-3);
}

/* ---------- INFO SCREEN WALL (info screen plan, package F) ----------
   The video wall is always dark (Marko, 2026-10-23), so these tokens have one value and no theme blocks. Only the wall
   (wall.css) and the page colour squares of the info screen main page (info-screen.css) use them. The wall background is
   a dark navy with soft light rays from the upper right and one faint arc; around the 16:9 picture the window is black.
   --wall-accent is the orange of the frames, tags and the page countdown. The page colours of the live fights (spec 4.2)
   come in a fixed order, each with the text colour on it: 1 orange, 2 green, 3 purple, 4 turquoise, 5 pink, 6 yellow; a
   7th page starts again with orange. None is red or white (the contest colours) or the blue of the tatami bands. The
   text on every page colour is a dark ink with at least 4.5:1 contrast (white on purple or pink is under 3:1). */
:root {
  --wall-outside: #000000;
  --wall-navy-top: #0E2042;
  --wall-navy-mid: #0A1630;
  --wall-navy-low: #060B18;
  --wall-ray: rgba(150, 190, 255, .055);
  --wall-arc: rgba(150, 190, 255, .07);
  --wall-arc-2: rgba(150, 190, 255, .04);
  --wall-glow: rgba(70, 120, 230, .32);
  --wall-glow-2: rgba(40, 70, 150, .25);
  --wall-bar-bg: rgba(6, 11, 22, .72);
  --wall-bar-line: rgba(150, 190, 255, .16);
  --wall-card: rgba(12, 20, 36, .82);
  --wall-text: #F3F5F8;
  --wall-text-2: #CCD4DF;
  --wall-muted: #A3AEBD;
  --wall-accent: #BF6624;
  --wall-accent-on: #FFFFFF;
  --wall-accent-glow: rgba(255, 150, 70, .7);
  --wall-plate: #F3F5F8;
  --wall-commercial: #000000;
  --wall-commercial-name: #FFFFFF;
  --wall-sound-bg: #1B2433;
  --wall-sound-text: #FFFFFF;
  --wall-sound-border: #A3AEBD;
  --wall-page-1: #F0883E;
  --wall-page-1-on: #1A0C02;
  --wall-page-2: #2BB673;
  --wall-page-2-on: #08140D;
  --wall-page-3: #B07CFF;
  --wall-page-3-on: #160A26;
  --wall-page-4: #21C2D6;
  --wall-page-4-on: #04161A;
  --wall-page-5: #E36FB0;
  --wall-page-5-on: #22081A;
  --wall-page-6: #F5D04A;
  --wall-page-6-on: #1A1300;
  /* Package G, the live fights: the tatami band and frame are one calm steel blue (#2F4A70, a little lighter at the top)
     with white text; the tile surfaces, lines, the green of a win, the light blue of the end-of-day message, and the
     contest colours (red, white) of the bars and dots. */
  --wall-band: #2F4A70;
  --wall-band-top: #38557D;
  --wall-band-text: #FFFFFF;
  --wall-tile: #131B2A;
  --wall-tile-2: #19233A;
  --wall-tile-3: #22304A;
  --wall-line: #24314A;
  --wall-line-strong: #33445F;
  --wall-faint: #8794A6;
  --wall-win: #6EE7A0;
  --wall-done: #9CC2FF;
  --wall-contest-1: #FF4D4D;
  --wall-contest-2: #FFFFFF;
  --wall-mark-edge: #7A8AA3;
  --wall-box-bg: rgba(255, 255, 255, .04);
  /* Marko, 2026-10-23: the amber of a next fight the laptop put aside (bar, outline and number; 7.4:1 on --wall-tile-3) */
  --wall-aside: #F2B84B;
  /* Marko, 2026-10-23, the winner display ("Zastava"): the place in the winner's colour. Red runs from #D32F2F to #B71C1C
     with white letters (at least 4.9:1 at the lightest end) and a white badge with red letters (6.5:1); white runs from
     #FFFFFF to #E9EDF3 with dark navy letters and a navy badge with white letters (over 14:1). */
  --wall-flag-red-1: #D32F2F;
  --wall-flag-red-2: #B71C1C;
  --wall-flag-red-text: #FFFFFF;
  --wall-flag-red-how-bg: #FFFFFF;
  --wall-flag-red-how-text: #B71C1C;
  --wall-flag-white-1: #FFFFFF;
  --wall-flag-white-2: #E9EDF3;
  --wall-flag-white-text: #0E1A2E;
  --wall-flag-white-how-bg: #0E1A2E;
  --wall-flag-white-how-text: #FFFFFF;
  /* Package G, the medalists: the glass band of a place, the warm yellow club, the shadow of the large text, the shadow
     of the round flag and the four metals of the SVG medals, each from its lightest to its darkest tone. Guide walkthrough
     round 29, F166: the rim, light spot and shade of the round flag are the shared --ball-* tokens above (the public
     medals by club table uses the same ball), with the same values as before. */
  --wall-place-1: rgba(60, 100, 190, .34);
  --wall-place-2: rgba(30, 55, 110, .18);
  --wall-place-3: rgba(20, 35, 70, .08);
  --wall-place-light: rgba(170, 200, 255, .18);
  --wall-place-dark: rgba(0, 0, 0, .3);
  --wall-club: #F5D37A;
  --wall-shadow: rgba(0, 0, 0, .5);
  --wall-drop: rgba(0, 0, 0, .55);
  --wall-medal-shine: #FFFFFF;
  --wall-gold-0: #FFF6C2;
  --wall-gold-1: #F4CF55;
  --wall-gold-2: #C8961A;
  --wall-gold-3: #7A5600;
  --wall-silver-0: #FFFFFF;
  --wall-silver-1: #DDE2E8;
  --wall-silver-2: #9BA5B1;
  --wall-silver-3: #59626D;
  --wall-bronze-0: #F8D7B8;
  --wall-bronze-1: #D6905A;
  --wall-bronze-2: #9C5B2B;
  --wall-bronze-3: #5A3214;
  --wall-steel-0: #E3EAF3;
  --wall-steel-1: #9AAEC6;
  --wall-steel-2: #566E8C;
  --wall-steel-3: #2C3B50;
  /* the main page: the page row that has more tatamis than a page holds (red text, 6.6:1 on white) */
  --info-screen-over: #B42318;
}
