/* ══════════════════════════════════════════════════════════
   X-ARENA — the site and the panel. "Match-day programme".

   Dark rooms for the control surface, bone-white sections for the
   programme. One signal colour, Live, used only for what is live or needs
   you (and the primary action); Stream for broadcast and scrims.
   Anton for display, Inter for reading, JetBrains Mono for labels.
   Square corners, hairlines, segmented bars, big numerals. No gradients.

   Every colour below is a role, not a hue, and every text/ground pair the
   site uses keeps WCAG AA (scripts/test_identity.py computes them):
   Live text on Ink 5.9:1, Ink on Live buttons 5.9:1 (white would be 3.3),
   Stream as text uses --stream-text (7.8:1), text on Bone uses the deep
   variants (--live-deep 5.3:1, --bone-muted 6.1:1).
   ══════════════════════════════════════════════════════════ */

/* Inter, served from this site (SIL OFL, /static/fonts/OFL.txt). One
   variable file covers every weight; the extended-Latin file is only
   fetched by a page that has a character from it. */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
/* Anton: the display face (the style packs ship it). SIL OFL. */
@font-face {
  font-family: "Anton"; font-style: normal; font-weight: 400;
  font-display: swap;
  src: url("/static/packs/fonts/Anton.woff2") format("woff2");
}
/* JetBrains Mono: labels, eyebrows, numbers in tables. SIL OFL,
   /static/fonts/JetBrainsMono-OFL.txt. */
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800;
  font-display: swap;
  src: url("/static/fonts/jetbrains-mono.woff2") format("woff2");
}

:root {
  /* The identity */
  --ink:         #0B0B0D;   /* the page */
  --bone:        #E9E5DA;   /* text on ink; the programme sections */
  --live:        #FF4B1F;   /* live, needs you, the primary action */
  --stream:      #3F5BFF;   /* broadcast and scrims (fills, bars, tags) */

  /* Grounds and lines on ink */
  --panel:       #111114;
  --panel-2:     #18181C;
  --line:        #26262B;
  --line-2:      #36363C;

  /* Text on ink */
  --text:        var(--bone);
  --muted:       #9A968B;
  --dim:         #8A867D;
  --stream-text: #8C9CFF;   /* Stream as words */
  --on-live:     var(--ink);
  --on-stream:   #FFFFFF;

  /* On the bone sections */
  --bone-2:      #DDD8CA;
  --bone-line:   #C9C3B3;
  --bone-ink:    var(--ink);
  --bone-muted:  #57534A;
  --live-deep:   #A8320E;   /* Live as words on bone */
  --stream-deep: #2D3FD6;

  /* States */
  --ok:          #3DDC84;
  --warn:        #F5B83D;
  --bad:         #FF4D6A;

  /* A server's own colour on its public pages (applyBrand sets it); the
     panel and the site keep Live. */
  --accent:      var(--live);

  --display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* One gutter, read by the page container, the sticky header's inner row
     and the footer alike. */
  --gutter: 1.5rem;
  --shell: 1200px;

  /* Square corners, everywhere. The names stay so every rule that reads
     them keeps working; a pill (a toggle) is the one round thing. */
  --r-sm: 0;
  --r:    0;
  --r-lg: 0;
  --r-pill: 999px;

  --field-bg: var(--panel-2);
  --focus: 0 0 0 2px color-mix(in srgb, var(--live) 70%, transparent);
  --shadow-pop: 0 18px 40px -18px #000;
  --shadow-sheet: 0 24px 60px -24px #000;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--live); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Nothing on this site wants an image wider than its container. */
img { max-width: 100%; height: auto; }

/* `hidden` is only `display: none` from the browser's own stylesheet, so any
   author rule that sets `display` beats it. */
[hidden] { display: none !important; }

h1, h2, h3 { margin: 0 0 .5rem; }
/* Display headings: Anton, in capitals, set tight. */
h1 { font-family: var(--display); font-weight: 400; font-size: 3rem; line-height: .95;
     text-transform: uppercase; letter-spacing: .005em; }
h2 { font-size: 1.15rem; font-weight: 650; letter-spacing: -.01em; }
/* Labels: mono, spaced capitals. */
h3 { font-family: var(--mono); font-size: .74rem; color: var(--muted); font-weight: 600;
     text-transform: uppercase; letter-spacing: .14em; }

/* The old gradient headline word: now simply Live. */
.gradient-text { color: var(--live); }

/* ── layout ─────────────────────────────────────────────── */

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 1.25rem 0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

.brand-row {
  display: flex; align-items: center; gap: .6rem;
  padding: 0 1.25rem 1.1rem;
  border-bottom: 1px solid var(--line); margin-bottom: .9rem;
}
.brand-row img { width: 30px; height: 30px; object-fit: contain; }
.brand-row .name { font-weight: 700; letter-spacing: .12em; font-size: .85rem; }

.nav { display: flex; flex-direction: column; gap: 1px; padding: 0 .6rem; }
.nav button {
  all: unset; cursor: pointer;
  padding: .5rem .7rem .5rem .85rem; border-radius: 0;
  color: #C9C5BA; font-size: .95rem;
  display: flex; align-items: center; gap: .6rem;
  border-left: 3px solid transparent;
}
.nav button:hover { color: var(--text); background: var(--panel-2); }
.nav button[aria-current="true"] {
  color: var(--text); font-weight: 600; background: transparent;
  border-left-color: var(--live);
}

/* Centred in the space beside the sidebar, rather than hugging it with an
   empty band on the right of a wide screen. */
.main { padding: 1.75rem 2rem 4rem; width: 100%; max-width: 1180px;
        margin: 0 auto; min-width: 0; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem;
}
.page-head h1 { font-size: clamp(2.3rem, 5vw, 4rem); margin: 0; overflow-wrap: anywhere; }
.page-head p { margin: .4rem 0 0; color: var(--muted); font-size: .92rem; max-width: 44rem; }

/* ── cards and stats ────────────────────────────────────── */

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 0; padding: 1.15rem 1.25rem; margin-bottom: 1.1rem;
}
.card > h2 { margin-bottom: .9rem; }

.stats { display: grid; gap: .8rem; margin-bottom: 1.1rem;
         grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); }
.stat {
  background: transparent; border: 1px solid var(--line-2);
  border-radius: 0; padding: 1rem 1.1rem;
}
.stat .n { font-family: var(--display); font-size: 2.6rem; font-weight: 400; letter-spacing: 0;
           font-variant-numeric: tabular-nums; line-height: 1; }
.stat .n.word { font-size: 1.2rem; letter-spacing: -.01em; padding: .45rem 0 .25rem;
                overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat .k { font-family: var(--mono); font-size: .7rem; color: var(--muted);
           text-transform: uppercase; letter-spacing: .14em; margin-top: .45rem; }
.stat.accent .n { color: var(--live); }

/* ── tables ─────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead th {
  text-align: left; padding: .55rem .65rem;
  font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--text); }
thead th[aria-sort] { color: var(--live); }
tbody td { padding: .55rem .65rem; border-bottom: 1px solid var(--line); }
tbody tr:hover { background: var(--panel-2); }
tbody tr.clickable { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
/* The mockups' eyebrow: a short Live rule, then spaced mono capitals. */
.eyebrow { display: flex; align-items: center; gap: .7rem; margin: 0 0 1rem;
           font-family: var(--mono); font-size: .74rem; font-weight: 600; letter-spacing: .16em;
           text-transform: uppercase; color: var(--live); }
.eyebrow::before { content: ""; width: 2.6rem; height: 2px; background: var(--live); flex: none; }

/* ── pills ──────────────────────────────────────────────── */

.pill {
  display: inline-block; padding: .14rem .5rem; border-radius: 0;
  font-family: var(--mono); font-size: .68rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap;
}
.pill.ok   { color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.pill.bad  { color: var(--bad);  border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.pill.cyan, .pill.live { color: var(--live); border-color: color-mix(in srgb, var(--live) 60%, transparent); }
.pill.stream { color: var(--stream-text); border-color: color-mix(in srgb, var(--stream) 80%, transparent); }
.pill.solid { background: var(--live); color: var(--on-live); border-color: var(--live); }

/* ── controls ───────────────────────────────────────────── */

/* Every text-like input, not a list of three: a type this misses falls back
   to the browser's own white box, which on a dark panel is unmistakable —
   and is exactly what happened to the number fields on the edit form. */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select, textarea {
  background: var(--field-bg); border: 1px solid var(--line-2); color: var(--text);
  padding: .5rem .65rem; border-radius: var(--r); font: inherit; font-size: .9rem;
  min-width: 220px;
}
input::placeholder, textarea::placeholder { color: #75726B; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--live); box-shadow: var(--focus);
}
/* The spinner arrows are a light widget the theme cannot reach. */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none; margin: 0;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .6rem 1.05rem; border-radius: 0;
  border: 1px solid var(--line-2); background: transparent;
  color: var(--text); font: inherit; font-size: .9rem; font-weight: 650;
  cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--bone); background: var(--panel-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .nav button:focus-visible, .guild-card:focus-visible,
.drawer-toggle:focus-visible, .notice-close:focus-visible,
.settings-card > summary:focus-visible {
  outline: none; box-shadow: var(--focus);
}
.btn .icon { width: 15px; height: 15px; }
/* Live with Ink words: 5.9:1. White on Live would be 3.3:1. */
.btn.primary {
  background: var(--live); border-color: var(--live); color: var(--on-live);
}
.btn.primary:hover { background: #FF6A44; border-color: #FF6A44; }
.btn.ghost { background: transparent; }
/* A bone button: the second choice on a dark row ("Book a slot"). */
.btn.bone { background: var(--bone); border-color: var(--bone); color: var(--ink); }
.btn.bone:hover { background: #F4F1E8; }

/* ── server picker ──────────────────────────────────────── */

.guild-grid { display: grid; gap: .75rem; margin-bottom: 1.1rem;
              grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.guild-card {
  display: flex; align-items: center; gap: .8rem; text-align: left;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 4px; padding: .9rem 1rem; cursor: pointer;
  color: inherit; font: inherit; width: 100%;
}
.guild-card:hover { border-color: var(--line-2); background: var(--panel-2); }
.guild-card .icon {
  width: 38px; height: 38px; border-radius: 4px; flex: 0 0 auto;
  background: var(--panel-2); display: grid; place-items: center;
  font-weight: 700; color: var(--muted); overflow: hidden;
}
.guild-card .icon img { width: 100%; height: 100%; object-fit: cover; }
/* The lines have to stack. Without a direction these are inline spans, so
   the name runs straight into the subtitle — and the ellipsis on .gname
   does nothing either, because an inline element ignores overflow. It
   looked right only while every subtitle was short enough not to wrap; a
   team card's subtitle is a tournament and a server name. */
.guild-card .meta { min-width: 0; display: flex; flex-direction: column;
                    align-items: flex-start; gap: .2rem; }
.guild-card .gname { font-weight: 600; white-space: nowrap; max-width: 100%;
                     overflow: hidden; text-overflow: ellipsis; }
.guild-card .gsub { font-size: .78rem; color: var(--muted); max-width: 100%;
                    overflow-wrap: anywhere; }

/* ── states ─────────────────────────────────────────────── */

.empty { padding: 2.2rem 1rem; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); margin-bottom: .3rem; }
.error {
  border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent);
  background: color-mix(in srgb, var(--bad) 8%, transparent);
  color: var(--text); padding: .8rem 1rem; border-radius: 4px;
}
/* Loading: a quiet shimmer bar rather than a word. */
.skeleton { position: relative; color: transparent; height: 3.2rem; margin: 1rem 0;
            border-radius: var(--r); overflow: hidden;
            background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 40%,
                                        var(--panel) 80%) 0 0 / 220% 100%;
            animation: shimmer 1.3s linear infinite; user-select: none; }
@keyframes shimmer { to { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

.audit-row { display: flex; gap: .7rem; padding: .5rem 0;
             border-bottom: 1px solid var(--line); font-size: .86rem; }
.audit-row:last-child { border-bottom: none; }
.audit-row .when { color: var(--dim); font-family: var(--mono);
                   font-size: .76rem; flex: 0 0 128px; }
.audit-row .who { color: var(--muted); flex: 0 0 110px;
                  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── public page wrapper (events, server pages, profiles, results) ── */

.landing { max-width: 880px; margin: 0 auto;
           padding: 3rem var(--gutter) 0; }
.landing.wide { max-width: var(--shell); }
.icon { width: 20px; height: 20px; flex: 0 0 auto; }

/* ── content pages: docs, terms, privacy ────────────────── */

/* Long-form reading measure. `wide` is for the command reference, which is
   mostly tables and suffocates at prose width. */
.prose { max-width: 46rem; }
.prose.wide { max-width: 100%; }

.prose h1 { margin-top: 0; }
.prose h2 { font-size: 1.35rem; margin: 2.6rem 0 .7rem;
            padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: .95rem; color: var(--text); text-transform: none;
            letter-spacing: 0; margin: 1.7rem 0 .4rem; }
.prose h4 { font-size: .9rem; color: var(--muted); margin: 1.2rem 0 .3rem; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.15rem; margin: .6rem 0; }
.prose li { margin: .28rem 0; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2.2rem 0; }
.prose code { font-family: var(--mono); font-size: .85em;
              background: var(--panel-2); border: 1px solid var(--line);
              border-radius: var(--r); padding: .05em .35em; color: var(--text); }
.prose blockquote { margin: 1rem 0; padding: .1rem 0 .1rem 1rem;
                    border-left: 2px solid var(--line-2); color: var(--dim); }
.prose .lede { font-size: 1.05rem; max-width: 44rem; }
.prose table { margin: .4rem 0 1.2rem; }
.prose td { vertical-align: top; }

/* A table is the one thing allowed to scroll sideways; the page never does. */
.table-scroll { overflow-x: auto; margin: .6rem 0 1.2rem;
                border: 1px solid var(--line); border-radius: 4px; }
.table-scroll table { margin: 0; }
.table-scroll thead th { background: var(--panel);
                         position: sticky; top: 0; z-index: 1; }
.table-scroll td, .table-scroll th { padding: .5rem .75rem; }

.muted { color: var(--muted); }

.doc-toc { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.6rem 0 2.4rem; }
.doc-toc a {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--r); padding: .4rem .7rem;
  font-size: .85rem; color: var(--muted);
}
.doc-toc a:hover { border-color: var(--line-2); color: var(--text);
                   text-decoration: none; }
.doc-toc span { font-variant-numeric: tabular-nums; font-size: .75rem;
                color: var(--dim); }

.doc-section { scroll-margin-top: 1rem; }
.doc-table td:first-child { white-space: nowrap; }
.doc-table td:last-child { white-space: nowrap; width: 1%; }

.pill.tier-admin    { color: var(--live);
                      border-color: color-mix(in srgb, var(--live) 55%, transparent); }
.pill.tier-manager  { color: var(--warn);
                      border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.pill.tier-referee  { color: var(--stream-text);
                      border-color: color-mix(in srgb, var(--stream-text) 55%, transparent); }
.pill.tier-open     { color: var(--muted); }

/* ── responsive ─────────────────────────────────────────── */
/*
   Two bugs lived here, and both only appear at width.

   The grid: `.shell` is min-height 100vh with two rows, and a grid stretches
   its rows to fill. Collapsed to one column, the sidebar row got stretched to
   half the screen and the `margin-top:auto` on the user box pushed it into
   the middle of that void. `grid-template-rows: auto 1fr` pins the bar to its
   content and gives the rest to the page.

   The overflow: a grid or flex item's default `min-width` is `auto`, which is
   "as wide as my content". A wide table inside one therefore widens the
   column rather than scrolling inside it, and the whole page slides sideways.
   `min-width: 0` is what stops that, and it has to be on every ancestor
   between the table and the viewport.
*/

.shell, .main, .card, .stat, .page-head { min-width: 0; }
.shell > * { min-width: 0; }

.drawer-toggle, .topbar { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }

  /* A compact bar, not a squashed sidebar. */
  .topbar {
    display: flex; align-items: center; gap: .7rem;
    padding: .7rem 1rem; background: var(--panel);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 30;
  }
  .topbar img { width: 26px; height: 26px; object-fit: contain; }
  .topbar .where { font-weight: 600; font-size: .9rem; min-width: 0;
                   overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .drawer-toggle {
    display: grid; place-items: center; margin-left: auto;
    width: 34px; height: 34px; border-radius: var(--r); cursor: pointer;
    background: var(--panel-2); border: 1px solid var(--line-2);
    color: var(--text); padding: 0;
  }
  .drawer-toggle .icon { width: 18px; height: 18px; }

  /* The sidebar becomes the drawer. */
  .sidebar {
    position: fixed; inset: 0 0 0 auto; width: min(280px, 84vw);
    height: 100dvh; z-index: 40; border-left: 1px solid var(--line-2);
    border-right: none; transform: translateX(100%);
    transition: transform .18s ease-out;
  }
  .shell[data-drawer="open"] .sidebar { transform: translateX(0); }
  .shell[data-drawer="open"]::after {
    content: ""; position: fixed; inset: 0; z-index: 35;
    background: #000A; backdrop-filter: blur(1px);
  }
  .sidebar .brand-row { display: none; }
  .nav { padding: .8rem .6rem 0; }
  .nav button { padding: .7rem .8rem; font-size: .95rem; }

  .main { padding: 1.1rem 1rem 3rem; }
  .page-head h1 { font-size: 1.55rem; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr)); gap: .6rem; }
  .stat { padding: .7rem .8rem; }
  .stat .n { font-size: 1.45rem; }
  .card { padding: .9rem 1rem; }
  input:not([type="checkbox"]), select, textarea { min-width: 0; width: 100%; }

  /* Long cells stop forcing the table wider than the screen. */
  table { font-size: .84rem; }
  tbody td { padding: .5rem .55rem; }
  td.wrap { white-space: normal; }
  .audit-row { display: grid; gap: .15rem .6rem; padding: .6rem 0;
               grid-template-columns: 1fr auto; align-items: baseline; }
  .audit-row .when { grid-row: 1; grid-column: 1; flex: none; }
  .audit-row .who  { grid-row: 1; grid-column: 2; flex: none; max-width: none;
                     justify-self: end; }
  .audit-row > span:nth-child(3) { grid-row: 2; grid-column: 1; }
  .audit-row > span:last-child { grid-row: 2; grid-column: 2;
                                 margin-left: 0 !important; justify-self: end; }

  .landing { padding-top: 2rem; }
}

@media (max-width: 420px) {
  /* One value, and the header's inner row and the footer follow it. */
  :root { --gutter: 1rem; }
}

/* Respect a reader who has asked for less movement. */
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

/* ── sidebar footer and nav icons ───────────────────────── */

.sidebar-foot { margin-top: auto; padding: 1rem 1.25rem 0;
                border-top: 1px solid var(--line); }
.sidebar-foot #who { margin-bottom: .55rem; font-size: .8rem;
                     overflow: hidden; text-overflow: ellipsis;
                     white-space: nowrap; }
.btn.full { display: block; width: 100%; text-align: center;
            margin-bottom: .4rem; }

.nav button { display: flex; align-items: center; gap: .6rem; }
.nav button .icon { width: 16px; height: 16px; color: var(--dim); }
.nav button[aria-current="true"] .icon { color: var(--live); }
/* A player navigates by team name rather than by view, and a team
   name is whatever its captain typed. */
.nav button .nav-label { overflow: hidden; text-overflow: ellipsis;
                         white-space: nowrap; min-width: 0; }

/* A two-line cell: the value, and a quieter qualifier under it. */
td.sub span { display: block; }
td.sub small { display: block; font-size: .74rem; color: var(--dim);
               white-space: nowrap; }
td.sub span { white-space: nowrap; }
td.wrap { white-space: normal; min-width: 8rem; }

/* ── actions and results ────────────────────────────────── */

.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.head-actions .btn { display: inline-flex; align-items: center; gap: .4rem; }
.head-actions .btn .icon { width: 15px; height: 15px; }

.actions { display: flex; flex-direction: column; }
.action {
  display: grid; grid-template-columns: auto 1fr auto; gap: .9rem;
  align-items: center; padding: .95rem 0;
  border-bottom: 1px solid var(--line);
}
.action:last-child { border-bottom: none; padding-bottom: 0; }
.action:first-child { padding-top: 0; }
.action-icon { width: 18px; height: 18px; color: var(--muted); }
.action-copy { min-width: 0; }
.action-copy strong { display: block; font-size: .9rem; }
.action-copy p { margin: .15rem 0 0; color: var(--muted); font-size: .82rem; }
.action-controls { display: flex; gap: .5rem; align-items: center;
                   flex-wrap: wrap; justify-content: flex-end; }
.action-controls input[type="text"] { min-width: 0; width: 11rem; }

.btn.danger { border-color: color-mix(in srgb, var(--bad) 45%, transparent);
              color: var(--bad); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 12%, transparent);
                    border-color: var(--bad); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.compact, select.compact { padding: .3rem .55rem; font-size: .8rem;
                               min-width: 0; }

.row-actions { white-space: nowrap; width: 1%; }
.row-actions > * + * { margin-left: .35rem; }

/* One banner per view, under the header rather than at the top of the page,
   so a result appears where the reader already is. */
.notice { display: flex; gap: .7rem; align-items: flex-start;
          border: 1px solid var(--line-2); border-left-width: 2px;
          border-radius: 4px; padding: .75rem .9rem; margin-bottom: 1.1rem;
          background: var(--panel); font-size: .88rem; }
.notice .icon { margin-top: .1rem; }
.notice.ok   { border-left-color: var(--ok);   }
.notice.ok .icon   { color: var(--ok); }
.notice.warn { border-left-color: var(--warn); }
.notice.warn .icon { color: var(--warn); }
.notice.bad  { border-left-color: var(--bad);  }
.notice.bad .icon  { color: var(--bad); }
.notice-list { margin: .4rem 0 0; padding-left: 1.1rem; color: var(--muted);
               font-size: .84rem; }
.notice-list li { margin: .15rem 0; }

@media (max-width: 860px) {
  .action { grid-template-columns: auto 1fr; }
  .action-controls { grid-column: 1 / -1; justify-content: flex-start; }
  .action-controls input[type="text"] { width: 100%; }
  .row-actions > * + * { margin-left: 0; margin-top: .35rem; display: block; }
  /* A roster row has four controls; stacked one per line they made every
     filled slot four controls tall. Two by two keeps the row compact. */
  .roster-table td.row-actions { display: grid; grid-template-columns: auto auto;
                                 gap: .35rem; width: auto; }
  .roster-table td.row-actions > * { margin: 0; }
}

/* ── forms ──────────────────────────────────────────────── */

.form-grid { display: grid; gap: 1rem;
             grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field label { font-size: .82rem; font-weight: 600;
               display: flex; align-items: center; gap: .5rem; }
.field .req { font-size: .66rem; font-weight: 600; color: var(--dim);
              text-transform: uppercase; letter-spacing: .08em; }
.field small { color: var(--dim); font-size: .76rem; line-height: 1.45; }
.field input, .field textarea, .field select { width: 100%; min-width: 0; }
.field textarea { background: var(--ink); border: 1px solid var(--line-2);
                  color: var(--text); border-radius: var(--r); padding: .45rem .6rem;
                  font: inherit; font-size: .88rem; resize: vertical; }
.field textarea:focus { outline: none; border-color: var(--live); }
.field.checkbox { grid-column: 1 / -1; }
.field.checkbox label { font-weight: 600; cursor: pointer; }
.field.checkbox input { width: auto; }

.form-actions { display: flex; gap: .6rem; margin-top: 1.4rem;
                padding-top: 1.1rem; border-top: 1px solid var(--line); }

/* ── the live indicator ─────────────────────────────────── */
/*
   One dot, reporting whether the event stream is actually connected. Grey
   when it is not. It is a status, not a badge that says "online" whatever
   the truth is — the page behaves differently depending on it, so the
   reader needs to know which state they are in.
*/

.live-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto;
  background: var(--line-2);
  transition: background .2s ease;
}
.live-dot[data-state="live"] { background: var(--ok); }

.sidebar-foot .live-row {
  display: flex; align-items: center; gap: .5rem;
  font-size: .74rem; color: var(--dim); margin-bottom: .55rem;
}

@media (prefers-reduced-motion: reduce) {
  .live-dot { transition: none; }
}

/* A card whose heading shares its row with a control. */
.card-head { display: flex; align-items: center; gap: 1rem;
             flex-wrap: wrap; margin-bottom: .9rem; }
.card-head h2 { margin: 0; }
.card-head input[type="search"] { margin-left: auto; max-width: 22rem; }

@media (max-width: 860px) {
  .card-head input[type="search"] { margin-left: 0; max-width: none; }
}

/* ── standings bar ────────────────────────────────────────
   A div sized as a percentage of the leader's points. No library and no
   canvas: the ordering is already the row order, so this only has to show
   how far apart the rows are. */
.bar-col { width: 22%; min-width: 5rem; }
.bar { height: 6px; border-radius: var(--r); background: var(--line);
       overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--r); background: var(--live);
            min-width: 2px; }

/* Hidden on a phone rather than squeezed. It is the one column that carries
   no number of its own — the points beside it say everything the bar does,
   less precisely — so it is the right thing to drop first. */
@media (max-width: 720px) {
  .bar-col { display: none; }
}

/* ── group colour coding ──────────────────────────────────
   Derived from the group's own letter, so the standings and the teams table
   agree without having to share a list. Eight, then it wraps; a tournament
   with more than eight groups gets repeats, which is better than running
   out of legible colours. */
.group-tag { display: inline-block; padding: .1rem .45rem; border-radius: 0;
             font-family: var(--mono); font-size: .7rem; font-weight: 600; letter-spacing: .08em;
             text-transform: uppercase; border: 1px solid currentColor; }
.group-tag.g0 { color: var(--live); }
.group-tag.g1 { color: var(--stream-text); }
.group-tag.g2 { color: #F28FB0; }
.group-tag.g3 { color: var(--ok); }
.group-tag.g4 { color: var(--warn); }
.group-tag.g5 { color: var(--bone); }
.group-tag.g6 { color: #6FB4FF; }
.group-tag.g7 { color: #9FE8C7; }

/* ── team page ────────────────────────────────────────── */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
      gap: .8rem 1.6rem; }
.kv > div { display: flex; flex-direction: column; gap: .15rem;
            min-width: 0; }
.kv .k { color: var(--muted); font-size: .78rem; text-transform: uppercase;
         letter-spacing: .06em; }
.kv span:not(.k) { overflow-wrap: anywhere; }

/* A Discord id, shown because a browser cannot resolve it to a name and
   the id is what staff paste back into Discord to find the person. */
.mention { color: var(--muted); font-size: .84rem; }

.link { color: var(--live); text-decoration: none; }
.link:hover { text-decoration: underline; }

.card-note { color: var(--muted); font-size: .86rem; margin: -.3rem 0 .9rem;
             max-width: 62ch; }

/* A roster short of a full line-up. The count is the thing being looked
   for, so it is coloured rather than badged — a badge per row would be
   louder than the rows that matter. */
.warn-text { color: var(--warn); }

/* "Group A" was wrapping to two lines inside its own pill and making every
   row in the teams table twice as tall. */
.group-tag { white-space: nowrap; }

/* ── entering a score ─────────────────────────────────────
   A form, not a table row: four fields and a button, laid out so it stays
   one tap per field on a phone. This is used at 11pm between matches, which
   is the whole reason it exists on the web at all. */
.score-form { display: grid; gap: .8rem 1rem; align-items: end;
              grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr)); }
.score-form label, .review-entry label {
  display: flex; flex-direction: column; gap: .3rem;
  color: var(--muted); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .06em; min-width: 0; }
/* The :not() chain is not decoration — it matches the specificity of the
   base input rule below, which sets min-width: 220px. Without it that rule
   wins and three fields in a grid row push the page 83px wide at 390px. */
.score-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.score-form select,
.review-entry input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  width: 100%; padding: .5rem .6rem; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--panel-2);
  color: var(--text); font: inherit; font-size: .95rem;
  /* Right for a lone field in a form, wrong inside a grid that has already
     decided the width. */
  min-width: 0; }
