*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* The palette (2026-11). Until then the site was cyan, pink and purple on
     a blue-black, every one of them at full saturation and most of them
     glowing - it looked like a stock template, not like this site. Now:
     neutral near-blacks, a bone white, ONE accent, a red for what warns or
     asks for money, a green for "live" and "saved". --accent3 is no third
     hue any more, only a quiet steel for labels that have to differ from
     the accent (an editor's badge, a scheduled article, a game mode).

     The palette is named here and nowhere else: a stylesheet that needs a
     colour of it with its own opacity writes rgba(var(--accent-rgb), 0.3),
     never the numbers. So a different accent is two lines in this block
     (the colour and its triplet) - plus the few places that can't read a
     custom property and say so: the minigame's canvas default
     (minigame/app.js, tile_engine.js, aim_engine.js, the colour picker in
     minigame.html), the two pages nginx serves itself (static/errors/),
     theme-color in partials/head.html, site.webmanifest and the generated
     logo files (develop/tools/build_brand_assets.py). Colours that aren't
     the site's own stay where they are used: a channel's or a payment
     service's brand colour, a rank tier's (ranked.css, players.css), a CMS
     status. */
  --bg: #0b0b0c;
  --bg2: #111113;
  --surface: #17171a;
  --accent: #d8b46a;
  --accent2: #e5484d;
  /* The red as small text on its own red tint: error and warning boxes,
     the chosen amount on /donate. There --accent2 itself drops to 4.3:1 on
     a card, under the 4.5:1 small text needs; this one keeps 6.2:1 or more
     (the pink of the first palette had 5.0:1 there). */
  --accent2-text: #f2797c;
  --accent3: #9fb0c3;
  --positive: #3ddc84;
  --text: #edebe6;
  /* Most --muted text is normal-sized or smaller (nav labels, timestamps,
     form hints), so it needs WCAG AA's 4.5:1, not the 3:1 of large text -
     the first palette's #5a6078 only reached 3.19:1. This one is 5.8:1 on
     --bg and 5.2:1 on --surface. */
  --muted: #8d8b85;
  /* A neutral hairline. It used to be the accent at 12 %, which tinted
     every box and every grid gap on the site. */
  --border: rgba(237, 235, 230, 0.1);
  /* The colours above once more as bare "R, G, B", for rgba(). */
  --bg-rgb: 11, 11, 12;
  --surface-rgb: 23, 23, 26;
  --accent-rgb: 216, 180, 106;
  --accent2-rgb: 229, 72, 77;
  --positive-rgb: 61, 220, 132;
  --text-rgb: 237, 235, 230;
  --font-display: "Bebas Neue", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --font-mono: "Space Mono", monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  cursor: none;
  /* overflow-x lives with the rest of the overflow handling at the bottom
     of this file, so the guard and the reasoning for it are in one place. */
}

/* Custom-cursor opt-out (game settings -> site-wide via localStorage,
   cursor.js adds this class on load). Individual interactive elements set
   their own cursor:none throughout the site's CSS to keep the illusion
   consistent while the custom cursor is active - overriding just body
   wouldn't reach those, so this deliberately overrides everything at once
   rather than hunting down every such rule across every stylesheet.
   Clickable elements get pointer back explicitly - plain `auto` on a
   <button> or a custom div-based control doesn't necessarily resolve to a
   hand cursor, so without this, buttons stopped looking clickable at all
   once the custom cursor (and its cursor:none everywhere) was disabled. */
body.cursor-native,
body.cursor-native * {
  cursor: auto !important;
}

body.cursor-native a,
body.cursor-native button,
body.cursor-native select,
body.cursor-native label,
body.cursor-native [class*="btn"],
body.cursor-native [class*="toggle"],
body.cursor-native [class*="tab"],
body.cursor-native [class*="card"],
body.cursor-native [class*="link"] {
  cursor: pointer !important;
}

