/* Scoreboard redesign: the base layer. Reset, type, utilities and page containers. Depends on tokens.css.
   Breakpoints: 760px (phone), 1100px (narrow desktop). No rule here needs an inline style attribute: the security
   policy blocks them, so every value the hand-off set in style="" is a class below or a data attribute that
   js/sb/portal.js applies through the CSSOM (data-css-vars). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* X-24: the page behind an open modal dialog (the confirm dialog, the result dialog, every dialog opened with
   showModal) does not scroll. A dialog opened without showModal is not :modal and leaves the page as it is. */
html:has(dialog:modal) { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs-md)/var(--lh-body) var(--font-body); -webkit-font-smoothing: antialiased; }
/* Public redesign (spec 3): a fixed photo behind every page of the public shell, never in the back office, the info
   screen or the wall. <html> keeps the page colour, so it paints first and nothing flashes; the body of the public shell
   is clear, so the layer between them shows. The layer does not scroll and takes no room, so it moves nothing. The fade
   (tokens.css) keeps text readable; the photo is anchored right, where the fighter stands. Decision 2026-10-25 (spec
   4.1): two smoke trails lie on top of the fade, the kick trail first, then the low sweep trail, in the photo's box (right
   center, cover), so they start at the kicking foot and the standing foot at every width; they blend with the theme's
   mode (screen in dark, multiply in light), the fade and the photo normally. On top, the trail veil of the theme
   (tokens.css) lowers the trails on the text side, so the large headings straight on the photo keep their contrast.
   From 1100px down the narrow files load instead of the wide ones; from 760px down the trails and the veil are none, so
   a phone loads no trail file (every list keeps six layers, so each blend mode meets its layer). Forced colours show no
   photo and no trails; print hides them in shell.css. */
html:has(> body.shell--public) { background: var(--bg); }
.shell--public { background: transparent; }
/* Guide walkthrough F164 (Marko, 2026-10-25): the public body is a column at least as high as the window and its main
   takes the free room (shell.css), so the footer sits at the bottom of the window on a short page and after the content
   on a long one. 100vh first, for a browser without the dvh unit; dvh follows the phone's moving address bar. The back
   office has its own shell (.bo-shell). */
.shell--public { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.shell--public::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-color: var(--bg); background-image: var(--backdrop-trail-veil), var(--backdrop-trail-kick-wide), var(--backdrop-trail-sweep-wide), var(--backdrop-fade-x), var(--backdrop-fade-y), var(--backdrop-wide); background-position: center, right center, right center, center, center, right center; background-size: auto, cover, cover, auto, auto, cover; background-repeat: no-repeat; background-blend-mode: normal, var(--backdrop-trail-blend), var(--backdrop-trail-blend), normal, normal, normal; }
@media (max-width: 1100px) { .shell--public::before { background-image: var(--backdrop-trail-veil), var(--backdrop-trail-kick-narrow), var(--backdrop-trail-sweep-narrow), var(--backdrop-fade-x), var(--backdrop-fade-y), var(--backdrop-narrow); } }
@media (max-width: 760px) { .shell--public::before { background-image: none, none, none, var(--backdrop-fade-x), var(--backdrop-fade-y), var(--backdrop-narrow); } }
@media (forced-colors: active) { .shell--public::before { content: none; } }
img { max-width: 100%; display: block; }
a { color: var(--brand-text); text-underline-offset: 3px; }
a:hover { color: var(--text); }
/* The house focus ring: solid, 3px, 3px outside the element (the accessibility sweep checks it). */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The legacy partials that later tasks still render inside a new page hide text with this name. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.show-phone { display: none !important; }
@media (max-width: 760px) {
  .show-phone { display: revert !important; }
  .hide-phone { display: none !important; }
}

/* ============ Containers and layout helpers ============ */
.container { width: 100%; max-width: var(--page-max); margin-inline: auto; padding-inline: var(--page-pad); }
.page-body { padding-top: var(--sp-8); padding-bottom: var(--sp-10); }
.page-body--tight { padding-top: var(--sp-6); }
.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.stack--sm { gap: var(--sp-1); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); }
.cluster--between { justify-content: space-between; }
.cluster--end { align-items: flex-end; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1280px) {
  .split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .split--aside { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); }
}
@media (min-width: 1101px) and (max-width: 1279px) { .split--even, .split--aside { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* ============ Type ============ */
.display { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; line-height: 1; letter-spacing: .01em; }
.display-1 { font-size: var(--fs-d1); }
.display-2 { font-size: var(--fs-d2); }
.display-3 { font-size: var(--fs-d3); }
.display-4 { font-size: var(--fs-d4); }
.section-title { font: 800 var(--fs-d1)/1 var(--font-display); text-transform: uppercase; letter-spacing: .03em; }
.eyebrow { font: 700 var(--fs-xs)/1.2 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.code { font: 700 1.25rem/1 var(--font-display); letter-spacing: .02em; } /* fight numbers: T1-042 */
.tz { font-size: var(--fs-xs); color: var(--muted); }
.help { font-size: var(--fs-sm); color: var(--muted); }
.title-wrap { overflow-wrap: anywhere; }
.block { display: block; }
.link-strong { color: var(--text); font-weight: 600; }
@media (max-width: 760px) {
  .display-4 { font-size: var(--fs-d2); }
  .display-3 { font-size: 1.875rem; }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* A form the page comes back to after a submit (form-return.js) lands under the sticky header. js/sb/portal.js writes
   the header's bottom edge as --app-header-bottom. */
[data-form-return] { scroll-margin-top: calc(var(--app-header-bottom, var(--header-h)) + var(--sp-4)); }

/* Every anchor target (a #fragment, the skip link, a field a link focuses) lands under the sticky header too. A field
   whose label sits above it adds the label's height: js/sb/portal.js writes --field-label-lift on the field. */
[id], :target { scroll-margin-top: calc(var(--app-header-bottom, var(--header-h)) + var(--sp-4) + var(--field-label-lift, 0px)); }