/* A grid item's default min-width is auto, which refuses to shrink below its
   content for the same reason. Both halves are needed. */
.score-form > *, .review-entry > * { min-width: 0; }
.score-form input:focus, .score-form select:focus, .review-entry input:focus {
  outline: 2px solid var(--live); outline-offset: 1px; }
.score-submit { display: flex; align-items: end; }
.score-submit .btn { width: 100%; }

/* ── the match sheet ──────────────────────────────────────
   One match for a whole roster: a short header of match-level fields, then
   a row per player. A table rather than a stack of forms, because the thing
   being copied is a table on a result screen and reading across a row is
   the whole job. It scrolls inside its own wrapper at phone width rather
   than widening the page. */
.sheet { display: flex; flex-direction: column; gap: .9rem; }
.sheet-head { display: grid; gap: .7rem 1rem; align-items: end;
              grid-template-columns: repeat(auto-fit, minmax(min(8rem, 100%), 1fr)); }
.sheet-head label { display: flex; flex-direction: column; gap: .3rem;
                    color: var(--muted); font-size: .74rem;
                    text-transform: uppercase; letter-spacing: .06em;
                    min-width: 0; }
.sheet-head > * { min-width: 0; }
.sheet-table { min-width: 26rem; }
.sheet-table td.num { width: 6.5rem; }
/* Same specificity trick as .score-form above, and for the same reason:
   the base input rule sets min-width: 220px and four of those in a row
   would push the page sideways. */
.sheet-table input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.sheet-head input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.sheet-head select {
  width: 100%; padding: .4rem .5rem; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--panel-2);
  color: var(--text); font: inherit; font-size: .9rem;
  text-align: right; min-width: 0; }
/* Numbers in the table read right-aligned; a match number and a stage name
   in the header row do not. Same specificity as the rule above, or it
   loses. */
.sheet-head input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.sheet-head select { text-align: left; }
.sheet-table input:focus, .sheet-head input:focus, .sheet-head select:focus {
  outline: 2px solid var(--live); outline-offset: 1px; }

/* ── whole-lobby entry (scoring.js lobbyEntryCard) ────────
   A team row, and under it the team's players folded away. The team name
   column wraps; every number box is narrow. Two teams on one place turn
   red before anything is sent. */
.le-table { min-width: 0; width: 100%; }
.le-table td.num, .le-table th.num { width: 5.5rem; }
.le-table td.wrap { min-width: 8rem; }
.le-table tr.le-players > td { padding-top: 0; border-top: 0; }
.le-table details > summary { cursor: pointer; color: var(--muted); font-size: .8rem;
  padding: .2rem 0 .4rem; }
.le-table details[open] > summary { color: var(--text); }
.le-player-table { min-width: 0; margin: 0 0 .6rem; }
.le-player-table th.num, .le-player-table td.num { width: 4.5rem; }
.sheet-table input.le-lap { text-align: left; min-width: 6.5rem; }
.sheet-table input.clash { border-color: var(--bad); outline: 1px solid var(--bad); }
.sheet-table input:disabled { opacity: .75; cursor: not-allowed; }
.card-head .le-tabs, .card-head > .seg:last-child { margin-left: auto; }
.le-one .score-form { margin-top: .4rem; }
.le-status { display: flex; flex-direction: column; gap: .5rem; margin: .7rem 0 .2rem; }
.le-status .hold-banner { display: block; margin: 0; }
@media (max-width: 640px) {
  .le-table td.num, .le-table th.num { width: 4.2rem; }
  .le-table td.wrap { min-width: 6rem; }
}

/* ── the review queue, one at a time ──────────────────────
   Every submission used to be a card stacked below the last, so a busy
   tournament pushed scores, standings and teams several screens down behind
   a queue nobody had asked to see all of. */
.review-nav { display: flex; align-items: center; gap: .5rem;
              margin-left: auto; }
.review-count { font-size: .78rem; color: var(--dim);
                font-variant-numeric: tabular-nums; min-width: 4.5rem;
                text-align: center; }
.review-nav .btn[disabled] { opacity: .35; pointer-events: none; }
.review-one { touch-action: pan-y; }
.review-claim { margin-top: .9rem; padding-top: .8rem;
                border-top: 1px dashed var(--line); }
.review-claim .sub { display: block; margin-bottom: .5rem; }
.warn-note { color: var(--warn); margin-top: .7rem; }

/* ── "this changed while you were typing" ─────────────────
   Pinned rather than inline, because the whole point is not to move what
   somebody is filling in. */
.stale { position: fixed; z-index: 60; left: 50%; bottom: 1rem;
         transform: translateX(-50%); display: flex; align-items: center;
         gap: .7rem; padding: .6rem .8rem; max-width: calc(100% - 2rem);
         background: var(--panel-2); border: 1px solid var(--line-2);
         border-radius: var(--r); font-size: .84rem;
         box-shadow: 0 18px 40px -18px #000; }
body.has-stale .main { padding-bottom: 7rem; }
@media (max-width: 560px) {
  .stale { flex-wrap: wrap; justify-content: center; text-align: center;
           bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)); }
  body.has-stale .main { padding-bottom: 9rem; }
}

/* ── the team board ───────────────────────────────────────
   What survives being scrolled past. A DM reaches a phone and is buried;
   this is still here an hour later when somebody asks what was said. */
.board-write { display: flex; flex-direction: column; gap: .6rem;
               margin-bottom: 1.2rem; }
.board-write textarea {
  width: 100%; padding: .55rem .65rem; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--panel-2);
  color: var(--text); font: inherit; font-size: .92rem; resize: vertical;
  min-width: 0; }
.board-write textarea:focus { outline: 2px solid var(--live);
                              outline-offset: 1px; }
.board-write .review-actions { justify-content: flex-end; }
.board { display: flex; flex-direction: column; gap: .7rem; }
.board-post { padding: .7rem .85rem; border: 1px solid var(--line);
              border-radius: var(--r); background: var(--panel-2);
              border-left: 2px solid var(--line-2); }
/* A message from the organisers is the one people are looking for. */
.board-post.staff { border-left-color: var(--live);
                    background: color-mix(in srgb, var(--live) 5%,
                                          var(--panel-2)); }
.board-meta { display: flex; align-items: center; gap: .55rem;
              flex-wrap: wrap; margin-bottom: .35rem; font-size: .8rem; }
.board-post p { margin: 0; color: var(--muted); font-size: .9rem;
                white-space: pre-wrap; overflow-wrap: anywhere; }

/* ── the registration form ────────────────────────────────
   A roster is a table of four to seven rows, each a person and two
   identifiers, so it is laid out as one. The member picker's dropdown has
   to escape the table's overflow, which is why the wrapper's clipping is
   lifted for this one. */
.sheet-title { margin: 1.6rem 0 .4rem; font-size: 1rem; color: var(--text);
               text-transform: none; letter-spacing: -.01em; }
.roster-table { min-width: 34rem; }
.roster-table td { vertical-align: middle; }
/* A name is not a number. The .sheet-table rule above carries three
   :not() clauses, so a one-clause override here lost to it and every
   field on the registration form typed itself backwards out of the
   right-hand edge — team-mate, in-game name and UID alike. Matching
   the clause count matches the specificity, and this rule is later. */
.roster-table input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { text-align: left; }
.roster-table .picker { min-width: 11rem; }
/* A dropdown inside a scrolling table would be cut off by it. */
.table-wrap:has(.roster-table) { overflow: visible; }
@media (max-width: 720px) {
  .table-wrap:has(.roster-table) { overflow-x: auto; }
}

/* ── the player's own rows ────────────────────────────────
   Marked rather than moved. A standings table that reorders itself around
   whoever is reading it is one you cannot compare with anybody else's
   screenshot, which is exactly what teams do with standings. */
tr.is-you > td { background: color-mix(in srgb, var(--live) 7%, transparent); }
tr.is-you > td:first-child {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--live) 70%, transparent); }

/* A file input is the one control whose native rendering is worse than
   anything, and it is the one a player uses under time pressure. */