/* ─── CURSOR ───
   Both start fully transparent and cursor.js reveals them on the first real
   mousemove. They used to be painted from the very first frame, which cost
   two composited fixed elements - one of them blended with mix-blend-mode -
   on every page load, including the two cases where they are then thrown
   away again a moment later: touch devices (cursor.js bails out on anything
   without a hover-capable pointer) and anyone who switched the custom cursor
   off in the minigame settings. It also parked a stray dot in the top-left
   corner until the pointer first moved, because top/left are 0 until a
   transform is written. public/donate.css already did exactly this for its
   own red variant; this is the same idea for every other page. */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
  opacity: 0;
}

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  opacity: 0;
}

/* ─── NOISE + SCANLINE ─── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  /* The SVG carries stitchTiles='stitch', which exists only to make adjacent
     tiles of turbulence join seamlessly - but with no background-size it was
     never tiled. An SVG with a viewBox and no width/height has no intrinsic
     size, so the browser stretched it to the element, i.e. the viewport, and
     rasterised a 4-octave fractal at up to ~3.8 million pixels per page load
     instead of the 256x256 it was written for. Measured with
     `perf_probe.py ab`, which interleaves both variants in one session and
     alternates their order: the 95th-percentile scroll frame is better with
     tiling in 57 of 70 paired measurements (p < 0.0001). First paint, style
     recalculation and layout show no difference - an earlier two-run
     comparison appeared to show a large first-paint win, but that was the
     machine drifting between runs, not this rule. A pixel diff of the
     before/after screenshots never exceeds 3/255 on any channel. */
  background-size: 256px 256px;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.4;
}

.scanline {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.025) 2px,
    rgba(0, 0, 0, 0.025) 4px
  );
  pointer-events: none;
  z-index: 8999;
}

/* ─── BACKGROUND DECORATORS ───
   Only the grid is left. A second layer, .bg-glow, washed every page in
   three coloured radial gradients (cyan from the top, purple and pink from
   the corners); it went 2026-11 together with the glowing headlines and
   boxes. Light a thing because it means something (the live dot), not
   because it is there. The grid itself is drawn in the text colour, so it
   reads as paper texture, not as a tint of the accent. */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(var(--text-rgb), 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--text-rgb), 0.02) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(
    ellipse 70% 80% at 50% 40%,
    black 20%,
    transparent 90%
  );
}

/* ─── NAV ─── */
/* `body > nav`, not a bare `nav`: the footer's link group and the news
   pagination are <nav> landmarks too, and a type selector here would
   position-fix those as well. The site header is the only <nav> that is
   a direct child of <body> in every template. */
body > nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  /* Three columns rather than `justify-content: space-between`. With
     space-between the link group was merely *between* the logo and the
     account/donate cluster, and since those two are nowhere near the same
     width, that left the links sitting ~150px left of the actual page
     centre. `1fr auto 1fr` gives the outer columns equal width, so the
     middle one is genuinely centred in the viewport.

     Plain `1fr` (not `minmax(0, 1fr)`): 1fr floors at min-content, so if the
     right-hand cluster ever needs more room than its share, the column grows
     and the links drift off-centre instead of the two groups overlapping.
     Degrading to "slightly off-centre" beats degrading to "unreadable".

     column-gap is what keeps the two groups apart while that happens. Without
     it the grid columns simply touch: once the right-hand cluster needs more
     than its share, its column grows until it sits flush against the last
     centre link, and "MINI-GAME" ran straight into the CMS button. Measured
     logged in as admin, the gap was 0px from 881px all the way to ~1400px -
     the wider cluster (CMS button + username + logout + donate + status +
     language) pushed the problem far past the narrow-band media query below,
     which only compensates up to 1150px. A reserved gap fixes it at every
     width at once, and unlike a wider media-query band it also survives a
     long username, which changes the cluster's width at every breakpoint. It
     is a floor, not a fixed gap: past ~1450px the 1fr columns are wider than
     their contents and the groups drift further apart on their own.

     The gap is not free. It comes out of the left 1fr column - the only
     flexible one once the right cluster is at its min-content floor - so
     every px of separation costs exactly 1px of centring below ~1450px:
     measured, 2rem moved the link group from -142px to -174px at 881px and
     from -3px to -35px at 1400px. That is the same trade the paragraph above
     already makes, taken one step further. The second band at the bottom of
     this file buys most of it back for the one case that needs it. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  column-gap: 2rem;
  align-items: center;
  padding: 1.2rem 3rem;
  /* No backdrop-filter. A blur of the backdrop has to be recomputed for every
     frame in which the backdrop changes - which, for a fixed nav, is every
     frame of every scroll. Measured with `perf_probe.py ab` (both variants
     interleaved in one session, order alternated, 6x CPU throttle): the
     95th-percentile scroll frame is better without the blur in 58 of 70
     paired measurements (p < 0.0001). First paint and style recalculation
     show no difference either way - do not repeat the claim that this
     improved them, that came from comparing two separate runs on a machine
     that drifts between them.
     The background went 0.82 -> 0.95 to compensate: over a near-black page the
     only visible difference was a faint haze from the glow layer of the time
     that the blur used to pull through, and outside the nav strip the
     rendered pixels were identical (develop/scratch/nav-blur-comparison). */
  background: rgba(var(--bg-rgb), 0.95);
  border-bottom: 1px solid var(--border);
}