/* Every file input, not only the screenshot one: the scrim sheet, the
   tournament sheet, logos and scenes showed the browser's own white
   "Choose File" button on a dark panel. */
input[type="file"] {
  max-width: 100%; padding: .45rem; font-size: .82rem; color: var(--muted);
  border: 1px dashed var(--line-2); border-radius: var(--r);
  background: var(--panel-2); }
.sheet-head input[type="file"] { width: 100%; }
input[type="file"]::file-selector-button {
  margin-right: .6rem; padding: .25rem .6rem; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--panel);
  color: var(--text); font: inherit; font-size: .8rem; cursor: pointer; }

/* ── the typeahead picker ─────────────────────────────────
   A native <select> is fine for eight teams and unusable for three hundred.
   The list is absolutely positioned so opening it does not push the form
   around, and only the first forty matches are ever in the DOM. */
.picker { position: relative; min-width: 0; }
.picker-input { width: 100%; padding: .5rem .6rem; border-radius: var(--r);
                border: 1px solid var(--line-2); background: var(--panel-2);
                color: var(--text); font: inherit; font-size: .95rem;
                min-width: 0; }
.picker-input:focus { outline: 2px solid var(--live); outline-offset: 1px; }
.picker-list { position: absolute; z-index: 30; top: calc(100% + 4px);
               left: 0; right: 0; max-height: 15rem; overflow-y: auto;
               background: var(--panel-2); border: 1px solid var(--line-2);
               border-radius: var(--r);
               box-shadow: 0 18px 40px -18px #000; }
.picker-opt { display: flex; align-items: baseline; gap: .6rem;
              padding: .45rem .6rem; cursor: pointer; font-size: .9rem; }
.picker-opt small { color: var(--dim); font-size: .74rem;
                    margin-left: auto; white-space: nowrap; }
.picker-opt:hover, .picker-opt.active { background: var(--panel); }
.picker-opt[aria-selected="true"] { color: var(--live); }
.picker-none { padding: .45rem .6rem; color: var(--dim); font-size: .8rem; }

/* ── the review queue ─────────────────────────────────────
   Each submission is a block rather than a table row: approving needs three
   number inputs and a link to the screenshot beside them, which does not fit
   a table cell at 390px. */
.review-list { display: flex; flex-direction: column; gap: .9rem; }
.review-row { display: flex; flex-wrap: wrap; gap: 1rem;
              align-items: flex-end; justify-content: space-between;
              padding: .9rem; border: 1px solid var(--line);
              border-radius: var(--r-lg); background: var(--panel-2); }
.review-meta { display: flex; flex-direction: column; gap: .2rem;
               min-width: 12rem; flex: 1 1 14rem; }
.review-entry { display: grid; gap: .6rem .8rem; align-items: end;
                grid-template-columns: repeat(3, minmax(4.5rem, 6rem)) auto; }
.review-actions { display: flex; gap: .5rem; align-items: end; }

@media (max-width: 560px) {
  .review-entry { grid-template-columns: repeat(3, 1fr); }
  .review-actions { grid-column: 1 / -1; }
  .review-actions .btn { flex: 1; }
}

/* ── staff page ───────────────────────────────────────────
   One block per tournament that has its own staff. */
.staff-group + .staff-group { margin-top: 1rem; }
.staff-group h3 { font-size: .9rem; margin: 0 0 .4rem; color: var(--muted, inherit); }

/* ── brackets ─────────────────────────────────────────────
   Rounds side by side. The bracket scrolls inside its card on a phone,
   never the page. */
.bracket { display: grid; grid-auto-flow: column;
           grid-auto-columns: minmax(min(10.5rem, 100%), 1fr); gap: .9rem;
           overflow-x: auto; padding-bottom: .4rem; margin: .4rem 0 .9rem; }
.bracket-round { display: flex; flex-direction: column; gap: .6rem;
                 justify-content: space-around; }
.bracket-round-name { font-size: .72rem; letter-spacing: .06em;
                      text-transform: uppercase; color: var(--muted, inherit); }
.bracket-match { border: 1px solid var(--line-2); border-radius: var(--r);
                 overflow: hidden; background: var(--panel-2); }
.bracket-match.ready { border-color: color-mix(in srgb, var(--warn) 45%, var(--line-2)); }
.bracket-team { display: flex; justify-content: space-between; gap: .5rem;
                width: 100%; padding: .4rem .55rem; font: inherit;
                font-size: .84rem; color: inherit; background: none; border: 0;
                text-align: left; }
.bracket-team + .bracket-team { border-top: 1px solid var(--line); }
button.bracket-team { cursor: pointer; }
.bracket-undo { display: block; width: 100%; border-radius: 0; border-top: 1px solid var(--line);
                font-size: .74rem; }
button.bracket-team:hover, button.bracket-team:focus-visible {
  background: color-mix(in srgb, var(--ok) 12%, transparent); }
.bracket-team.won { font-weight: 600; color: var(--ok); }
.bracket-team.empty { color: var(--muted, inherit); font-style: italic; }
.bracket-champion { margin: .2rem 0 .6rem; }

/* ── the public results page ──────────────────────────── */
.public-main { max-width: 64rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.podium { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .45rem; }
.podium li { display: flex; align-items: baseline; gap: .7rem;
             padding: .55rem .7rem; border: 1px solid var(--line);
             border-radius: var(--r); background: var(--panel-2); }
.podium-place { min-width: 1.6rem; color: var(--muted); }
.podium-1 { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.podium-1 .podium-place { color: var(--warn); }
.award-rows { display: grid; gap: .3rem; margin-bottom: .5rem; }

/* ── referrals ────────────────────────────────────────── */
.referral-block + .referral-block { margin-top: 1.1rem; padding-top: 1rem;
                                    border-top: 1px solid var(--line); }
.referral-code { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.referral-code code { font-size: 1.05rem; letter-spacing: .04em;
                      padding: .3rem .55rem; border: 1px solid var(--line-2);
                      border-radius: var(--r); }
.progress-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.progress { flex: 1 1 10rem; height: .5rem; border-radius: 999px;
            background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--ok); }

/* The inlined icon sprite: definitions only, never drawn. A class rather
   than style="display:none", which the Content-Security-Policy forbids. */
svg.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── the site's dropdown (web/static/js/dropdown.js) ──────
   Replaces every native <select>, whose popup is drawn by the operating
   system and on Android looks nothing like the site. */
.dd { position: relative; display: inline-flex; min-width: 0; max-width: 100%; }
.field .dd, .form-grid .dd { display: flex; width: 100%; }
.dd-trigger { display: flex; align-items: center; justify-content: space-between;
              gap: .6rem; width: 100%; min-width: 0; padding: .5rem .65rem;
              font: inherit; font-size: .9rem; color: var(--text); text-align: left;
              background: var(--panel-2); border: 1px solid var(--line-2);
              border-radius: var(--r); cursor: pointer; }
.dd-trigger:hover { border-color: color-mix(in srgb, var(--live) 35%, var(--line-2)); }
.dd-trigger:focus-visible { outline: 2px solid var(--live); outline-offset: 1px; }
.dd-trigger:disabled { opacity: .55; cursor: default; }
.dd-trigger.placeholder .dd-text { color: var(--dim); }
.dd-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-caret { flex: none; width: 15px; height: 15px; fill: none; stroke: var(--muted);
            stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
            transition: transform .15s ease; }
.dd.open .dd-caret { transform: rotate(180deg); }
.dd.open .dd-trigger { border-color: var(--live); }
.dd.compact .dd-trigger { padding: .3rem .5rem; font-size: .8rem; gap: .4rem; }
.dd.compact .dd-caret { width: 13px; height: 13px; }

.dd-list { position: fixed; z-index: 80; overflow-y: auto; padding: .3rem;
           background: var(--panel-2); border: 1px solid var(--line-2);
           border-radius: var(--r-lg); box-shadow: 0 22px 50px -18px #000;
           overscroll-behavior: contain; }
.dd-opt { display: flex; align-items: baseline; gap: .6rem; padding: .5rem .6rem;
          border-radius: var(--r); font-size: .9rem; color: var(--text);
          cursor: pointer; user-select: none; }
.dd-opt small { margin-left: auto; color: var(--dim); font-size: .74rem;
                white-space: nowrap; }
.dd-opt.active { background: color-mix(in srgb, var(--live) 10%, var(--panel)); }
.dd-opt[aria-selected="true"] { color: var(--live); font-weight: 600; }
.dd-opt[aria-selected="true"]::after { content: ""; margin-left: auto; width: .4rem;
                                       height: .4rem; border-radius: 50%;
                                       background: var(--live); align-self: center; }
.dd-opt[aria-disabled="true"] { color: var(--dim); cursor: not-allowed; }

/* On a phone: a sheet from the bottom of the screen, drawn by the site. */
.dd-backdrop { display: none; }
.dd-backdrop.on { display: block; position: fixed; inset: 0; z-index: 79;
                  background: rgb(0 0 0 / .55); }
.dd-list.dd-sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto;
                 max-height: 70vh; padding: .5rem .5rem
                 calc(.75rem + env(safe-area-inset-bottom, 0px));
                 border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: 0; }
.dd-list.dd-sheet::before { content: ""; display: block; width: 2.5rem; height: 4px;
                         margin: .2rem auto .55rem; border-radius: 999px;
                         background: var(--line-2); }
.dd-list.dd-sheet .dd-opt { padding: .8rem .75rem; font-size: 1rem; }


/* ══════════════════════════════════════════════════════════
   Consistency pass (round 5)
   ══════════════════════════════════════════════════════════ */

/* Text that is secondary, wherever it sits. Used across the panel and
   styled only inside tables until now. */
.sub { color: var(--muted); font-size: .84rem; }

/* Checkboxes in the site's colours. The browser's own were a white box on
   a black page. */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 1.05rem; height: 1.05rem; margin: 0; vertical-align: -.18rem;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--field-bg); cursor: pointer; display: inline-grid;
  place-content: center;
}
input[type="checkbox"]::before {
  content: ""; width: .55rem; height: .32rem; margin-top: -.12rem;
  border-left: 2px solid #07070C; border-bottom: 2px solid #07070C;
  transform: rotate(-45deg) scale(0); transition: transform .1s ease-out;
}
input[type="checkbox"]:checked { background: var(--live); border-color: var(--live); }
input[type="checkbox"]:checked::before { transform: rotate(-45deg) scale(1); }
input[type="checkbox"]:focus-visible { outline: none; box-shadow: var(--focus); }
.field.checkbox label { display: flex; align-items: center; gap: .55rem; }

/* Every typed control in one style, whichever card it sits in. */
.score-form input, .score-form select, .sheet-table input, .sheet-head input,
.picker-input {
  background: var(--field-bg); border-radius: var(--r); font-size: .92rem;
}
.score-form input:focus, .sheet-table input:focus, .picker-input:focus {
  outline: none; border-color: var(--live); box-shadow: var(--focus);
}

/* The typeahead lists, in the dropdown's style. */
.picker-list { padding: .3rem; border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.picker-opt { border-radius: var(--r); padding: .5rem .6rem; }
.picker-opt:hover, .picker-opt.active {
  background: color-mix(in srgb, var(--live) 10%, var(--panel));
}

/* Radii and tags: the named set, not hand-written values. */
.card, .stat, .guild-card, .notice, .error, .table-scroll, .review-row {
  border-radius: var(--r-lg);
}
.group-tag, .progress { border-radius: var(--r-pill); }

/* Card headings: one size, one spacing, title and actions on one row. */
.card > h2, .card-head h2 { font-size: 1.05rem; }
.card-head { display: flex; align-items: center; justify-content: space-between;
             gap: .75rem; flex-wrap: wrap; margin-bottom: .9rem; }
.card-head h2 { margin: 0; }
.sheet-title { font-size: .95rem; margin: 1.2rem 0 .6rem; }
.staff-group h3 { color: var(--text); text-transform: none; letter-spacing: 0; }

/* A quiet heading above a group of cards on the tournament page. */
.section-label { margin: 1.6rem 0 .7rem; font-size: .72rem; color: var(--dim); }
.section-label:first-child { margin-top: 0; }

/* The folded settings section. */
.settings-card { padding: 0; }
.settings-card > summary {
  list-style: none; cursor: pointer; display: flex; align-items: baseline;
  gap: .75rem; flex-wrap: wrap; padding: 1rem 1.2rem; border-radius: var(--r-lg);
}
.settings-card > summary::-webkit-details-marker { display: none; }
.settings-card > summary::after {
  content: ""; margin-left: auto; align-self: center; width: .5rem; height: .5rem;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .15s ease;
}
.settings-card[open] > summary::after { transform: rotate(-135deg); }
.settings-card > summary:hover { background: var(--panel-2); }
.settings-title { font-weight: 650; font-size: 1.05rem; }
.settings-card > .actions { padding: 0 1.2rem 1rem; }

/* An empty roster slot reads as a gap to fill. */
tr.slot-empty td { background: color-mix(in srgb, var(--live) 3%, transparent); }
tr.slot-empty td:first-child { box-shadow: inset 2px 0 0 color-mix(in srgb, var(--live) 45%, transparent); }

/* Empty states: a small mark above the words. */
.empty:not(.bracket-team)::before {
  content: ""; display: block; width: 2.2rem; height: 2.2rem; margin: 0 auto .8rem;
  border-radius: 50%; border: 2px dashed var(--line-2);
}

/* Notices: the dismiss button. */
.notice { align-items: flex-start; }
.notice-body { flex: 1; min-width: 0; }
.notice-close {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px;
  margin: -.2rem -.3rem 0 .5rem; padding: 0; border: 0; border-radius: var(--r);
  background: transparent; color: var(--muted); cursor: pointer;
}
.notice-close:hover { background: var(--panel-2); color: var(--text); }
.notice-close .icon { width: 14px; height: 14px; }

/* The phone's top bar says in words whether the page is live. A dot with a
   title cannot be read on a touch screen. */
.live-pill { display: none; }
.drawer-close { display: none; }

@media (max-width: 860px) {
  .live-pill { display: inline-flex; align-items: center; gap: .35rem;
               font-size: .72rem; color: var(--muted); }
  .sidebar .brand-row { display: flex; border-bottom: 0; margin: 0;
                        padding: 0 .9rem .2rem; }
  .sidebar .brand-row img, .sidebar .brand-row .name { display: none; }
  .drawer-close {
    display: grid; place-items: center; margin-left: auto; width: 34px; height: 34px;
    padding: 0; border-radius: var(--r); background: var(--panel-2);
    border: 1px solid var(--line-2); color: var(--text); cursor: pointer;
  }
  .drawer-close .icon { width: 16px; height: 16px; }
}

/* Tables become stacked rows on a phone: each row a block, each cell a
   label and a value. Scrolling an eight-column table sideways with a thumb
   was the only way to read one. */
@media (max-width: 560px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody { display: block; }
  table.stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem .9rem;
                   padding: .75rem .1rem; border-bottom: 1px solid var(--line); }
  table.stack tbody td { display: block; padding: 0; border: 0; text-align: left;
                         min-width: 0; overflow-wrap: anywhere; }
  table.stack td[data-label]::before {
    content: attr(data-label); display: block; font-size: .66rem;
    text-transform: uppercase; letter-spacing: .09em; color: var(--dim);
  }
  table.stack td:first-child { grid-column: 1 / -1; font-size: .95rem; }
  table.stack td:first-child::before { display: none; }
  table.stack td.row-actions { grid-column: 1 / -1; display: flex; gap: .4rem;
                               flex-wrap: wrap; width: auto; }
  table.stack td.row-actions::before { display: none; }
  table.stack td.bar-col { display: none; }
  .table-wrap:has(table.stack) { overflow-x: visible; }
  /* An editable roster: each slot a block, its fields full width. Its
     desktop minimum widths would push a stacked table off the screen. */
  table.stack.sheet-table, table.stack.roster-table { min-width: 0; }
  .table-wrap:has(table.stack.roster-table) { overflow: visible; }
  table.stack.roster-table td .picker { min-width: 0; }
  table.stack.roster-table td.row-actions { display: flex; }
  table.stack.roster-table td input,
  table.stack.roster-table td .picker { width: 100%; min-width: 0; }
  table.stack.roster-table td.stack-l:has(input), table.stack.roster-table
    td.stack-r:has(input) { grid-column: 1 / -1; }
  table.stack.ranked tr { grid-template-columns: 1.6rem 1fr 1fr; }
  table.stack.ranked td:nth-child(1) { grid-column: 1; grid-row: 1; color: var(--dim);
                                       font-family: var(--mono); font-size: .85rem;
                                       align-self: center; }
  table.stack.ranked td:nth-child(2) { grid-column: 2 / -1; grid-row: 1;
                                       font-weight: 600; font-size: .95rem; }
  table.stack.ranked td:nth-child(2)::before { display: none; }
  table.stack.ranked td.stack-l { grid-column: 2; }
  table.stack.ranked td.stack-r { grid-column: 3; }

  /* A row of controls wraps into full-width ones instead of squeezing:
     dropdowns share the width, buttons keep their words on one line. */
  .review-actions, .action-controls { flex-wrap: wrap; }
  .review-actions > .dd, .action-controls > .dd { flex: 1 1 9rem; }
  .review-actions > .btn, .action-controls > .btn { white-space: nowrap; }
}

/* ── the shared header and footer, and the sign-in page ─────
   One header and footer for every public page (web/routes/layout.py). An
   anchor target lands below the sticky header, not under it. */
[id] { scroll-margin-top: 5rem; }
.anchor { display: block; height: 0; }
.signin-notice { margin: 1.1rem 0 .4rem; padding: .85rem 1rem;
                 border: 1px solid var(--line-2); border-left: 3px solid var(--warn);
                 border-radius: var(--r); background: var(--panel);
                 color: var(--muted); font-size: .92rem; }
.signin-notice strong { color: var(--text); margin-right: .3rem; }
.signin-grid { display: grid; gap: 1rem; margin: 1.8rem 0 .6rem;
               grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); }
.signin-card { border: 1px solid var(--line); border-radius: var(--r-lg);
               background: var(--panel); padding: 1.2rem 1.25rem 1.3rem;
               display: flex; flex-direction: column; gap: .55rem; }
.signin-card.primary { border-color: var(--line-2);
                       background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.prose .signin-card h2 { margin: 0; padding: 0; border: 0; font-size: 1.02rem; }
.signin-card p { margin: 0; font-size: .92rem; }
.signin-card .sub { font-size: .82rem; color: var(--dim); }
.signin-card .btn { align-self: flex-start; margin-top: .4rem; }

/* ── the status page ────────────────────────────────────────
   A tinted bar and a list. No pulsing dots: a status page that animates
   is announcing itself, and this one only has to be read. */
.status-board { margin: 1.8rem 0 1.4rem; }
.status-banner { --tone: var(--ok);
                 display: flex; flex-wrap: wrap; align-items: baseline;
                 justify-content: space-between; gap: .4rem 1.2rem;
                 padding: 1rem 1.15rem; border-radius: var(--r-lg);
                 border: 1px solid color-mix(in srgb, var(--tone) 35%, var(--line));
                 background: color-mix(in srgb, var(--tone) 9%, var(--panel)); }
.status-banner strong { color: var(--text); font-size: 1.05rem; font-weight: 650; }
.status-banner span { color: var(--muted); font-size: .84rem; }
.status-banner code { font-family: var(--mono); font-size: .9em; color: var(--text); }
.status-list { list-style: none; margin: 1rem 0 0; padding: 0;
               border: 1px solid var(--line); border-radius: var(--r-lg);
               background: var(--panel); }
.prose .status-list { padding: 0; }
.prose .status-list li { margin: 0; }
.status-row { --tone: var(--ok);
              display: grid; align-items: center; gap: .3rem 1.2rem;
              grid-template-columns: minmax(10rem, 13rem) 1fr auto;
              padding: .95rem 1.15rem; }
.status-row + .status-row { border-top: 1px solid var(--line); }
.status-name { display: flex; align-items: center; gap: .65rem; }
.status-name strong { font-size: .93rem; }
.status-mark { width: .6rem; height: .6rem; border-radius: 2px; flex: none;
               background: var(--tone); }
.status-row p { margin: 0; font-size: .88rem; color: var(--muted); }
.status-side { display: flex; align-items: center; gap: .8rem;
               justify-content: flex-end; white-space: nowrap; }
.status-metric { font-family: var(--mono); font-size: .8rem; color: var(--dim); }
.status-state { font-size: .78rem; font-weight: 600; color: var(--tone);
                min-width: 5.6rem; text-align: right; }
[data-state="degraded"] { --tone: var(--warn); }
[data-state="down"] { --tone: var(--bad); }
[data-state="off"] { --tone: var(--dim); }
.status-foot { font-size: .86rem; }
@media (max-width: 640px) {
  .status-row { grid-template-columns: 1fr auto; }
  .status-row p { grid-column: 1 / -1; grid-row: 2; padding-left: 1.25rem; }
  .status-state { min-width: 0; }
}

.btn .icon { width: 18px; height: 18px; margin-right: .5rem; }

/* ── the public results page, in the site's chrome ─────────── */
.public-head .eyebrow { margin-bottom: .5rem; }
.public-meta { display: flex; flex-wrap: wrap; align-items: center;
               gap: .4rem .8rem; margin-top: .7rem; }
.public-main td.rank { width: 2rem; color: var(--dim); }
.public-main td.rank.first { color: var(--warn); }
.public-main td.sub strong { display: block; color: var(--text); }
.public-promo-wrap { max-width: 64rem; margin: 0 auto; padding: 0 1rem; }
.public-promo { display: flex; align-items: center; gap: 1rem;
                padding: 1rem 1.15rem; border: 1px solid var(--line);
                border-radius: var(--r-lg); background: var(--panel); }
.public-promo p { margin: 0; font-size: .88rem; color: var(--muted); flex: 1; }
.public-promo strong { color: var(--text); }
.public-promo .btn { flex: none; }
.public-main { padding-bottom: 2rem; }
@media (max-width: 560px) {
  .public-main th.opt, .public-main td.opt { display: none; }
  .public-promo { flex-wrap: wrap; }
  .public-promo .btn { flex: 1 1 100%; justify-content: center; }
}
/* ══════════════════════════════════════════════════════════
   Round 6 fixes
   ══════════════════════════════════════════════════════════ */
/* A finger on the list scrolls it; the browser must not treat the gesture
   as anything else. */
.dd-list { touch-action: pan-y; -webkit-overflow-scrolling: touch; }

/* With no server open there is nothing to be live for. A class that sets
   display would otherwise beat the hidden attribute. */
.live-pill[hidden], .live-row[hidden] { display: none !important; }

/* .card-note pulls itself up under a card heading; under a referral code
   that negative margin put the line inside the code's box. */
.referral-code { margin: .35rem 0 0; }
.referral-block .card-note { margin: .6rem 0 .5rem; }
.referral-block h3 { margin: 0 0 .5rem; }
.referral-block + .referral-block { margin-top: 1.4rem; padding-top: 1.2rem; }

/* ── scoring: the editor, the rule card, the format block ─────
   The editor follows the panel's control system: same fields, same
   radius, a dense grid for the placement table. */
.format-scoring { margin-top: 1.4rem; padding-top: 1.1rem;
                  border-top: 1px solid var(--line); }
.format-scoring .section-label { margin-top: 0; }
.mode-hint { min-height: 2.6em; }
.rule-editor-host:not(:empty) { margin-top: 1rem; }
.rule-editor { display: grid; gap: 1rem; padding: 1rem;
               border: 1px solid var(--line); border-radius: var(--r-lg);
               background: var(--panel-2); }
.rule-section h4 { margin: 0 0 .5rem; font-size: .72rem; letter-spacing: .1em;
                   text-transform: uppercase; color: var(--dim); font-weight: 600; }
.rule-section .sub { margin: 0 0 .5rem; font-size: .82rem; }
.rule-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; }
.rule-row > label { display: flex; flex-direction: column; gap: .3rem;
                    font-size: .8rem; color: var(--muted); min-width: 9rem;
                    flex: 1 1 9rem; }
.rule-row > label small { color: var(--dim); font-size: .74rem; }
.placement-grid { display: grid; gap: .45rem;
                  grid-template-columns: repeat(auto-fill, minmax(min(4.4rem, 100%), 1fr)); }
.placement-grid .place { display: flex; flex-direction: column; gap: .2rem;
                         font-size: .7rem; color: var(--dim); }
.placement-grid input { padding: .35rem .45rem; text-align: right;
                        font-variant-numeric: tabular-nums; }
.extra-stats { display: grid; gap: .5rem; }
.extra-stat { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.extra-stat input[type="text"] { flex: 1 1 8rem; }
.extra-stat input[type="number"] { width: 5.5rem; }
.extra-stat .sub { margin: 0; }
.extra-stats > .btn { justify-self: start; }
.tiebreak-list { margin: 0 0 .5rem; padding: 0; list-style: none;
                 counter-reset: tb; display: grid; gap: .35rem; }
.tiebreak-list li { counter-increment: tb; display: flex; align-items: center;
                    gap: .6rem; padding: .4rem .55rem; border: 1px solid var(--line);
                    border-radius: var(--r); background: var(--panel); font-size: .86rem; }
.tiebreak-list li::before { content: counter(tb); font-family: var(--mono);
                            color: var(--dim); min-width: 1rem; }
.tiebreak-actions { margin-left: auto; display: flex; gap: .3rem; }
.tiebreak-actions .btn[disabled] { opacity: .35; pointer-events: none; }
.checkline { display: flex; align-items: center; gap: .5rem; font-size: .86rem;
             color: var(--muted); margin-top: .6rem; }
.rule-example { margin: 0; padding: .6rem .75rem; border-radius: var(--r);
                border-left: 2px solid var(--live); background: var(--panel);
                font-size: .88rem; color: var(--text); }
.rule-summary { display: grid; gap: .6rem; }
.rule-facts { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.placement-strip { display: flex; flex-wrap: wrap; gap: .3rem; }
.placement-strip span { display: flex; flex-direction: column; align-items: center;
                        min-width: 2.4rem; padding: .25rem .3rem;
                        border: 1px solid var(--line); border-radius: var(--r);
                        font-variant-numeric: tabular-nums; font-size: .86rem; }
.placement-strip small { font-size: .62rem; color: var(--dim); }
.score-form.format-head_to_head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) {
  .rule-editor { padding: .75rem; }
  .tiebreak-list li { flex-wrap: wrap; }
  .tiebreak-actions { margin-left: 0; width: 100%; }
  .score-form.format-head_to_head { grid-template-columns: 1fr; }
}
/* The base input rule sets a 220px minimum, which suits a form field and
   breaks a sixteen-cell points table. */
.rule-editor input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  min-width: 0; width: 100%; }
.rule-editor .extra-stat input[type="number"]:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  width: 5.5rem; }
.rule-editor .extra-stat input[type="text"] { width: auto; }
.rule-row { align-items: flex-start; }
.format-scoring .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  min-width: 0; width: 100%; }

/* ── scrims ──────────────────────────────────────────────── */
.scrim-grid { display: grid; gap: 1rem;
              grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); }
.scrim-card { display: flex; flex-direction: column; gap: .35rem; text-align: left;
              font: inherit; color: inherit; cursor: pointer; margin: 0; }
.scrim-card:hover, .scrim-card:focus-visible { border-color: var(--line-2);
                                               background: var(--panel-2); }
.scrim-card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.scrim-card .sub { font-size: .82rem; }
.scrim-next { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
              margin-top: .5rem; padding-top: .55rem; border-top: 1px solid var(--line);
              font-size: .84rem; }
.scrim-booking { display: flex; align-items: center; justify-content: space-between;
                 gap: .8rem; flex-wrap: wrap; padding: .65rem 0; }
.scrim-booking + .scrim-booking { border-top: 1px solid var(--line); }
.scrim-booking > div:first-child { display: flex; flex-direction: column; gap: .15rem; }
.scrim-booking .sub { font-size: .82rem; }
.room-form { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.room-form .section-label { margin-top: 0; }
.room-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  min-width: 0; flex: 1 1 10rem; }
.seg { display: inline-flex; gap: .3rem; flex-wrap: wrap; }
.card-head .seg { margin-left: auto; }
.sheet-table input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  min-width: 0; width: 6rem; }
.scrim-booking > div:first-child { min-width: 0; flex: 1 1 14rem; }
.scrim-booking strong, .scrim-booking .sub { overflow-wrap: anywhere; }
/* .row-actions is sized for a table cell (width: 1%); in a flex row that
   squeezed the Book button out past the card. */
.scrim-booking .row-actions { width: auto; flex: 0 0 auto; margin-left: auto; }
@media (max-width: 560px) {
  .sheet-table input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
    width: 3.6rem; padding-inline: .4rem; }
  table.stack .row-actions { width: auto; white-space: normal; }
}

/* ══════════════════════════════════════════════════════════
   Round 7: the command centre
   ══════════════════════════════════════════════════════════ */
:root { --viz-1: var(--live); --viz-2: var(--bone); --viz-3: var(--stream); }
.nav button[aria-current="true"] .icon { color: var(--accent); }

/* Right now: attention cards, the urgent ones first. */
.home-now { margin-bottom: 1.1rem; }
.now-grid { display: grid; gap: .8rem;
            grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr)); }
.now-card { --tone: var(--line-2);
            display: flex; flex-direction: column; gap: .35rem; padding: .9rem 1rem;
            border: 1px solid var(--line); border-left: 3px solid var(--tone);
            border-radius: var(--r-lg); background: var(--panel); }
.now-card.tone-urgent { --tone: var(--bad); }
.now-card.tone-live { --tone: var(--ok); }
.now-card.tone-open { --tone: var(--warn); }
.now-card.tone-warn { --tone: var(--warn); }
.now-card.tone-calm { --tone: var(--accent); }
.now-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.now-top .icon { color: var(--tone); }
.now-value { font-size: 1.55rem; font-weight: 650; letter-spacing: -.02em;
             font-variant-numeric: tabular-nums; }
.now-label { color: var(--muted); font-size: .86rem; }
.now-card .btn { align-self: flex-start; margin-top: .2rem; }
.now-card.quiet { grid-column: 1 / -1; }

/* Two columns on a wide screen: the work, then what is coming. */
.home-cols { display: grid; gap: 1.1rem; align-items: start;
             grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.home-main, .home-side { display: grid; gap: 1.1rem; min-width: 0; }
.home-cols .card { margin: 0; }
.home-activity { margin-top: 1.1rem; }
@media (max-width: 1100px) { .home-cols { grid-template-columns: 1fr; } }

/* A tournament's life as a stepper, and its one next step. */
.track-list { display: grid; gap: .8rem; }
.track { padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--r-lg);
         background: var(--panel-2); display: grid; gap: .7rem; }
.track-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.track-name { font: inherit; font-weight: 650; color: var(--text); background: none;
              border: 0; padding: 0; cursor: pointer; text-align: left; }
.track-name:hover, .track-name:focus-visible { color: var(--accent); }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: 0;
           overflow-x: auto; }
.step { flex: 1 1 0; min-width: 5.5rem; position: relative; display: flex;
        flex-direction: column; align-items: flex-start; gap: .35rem; padding-right: .4rem;
        font-size: .76rem; color: var(--dim); }
.step::before { content: ""; position: absolute; top: 5px; left: 12px; right: 0;
                height: 2px; background: var(--line-2); }
.step:last-child::before { display: none; }
.step .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2);
             background: var(--panel-2); position: relative; z-index: 1; }
.step.done { color: var(--muted); }
.step.done .dot { background: var(--accent); border-color: var(--accent); }
.step.done::before { background: color-mix(in srgb, var(--accent) 55%, var(--line-2)); }
.step.current { color: var(--text); font-weight: 600; }
.step.current .dot { border-color: var(--accent);
                     box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.next { display: flex; align-items: center; justify-content: space-between; gap: .8rem;
        padding: .6rem .75rem; border-radius: var(--r); background: var(--panel);
        border: 1px solid var(--line); }
.next > div { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.next strong { font-size: .9rem; }
.next .sub { font-size: .8rem; }
.next.tone-urgent { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.next.tone-open { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }

/* The next seven days. */
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-day { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
          color: var(--dim); margin: .9rem 0 .35rem; }
.tl-day:first-child { margin-top: 0; }
.tl-item { display: grid; grid-template-columns: 3.2rem 1fr; gap: .6rem;
           padding: .45rem 0 .45rem .65rem; border-left: 2px solid var(--line-2); }
.tl-item.kind-scrim { border-left-color: var(--viz-2); }
.tl-item.kind-room { border-left-color: var(--viz-1); }
.tl-item.kind-deadline { border-left-color: var(--warn); }
.tl-item time { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.tl-item > div { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.tl-title { font: inherit; font-size: .88rem; color: var(--text); background: none; border: 0;
            padding: 0; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
button.tl-title:hover, button.tl-title:focus-visible { color: var(--accent); }
.tl-item .sub { font-size: .78rem; }

/* Server health. */
.health-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.health-list li { --tone: var(--warn); display: flex; flex-direction: column; gap: .2rem;
                  padding: .6rem .75rem; border-radius: var(--r); background: var(--panel-2);
                  border-left: 3px solid var(--tone); }
.health-list li.tone-bad { --tone: var(--bad); }
.health-list .fix { font-size: .8rem; color: var(--text); }

/* Charts. One series each: one hue, no legend, a tooltip, a table. */
.viz-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); }
.viz-card { display: grid; gap: .4rem; min-width: 0; }
.viz-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.viz-head h3 { margin: 0; font-size: .86rem; color: var(--text); text-transform: none;
               letter-spacing: 0; }
.viz-total { font-size: .76rem; color: var(--dim); }
.viz-frame { position: relative; }
.viz { width: 100%; height: auto; display: block; }
.viz-axis { stroke: var(--line-2); stroke-width: 1; }
.viz-gridline { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.viz-tick { fill: var(--dim); font-size: 9.5px; font-family: var(--mono); }
.viz-hit { fill: transparent; }
.viz-fill.viz-1 { fill: var(--viz-1); }
.viz-fill.viz-2 { fill: var(--viz-2); }
.viz-fill.viz-3 { fill: var(--viz-3); }
.viz-bar:hover .viz-hit, .viz-bar:focus .viz-hit { fill: color-mix(in srgb, var(--text) 6%, transparent); }
.viz-bar:focus { outline: none; }
.viz-tip { position: absolute; top: -.3rem; transform: translate(-50%, -100%);
           padding: .3rem .5rem; border-radius: var(--r); font-size: .76rem;
           background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text);
           white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-pop); }
.viz-table summary { font-size: .76rem; color: var(--dim); cursor: pointer; }
.viz-table table { font-size: .8rem; }
.seg .btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

/* ── the frame: server switcher, palette, groups, crumbs, toasts ── */
.server-current { display: flex; align-items: center; gap: .6rem; margin: .4rem .9rem .3rem; min-width: 0; }
.server-current[hidden], .switch-server[hidden], .palette-open[hidden] { display: none; }
.server-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
               font-weight: 600; font-size: .95rem; }
.server-icon { width: 26px; height: 26px; flex: none; border-radius: 7px; overflow: hidden;
               display: grid; place-items: center; font-size: .75rem; font-weight: 700;
               background: color-mix(in srgb, var(--accent) 22%, var(--panel)); color: var(--text); }
.server-icon img { width: 26px; height: 26px; display: block; }
.switch-server { width: calc(100% - 1.4rem); margin: .1rem .7rem .5rem; justify-content: center; }
.guild-card.current { border-color: var(--accent); }
.guild-card .gpills { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .2rem; }
.palette-open { display: flex; align-items: center; gap: .5rem; width: calc(100% - 1.4rem);
                margin: 0 .7rem .6rem; padding: .45rem .6rem; font: inherit; font-size: .84rem;
                color: var(--dim); background: transparent; border: 1px solid var(--line);
                border-radius: var(--r); cursor: pointer; }
.palette-open:hover, .palette-open:focus-visible { color: var(--muted); border-color: var(--line-2); }
.palette-open span { flex: 1; text-align: left; }
.palette-open kbd, .palette-foot span { font-family: var(--mono); font-size: .7rem; }
.palette-open kbd { padding: .05rem .35rem; border: 1px solid var(--line-2); border-radius: 4px;
                    color: var(--muted); }
.nav-group { padding: .9rem .9rem .3rem; font-size: .66rem; letter-spacing: .14em;
             text-transform: uppercase; color: var(--dim); }
.nav-group:first-child { padding-top: .3rem; }
.nav-group[hidden] { display: none; }

.palette-backdrop { position: fixed; inset: 0; z-index: 90; background: rgb(0 0 0 / .55);
                    display: flex; justify-content: center; align-items: flex-start;
                    padding: 12vh 1rem 1rem; }
.palette { width: min(36rem, 100%); background: var(--panel); border: 1px solid var(--line-2);
           border-radius: var(--r-lg); box-shadow: var(--shadow-sheet); overflow: hidden; }
.palette .palette-input:not([type="checkbox"]) { width: 100%; min-width: 0; border: 0;
           border-bottom: 1px solid var(--line); border-radius: 0; padding: .9rem 1rem;
           font-size: 1rem; background: var(--panel); box-shadow: none; }
.palette-list { max-height: 50vh; overflow-y: auto; padding: .35rem; }
.palette-item { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
                padding: .55rem .7rem; border-radius: var(--r); cursor: pointer; }
.palette-item small { color: var(--dim); font-size: .76rem; white-space: nowrap; }
.palette-item.active { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.palette-none { padding: .9rem; color: var(--dim); font-size: .88rem; }
.palette-foot { display: flex; gap: 1rem; padding: .5rem 1rem; border-top: 1px solid var(--line);
                color: var(--dim); }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: 0 0 .5rem;
          font-size: .8rem; }
.crumb { font: inherit; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; }
.crumb:hover, .crumb:focus-visible { color: var(--accent); }
.crumb.current { color: var(--dim); }
.crumb-sep { color: var(--line-2); }

.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 95; display: grid; gap: .5rem;
          max-width: min(24rem, calc(100vw - 2rem)); }
.toast { padding: .65rem .9rem; border-radius: var(--r); background: var(--panel-2);
         border: 1px solid var(--line-2); border-left: 3px solid var(--ok); font-size: .86rem;
         box-shadow: var(--shadow-pop); transition: opacity .3s ease, transform .3s ease; }
.toast.bad { border-left-color: var(--bad); }
.toast.leaving { opacity: 0; transform: translateY(6px); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
@media (max-width: 560px) {
  /* Two to a row on a phone, so the attention cards do not push the page
     a screen down. */
  .now-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .now-card { padding: .75rem .8rem; }
  .now-value { font-size: 1.3rem; }
  .now-label { font-size: .8rem; }
}

/* ── the demo ─────────────────────────────────────────────── */
/* One slim line across the top of the demo panel: what this is, and the way
   to the real thing. It sits in the page flow, so nothing is covered. */
.demo-bar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .5rem 1rem; background: var(--panel-2); border-bottom: 1px solid var(--line-2);
  font-size: .85rem; color: var(--muted); }
.demo-bar > span:nth-child(2) { flex: 1 1 18rem; }
.demo-tag { font: 600 .7rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); background: var(--live); border-radius: 4px; padding: .3rem .45rem; }
.demo-bar .btn { white-space: nowrap; }
body:has(.demo-bar) .shell { min-height: calc(100vh - 2.6rem); }
@media (max-width: 760px) {
  .demo-bar { gap: .5rem; padding: .45rem .75rem; font-size: .8rem; }
  .demo-bar > span:nth-child(2) { flex-basis: calc(100% - 4rem); }
}