/* The hamburger is grid item 2 on mobile (where the links/right cluster are
   display:none), so it needs pushing to the far edge of its own column. */
body > nav > .nav-logo {
  justify-self: start;
}

body > nav > .nav-right {
  justify-self: end;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-decoration: none;
}

/* "Z" in the accent, "ORA" in the text colour. It was cyan with a glow and
   pink - two signal colours on four letters. */
.nav-logo span {
  color: var(--text);
}

/* Hidden by default (desktop) - only shown below the responsive breakpoint,
   see the @media block further down. */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: none;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Animates into an X when the menu is open. */
body > nav.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body > nav.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

body > nav.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-links a.active {
  color: var(--accent);
}

.nav-links a.active::after {
  transform: scaleX(1);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Same box as .nav-login-btn (font, letter-spacing, padding) so the donate,
   login/profile and CMS buttons line up at one height in the nav - it used
   to be a few pixels taller and wider than the buttons next to it. */
.nav-donate {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  background: transparent;
  border: 1px solid var(--accent2);
  color: var(--accent2);
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s;
  cursor: none;
}

.nav-donate svg {
  width: 0.8em;
  height: 0.8em;
  flex-shrink: 0;
}

/* Reusable inline heart icon - scales with whatever font-size its parent
   (h1, button, etc.) already has. Deliberately modest (well under the size
   of the text next to it) - this is a small accent on a button/heading,
   not the dominant visual. */
.heart-icon svg {
  width: 0.5em;
  height: 0.5em;
  vertical-align: -0.02em;
}

.nav-donate:hover {
  background: var(--accent2);
  color: #000;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--muted);
  border-radius: 50%;
  transition:
    background 0.4s,
    box-shadow 0.4s;
}

.nav-status.is-live {
  color: var(--positive);
}

.nav-status.is-live .status-dot {
  background: var(--positive);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(var(--positive-rgb), 0.5);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(var(--positive-rgb), 0);
  }
}

/* ─── LANGUAGE TOGGLE (pill switch with a sliding thumb) ─── */
/* The whole pill is a single link to the other locale - clicking anywhere
   on it (not just one specific label) flips the language, like a real
   toggle switch rather than two separate destination links. */
.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem;
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  transition: border-color 0.2s;
}

.lang-switch:hover {
  border-color: var(--accent);
}

.lang-switch-thumb {
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: calc(50% - 0.2rem);
  height: calc(100% - 0.4rem);
  background: var(--accent);
  border-radius: 999px;
  transition: transform 0.25s ease;
  z-index: 0;
}

.lang-switch-thumb.is-en {
  transform: translateX(100%);
}

.lang-option {
  position: relative;
  z-index: 1;
  display: inline-block;
  min-width: 1.6rem;
  padding: 0.3rem 0.55rem;
  text-align: center;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
  cursor: none;
}

.lang-option.active {
  color: #000;
}

.lang-switch-standalone {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2;
}