/* In the homepage's frame there is no live connection to report on. */
[data-frame] .live-pill, [data-frame] .live-row { display: none !important; }

/* ── the public results page's head ───────────────────────── */
.public-hero { position: relative; overflow: hidden; margin-bottom: 1.2rem;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.public-hero::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--accent); }
.public-banner { height: 150px; background-size: cover; background-position: center;
  border-bottom: 1px solid var(--line); }
.public-hero-body { padding: 1.4rem 1.4rem 1.2rem; display: grid; gap: .9rem; }
.public-hero h1 { margin: 0; font-size: clamp(2.4rem, 7vw, 4.6rem); line-height: .9; overflow-wrap: anywhere; }
.public-hero .eyebrow { margin: 0; }
.public-hero .public-meta { gap: .6rem; color: var(--muted); font-size: .88rem; }
.public-hero .pill .live-dot { margin-right: .35rem; }
.public-hero .stepper { margin-top: .2rem; }
.public-stats { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(min(9.5rem, 100%), 1fr)); }
.public-stat { background: var(--panel-2); padding: .7rem .85rem; display: grid; gap: .15rem;
  min-width: 0; }
.public-stat .k { font-family: var(--mono); font-size: .64rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .14em; color: var(--dim); }
.public-stat strong { font-family: var(--display); font-weight: 400; font-size: 1.7rem; line-height: 1.05;
  text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.public-stat .sub { font-size: .78rem; color: var(--muted); }
.public-main td.pts { position: relative; }
.public-main .pts-bar { display: block; width: 4.5rem; height: 2px; margin: .3rem 0 0 auto;
  background: var(--line-2); overflow: hidden; }
.public-main .pts-fill { display: block; height: 100%; margin-left: auto; border-radius: 2px;
  background: var(--accent); }
.public-main tr.top-1 td.rank { color: var(--warn); }
.public-main tr.top-2 td.rank, .public-main tr.top-3 td.rank { color: var(--text); }
@media (max-width: 560px) {
  .public-hero-body { padding: 1.1rem 1rem 1rem; }
  .public-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ── the command reference's filter ─────────────────────────── */
.doc-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .8rem;
  margin: 2rem 0 1rem; position: sticky; top: 0; z-index: 5; padding: .7rem 0;
  background: var(--ink); border-bottom: 1px solid var(--line); }
.doc-filter input[type="search"] { flex: 1 1 16rem; max-width: 24rem; }
.doc-filter .seg .btn[aria-pressed="true"] { border-color: var(--live); color: var(--live); }
.doc-count { margin: 0; font-size: .82rem; }
.doc-none { margin: 1.5rem 0; }
.doc-buttons { list-style: none; margin: .45rem 0 0; padding: 0; display: flex; flex-wrap: wrap;
  gap: .35rem .8rem; font-size: .8rem; color: var(--muted); }
.doc-buttons .pill { font-size: .66rem; }

/* ── the broadcast control room ─────────────────────────────── */
.bc-list { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)); }
.bc-pick { display: grid; gap: .35rem; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.bc-pick:hover, .bc-pick:focus-visible { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); }
.bc-pick.is-done { opacity: .7; }
.bc-pick-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.bc-overlays { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); }
.bc-overlay { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel-2);
  overflow: hidden; display: grid; }
.bc-overlay.is-selected { border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); }
/* A checkerboard behind each preview, as OBS shows transparency. */
.bc-preview { position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background-color: #2A2F3D;
  background-image: linear-gradient(45deg, #353B4B 25%, transparent 25%),
    linear-gradient(-45deg, #353B4B 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #353B4B 75%),
    linear-gradient(-45deg, transparent 75%, #353B4B 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.bc-preview iframe { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px;
  border: 0; transform-origin: 0 0; pointer-events: none; background: transparent; }
.bc-overlay-body { padding: .7rem .8rem .8rem; display: grid; gap: .45rem; }
.bc-overlay-body .sub { margin: 0; font-size: .8rem; }
.bc-overlay-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.bc-overlay-head .btn[aria-pressed="true"] { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.bc-overlay-head .btn[aria-pressed="false"] { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.bc-url { display: flex; gap: .4rem; min-width: 0; }
.bc-url input { flex: 1; min-width: 0; font-family: var(--mono); font-size: .74rem; }
.bc-cols { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.bc-col { display: grid; gap: 1rem; }
.bc-col > .card { margin: 0; }
.bc-scene { margin: 1rem 0; }
.bc-big { font-size: 1.5rem; font-weight: 700; margin: .2rem 0; }
.bc-thirds { list-style: none; margin: 0 0 .8rem; padding: 0; display: grid; gap: .4rem; }
.bc-thirds li { display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); }
.bc-thirds li.on-air { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.bc-num { width: 1.4rem; height: 1.4rem; display: grid; place-items: center; border-radius: 4px;
  border: 1px solid var(--line-2); font-size: .75rem; color: var(--muted); flex: 0 0 auto; }
.bc-third-text { flex: 1; min-width: 0; display: grid; }
.bc-third-text strong, .bc-third-text .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-add { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.bc-add > .dd { flex: 0 1 9rem; min-width: 0; }
.bc-add > input { flex: 1 1 9rem; min-width: 0; width: auto; }
.bc-add > button { flex: 0 0 auto; }
.bc-maps { margin: .6rem 0; }
.bc-casters { list-style: none; margin: 0 0 .7rem; padding: 0; display: grid; gap: .35rem; }
.bc-casters li { display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .4rem .6rem; border: 1px solid var(--line); border-radius: var(--r); }
.bc-keys { margin-top: 1rem; }
@media (max-width: 900px) {
  .bc-cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .bc-add > input { flex-basis: 100%; }
  .bc-thirds li { flex-wrap: wrap; }
}
.bc-col textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.bc-scene ~ .card .control-row input[type="url"] { flex: 1 1 18rem; min-width: 0; }
.bc-url .btn { white-space: nowrap; }
/* A team's logo, on its page. */
.logo-card { display: flex; gap: 1rem; align-items: center; }
.logo-preview { width: 64px; height: 64px; flex: 0 0 auto; border-radius: 10px; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center;
  font-weight: 800; color: var(--muted); }
.logo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-body { display: grid; gap: .35rem; min-width: 0; }
.logo-body input[type="file"] { max-width: 100%; font-size: .82rem; color: var(--muted); }
@media (max-width: 560px) { .logo-card { align-items: flex-start; } }
/* The public page: Watch live, and logos beside team names. */
.public-hero .watch-live { justify-self: start; gap: .5rem; }
.public-main .team-cell { display: flex; align-items: center; gap: .6rem; }
.public-main .team-cell > span { display: grid; min-width: 0; }
.public-main .team-logo { width: 24px; height: 24px; border-radius: 5px; object-fit: cover;
  flex: 0 0 auto; background: var(--panel-2); }
.tl-item.kind-stream { border-left-color: var(--ok); }

/* ── Promote: graphics, promotion, announce, players ───────── */
.gfx-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr)); }
.gfx-card { display: grid; gap: .7rem; margin: 0; }
.gfx-frame { background: var(--ink); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; display: grid; place-items: center; }
.gfx-img { display: block; width: 100%; height: auto; }
.gfx-img.size-feed { aspect-ratio: 1080 / 1350; }
.gfx-img.size-wide { aspect-ratio: 16 / 9; }
.gfx-body { display: grid; gap: .45rem; }
.gfx-body .sub { font-size: .82rem; }
.promo-detail td { background: var(--panel-2); }
.sponsor-list { list-style: none; margin: 0 0 .8rem; padding: 0; display: grid; gap: .4rem; }
.sponsor-list li { display: flex; align-items: center; gap: .7rem; padding: .5rem .6rem;
  border: 1px solid var(--line); border-radius: var(--r); }
.sponsor-list li > div { flex: 1; min-width: 0; display: grid; }
.sponsor-list img { border-radius: 5px; object-fit: cover; }
.sponsor-add { display: grid; gap: .45rem; grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr));
  align-items: center; }
.sponsor-add input[type="file"] { font-size: .8rem; color: var(--muted); max-width: 100%; }
.embed-preview { display: grid; gap: .4rem; }
.embed-ping { color: #C9CDFB; background: rgba(88, 101, 242, .3); border-radius: 3px;
  padding: 0 .2rem; justify-self: start; font-size: .9rem; }
.embed-box { border-left: 4px solid var(--accent); background: #2B2D31; border-radius: 4px;
  padding: .7rem .9rem; color: #DBDEE1; display: grid; gap: .4rem; }
.embed-title { font-weight: 700; color: #F2F3F5; }
.embed-body p { margin: 0 0 .25rem; white-space: pre-wrap; }
.embed-image { width: 100%; max-width: 22rem; border-radius: 4px; margin-top: .3rem; }
.linkish { background: none; border: 0; padding: 0; color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; text-align: left; }
.linkish:hover, .linkish:focus-visible { color: var(--accent); text-decoration: underline; }
.career-card .stats { margin: .4rem 0; }

/* ── discovery: the directory, server pages, careers, widgets ── */
.dir-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: 1rem 0; }
.dir-filter select { max-width: 14rem; }
.dir-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); }
.dir-card { display: grid; gap: .45rem; margin: 0; align-content: start; }
.dir-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.dir-facts { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .85rem; color: var(--text); }
.server-title { display: flex; align-items: center; gap: .9rem; }
.server-title img { border-radius: 14px; }
.server-title h1 { margin: 0; }
.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.event-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .4rem .9rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel-2); }
.event-list li > div { display: grid; min-width: 0; }
.sponsor-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem 1.4rem;
  align-items: center; }
.sponsor-row li { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.sponsor-row li.tier-title { font-size: 1.1rem; }
.sponsor-row img { border-radius: 6px; object-fit: cover; }
.sponsor-row a { color: var(--text); }
.public-main .podium .pill { margin-left: auto; }
/* The widget: plain, compact, at home in someone else's page. */
.embed-body-page { background: var(--ink); margin: 0; }
.embed-main { padding: .9rem 1rem; max-width: 46rem; }
.embed-main h1 { font-size: 1.15rem; margin: 0 0 .7rem; }
.embed-main table { width: 100%; }
.embed-big { font-size: 1.3rem; font-weight: 700; margin: .2rem 0; }
.embed-schedule { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.embed-schedule li { display: flex; gap: .8rem; }
.embed-schedule time { font-family: var(--mono); color: var(--muted); min-width: 9.5rem; }
.embed-foot { margin-top: .9rem; font-size: .78rem; color: var(--dim); }
.embed-foot a { color: var(--muted); }
.promo-name strong, .promo-name small { display: block; }
.promo-name small { color: var(--muted); }
.sponsor-add > * { min-width: 0; width: 100%; box-sizing: border-box; }
.form-grid input, .form-grid textarea { min-width: 0; max-width: 100%; box-sizing: border-box; }
/* A page block never grows past the page to fit a wide table: the table
   scrolls inside its own box instead. */
.main > * { min-width: 0; }
@media (max-width: 560px) { .sponsor-add { grid-template-columns: minmax(0, 1fr); } }

/* ── fixtures ─────────────────────────────────────────────── */
.fx-round { margin-top: 1rem; }
.fx-list { display: grid; gap: .4rem; }
.fx-row { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2);
  padding: .55rem .7rem; display: grid; gap: .4rem; min-width: 0; }
.fx-row.status-done { opacity: .85; }
.fx-main { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) auto auto; gap: .4rem .8rem;
  align-items: center; }
.fx-time { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.fx-teams { display: flex; align-items: center; gap: .6rem; min-width: 0; flex-wrap: wrap; }
.fx-teams span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-teams .won { font-weight: 700; color: var(--text); }
.fx-score { color: var(--muted); min-width: 2.6rem; text-align: center; }
.fx-meta, .fx-actions { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.fx-actions { justify-content: flex-end; }
.fx-maps { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .78rem; color: var(--muted); }
.fx-maps .a, .fx-maps .b { color: var(--text); }
.fx-form { border-top: 1px solid var(--line); padding-top: .6rem; display: grid; gap: .5rem; }
/* The base input rule's min-width: 220px pushed a phone sideways here. */
.fx-map-row input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.fx-player-table input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { min-width: 0; width: 100%; }
.fx-players > summary { cursor: pointer; color: var(--muted); font-size: .8rem; padding: .1rem 0 .3rem; }
.fx-players[open] > summary { color: var(--text); }
.fx-player-table { min-width: 0; width: 100%; margin-bottom: .4rem; }
.fx-player-table th.num, .fx-player-table td.num { width: 4.2rem; }
.fx-map-row { display: grid; grid-template-columns: 6rem minmax(0, 1fr) 5rem 5rem; gap: .4rem; align-items: center; }
.fx-schedule { margin: .4rem 0 .6rem; }
.fx-schedule summary { cursor: pointer; color: var(--accent); font-size: .88rem; }
.veto-steps { margin: 0; padding-left: 1.2rem; display: grid; gap: .15rem; font-size: .88rem; }
.tpl-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr)); }
.tpl-grid .card { margin: 0; }
.bracket-options { flex-wrap: wrap; }
.inline-check { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted); }
@media (max-width: 760px) {
  .fx-main { grid-template-columns: minmax(0, 1fr); }
  .fx-time { grid-column: 1 / -1; }
  .fx-meta { grid-column: 1 / -1; }
  .fx-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .fx-map-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ── Fair play ──────────────────────────────────────────── */
.fp-tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin: 0 0 1rem; border-bottom: 1px solid var(--line); }
.fp-tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted);
  padding: .55rem .8rem; font: inherit; font-size: .9rem; cursor: pointer; display: inline-flex;
  align-items: center; gap: .4rem; margin-bottom: -1px; }
.fp-tab:hover { color: var(--text); }
.fp-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.fp-count { font-size: .72rem; min-width: 1.3rem; padding: .05rem .35rem; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line); text-align: center; }
.fp-list { display: grid; gap: .6rem; }
.fp-dispute, .fp-request { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2);
  padding: .8rem .9rem; display: grid; gap: .45rem; min-width: 0; }
.fp-dispute-head { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; align-items: baseline; }
.fp-pills { display: flex; gap: .35rem; flex-wrap: wrap; }
.fp-claim { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fp-evidence { margin: 0; padding-left: 1.1rem; font-size: .85rem; overflow-wrap: break-word; word-break: break-word; }
.fp-responses { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; font-size: .9rem; }
.fp-responses p { margin: .1rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fp-decision { border-left: 3px solid var(--accent); padding: .2rem 0 .2rem .7rem; }
.fp-decision p { margin: .2rem 0 0; white-space: pre-wrap; }
.fp-handle summary, .fp-raise summary, .fp-own summary, .fp-accepts summary { cursor: pointer; color: var(--accent);
  font-size: .9rem; }
.fp-handle-grid { display: grid; gap: .5rem; margin-top: .6rem; }
.fp-inline { display: flex; gap: .5rem; align-items: flex-start; flex-wrap: wrap; }
.fp-inline > input, .fp-inline > textarea, .fp-inline > .picker { flex: 1 1 14rem; min-width: 0; }
.fp-flags { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.fp-flag { display: flex; gap: .5rem; align-items: baseline; font-size: .9rem; }
.fp-rules { border: 1px solid var(--line); border-radius: var(--r); padding: .2rem 1rem; margin-top: .6rem;
  max-height: 28rem; overflow: auto; }
.fp-rules:empty { display: none; }
.fp-rules-input { width: 100%; font-family: var(--mono); font-size: .85rem; }
.fp-rules-edit { display: grid; gap: .5rem; }
.fp-team-rules p { margin: 0 0 .4rem; }
.fp-accepts ul { margin: .5rem 0 0; padding-left: 1.1rem; display: grid; gap: .3rem; }
.fp-raise { margin-top: .6rem; }
.fp-raise .form-grid { margin-top: .6rem; }
@media (max-width: 760px) {
  .fp-tab { padding: .5rem .55rem; font-size: .85rem; }
}
.field-note { font-size: .78rem; color: var(--muted); margin: .2rem 0 0; }
.fp-rules h1 { font-size: 1.15rem; margin: .8rem 0 .4rem; }
.fp-rules h2 { font-size: 1rem; margin: 1rem 0 .3rem; }
.fp-rules ul { padding-left: 1.2rem; }
.table-notes { list-style: none; margin: .6rem 0 0; padding: .5rem 0 0; border-top: 1px solid var(--line);
  font-size: .8rem; color: var(--muted); display: grid; gap: .2rem; }
.public-rules { margin-top: .8rem; }
details > summary h2 { display: inline; }

/* ── Payments ───────────────────────────────────────────── */
.pay-hook { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .4rem 0; min-width: 0; }
.pay-hook code { overflow-wrap: anywhere; font-size: .82rem; padding: .25rem .45rem; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--panel-2); min-width: 0; }
.pay-steps { margin: .4rem 0 .8rem; padding-left: 1.2rem; display: grid; gap: .45rem; font-size: .9rem; }
.pay-amount { font-size: 1.4rem; }

/* A phone has no keyboard shortcut to advertise. */
@media (hover: none), (max-width: 760px) { .palette-open kbd { display: none; } }

/* ── Phones: compact tables and a vertical stepper ─────────── */
@media (max-width: 600px) {
  table.phone-compact th.opt, table.phone-compact td.opt { display: none; }
  table.phone-compact th, table.phone-compact td { padding-left: .45rem; padding-right: .45rem; }
}
@media (max-width: 520px) {
  /* Four or five stage names do not fit across a phone: the stepper
     reads down instead, one stage a line, the line joining the dots. */
  .stepper { flex-direction: column; overflow: visible; gap: 0; }
  .step { flex: none; min-width: 0; flex-direction: row; align-items: center; gap: .65rem;
          padding: .25rem 0; font-size: .82rem; }
  .step::before { top: calc(50% + 6px); left: 5px; right: auto; width: 2px; height: calc(100% - 6px); }
}

.advance-counter { margin-top: .7rem; }
@media (max-width: 600px) {
  /* Headers may wrap rather than push a column off the edge. */
  table.phone-compact th { white-space: normal; letter-spacing: .04em; }
  table.phone-compact td { font-size: .85rem; }
  /* Something to press on a phone is at least 36px tall. */
  .btn, .btn.compact, .dd-trigger, select.compact { min-height: 36px; }
  .crumb { padding: .45rem .1rem; }
  .crumbs { flex-wrap: wrap; }
}
@media (max-width: 360px) {
  .public-main th, .public-main td { padding-left: .35rem; padding-right: .35rem; }
  .half { min-width: 0; }
}
@media (max-width: 600px) {
  table.phone-compact th[data-short] { font-size: 0; letter-spacing: 0; }
  table.phone-compact th[data-short]::after { content: attr(data-short); font-size: .68rem;
                                              letter-spacing: .04em; }
  table.phone-compact td.wrap { min-width: 6rem; }
  table.phone-compact th, table.phone-compact td { padding-left: .35rem; padding-right: .35rem; }
}
@media (max-width: 360px) {
  table.phone-compact td.wrap { min-width: 4.5rem; }
  table.phone-compact th, table.phone-compact td { padding-left: .28rem; padding-right: .28rem; }
}
/* The per-player stats sheet: small number boxes, not full-width fields. */
.sheet-table input { min-width: 0; width: 4.6rem; padding-left: .4rem; padding-right: .4rem; }
@media (max-width: 600px) {
  .sheet-table input { width: 3.4rem; }
  .sheet-table th, .sheet-table td { padding-left: .3rem; padding-right: .3rem; }
}
@media (max-width: 600px) {
  /* 26rem is wider than a phone: the sheet fits instead, narrower boxes. */
  .sheet-table { min-width: 0; }
  .sheet-table td.num { width: auto; }
  .sheet-table input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { width: 3.6rem; padding: .4rem .3rem; }
}

/* ── Designs ────────────────────────────────────────────── */
.design-upload { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .4rem 0 .9rem; }
.design-upload input[type="file"] { min-width: 0; max-width: 100%; }
.design-upload input[type="text"] { flex: 1 1 12rem; }
.design-grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(min(9rem, 100%), 1fr)); }
.design-tile { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); overflow: hidden;
  display: grid; gap: .4rem; padding-bottom: .5rem; min-width: 0; }
.design-tile > .btn { margin: 0 .5rem; }
.design-thumb { aspect-ratio: 16 / 10; background: repeating-conic-gradient(#1b1f2b 0% 25%, #12151e 0% 50%) 50% / 16px 16px;
  display: grid; place-items: center; overflow: hidden; }
.design-thumb img { width: 100%; height: 100%; object-fit: contain; }
.design-thumb.font span { font-size: 2.2rem; font-weight: 700; color: var(--muted); }
.design-meta { display: grid; gap: .1rem; padding: 0 .55rem; min-width: 0; }
.design-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.design-preview-wrap { margin-top: .8rem; max-width: 22rem; }
.design-preview { width: 100%; border-radius: var(--r); border: 1px solid var(--line); display: block; }
.design-frames { list-style: none; margin: 0 0 .7rem; padding: 0; display: grid; gap: .45rem; }
.design-frames li { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.design-frames li img { width: 4.5rem; aspect-ratio: 16 / 9; object-fit: contain; border-radius: 4px;
  background: repeating-conic-gradient(#1b1f2b 0% 25%, #12151e 0% 50%) 50% / 10px 10px; }
.design-frames li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.design-frames.take { display: flex; flex-wrap: wrap; }
/* Same specificity as the base field rule, so a slider is not a 220px text box. */
input[type="range"]:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  min-width: 0; flex: 1 1 10rem; padding: 0; border: 0; background: none; accent-color: var(--accent); }

/* ══════════════════════════════════════════════════════════
   Sidebar: the navigation scrolls, Sign out stays put (round 14)
   ══════════════════════════════════════════════════════════
   The sidebar used to scroll as one piece, so once the navigation grew past
   the screen (17 entries and five headings) Sign out sat below the fold of
   every laptop. Now the header rows and the footer keep their size, the
   navigation takes what is left and scrolls inside it, and the footer is a
   compact block. Only a screen too short to hold even that (under 560px)
   scrolls the whole sidebar as before. */
.sidebar { overflow: hidden; padding: 1rem 0 .75rem; }
.sidebar > :not(.nav) { flex: none; }
.sidebar .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto;
                overscroll-behavior: contain; scrollbar-width: thin;
                padding-bottom: .5rem; }
.nav button { padding: .42rem .7rem; }
.nav-group { padding: .7rem .9rem .25rem; }
.sidebar-foot { padding: .7rem 1.25rem 0; }
.sidebar-foot .live-row { margin-bottom: .35rem; }
.sidebar-foot #who { margin-bottom: .45rem; }
.sidebar-foot .btn.full { margin-bottom: 0; }
@media (max-height: 560px) {
  .sidebar { overflow-y: auto; }
  .sidebar .nav { flex: none; overflow: visible; }
}
/* In the phone drawer the entries keep their bigger, thumb-sized rows. */
@media (max-width: 860px) {
  .nav button { padding: .62rem .8rem; }
  .sidebar { padding-top: .5rem; padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)); }
}
/* The demo's banner sits above the sidebar in the flow; take its height
   off, or the sidebar's foot starts that far below the screen. */
@media (min-width: 861px) {
  body:has(.demo-bar) .sidebar { height: calc(100vh - 2.75rem); }
}

/* ── Data from a sheet (round 14) ───────────────────────── */
.sheet-add { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .6rem 0; }
.sheet-add input[type="url"] { flex: 1 1 18rem; min-width: 0; }
.sheet-template input.num-input:not([type="checkbox"]):not([type="radio"]) { min-width: 0; width: 5.5rem; flex: none; }
.sheet-template .sheet-add { row-gap: .7rem; }
.sheet-template .btn[download] { text-decoration: none; }
.sheet-template h3 { margin: 1.1rem 0 .3rem; font-size: .95rem; }
.sheet-code { white-space: pre-wrap; word-break: break-all; }
.sheet-script pre { max-height: 16rem; overflow: auto; padding: .7rem; border: 1px solid var(--line);
                    border-radius: var(--r); background: var(--panel-2); font-size: .74rem;
                    white-space: pre-wrap; word-break: break-word; }
.sheet-status { margin: .2rem 0 .7rem; }
.sheet-controls { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.sheet-controls input[type="file"] { max-width: 100%; }
.inline-field { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .85rem; }
.num-input { width: 4.5rem; min-width: 0; }
.field-grid, .tag-grid { display: grid; gap: .6rem .9rem; margin: .6rem 0 .8rem;
                         grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); }