/* The account screens' <main> (base_auth.html). Their body centres its one
   child with flex; spanning the row and centring again keeps the box exactly
   where it sat before it had a <main> around it. */
.auth-main {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* ─── NAV: MOBILE COLLAPSE ───
   Below this width the full nav (logo + 6 links + login/donate/status/lang)
   doesn't fit on one line and was overflowing/wrapping badly. The breakpoint
   was 880px while there were 4 links; Ranked and Net Worth (2026-09) made the
   admin bar 67px wider than an 881px window (measured), and it only fit again
   from ~950px. 1024px leaves the admin bar ~75px to spare for a longer
   username. nav.js's matchMedia must stay one pixel above this. Collapses
   into a hamburger toggle; .nav-links/.nav-right get flex-basis:100% so
   they drop onto their own row when shown, but contribute nothing to
   layout while `display:none`, so the collapsed bar stays a clean single
   row of just the logo + toggle button. */
@media (max-width: 1024px) {
  body > nav {
    /* Back to flex below the breakpoint: the collapse works by giving
       .nav-links/.nav-right `flex-basis: 100%` so they drop onto their own
       row, which has no meaning in the three-column grid the desktop bar
       uses. The grid is a desktop-only centring device. */
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    /* The desktop grid's reserved column-gap would apply to this flex row too
       (logo/toggle, and the two stacked groups below them), where the spacing
       comes from the rules below instead. Cleared so the collapsed bar is
       exactly what it was before that gap existed. */
    column-gap: 0;
    padding: 1rem 1.5rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links,
  .nav-right {
    flex-basis: 100%;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
    margin-top: 1.2rem;
  }

  body > nav.nav-open .nav-links,
  body > nav.nav-open .nav-right {
    display: flex;
  }

  /* Opaque while open. The bar's 95% (see body > nav) is invisible over the
     page's dark background, but the open menu covers the hero, and its big
     bright lettering showed through between the menu links. */
  body > nav.nav-open {
    background: var(--bg);
  }

  .nav-right {
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
  }
}

/* ─── SITE FOOTER (shared across all main content pages) ─── */
footer {
  padding: 2.5rem 3rem;
  border-top: 1px solid var(--border);
}

.footer-top {
  /* Same three-column centring device as the header: the logo takes column
     one, the combined link group takes the centred middle column, and the
     third column is left empty on purpose - it is what makes the middle one
     land on the page centre rather than merely after the logo. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.2rem;
}

.footer-top > .footer-logo {
  justify-self: start;
}

/* Page links and social links read as one block, separated by a rule rather
   than by being flung to opposite ends of the row. */
.footer-nav-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.footer-nav-group .footer-social {
  padding-left: 1.5rem;
  border-left: 1px solid var(--border);
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-logo:hover {
  color: var(--accent);
}

.footer-links,
.footer-social {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a,
.footer-social a {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover,
.footer-social a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.footer-domain {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.footer-domain span {
  color: var(--accent);
}

.footer-legal {
  display: flex;
  align-items: center;
  /* The row now carries four items (privacy, imprint, cookie settings and the
     contact address). Without wrapping, the last one was squeezed and clipped
     at narrow widths - and an email address is the one item here that cannot
     be abbreviated without becoming useless. */
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* An address is a fixed string; uppercasing it makes it harder to read and
   to transcribe, and it is the one item in this row that people copy.

   inline-flex, not the default inline: `gap` only applies to flex and grid
   containers, so on an inline box it was silently ignored and the envelope
   icon sat flush against the first character of the address. */
.footer-mail {
  display: inline-flex;
  align-items: center;
  text-transform: none;
  letter-spacing: 0.04em;
  gap: 0.4rem;
}

.footer-legal a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-legal a:hover {
  color: var(--accent);
}

.footer-legal span {
  color: var(--border);
}

/* ─── NAV LOGIN BUTTON ─── */
.nav-login-btn {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  padding: 0.35rem 0.75rem;
  transition: background 0.2s, color 0.2s;
}

.nav-login-btn:hover {
  background: var(--accent);
  color: #000;
}

.nav-logout-form {
  display: inline-flex;
}

.nav-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: none;
  padding: 0;
  transition: border-color 0.2s, color 0.2s;
}

.nav-logout-btn svg {
  width: 0.85rem;
  height: 0.85rem;
}

.nav-logout-btn:hover {
  border-color: var(--accent2);
  color: var(--accent2);
}

/* ─── FLASH MESSAGES ─── */
.flash-banner {
  max-width: 900px;
  margin: 6.5rem auto 0;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-align: center;
}

.flash-success {
  color: var(--positive);
  background: rgba(var(--positive-rgb), 0.06);
  border: 1px solid rgba(var(--positive-rgb), 0.25);
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   OVERFLOW GUARDS, TOUCH TARGETS, FOCUS AND THE MOBILE PASS

   Everything below is cross-cutting: it applies to every page rather than
   to one template's components, which is why it lives here instead of in
   the per-page stylesheets.
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── HORIZONTAL OVERFLOW ───
   `overflow-x: hidden` on <body> alone (what was here before) hides the
   symptom but still lets the *document* be wider than the viewport, and it
   turns the body into a scroll container, which silently breaks
   `position: sticky` for any descendant. `clip` suppresses the scroll
   without creating that container, and setting it on <html> too means an
   element that escapes the body box cannot drag the page sideways either.

   These are a safety net, not the fix - the components that actually
   overflowed are corrected at their own rules (see index.css's .news-grid
   and .donate-big-btn). A guard that silently swallows a real layout bug is
   how the homepage ended up 348px wide inside a 320px viewport. */
html {
  overflow-x: clip;
}

body {
  overflow-x: clip;
  max-width: 100%;
}

/* Replaced media never overflows its column, whatever its intrinsic size. */
img,
svg,
video,
canvas,
iframe,
embed,
object {
  max-width: 100%;
}

/* A long unbroken token (a URL in the legal pages, a pasted article link, a
   30-character German compound) is otherwise unbreakable and pushes its
   whole column past the viewport edge. */
h1,
h2,
h3,
h4,
h5,
h6,
p,
li,
dd,
dt,
figcaption,
blockquote,
td,
th,
label,
summary {
  overflow-wrap: break-word;
}

/* ─── SKIP LINK ───
   First thing in the tab order on every page: keyboard and screen-reader
   users otherwise have to tab through the entire nav on every single page
   load before reaching the content. Visually hidden until focused. */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -100%;
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent);
  color: #000;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0.75rem;
}

/* ─── FOCUS VISIBILITY ───
   The site draws its own cursor and sets `cursor: none` nearly everywhere,
   so a keyboard user previously had no reliable indication of where they
   were. `:focus-visible` rather than `:focus` so a mouse click on a button
   does not leave a ring behind it. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Against the site's red and filled controls the accent ring is hard to
   separate from the control's own colour - flip it to a neutral there. */
.nav-donate:focus-visible,
.donate-big-btn:focus-visible,
.btn-donate-hero:focus-visible,
.btn-danger:focus-visible,
.kontakt-submit:focus-visible {
  outline-color: var(--text);
}

/* ─── TOUCH TARGETS ───
   WCAG 2.2 SC 2.5.8 puts the floor at 24x24 CSS px; 44px is the size a
   thumb actually hits. The footer/legal/auth links were 13-16px tall - the
   text itself was the entire hit area. Padding (rather than a min-height on
   an inline box, which does nothing) is what actually grows the target. */
@media (pointer: coarse) {
  .footer-links a,
  .footer-social a,
  .footer-legal a,
  .nav-links a,
  .back-link,
  .legal-back,
  .export-link,
  .consent-legal a,
  .news-pagination a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
  }

  /* The footer rows are laid out with `gap`, so vertical padding on the
     links doubles up against it - shrink the row gap to compensate and keep
     the visual rhythm the desktop layout has. */
  .footer-links,
  .footer-social {
    gap: 0 1.5rem;
  }

  /* Checkbox hit area. The visual box keeps its designed size; the
     surrounding label is what grows.

     :not(.consent-check input) matters: those checkboxes are deliberately
     collapsed to 1x1 and made transparent because .consent-check-box draws
     the visible control in their place. A blanket min-size here re-inflated
     them into invisible 20x20 hit areas floating over the banner. */
  input[type="checkbox"]:not(.consent-check input),
  input[type="radio"]:not(.consent-check input) {
    min-width: 24px;
    min-height: 24px;
  }

  .checkbox-row label,
  .consent-check {
    min-height: 44px;
  }

  /* A one-character label ("X") is a 7px-wide tap target however tall its
     row is - the height rule above did nothing for it. The label starts at
     the box's left edge: centred, every word shorter than 44px ("NEWS",
     "X") was pushed off the left edge its row shares with the logo above. */
  .footer-social a,
  .footer-links a,
  .footer-legal a {
    min-width: 44px;
    justify-content: flex-start;
  }
}

/* A contact address is something visitors act on, not just read, so it gets a
   real target on touch even though an inline link inside a paragraph is
   formally exempt from WCAG 2.5.8. */
.legal-address a {
  display: inline-block;
  padding-block: 0.5rem;
}

/* ─── SHARED ICON SIZING (partials/icons.html) ─── */
.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -0.125em;
}

/* Directional icons sitting next to a label read better slightly smaller
   than the text they annotate. */
.back-link .icon,
.legal-back .icon,
.export-link .icon,
.news-pagination .icon,
.notfound-link-arrow .icon,
.link-register-cta .icon {
  width: 0.9em;
  height: 0.9em;
}

/* Anchors that carry an icon plus a label need to be a flex row, otherwise
   the SVG sits on the text baseline and the two drift apart on wrap. */
.back-link,
.legal-back,
.export-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ─── FLASH MESSAGES ───
   `.flash-error` had no rule at all, so a failed action rendered as
   unstyled body text in the middle of the page - indistinguishable from
   ordinary copy and not obviously an error. */
.flash-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.flash-error {
  color: var(--accent2-text);
  background: rgba(var(--accent2-rgb), 0.07);
  border: 1px solid rgba(var(--accent2-rgb), 0.3);
}

/* ─── COOKIE CONSENT (partials/consent.html) ─── */
.consent-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 9500;
  display: flex;
  justify-content: center;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  /* No backdrop-filter here: the surface above is 97% opaque, so a blur of
     the backdrop contributes 3% of a pixel nobody can see - while costing a
     full-width blur pass on an element that also animates in (fadeUp). The
     nav at the top of this file is the one place the blur is actually
     visible, because its background is 0.82. */
  background: rgba(var(--bg-rgb), 0.97);
  border-top: 1px solid var(--accent);
  animation: fadeUp 0.35s ease both;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
}

.consent-banner[hidden] {
  display: none;
}

.consent-inner {
  width: 100%;
  max-width: 720px;
}

.consent-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.consent-text {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
}

.consent-options {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 0.5rem;
  margin: 1rem 0;
}

.consent-option {
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}

/* The native checkbox stays in the DOM - it is what the keyboard and screen
   readers actually operate - but is visually replaced by a box matching the
   site's angular, un-rounded language. Not `display:none`, which would drop
   it out of the tab order entirely. */
.consent-check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.consent-check-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 0.1rem;
  border: 1px solid var(--muted);
  color: transparent;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.consent-check input:checked + .consent-check-box {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.consent-check input:focus-visible + .consent-check-box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.consent-option.is-locked .consent-check {
  cursor: default;
}

.consent-option.is-locked .consent-check-box {
  background: var(--border);
  border-color: var(--border);
  color: var(--muted);
}

.consent-option-name {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}

.consent-option-desc {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Decline is a peer of accept: same size, same row, same hit area. A
   visually demoted "reject" is exactly what the GDPR guidance calls out,
   and the privacy policy promises parity in as many words. */
.consent-btn {
  flex: 1 1 auto;
  min-width: 8rem;
  min-height: 44px;
  padding: 0.7rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.consent-btn:hover {
  background: var(--accent);
  color: #000;
}

.consent-btn-primary {
  background: var(--accent);
  color: #000;
}

.consent-btn-primary:hover {
  filter: brightness(1.12);
}

.consent-btn-quiet {
  border-color: var(--border);
  color: var(--muted);
}

.consent-btn-quiet:hover {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

.consent-legal {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.consent-legal a {
  color: var(--muted);
  text-decoration: none;
}

.consent-legal a:hover {
  color: var(--accent);
}

.consent-legal span {
  color: var(--border);
}

/* ─── FOOTER: MOBILE ───
   The three footer groups sit `space-between` on desktop, which on a phone
   leaves a lone logo on one line and ragged, hard-to-scan link columns
   below it. Stacking them left-aligned reads as deliberate structure. */
@media (max-width: 700px) {
  footer {
    padding: 2rem 1.25rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  }

  /* Back to a single stacked column below the breakpoint. The desktop
     three-column grid has nothing to centre against on a phone - there is
     no room beside the links for the logo to sit - so the centring device
     is dropped rather than squeezed. */
  .footer-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .footer-nav-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  /* The vertical rule between the two groups only makes sense while they sit
     side by side. */
  .footer-nav-group .footer-social {
    padding-left: 0;
    border-left: none;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ─── NAV: MOBILE REFINEMENTS ───
   Extends the collapse block above. The open menu can be taller than a
   phone screen once the account/donate/language row is included, so it
   scrolls within itself rather than pushing the page. */
@media (max-width: 1024px) {
  body > nav {
    padding: 0.85rem 1.25rem;
  }

  .nav-logo {
    font-size: 1.7rem;
  }

  /* 44px square, so the hamburger is a real thumb target rather than a
     30px glyph. The bars themselves keep their designed width. */
  .nav-toggle {
    width: 44px;
    height: 44px;
    align-items: center;
    margin-right: -0.6rem;
  }

  .nav-toggle span {
    width: 26px;
  }

  body > nav.nav-open .nav-links,
  body > nav.nav-open .nav-right {
    max-height: min(60vh, 24rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .nav-links {
    gap: 0;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.85rem 0;
    font-size: 0.78rem;
  }

  /* The desktop underline animates across the link's own width; as a
     full-width block on mobile it would rule a line across the whole menu. */
  .nav-links a::after {
    display: none;
  }

  .nav-links a.active {
    padding-left: 0.7rem;
    border-left: 2px solid var(--accent);
  }

  .nav-right {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
  }

  .nav-login-btn,
  .nav-donate {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding-inline: 1rem;
  }

  .nav-logout-btn {
    width: 44px;
    height: 44px;
  }

  .nav-status {
    min-height: 44px;
  }
}

/* ─── TYPOGRAPHY: MOBILE ───
   The display face is set with wide tracking throughout, which is part of
   what pushed headings past the viewport edge. Tightening it below the
   phone breakpoint keeps the same look at a size that fits. */
@media (max-width: 600px) {
  .section-title,
  .legal-title,
  .news-title {
    letter-spacing: 0.02em;
  }
}

/* ─── REDUCED MOTION ───
   The site leans on entrance animations, a pulsing live dot and a lerped
   cursor ring. Honour the OS-level preference to switch them off. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ─── VISUALLY HIDDEN ───
   For labels that a screen reader needs but the visual design already
   conveys another way (the game's leaderboard filter, its search field, the
   tile-colour picker - each previously had a placeholder or an adjacent
   <span> but no actual <label>). Deliberately not `display:none` or
   `visibility:hidden`, both of which remove the element from the
   accessibility tree, which is the exact opposite of the intent. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ─── SUBMIT IN FLIGHT (static/js/base/form_guard.js) ───
   Replaces the old behaviour of overwriting the button's label with "…":
   the label stays readable and a spinner is added beside it, so the visitor
   can still see what they submitted while it is in flight. */
button.is-submitting {
  position: relative;
  opacity: 0.75;
  cursor: progress;
}

button.is-submitting::after {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-left: 0.55em;
  vertical-align: -0.1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: form-guard-spin 0.7s linear infinite;
}

@keyframes form-guard-spin {
  to {
    transform: rotate(360deg);
  }
}

/* prefers-reduced-motion is honoured by the global rule at the end of this
   file, which collapses the spin to a single frame - so the ring shows as a
   static indicator rather than a moving one. */

/* ─── NAV: THE NARROW DESKTOP BAND ───
   Between the mobile collapse (1024px) and 1365px the account/donate/
   status/language cluster is wider than its share of the three-column grid,
   so it pushes the centred link group off-centre. Nothing is removed here;
   the bar just spends less on padding and gaps at exactly the widths where
   it cannot afford them. Up to 1150px while the nav had 4 links; with 6
   (2026-09) the plain bar was -107px off-centre at 1151px and -42px at
   1280px. Measured with this band: -67px at 1025px, -4px at 1150px, centred
   from 1200px up, and still centred at 1366px where the band ends. */
@media (min-width: 1025px) and (max-width: 1365px) {
  body > nav {
    padding-inline: 1.5rem;
  }

  .nav-links {
    gap: 1.25rem;
  }

  .nav-right {
    gap: 0.75rem;
  }

  .nav-login-btn,
  .nav-donate {
    padding-inline: 0.55rem;
  }
}

/* ─── NAV: THE SAME BAND, EXTENDED FOR THE LOGGED-IN BAR ───
   The band above ends at 1365px because that is where the logged-out cluster
   stops needing help. The CMS button adds a whole extra button, so the
   logged-in bar is still oversized well past it: with the reserved column-gap
   the groups no longer touch, but the link group pays for that gap in
   centring. With 4 links this band ran 1151-1450px (-160px at 1151px without
   it, -39px with it). With 6 links (2026-09), measured: -186px at 1025px down
   to -24px at 1365px inside the band above, centred at 1450px, and without
   this block -114px at 1451px and -40px at 1600px; with it, centred to 1700px
   and from there on its own.

   Keyed on :has(.nav-cms-btn) rather than a role class on <body>, because
   what makes the cluster wide is the extra button itself - so if a role is
   ever added that also sees /cms, the compensation follows it without anyone
   remembering to update this. The logged-out bar never matches it, so it is
   the same with and without this block. A browser
   without :has() support simply ignores it and gets the behaviour above,
   which is already correct, just less well centred.

   The four values are deliberately the same as the band above; change both
   together. tests/test_references.py ties .nav-cms-btn here to nav.html so
   the class cannot be renamed or dropped as dead CSS without a failing test. */
@media (min-width: 1366px) and (max-width: 1700px) {
  body > nav:has(.nav-cms-btn) {
    padding-inline: 1.5rem;
  }

  body > nav:has(.nav-cms-btn) .nav-links {
    gap: 1.25rem;
  }

  body > nav:has(.nav-cms-btn) .nav-right {
    gap: 0.75rem;
  }

  body > nav:has(.nav-cms-btn) .nav-login-btn,
  body > nav:has(.nav-cms-btn) .nav-donate {
    padding-inline: 0.55rem;
  }
}

/* ─── PHONES: 12PX TEXT FLOOR ───
   Text under 12px counts as illegible on a phone - Lighthouse's rule, and
   the one a reader's eyes apply. The mono labels, tags, form labels and
   footer links ran 0.55-0.72rem (8.8-11.5px), which made 45-97% of the text
   on most pages too small on a phone (measured at 375px, 2026-10); the
   footer alone was 151 characters at 9.6px on every page. Lifted to
   0.75rem below 600px only - the desktop layout keeps its small caps. Every
   page stylesheet ends with the same block for its own rules (it has to come
   after them to win). */
@media (max-width: 600px) {
  .nav-donate,
  .nav-status,
  .lang-switch,
  .footer-links a,
  .footer-social a,
  .footer-domain,
  .footer-legal,
  .nav-login-btn,
  .flash-banner,
  .skip-link,
  .consent-option-name,
  .consent-option-desc,
  .consent-btn,
  .consent-legal {
    font-size: 0.75rem;
  }
}