.tag-grid { grid-template-columns: repeat(auto-fill, minmax(min(9rem, 100%), 1fr)); }
.field-grid .field, .tag-grid .field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field-grid .field > span, .tag-grid .field > span { font-size: .8rem; color: var(--muted);
                                                     overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-grid .dd, .tag-grid input { width: 100%; }
.sheet-map > summary { cursor: pointer; color: var(--muted); margin: .4rem 0; }
.sheet-links h3 { font-size: .9rem; margin: .8rem 0 .2rem; }
/* The global input minimum (220px) would push these out of their cells. */
.tag-grid input.tag-input:not([type="checkbox"]):not([type="radio"]),
.field-grid input:not([type="checkbox"]):not([type="radio"]) { min-width: 0; width: 100%; }
.sheet-controls input.num-input:not([type="checkbox"]):not([type="radio"]) { min-width: 0; width: 4.5rem; }

/* ── Scenes (round 14) ──────────────────────────────────── */
.scene-thumb { all: unset; cursor: pointer; display: grid; place-items: center; aspect-ratio: 16 / 9;
               background: var(--panel-2); border-radius: var(--r); overflow: hidden; }
.scene-thumb img { width: 100%; height: 100%; object-fit: cover; }
.scene-thumb:focus-visible { outline: 2px solid var(--live); outline-offset: 2px; }
.scene-preview { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000 linear-gradient(45deg, #111 25%, transparent 25%, transparent 75%, #111 75%) 0 0 / 24px 24px;
                 border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.scene-preview-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.scene-boxes { position: absolute; inset: 0; }
.scene-box { all: unset; position: absolute; box-sizing: border-box; border: 1px solid rgb(0 229 255 / .85);
             background: rgb(0 229 255 / .08); color: #fff; font-size: .6rem; line-height: 1; cursor: pointer;
             display: flex; align-items: flex-start; justify-content: flex-start; padding: 1px 2px; min-width: 6px;
             min-height: 6px; }
.scene-box.is-image { border-color: rgb(255 72 196 / .9); background: rgb(255 72 196 / .08); }
.scene-box:hover { background: rgb(0 229 255 / .2); }
.scene-box { touch-action: none; user-select: none; }
.scene-box.is-selected { border: 2px solid #fff; background: rgb(0 229 255 / .22);
                         box-shadow: 0 0 0 1px rgb(0 0 0 / .6); z-index: 2; }
.scene-box-n { position: absolute; left: -1px; bottom: 100%; background: rgb(0 229 255 / .9); color: #001014;
                padding: 1px 4px; border-radius: 2px 2px 0 0; font-weight: 700; font-size: .62rem; line-height: 1.2; }
.scene-box.is-image .scene-box-n { background: rgb(255 72 196 / .9); }
.scene-box.is-selected .scene-box-n { background: #fff; }
.scene-box-grip { position: absolute; right: -5px; bottom: -5px; width: 12px; height: 12px; border-radius: 2px;
                  background: #fff; border: 1px solid #000; cursor: nwse-resize; display: none; }
.scene-box.is-selected .scene-box-grip { display: block; }
.scene-editor { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) { .scene-editor { grid-template-columns: minmax(0, 1fr); } }
.scene-stage-foot { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between;
                    margin-top: .6rem; }
.scene-status { min-height: 1.2em; }
.scene-list { list-style: none; margin: .4rem 0 .9rem; padding: 0; display: grid; gap: .3rem;
              max-height: 22rem; overflow: auto; }
.scene-list li { border: 1px solid var(--line); border-radius: var(--r); }
.scene-list li.is-selected { border-color: var(--live); background: color-mix(in srgb, var(--live) 8%, transparent); }
.scene-list-item { all: unset; box-sizing: border-box; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
                   gap: .6rem; align-items: center; width: 100%; padding: .45rem .6rem; cursor: pointer; }
.scene-list-item:focus-visible { outline: 2px solid var(--live); outline-offset: -2px; }
.scene-list-main { display: grid; min-width: 0; }
.scene-list-main strong, .scene-list-main .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene-list-now { font-size: .8rem; color: var(--text); max-width: 10rem; overflow: hidden; text-overflow: ellipsis;
                  white-space: nowrap; }
.scene-inspector { display: grid; gap: .7rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.scene-insp-head { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.scene-now { margin: 0; font-size: .85rem; color: var(--live); min-height: 1.2em; overflow-wrap: anywhere; }
.scene-inspector input[type="color"], .scene-inspector .sheet-controls input[type="color"] {
  width: 2.6rem; height: 2rem; flex: none; padding: 2px; border: 1px solid var(--line-2); background: none; min-width: 0; }
@media (min-width: 1101px) { .scene-stage-card { position: sticky; top: 1rem; } }
.bc-program { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start;
              margin-bottom: 1rem; }
@media (max-width: 800px) { .bc-program { grid-template-columns: minmax(0, 1fr); } }
.bc-scene-list { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .4rem; }
.bc-scene-list li { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; padding: .45rem .6rem;
                    border: 1px solid var(--line); border-radius: var(--r); }
.bc-scene-list li strong { flex: 1 1 8rem; min-width: 0; overflow-wrap: anywhere; }
.bc-scene-list li.on-air { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.bc-onscreen { margin: 1rem 0; }
.bc-onscreen:empty { display: none; }
.bc-onscreen-list { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .4rem; }
.bc-onscreen-list li { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; padding: .4rem .6rem;
                       border: 1px solid var(--line); border-radius: var(--r); }
.bc-onscreen-list li.is-overridden { border-color: color-mix(in srgb, var(--warn, #f5b83d) 60%, var(--line)); }
.bc-onscreen-list input[type="text"] { flex: 1 1 12rem; min-width: 0; }
.bc-os-name { flex: 1 1 100%; min-width: 0; font-weight: 600; font-size: .85rem; overflow-wrap: anywhere; }
.bc-thirds li.is-editing { border-color: var(--live); }
.plain-list { list-style: none; padding: 0; margin: .3rem 0 .8rem; display: grid; gap: .3rem; }
.photo-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(7rem, 100%), 1fr)); }
.photo-tile { display: grid; gap: .3rem; justify-items: center; text-align: center; font-size: .8rem; min-width: 0; }
.photo-tile img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--panel-2); border-radius: var(--r); }
.photo-tile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* ── Designs → Look: the style packs ── */
.look-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); }
.look-tile { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel-2);
             display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.look-tile.is-current { border-color: var(--live); box-shadow: 0 0 0 1px var(--live); }
.look-thumb { aspect-ratio: 4 / 5; background: #000; overflow: hidden; }
.look-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.look-meta { padding: .7rem .8rem .8rem; display: grid; gap: .45rem; align-content: start; }
.look-meta p { margin: 0; }
.look-name { display: flex; gap: .5rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.look-second { margin-top: .9rem; }
.look-second input[type="color"] { width: 2.6rem; height: 2rem; padding: 2px; border: 1px solid var(--line-2);
                                   background: none; flex: none; }

/* ── Guides (/guide/*): screenshots and wide tables in the prose ── */
.prose figure { margin: 1.4rem 0 1.8rem; }
.prose figure img, .prose p img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line);
                                  border-radius: var(--r); background: var(--panel); }
.prose figcaption { color: var(--muted); font-size: .85rem; margin-top: .5rem; }
.guide h2 { scroll-margin-top: 5rem; }
.guide h3 { margin-top: 1.8rem; }

/* ── Designs → Scenes: ready-made scenes ── */
.ready-made { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center;
              border: 1px solid var(--line); border-radius: var(--r); padding: .9rem; margin: .9rem 0; }
@media (max-width: 800px) { .ready-made { grid-template-columns: minmax(0, 1fr); } }
.ready-made-pick h3 { margin-top: 0; }
.ready-preview { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r);
                 border: 1px solid var(--line); background: var(--panel-2); }
.bc-os-thumb { width: 2.4rem; height: 2.4rem; object-fit: cover; border-radius: 6px; border: 1px solid var(--line);
               background: var(--panel-2); flex: none; }
.bc-onscreen-list .dd { flex: 1 1 14rem; min-width: 0; }

/* ══════════════════════════════════════════════════════════
   THE WEBSITE — the match-day programme
   Ink "control room" sections and Bone "programme" sections, full
   bleed; the words sit in a .wrap of the shell's width. Big Anton
   headings, mono labels, hairlines, no gradients.
   ══════════════════════════════════════════════════════════ */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
           overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { max-width: var(--shell); margin: 0 auto; padding-inline: var(--gutter); }
.btn.link { border-color: transparent; background: transparent; color: var(--text); }
.btn.link:hover { border-color: transparent; background: transparent; text-decoration: underline; }
code { font-family: var(--mono); font-size: .86em; }

/* ── the header ── */
.site-head { position: sticky; top: 0; z-index: 20; background: var(--ink);
             border-bottom: 1px solid var(--line); }
.head-inner { max-width: var(--shell); margin: 0 auto; padding: .85rem var(--gutter);
              display: flex; align-items: center; gap: 1.5rem; }
.site-head .brand { display: flex; align-items: center; flex: none; }
.site-head .brand img { width: 44px; height: auto; display: block; }
.site-head .brand:hover { opacity: .85; }
.site-nav { display: flex; gap: 1.8rem; margin: 0 auto; font-size: .9rem; align-items: center; }
.site-nav a { color: var(--bone); padding-block: .3rem; border-bottom: 2px solid transparent; }
.site-nav a:hover { text-decoration: none; border-bottom-color: var(--line-2); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--live); }
.site-head .head-actions { display: flex; align-items: center; gap: .9rem; flex: none; }
.site-head .head-actions .signin { font-family: var(--mono); font-size: .74rem; letter-spacing: .16em;
                        text-transform: uppercase; font-weight: 600; color: var(--muted); }
.site-head .head-actions .signin:hover { color: var(--bone); text-decoration: none; }
.site-head .head-actions .btn.primary { padding: .65rem 1.2rem; font-size: .88rem; }
.menu-check { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.menu-toggle { display: none; }

@media (max-width: 900px) {
  .head-inner { flex-wrap: wrap; gap: .6rem 1rem; }
  .site-head .head-actions { margin-left: auto; }
  .menu-toggle { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; order: 2;
                 font-family: var(--mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
                 color: var(--muted); padding: .45rem 0 .45rem .3rem; }
  .menu-bars, .menu-bars::before, .menu-bars::after { display: block; width: 20px; height: 2px;
                 background: var(--bone); position: relative; }
  .menu-bars::before, .menu-bars::after { content: ""; position: absolute; left: 0; }
  .menu-bars::before { top: -6px; } .menu-bars::after { top: 6px; }
  .menu-check:focus-visible + .menu-toggle { box-shadow: var(--focus); }
  .site-nav { order: 3; display: none; width: 100%; flex-direction: column; align-items: stretch;
              gap: 0; margin: 0; border-top: 1px solid var(--line); }
  .site-nav a { padding: .8rem 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--line); box-shadow: inset 3px 0 0 var(--live);
                                     padding-left: .8rem; }
  .menu-check:checked ~ .site-nav { display: flex; }
  .menu-check:checked + .menu-toggle .menu-bars { background: transparent; }
  .menu-check:checked + .menu-toggle .menu-bars::before { top: 0; transform: rotate(45deg); }
  .menu-check:checked + .menu-toggle .menu-bars::after { top: 0; transform: rotate(-45deg); }
}
/* On a phone the header is the logo, Sign in and Menu, as in the mockups:
   the hero's own Add to Discord is right underneath. */
@media (max-width: 720px) { .site-head .head-actions .head-add { display: none; } }
@media (max-width: 480px) { .menu-word { display: none; } }

/* ── sections ── */
.site { display: block; }
.sect { padding: 6.5rem 0; }
.sect:not(.bone) + .sect:not(.bone) { padding-top: 0; }
.display { font-family: var(--display); font-weight: 400; text-transform: uppercase; color: var(--bone);
           font-size: clamp(2.6rem, 6.4vw, 5.4rem); line-height: .92; letter-spacing: .005em; margin: 0 0 1.4rem; }
.sect-lede { color: var(--muted); font-size: 1.05rem; line-height: 1.6; max-width: 34rem; margin: 0 0 1.6rem; }
.ticks { list-style: none; margin: 0 0 1.4rem; padding: 0; }
.ticks li { position: relative; padding-left: 1.3rem; margin: .5rem 0; color: var(--muted); }
.ticks li::before { content: ""; position: absolute; left: 0; top: .62em; width: 8px; height: 2px; background: var(--live); }
.see-it { display: inline-block; margin-top: .35rem; font-family: var(--mono); font-size: .7rem;
          letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--live); }

/* The programme sections: bone ground, ink words, deep Live for the labels. */
.bone { background: var(--bone); color: var(--ink); }
.bone .display { color: var(--ink); }
.bone .eyebrow { color: var(--ink); }
.bone .eyebrow::before { background: var(--live); }
.bone p { color: #2A2823; }
.bone .sect-lede, .bone .fig-label { color: var(--bone-muted); }

/* ── the hero ── */
.hero { padding: 4.5rem 0 5rem; overflow: hidden; }
.hero-grid { display: grid; gap: 3rem; align-items: center;
             grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); }
.hero-title { font-size: clamp(3.2rem, 16.4vw, 7.6rem); line-height: .86; margin: 0 0 1.8rem;
              color: var(--bone); letter-spacing: .004em; }
.hero-title span { display: block; }
/* Should Anton be slow to arrive, the wider stand-in face wraps rather than
   running off the side of a phone. */
.hero-title, .display { overflow-wrap: break-word; }
.hero-title .outline { color: transparent; -webkit-text-stroke: 2px var(--bone); }
.hero-title .live { color: var(--live); }
.hero .lede { font-size: 1.1rem; line-height: 1.6; color: #BEB9AD; max-width: 31rem; margin: 0 0 1.8rem; }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.cta .btn { padding: .9rem 1.35rem; font-size: .95rem; }
.cta .btn.ghost { border-color: var(--line-2); }
.hero .note { font-size: .8rem; color: var(--dim); margin: 1.4rem 0 0; max-width: 30rem; }
.hero-visual { position: relative; min-width: 0; }

.demo-window { margin: 0 0 3.5rem; position: relative; border: 1px solid var(--line-2); background: var(--panel);
               box-shadow: 18px 18px 0 -1px #000; }
.demo-window-bar { display: flex; align-items: center; gap: .8rem; padding: .55rem .8rem;
                   border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: .68rem;
                   letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.demo-window-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-window-bar a { color: var(--live); white-space: nowrap; }
.dots { display: inline-flex; gap: 5px; flex: none; }
.dots i, .demo-window-dots i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.demo-window-dots { display: inline-flex; gap: 5px; flex: none; }
.demo-window-body { position: relative; aspect-ratio: 1280 / 800; overflow: hidden; background: var(--ink); }
.demo-window-body iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0;
                           transform-origin: 0 0; pointer-events: none; background: var(--ink); }
.demo-window-body:not([data-scaled]) iframe { width: 100%; height: 100%; }
.demo-cover { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-end;
              padding: 1rem; text-decoration: none; }
.demo-cover .btn { opacity: 0; transition: opacity .15s ease; }
.demo-cover:hover .btn, .demo-cover:focus-visible .btn { opacity: 1; }
.demo-cover:hover { text-decoration: none; }
.demo-cover:focus-visible { outline: 2px solid var(--live); outline-offset: -2px; }
/* The Discord message that goes with it: a registration panel in a server. */
.discord-card { position: absolute; left: -2.2rem; bottom: -3.2rem; width: min(21rem, 80%);
                display: grid; gap: .3rem; padding: .9rem 1rem 1rem; background: #2B2D31; color: #DBDEE1;
                border-left: 4px solid var(--live); box-shadow: 0 24px 50px -20px #000; font-size: .86rem;
                border-radius: 4px; }
.discord-card-who { font-weight: 700; color: #F2F3F5; font-size: .82rem; }
.discord-card-who b { background: #5865F2; color: #fff; font-size: .6rem; padding: .05rem .3rem;
                      border-radius: 3px; margin-left: .3rem; vertical-align: 1px; }
.discord-card strong { color: #F2F3F5; }
.discord-card-note { color: #B5BAC1; font-size: .8rem; }
.discord-card-btn { justify-self: start; margin-top: .35rem; background: #5865F2; color: #fff; font-weight: 600;
                    font-size: .82rem; padding: .4rem .9rem; border-radius: 3px; }

/* ── the numbers band ── */
.band { background: var(--bone); color: var(--ink); }
.band-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.band-item { padding: 1.8rem 1.4rem 1.6rem; border-left: 1px solid var(--bone-line); min-width: 0; }
.band-item:first-child { border-left: 0; padding-left: 0; }
.band-item strong { display: block; font-family: var(--display); font-weight: 400; text-transform: uppercase;
                    font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1; color: var(--ink); }
.band-item.is-live strong { color: var(--live-deep); }
.band-item span { display: block; margin-top: .5rem; font-family: var(--mono); font-size: .7rem; font-weight: 600;
                  letter-spacing: .14em; text-transform: uppercase; color: var(--bone-muted); }

/* ── 01 the team sheet ── */
.sheet-grid { display: grid; gap: 3rem; grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr); align-items: start; }
.sheet-grid .sect-head { position: sticky; top: 6rem; }
.team-sheet { border-top: 1px solid var(--line-2); }
.ts-row { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) minmax(0, 1fr); gap: 1.6rem;
          padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.ts-row p { margin: 0; color: #D6D2C6; font-size: .95rem; line-height: 1.55; }
.ts-row code { color: var(--bone); background: var(--panel-2); padding: .05em .35em; }
.ts-row .see-it { display: block; }
.ts-head { padding: .9rem 0; }
.ts-head span, .ts-k { font-family: var(--mono); font-size: .7rem; font-weight: 600; letter-spacing: .14em;
                       text-transform: uppercase; color: var(--dim); padding-top: .2rem; }
.ts-head .ts-org { color: var(--live); }
.ts-head .ts-ply { color: var(--bone); }

/* ── 02 three steps ── */
.big-steps { list-style: none; margin: 3rem 0 0; padding: 0; display: grid;
             grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.big-steps li { padding: 2rem 2rem 1rem 0; display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; }
.big-steps li + li { border-left: 1px solid var(--line); padding-left: 2rem; }
.step-num { font-family: var(--display); font-size: clamp(5rem, 9vw, 8rem); line-height: .85; color: var(--bone); }
.big-steps li:first-child .step-num { color: var(--live); }
.big-steps h3 { font-family: var(--sans); text-transform: none; letter-spacing: -.01em; font-size: 1.3rem;
                font-weight: 650; color: var(--bone); margin: .6rem 0 0; }
.big-steps p { margin: 0; color: var(--muted); }
.big-steps code, .step-codes code { background: var(--panel-2); border: 1px solid var(--line); color: var(--bone);
                                    padding: .2rem .5rem; font-size: .8rem; }
.step-codes { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ── 03 the nights (bone) ── */
.nights-grid { display: grid; gap: 3rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 3rem; }
.night-fig { margin: 0; display: flex; flex-direction: column; gap: 1rem; }
.night-fig p { margin: auto 0 0; max-width: 26rem; }
.fig-label { font-family: var(--mono); font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
             display: flex; align-items: center; gap: .7rem; }
.tag-example { border: 1px solid var(--bone-line); padding: .05rem .4rem; font-size: .62rem; }
.scrim-sheet { background: var(--ink); color: var(--bone); padding: .4rem 1.1rem .6rem; }
.ss-row { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 3rem 6.5rem; gap: .8rem; align-items: center;
          padding: .7rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.ss-row:last-child { border-bottom: 0; }
.ss-row:not(.ss-head) > span:first-child { font-family: var(--mono); font-size: .82rem; }
.ss-head span { font-family: var(--mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.tag { display: inline-block; font-family: var(--mono); font-size: .62rem; font-weight: 700; letter-spacing: .14em;
       text-transform: uppercase; padding: .15rem .45rem; border: 1px solid currentColor; white-space: nowrap; }
.tag-ok { color: var(--ok); }
.tag-stream { color: var(--stream-text); }
.tag-live { color: var(--ink); background: var(--live); border-color: var(--live); }
.tag-bone { color: var(--ink); background: var(--bone); border-color: var(--bone); }
/* A bracket drawn with borders: two pairs, two winners, a champion. */
.mini-bracket { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; align-items: stretch;
                font-family: var(--mono); font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.mb-round { display: flex; flex-direction: column; justify-content: space-around; gap: 1.6rem; }
.mb-pair { display: flex; flex-direction: column; gap: .5rem; position: relative; margin-right: 1.4rem; }
.mb-pair::after { content: ""; position: absolute; right: -1.4rem; top: 1rem; bottom: 1rem; width: 1.4rem;
                  border: 1px solid var(--ink); border-left: 0; }
.mb-pair span, .mb-one span { display: block; background: var(--ink); color: var(--bone); padding: .55rem .7rem;
                              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-semis { justify-content: space-around; padding-left: 1.4rem; }
.mb-semis .mb-one { position: relative; margin-right: 1.4rem; }
.mb-semis .mb-one::before { content: ""; position: absolute; left: -1.4rem; top: 50%; width: 1.4rem; border-top: 1px solid var(--ink); }
.mb-semis { position: relative; }
.mb-semis::after { content: ""; position: absolute; right: 0; top: 25%; bottom: 25%; width: 1.4rem;
                   border: 1px solid var(--ink); border-left: 0; }
.mb-final { justify-content: center; padding-left: 1.4rem; position: relative; }
.mb-final::before { content: ""; position: absolute; left: 0; top: 50%; width: 1.4rem; border-top: 1px solid var(--ink); }
.mb-one.is-winner span { background: var(--live); color: var(--ink); }

/* ── 04 two doors ── */
.doors-grid { display: grid; gap: 3.5rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
.review-card { border: 1px solid var(--line-2); background: var(--panel); padding: 0 0 1.2rem;
               box-shadow: 18px 18px 0 -1px #000; }
.rc-bar { display: flex; align-items: center; gap: .8rem; padding: .6rem .9rem; border-bottom: 1px solid var(--line);
          font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.rc-shot { margin: 1.1rem 1.1rem 0; height: 9rem; display: grid; place-items: center;
           background: repeating-linear-gradient(135deg, var(--panel-2) 0 14px, var(--panel) 14px 28px); }
.rc-shot span { font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.rc-claim { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 1rem 1.1rem;
            border-top: 1px solid var(--line); }
.rc-claim > div { padding-top: .7rem; }
.rc-claim .k { display: block; font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
               color: var(--dim); margin-bottom: .3rem; }
.rc-claim strong { font-size: .92rem; }
.rc-actions { display: flex; gap: .5rem; padding: 0 1.1rem; }
.rc-actions .btn { pointer-events: none; padding: .55rem 1.1rem; }

/* ── 05 on stream ── */
.stream-window { margin: 2.6rem 0 0; display: grid; gap: .6rem; }
.stream-window figcaption { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
                            color: var(--dim); }
/* A plain backdrop where the game would be: no fake gameplay. */
.stream-stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line-2);
                background: radial-gradient(70% 60% at 60% 40%, #1A2150 0%, #0D1028 55%, #08091A 100%); }
.stream-stage iframe { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; border: 0;
                       transform-origin: 0 0; pointer-events: none; background: transparent; }
.stream-stage:not([data-scaled]) iframe { width: 100%; height: 100%; }
.stream-notes { display: grid; gap: 1rem 2.5rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 2.4rem; }
.stream-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; }

/* ── the close: the Live band ── */
.cta-band { background: var(--live); color: var(--ink); padding: 6rem 0 5.5rem; }
.cta-band .display { color: var(--ink); font-size: clamp(3rem, 9vw, 8rem); line-height: .88; max-width: 14ch; }
.cta-band p { font-size: 1.05rem; margin: 0 0 1.8rem; max-width: 34rem; }
.cta-band code { background: color-mix(in srgb, var(--ink) 12%, transparent); padding: .05em .35em; }
.cta-band .btn { border-color: var(--ink); color: var(--ink); background: transparent; }
.cta-band .btn.primary { background: var(--ink); color: var(--bone); }
.cta-band .btn:hover { background: var(--ink); color: var(--bone); }
.cta-band .btn:focus-visible { box-shadow: 0 0 0 2px var(--bone), 0 0 0 4px var(--ink); }

/* ── the footer ── */
footer.site { padding: 3.2rem 0 2.2rem; border-top: 1px solid var(--line); color: var(--dim); font-size: .86rem;
              background: var(--ink); }
.foot-top { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, .7fr));
            padding-bottom: 2.4rem; }
.foot-brand .brand { display: inline-block; }
.foot-brand .brand img { width: 44px; display: block; }
.foot-brand p { margin: 1rem 0 0; max-width: 24rem; color: var(--muted); line-height: 1.6; font-size: .84rem; }
.foot-links { display: flex; flex-direction: column; gap: .45rem; align-items: flex-start; }
.foot-links h4 { margin: 0 0 .35rem; font-size: .88rem; font-weight: 650; color: var(--bone); }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--bone); }
.foot-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem;
              padding-top: 1.3rem; border-top: 1px solid var(--line); font-size: .8rem; }
.foot-legal a { color: var(--dim); }
.foot-legal a:hover { color: var(--muted); }
.foot-legal code { color: var(--muted); }

/* ── widths ── */
@media (min-width: 1001px) { .hero-title { font-size: clamp(3.6rem, 8.3vw, 7.6rem); } }
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .discord-card { left: 1.2rem; }
  .hero-visual { max-width: 40rem; }
  .sheet-grid, .doors-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .sheet-grid .sect-head { position: static; }
  .nights-grid { gap: 2.5rem; }
}
@media (max-width: 760px) {
  .sect { padding: 4.2rem 0; }
  .hero { padding: 2.6rem 0 3rem; }
  .hero-title .outline { -webkit-text-stroke-width: 1.5px; }
  /* On a phone the panel is too small to read; the Discord message is
     the picture instead, as in the mockups. */
  .demo-window { margin: 0; border: 0; background: none; box-shadow: none; }
  .demo-window-bar, .demo-window-body { display: none; }
  .discord-card { position: static; width: auto; }
  .cta .btn { flex: 1 1 100%; }
  .band-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band-item:nth-child(odd) { border-left: 0; padding-left: 0; }
  .band-item:nth-child(n+3) { border-top: 1px solid var(--bone-line); }
  .ts-row { grid-template-columns: minmax(0, 1fr); gap: .45rem; }
  .ts-head { display: none; }
  .ts-row p::before { display: block; font-family: var(--mono); font-size: .62rem; font-weight: 600; letter-spacing: .14em;
                      text-transform: uppercase; margin-bottom: .15rem; }
  .ts-row p:nth-of-type(1)::before { content: "Organisers"; color: var(--live); }
  .ts-row p:nth-of-type(2)::before { content: "Players"; color: var(--muted); }
  .big-steps { grid-template-columns: minmax(0, 1fr); }
  .big-steps li, .big-steps li + li { padding: 1.4rem 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .nights-grid, .stream-notes { grid-template-columns: minmax(0, 1fr); }
  .ss-row { grid-template-columns: 3.6rem minmax(0, 1fr) 2.2rem auto; gap: .5rem; }
  .cta-band { padding: 4rem 0; }
  .foot-top { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .foot-top { grid-template-columns: 1fr 1fr; }
  .mini-bracket { font-size: .62rem; letter-spacing: .06em; }
  .mb-pair span, .mb-one span { padding: .5rem .45rem; }
}

/* ── Fixtures (/events) ── */
.fixtures-main { padding-top: 3.5rem; padding-bottom: 4rem; }
.ev-head { margin-bottom: 2.4rem; }
.ev-title { font-size: clamp(4.2rem, 13vw, 9.5rem); line-height: .86; margin: 0 0 1.2rem; color: var(--bone); }
.ev-lede { color: #BEB9AD; font-size: 1.02rem; max-width: 32rem; margin: 0; }
.ev-filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.6rem;
             border-bottom: 1px solid var(--line-2); }
.ev-tabs { display: flex; flex-wrap: wrap; gap: 0 1.8rem; }
.ev-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
                  padding: .8rem 0; cursor: pointer; color: var(--dim); font-family: var(--mono); font-size: .72rem;
                  font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.ev-tabs button:hover { color: var(--bone); }
.ev-tabs button[aria-pressed="true"] { color: var(--bone); border-bottom-color: var(--live); }
.ev-tabs button:focus-visible { outline: none; box-shadow: var(--focus); }
.ev-filter select { min-width: 0; margin-bottom: .4rem; }
.ev-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) 11rem 10rem; gap: 1.6rem; align-items: center;
          padding: 1.6rem 0; border-bottom: 1px solid var(--line); }
.ev-date { display: grid; align-content: start; }
.ev-date strong { font-family: var(--display); font-weight: 400; font-size: 3.4rem; line-height: .9; color: var(--bone); }
.ev-date.is-word strong { font-size: 2.2rem; color: var(--live); text-transform: uppercase; }
.ev-date span { font-family: var(--mono); font-size: .64rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
                color: var(--dim); margin-top: .3rem; }
.ev-body { display: grid; gap: .3rem; justify-items: start; min-width: 0; }
.ev-name { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(1.8rem, 3.4vw, 2.6rem);
           line-height: .95; margin: .2rem 0 0; color: var(--bone); letter-spacing: .005em; overflow-wrap: anywhere; }
.ev-sub { color: var(--muted); font-size: .9rem; }
.ev-prize { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; color: var(--warn); }
.ev-cap { display: grid; gap: .45rem; }
.ev-cap > span { font-family: var(--mono); font-size: .66rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
                 color: var(--dim); }
.seg-bar { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
.seg-bar i { display: block; height: 4px; background: var(--line-2); }
.seg-bar i.on { background: var(--live); }
.ev-act { display: flex; justify-content: flex-end; }
.ev-act .btn { width: 100%; padding: .8rem 1rem; }
.ev-quiet { color: var(--muted); padding: 2rem 0; margin: 0; }
.btn.ink { background: var(--ink); border-color: var(--ink); color: var(--bone); }
.btn.ink:hover { background: #222226; border-color: #222226; }
.ev-empty { margin-top: 2.6rem; background: var(--bone); color: var(--ink); padding: 2rem 2.2rem;
            display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem 2rem; }
.ev-empty .display { color: var(--ink); font-size: clamp(2rem, 4.6vw, 3.4rem); margin: .3rem 0 .4rem; }
.ev-empty p { margin: 0; color: var(--bone-muted); }
.ev-empty-k { font-family: var(--mono); font-size: .66rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.site-page .public-promo-wrap { max-width: var(--shell); padding-inline: var(--gutter); margin-bottom: 3rem; }
@media (max-width: 900px) {
  .ev-row { grid-template-columns: 5.2rem minmax(0, 1fr); gap: 1rem 1.2rem; align-items: start; }
  .ev-cap, .ev-act { grid-column: 2; }
  .ev-act { justify-content: stretch; }
}
@media (max-width: 480px) {
  .ev-row { grid-template-columns: minmax(0, 1fr); }
  .ev-cap, .ev-act { grid-column: 1; }
  .ev-date { display: flex; align-items: baseline; gap: .7rem; }
  .ev-date strong { font-size: 2.2rem; }
  .ev-empty { padding: 1.5rem 1.2rem; }
  .ev-empty .btn { width: 100%; }
}

/* ── guides: a contents rail beside the page ── */
.guide-layout { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 3.5rem; align-items: start; }
.guide-rail { position: sticky; top: 6rem; display: flex; flex-direction: column; gap: .1rem;
              max-height: calc(100vh - 7rem); overflow-y: auto; }
.rail-k { margin: 0 0 .6rem; font-family: var(--mono); font-size: .64rem; font-weight: 600; letter-spacing: .16em;
          text-transform: uppercase; color: var(--dim); }
.guide-rail a { display: block; padding: .4rem .7rem; border-left: 2px solid var(--line); color: var(--muted);
                font-family: var(--mono); font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.prose .guide-rail a, .guide-rail a { color: var(--muted); }
.prose .guide-rail a:hover, .guide-rail a:hover { color: var(--bone); border-left-color: var(--line-2); text-decoration: none; }
.prose .guide-rail a[aria-current="true"], .guide-rail a[aria-current="true"] { color: var(--bone); border-left-color: var(--live); }
.guide-layout .guide { max-width: 50rem; min-width: 0; }
.guide-hero { margin-bottom: 3rem; }
.prose .guide-title { font-size: clamp(4rem, 11vw, 8.6rem); line-height: .86; margin: 0 0 1.4rem; border: 0; padding: 0; }
.guide-title span { display: block; }
.guide-lede { font-size: 1.08rem; color: #BEB9AD !important; max-width: 34rem; }
.guide-steps { margin-top: 2.4rem; }
.guide-steps li { padding-top: 1.4rem; }
.guide-steps .step-num { font-size: clamp(3.6rem, 6vw, 5rem); }
.guide-steps p { color: var(--bone) !important; font-size: .95rem; }
.prose .guide h2 { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .01em;
                   font-size: clamp(2rem, 4vw, 2.8rem); line-height: .95; border-bottom: 0; padding-bottom: 0;
                   margin-top: 3.6rem; }
.prose .guide h2::before { content: ""; display: block; width: 2.6rem; height: 2px; background: var(--live); margin-bottom: .9rem; }
.prose .guide h3 { font-family: var(--mono); text-transform: uppercase; letter-spacing: .14em; font-size: .76rem;
                   color: var(--bone); }
.prose .guide table code, .prose .guide p code, .prose .guide li code { background: var(--panel-2); border-color: var(--line-2); }
.overlay-set { margin: 0 0 3rem; }
.overlay-set h3 { margin-top: 0 !important; }
.og-grid { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: .8rem 0; }
.og-tile { margin: 0 !important; }
.og-stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line);
            background: radial-gradient(70% 60% at 60% 40%, #1A2150 0%, #0D1028 55%, #08091A 100%); }
.og-stage iframe { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0;
                   pointer-events: none; background: transparent; }
.og-stage:not([data-scaled]) iframe { width: 100%; height: 100%; }
.og-tile figcaption { margin-top: .5rem !important; font-family: var(--mono); font-size: .66rem !important; font-weight: 600;
                      letter-spacing: .14em; text-transform: uppercase; color: var(--bone) !important; }
@media (max-width: 960px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
  .guide-rail { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; gap: .4rem;
                padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); order: 2; }
  .rail-k { width: 100%; }
  .guide-rail a { border: 1px solid var(--line); padding: .35rem .55rem; }
  .guide-layout .guide { display: contents; }
  .guide-hero { order: 1; margin-bottom: 0; }
  .guide-layout .guide > :not(.guide-hero) { order: 3; }
}
@media (max-width: 640px) {
  .og-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── content pages (docs, legal, sign-in): the programme's type ── */
.prose h1 { font-size: clamp(2.8rem, 7vw, 5rem); line-height: .9; margin-bottom: 1rem; }
.prose h2 { font-size: 1.3rem; font-weight: 650; border-bottom-color: var(--line); }
.prose a { color: var(--live); }
.prose .lede { color: #BEB9AD; }
.landing.wide.guide-shell { padding-top: 3.5rem; }

/* Spaced mono headers are wide; on the narrowest phones they tighten so a
   four-column table still fits without scrolling. */
@media (max-width: 380px) {
  thead th { letter-spacing: .04em; padding-left: .4rem; padding-right: .4rem; font-size: .6rem; }
  tbody td { padding-left: .4rem; padding-right: .4rem; }
}

/* ══════════════════════════════════════════════════════════
   THE PANEL — the control room
   One palette for every server (a server's accent is for its overlays,
   graphics, public pages and embeds). The sidebar: logo, server, grouped
   pages with a Live bar on the current one. A strip over every page.
   ══════════════════════════════════════════════════════════ */

.shell { grid-template-columns: 232px minmax(0, 1fr); }
.stage { min-width: 0; display: flex; flex-direction: column; }
.sidebar { background: var(--ink); border-right: 1px solid var(--line); padding-top: 1.5rem; }
.brand-row { border-bottom: 0; padding: 0 1.4rem 1.3rem; margin-bottom: 0; }
.brand-row img { width: 66px; height: auto; object-fit: contain; }
.brand-row .name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.server-current { margin: 0 1.4rem .5rem; }
.server-current .server-name { font-family: var(--mono); font-size: .68rem; font-weight: 600; letter-spacing: .16em;
                               text-transform: uppercase; color: var(--dim); }
.server-current .server-icon { display: none; }
.switch-server { margin: 0 1.4rem .6rem; width: calc(100% - 2.8rem); justify-content: flex-start; }
.palette-open { border-radius: 0; margin-left: 1.4rem; width: calc(100% - 2.8rem); }
.nav { padding: .2rem 0 0; }
.nav button { padding: .55rem 1.4rem .55rem 1.3rem; font-size: .95rem; color: #C9C5BA; border-left-width: 3px; }
.nav button .icon { display: none; }
.nav button[aria-current="true"] { color: var(--bone); font-weight: 600; }
.nav-group { padding: 1.1rem 1.4rem .35rem; font-family: var(--mono); font-size: .62rem; font-weight: 600;
             letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.nav-badge { margin-left: .55rem; min-width: 1.25rem; padding: .05rem .3rem; background: var(--live); color: var(--ink);
             font-family: var(--mono); font-size: .66rem; font-weight: 700; text-align: center; line-height: 1.4; }
.sidebar-foot { padding: 1rem 1.4rem 0; }
.sidebar-foot #who { font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; }

/* The strip over every page. */
.top-strip { display: flex; justify-content: space-between; align-items: center; gap: 1rem;
             padding: .7rem 2rem; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: .66rem;
             font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.top-strip[hidden] { display: none; }
.strip-where { color: var(--live); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-when { white-space: nowrap; }
/* The demo's own line moves into the strip; its button stays. */
.demo-bar { background: var(--ink); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: .7rem;
            letter-spacing: .06em; padding: .45rem 1rem; }
.demo-tag { font: 700 .62rem/1 var(--mono); letter-spacing: .16em; border-radius: 0; }

.main { max-width: 1240px; padding: 2rem 2rem 4rem; }
.page-head h1 { font-size: clamp(2.4rem, 5.4vw, 4.6rem); line-height: .9; }
.home-hello { margin: 0 0 .35rem !important; font-family: var(--mono); font-size: .68rem !important; font-weight: 600;
              letter-spacing: .16em; text-transform: uppercase; color: var(--dim) !important; }
.home-head { align-items: flex-end; }

/* What needs you: four tiles, a big number each. */
.now-grid { gap: 0; grid-template-columns: repeat(auto-fill, minmax(min(14rem, 100%), 1fr));
            border: 1px solid var(--line-2); }
.now-card { border: 0; border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2); margin: -1px 0 0 -1px;
            background: transparent; padding: 1.3rem 1.3rem 1.2rem; gap: .2rem; }
.now-top .icon { display: none; }
.now-value { font-family: var(--display); font-weight: 400; font-size: 4rem; line-height: .95; letter-spacing: 0;
             color: var(--bone); }
.now-card.tone-urgent .now-value { color: var(--live); }
.now-label { color: var(--bone); font-size: .95rem; }
.now-go { all: unset; cursor: pointer; margin-top: .55rem; font-family: var(--mono); font-size: .68rem; font-weight: 700;
          letter-spacing: .16em; text-transform: uppercase; color: var(--live); }
.now-go:hover { text-decoration: underline; text-underline-offset: 3px; }
.now-go:focus-visible { box-shadow: var(--focus); }

/* Section labels in mono, as the mockups' TOURNAMENTS IN PROGRESS. */
.home-progress, .home-timeline, .home-health, .home-activity { background: transparent; border: 0; padding: 0; }
.home-progress .card-head h2, .home-timeline .card-head h2, .home-health .card-head h2, .home-activity .card-head h2,
.viz-head h3 { font-family: var(--mono); font-size: .7rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
               color: var(--muted); }
.home-progress { margin-top: 2.6rem; }
.home-progress .card-head { border-bottom: 1px solid var(--line-2); padding-bottom: .6rem; margin-bottom: 0; }
.track-list { gap: 0; }
.track { grid-template-columns: minmax(0, 1.3fr) minmax(8rem, 1fr) minmax(0, 1.6fr); align-items: center; gap: 1.2rem;
         background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: .85rem 0; }
.track-head { display: grid; gap: .1rem; }
.track-name { font-weight: 650; }
.track-name:hover, .track-name:focus-visible { color: var(--live); }
.track .stepper { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; overflow: visible; }
.track .step { min-width: 0; height: 4px; padding: 0; background: var(--line-2); }
.track .step::before, .track .step .dot { display: none; }
.track .step .step-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.track .step.done, .track .step.current { background: var(--live); }
.track-now { display: block; margin-top: .45rem; font-family: var(--mono); font-size: .62rem; font-weight: 600;
             letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.track .next { background: transparent; border: 0; padding: 0; }
.track .next.tone-urgent, .track .next.tone-open { border: 0; }
.track .next .now-go { margin-top: 0; white-space: nowrap; }

/* Three charts in a row: Live, Bone, Stream. */
.home-trends { margin: 2.4rem 0 0; }
.viz-grid { gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); }
.viz-total { font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; }
.viz-tip { border-radius: 0; font-family: var(--mono); font-size: .7rem; }

.home-cols { margin-top: 2.6rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.4rem; }
.home-timeline .card-head, .home-health .card-head, .home-activity .card-head { border-bottom: 1px solid var(--line-2);
  padding-bottom: .6rem; }
.tl-item { grid-template-columns: 4.6rem 1fr; border-left: 0; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.tl-item time { align-self: start; justify-self: start; background: var(--panel-2); color: var(--bone); padding: .25rem .45rem;
                font-size: .72rem; }
.tl-item > div { border-left: 2px solid var(--live); padding-left: .7rem; }
.tl-item.kind-scrim > div { border-left-color: var(--stream); }
.tl-item.kind-deadline > div { border-left-color: var(--warn); }
.tl-title { font-weight: 600; }
.home-activity { margin-top: 2rem; }
.audit-row .pill { font-size: .6rem; }

@media (max-width: 1100px) {
  .home-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .topbar { background: var(--ink); }
  .topbar img { width: 36px; height: auto; }
  .topbar .where { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; }
  .sidebar { background: var(--ink); }
  .top-strip { padding: .6rem 1rem; font-size: .6rem; }
  .main { padding: 1.3rem 1rem 3rem; }
  .now-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
  .now-card { padding: 1rem; }
  .now-value { font-size: 3rem; }
  .track { grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1rem; }
  .track-stage { grid-column: 1 / -1; grid-row: 2; }
  .track .next { grid-column: 1 / -1; }
}

/* Review on a phone: Reject and Approve in the thumb zone, pinned to the
   bottom of the screen while one submission is open, as in the mockups. */
@media (max-width: 860px) {
  .review-one .review-entry .review-actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; margin: 0;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: .6rem;
    padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom, 0px));
    background: var(--ink); border-top: 1px solid var(--line-2); }
  .review-one .review-entry .review-actions .btn { min-height: 48px; font-size: .95rem; }
  .review-one .review-entry .review-actions .btn.danger { order: -1; }
  .main:has(.review-one .review-entry) { padding-bottom: 6.5rem; }
}
.btn.danger { border-color: color-mix(in srgb, var(--bad) 60%, var(--line-2)); color: var(--bone); }
.btn.danger:hover { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
/* Anton at a tight line-height rises above its line box, and a heading's
   text is hit-tested by its glyphs: the crumbs sit above it, with room. */
.crumbs { position: relative; z-index: 1; margin-bottom: .9rem; font-family: var(--mono); font-size: .7rem;
          letter-spacing: .1em; text-transform: uppercase; }
.page-head h1, .public-hero h1, .display, .hero-title { position: relative; z-index: 0; }

/* Hold the scoreboard (control room) */
.hold-banner { border: 1px solid var(--warn); border-left: 4px solid var(--warn); background: var(--panel);
  padding: .7rem .9rem; margin: 0 0 1rem; color: var(--text); font-size: .9rem; }
.hold-banner strong { color: var(--warn); margin-right: .35rem; }
