/* TournaModus — Novamodus palette: blue (--brand), red (--accent), white.
   Light theme by default; a dark theme follows the device setting (or ?theme=dark / ?theme=light). */
:root {
  color-scheme: light;
  --brand: #2E3192;        /* backgrounds: buttons, banners */
  --brand-text: #2E3192;   /* text and links in brand blue */
  --brand-ink: #ffffff;
  --brand-soft: #e1e5f7;
  --accent: #E1251B;
  --accent-text: #E1251B;
  --accent-soft: #fbe2e0;
  /* page and cards are soft tints of the brand blue rather than plain white */
  --bg: #dce1f3;
  --surface: #fafbff;       /* near-white cards, lifted off the tinted page by --card-shadow */
  --ink: #1b1d3a;
  --muted: #545877;
  --line: #ccd2ea;
  --danger: #c4161c;
  --chip-bg: #e2e6f6;
  --input-bg: #ffffff;
  --toast-bg: #1b1d3a;
  --hl-bg: #fff1b8;
  --notice-bg: #fff8e6;
  --notice-line: #f3d48a;
  --score-bg: #e7eaf8;
  --connector: #c4c7e6;
  /* status, winners and focus */
  --ok-text: #1e7d46; --ok-soft: #dcf2e4;
  --warn: #e8a000; --warn-text: #8a5300; --warn-soft: #fdf0d2;
  --gold: #d4a017; --gold-text: #8a6100; --gold-soft: #fbf1d3;
  --gold-grad: linear-gradient(135deg, #f8d66d, #e0a800);
  --focus: #2E3192;
  --card-shadow: 0 1px 2px rgba(27,29,58,.06), 0 6px 18px rgba(46,49,146,.08);
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
/* dark theme tokens (kept in one place; applied by the two rules below) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand: #3d42b8; --brand-text: #aab0ff; --brand-soft: #262a5e;
    --accent-text: #ff7a72; --accent-soft: #3d1c22;
    --bg: #0f1024; --surface: #1a1c38; --ink: #e6e8f7; --muted: #a3a8c9; --line: #2f3360; --danger: #ff7a72;
    --chip-bg: #2a2d52; --input-bg: #12142c; --toast-bg: #2e3192; --hl-bg: #5a4a00;
    --notice-bg: #3a3214; --notice-line: #7a6420; --score-bg: #22254a; --connector: #3d4175;
    --ok-text: #6fdc9f; --ok-soft: #173a29; --warn: #f0b429; --warn-text: #ffc35a; --warn-soft: #3d2e0c;
    --gold: #e0b030; --gold-text: #ffd166; --gold-soft: #3a3010; --focus: #aab0ff;
    --card-shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 18px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #3d42b8; --brand-text: #aab0ff; --brand-soft: #262a5e;
  --accent-text: #ff7a72; --accent-soft: #3d1c22;
  --bg: #0f1024; --surface: #1a1c38; --ink: #e6e8f7; --muted: #a3a8c9; --line: #2f3360; --danger: #ff7a72;
  --chip-bg: #2a2d52; --input-bg: #12142c; --toast-bg: #2e3192; --hl-bg: #5a4a00;
  --notice-bg: #3a3214; --notice-line: #7a6420; --score-bg: #22254a; --connector: #3d4175;
    --ok-text: #6fdc9f; --ok-soft: #173a29; --warn: #f0b429; --warn-text: #ffc35a; --warn-soft: #3d2e0c;
    --gold: #e0b030; --gold-text: #ffd166; --gold-soft: #3a3010; --focus: #aab0ff;
    --card-shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 18px rgba(0,0,0,.25);
}
/* Blallow theme: black backgrounds, yellow buttons and highlights (third click of the theme button).
   Comes after the dark rules so it wins even on a device set to dark mode. */
:root[data-theme="blallow"] {
  color-scheme: dark;
  --brand: #FFC400; --brand-text: #FFC400; --brand-ink: #111; --brand-soft: #2a2410;
  --accent: #FFC400; --accent-text: #FFD54A; --accent-soft: #3a300a; --danger: #ff6b5f;
  --bg: #0a0a0a; --surface: #151515; --ink: #f2f2f2; --muted: #a6a6a6; --line: #2b2b2b;
  --chip-bg: #222; --input-bg: #0f0f0f; --toast-bg: #222; --hl-bg: #5a4a00;
  --notice-bg: #2a2410; --notice-line: #6b5a12; --score-bg: #1d1d1d; --connector: #3a3a3a;
  --ok-text: #7ee2a8; --ok-soft: #13261b; --warn: #FFC400; --warn-text: #FFD54A; --warn-soft: #2a2410;
  --gold: #FFC400; --gold-text: #FFD54A; --gold-soft: #2a2410; --focus: #FFC400;
  --card-shadow: 0 1px 2px rgba(0,0,0,.5);
}
:root[data-theme="blallow"] .brand-mark { background: #fff; border-radius: 50%; }
/* the logo mark is navy line art: give it a light disc so it stays visible on dark headers */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-mark { background: #fff; border-radius: 50%; } }
:root[data-theme="dark"] .brand-mark { background: #fff; border-radius: 50%; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  /* faint sports line-art pattern behind every page; cards stay solid so text is unaffected */
  background: var(--bg) url("/about-bg.svg") repeat center top / 320px;
  color: var(--ink);
  font: 15px/1.5 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand-text); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 24px; padding-bottom: 48px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; }
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: linear-gradient(90deg, var(--brand) 0 70%, var(--accent) 70% 100%); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 12px; }
.brand { text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 44px; height: 44px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-size: 1.9rem; letter-spacing: -.01em; }
.b-red { color: var(--accent-text); font-weight: 800; }
.b-blue { color: var(--brand-text); font-weight: 400; }
.brand-tag { color: var(--brand-text); font-size: .62rem; letter-spacing: .42em; text-transform: uppercase; margin-top: 5px; padding-left: 2px; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--brand-text); text-decoration: none; padding: 8px 12px; font-weight: 600; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--accent-text); }
.nav a.active { border-bottom-color: var(--accent); }
.nav { margin-left: auto; } /* desktop: links and the theme button sit together on the right */
/* sun / moon theme button, top right of the header */
.theme-toggle { flex: none; width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--brand-text); cursor: pointer; padding: 0; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent-text); }
/* one keyboard focus ring everywhere: brand blue (light blue in dark, yellow in Blallow) */
:where(a, button, summary, [tabindex], .chip):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* the button shows the theme it switches to: moon (light -> dark), half disc (dark -> Blallow), sun (Blallow -> light) */
.theme-toggle svg { display: none; }
.theme-toggle .icon-moon, .theme-toggle[data-mode="light"] .icon-moon { display: block; }
.theme-toggle[data-mode="dark"] .icon-moon, .theme-toggle[data-mode="blallow"] .icon-moon { display: none; }
.theme-toggle[data-mode="dark"] .icon-blallow { display: block; }
.theme-toggle[data-mode="blallow"] .icon-sun { display: block; }
.site-footer { border-top: 1px solid var(--line); padding: 16px 0; color: var(--muted); font-size: .85rem; background: var(--surface); }

/* embed mode: hide chrome when shown inside the organization's site */
body.embed .site-header, body.embed .site-footer { display: none; }
body.embed { min-height: 0; background: transparent; }
body.embed main.wrap { padding-top: 8px; }

/* hero */
.hero { background: var(--brand); color: #fff; border-radius: var(--radius); padding: 32px 28px; margin-bottom: 24px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -90px; top: -90px; width: 240px; height: 240px; border-radius: 50%;
  border: 14px solid rgba(255,255,255,.12); border-left-color: var(--accent); transform: rotate(-30deg); }
.hero h1 { position: relative; }
.hero h1 em { color: #ff6b63; font-style: normal; }
.hero p { margin: 0; color: rgba(255,255,255,.85); max-width: 60ch; position: relative; }

/* about (landing) */
/* deep blue gradient with a red glow top right and a blue glow bottom left; the sport art sits on top (::before) */
.about-hero { padding: 44px 32px;
  background: radial-gradient(circle at 88% 12%, rgba(225,37,27,.38), transparent 42%),
    radial-gradient(circle at 8% 115%, rgba(110,130,255,.4), transparent 50%),
    linear-gradient(135deg, var(--brand), #1a1c66); }
.about-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("/hero-sports.svg") no-repeat right 8px center / auto 112%; }
@media (max-width: 1100px) { .about-hero::before { background-position: right -140px center; } } /* keep the bat clear of the heading */
.about-hero::after { display: none; } /* the illustration replaces the decorative arc */
.about-hero h1 { font-size: 2.3rem; }
.hero-actions { margin-top: 20px; position: relative; }
.btn.ghost { background: transparent; border-color: rgba(255,255,255,.7); color: #fff; }
.btn.ghost:hover { background: rgba(255,255,255,.12); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
/* Home page number tiles: icon, number + label, arrow. Each has its colour: blue sports, green open, gold archives */
.stat { --stat: var(--brand-text); display: flex; align-items: center; gap: 14px; padding: 18px 20px; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--card-shadow); position: relative; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--stat) 10%, var(--surface)), var(--surface) 65%);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.stat::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--stat); opacity: .8; }
.stat-open { --stat: var(--ok-text); }
.stat-archive { --stat: var(--gold-text); }
.stat-icon { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem;
  background: color-mix(in srgb, var(--stat) 16%, transparent); }
.stat-text { display: grid; min-width: 0; }
.stat b { font-size: 2rem; font-weight: 800; color: var(--stat); line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .9rem; font-weight: 600; }
.stat-go { margin-left: auto; font-size: 1.2rem; color: var(--muted); transition: transform .15s ease, color .15s ease; }
.stat:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(20,22,60,.18); border-color: color-mix(in srgb, var(--stat) 40%, var(--line)); }
.stat:hover .stat-go { transform: translateX(4px); color: var(--stat); }
@media (prefers-reduced-motion: reduce) { .stat:hover, .stat:hover .stat-go { transform: none; } }
.lead { font-size: 1.05rem; line-height: 1.7; max-width: 75ch; margin: 0 0 16px; }
/* footer: wordmark left, "Powered by SoCom" right */
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-org { color: var(--muted); font-weight: 400; }
.powered-by { color: var(--muted); }
.powered-by b { color: var(--brand-text); }

/* About page highlights */
.highlights { list-style: none; padding: 0; margin: 4px 0 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.highlights li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.highlights .hl-icon { font-size: 1.4rem; line-height: 1; margin-top: 2px; }
.highlights b { display: block; margin-bottom: 2px; }
.highlights div span { color: var(--muted); font-size: .9rem; line-height: 1.45; }

/* "Sports we play" showcase on the About page: informational tiles, not buttons */
.showcase-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 4px 0 12px; }
.sport-showcase { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.sport-tile { display: grid; justify-items: center; text-align: center; gap: 2px; padding: 14px 8px 12px; border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--sport, var(--brand)) 16%, transparent), transparent); }
.sport-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem;
  background: var(--surface); box-shadow: 0 0 0 2px var(--sport, transparent), 0 2px 8px rgba(46,49,146,.15); margin-bottom: 6px; }
.sport-name { font-weight: 700; color: var(--ink); }
.sport-formats { font-size: .75rem; color: var(--muted); }
.sport-tile.suggest { background: none; border: 2px dashed var(--accent); padding: 0; }
.sport-tile.suggest a { display: grid; justify-items: center; gap: 2px; padding: 12px 8px 10px; width: 100%; height: 100%; text-decoration: none; border-radius: 10px; }
.sport-tile.suggest a:hover, .sport-tile.suggest a:focus-visible { background: var(--accent-soft); }
.sport-tile.suggest .sport-icon { color: var(--accent-text); font-weight: 700; box-shadow: none; border: 1px solid var(--accent); }
.sport-tile.suggest .sport-name { color: var(--accent-text); }
.section-title { margin: 28px 0 12px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--card-shadow); }
.step .num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 10px; }
.step h3 { margin-bottom: 4px; }
.step p { margin: 0; color: var(--muted); font-size: .92rem; }
.card.interest-feature { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; border-left: 5px solid var(--accent); margin-top: 16px; }
.interest-feature .eyebrow { color: var(--accent-text); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.interest-feature h2 { font-size: 1.6rem; margin-top: 6px; }
.interest-feature p { max-width: 65ch; line-height: 1.65; }
.flow { padding-left: 1.3em; margin: 0 0 16px; display: grid; gap: 4px; }
.flow li::marker { color: var(--accent-text); font-weight: 700; }
.why { padding-left: 1.1em; margin: 0 0 18px; display: grid; gap: 8px; line-height: 1.55; max-width: 65ch; }
.trending { background: var(--brand-soft); border-radius: var(--radius); padding: 18px; align-self: start; }
.trending ul { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 14px; }
.trending .t-row { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.trending .meter { background: var(--surface); max-width: none; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--sport, var(--brand)); border-color: var(--sport, var(--brand)); color: #fff; }
.chip[style*="--sport"]:not([aria-pressed="true"]) { border-color: color-mix(in srgb, var(--sport) 45%, var(--line)); }
.chip.interest { text-decoration: none; border: 1px dashed var(--accent); color: var(--accent-text); font-weight: 600; }
.chip.interest:hover { background: var(--accent-soft); }
.chip.interest[aria-current="page"] { background: var(--accent); border-style: solid; color: #fff; }

/* show interest: suggestions & votes */
.ideas { list-style: none; padding: 0; margin: 0 0 12px; }
.idea { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.idea:last-child { border-bottom: 0; }
.idea-main { display: grid; gap: 4px; flex: 1 1 220px; min-width: 0; }
.meter { height: 8px; border-radius: 999px; background: var(--brand-soft); overflow: hidden; max-width: 320px; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: inherit; }
.vote-email { margin-bottom: 4px; }
/* "Rate this site" pop-up */
.rate-dialog { width: min(420px, calc(100vw - 32px)); }
.star-pick { display: flex; gap: 4px; }
.star-pick button { background: none; border: 0; padding: 0 2px; font-size: 2.2rem; line-height: 1; cursor: pointer; color: var(--line); transition: transform .1s, color .1s; }
.star-pick button.on { color: #f5b300; }
.star-pick button:hover { transform: scale(1.12); }
.star-pick button:focus-visible { border-radius: 4px; }
.star-label { min-height: 1.2em; margin-top: -8px; }
.rate-dialog .add-comment { justify-self: start; }
/* admin: ratings and feedback */
.rating-summary { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.rating-score { display: grid; justify-items: center; gap: 2px; }
.rating-score b { font-size: 2.6rem; line-height: 1; color: var(--brand-text); }
.stars { color: #f5b300; letter-spacing: 1px; }
.rating-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rating-bars li { display: grid; grid-template-columns: 34px 1fr 28px; gap: 8px; align-items: center; font-size: .85rem; }
.rating-bars .meter { max-width: none; }
.feedback-list { list-style: none; margin: 0; padding: 0; }
.feedback-list li { padding: 12px 0; border-top: 1px solid var(--line); }
.feedback-list li:first-child { border-top: 0; padding-top: 0; }
.feedback-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.feedback-head .spacer { flex: 1; }
.feedback-list p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 520px) { .rating-summary { grid-template-columns: 1fr; } }
/* admin: who voted for a suggestion */
.voters summary { cursor: pointer; color: var(--brand-text); font-weight: 600; width: fit-content; }
.voters ol { margin: 6px 0 0; padding-left: 1.4em; display: grid; gap: 3px; font-size: .9rem; max-height: 240px; overflow-y: auto; }
.voters .badge { font-size: .62rem; vertical-align: 1px; }
.combo-list { position: fixed; z-index: 60; margin: 0; padding: 4px; list-style: none; max-height: 220px; max-width: 320px; overflow-y: auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.combo-list li { padding: 7px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-list li small { display: block; color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; }
input.from-list { background: var(--bg); color: var(--muted); cursor: default; }
.employee-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.combo-list li:hover, .combo-list li.on { background: color-mix(in srgb, var(--brand) 14%, transparent); }
.lookalike { display: block; margin-top: 4px; color: var(--accent-text); }
.match-box { border: 1px solid var(--accent); border-radius: 10px; padding: 10px 12px; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.match-box p { margin: 0 0 8px; font-weight: 600; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--card-shadow); }
.card + .card { margin-top: 16px; }
.grid .card + .card { margin-top: 0; }
.t-card { display: flex; flex-direction: column; gap: 10px; }
/* sport colour along the top edge of tournament cards and the tournament page */
.t-card, .card.sport-edge { border-top: 4px solid var(--sport, var(--brand)); }
/* Blallow stays black and yellow: every sport colour becomes yellow there */
:root[data-theme="blallow"] [style*="--sport"] { --sport: #FFC400 !important; }
:root[data-theme="blallow"] .chip[aria-pressed="true"] { color: #111; }
.t-card .sport { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.t-card .meta { font-size: .88rem; color: var(--muted); display: grid; gap: 2px; }
.t-card .actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
/* enrollment confirmation */
.confirm-card { text-align: left; outline: none; }
.confirm-tick { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 1.8rem; font-weight: 800;
  display: grid; place-items: center; margin-bottom: 10px; animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .confirm-tick { animation: none; } }
.confirm-details { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0; padding: 14px; background: var(--brand-soft); border-radius: 8px; font-size: .92rem; }
.confirm-details dt { color: var(--muted); font-weight: 600; }
.confirm-details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.confirm-tick.waiting { background: var(--brand); font-size: 1.5rem; }
.withdraw-box { margin: 12px 0; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 8px; font-size: .9rem; }
.withdraw-box .toolbar { margin-top: 8px; }
.withdraw-page { max-width: 560px; }
.withdraw-page .toolbar { margin-top: 14px; }
.linklike { background: none; border: 0; padding: 0; color: var(--brand-text); text-decoration: underline; cursor: pointer; font: inherit; font-size: .9rem; }

.urgency { display: grid; gap: 8px; margin: 2px 0 4px; }
.spots-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.spots-row b { color: var(--ink); }
.spots .meter { max-width: none; }
.meter.hot span { background: var(--warn); }
.chip-hot { background: var(--warn); color: #1b1d3a; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.countdown { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .85rem; font-weight: 600; color: var(--brand-text); }
.countdown.urgent { color: var(--warn-text); }
.cd-clock { display: inline-flex; align-items: flex-start; gap: 3px; font-variant-numeric: tabular-nums; }
.cd-unit { display: inline-flex; align-items: baseline; gap: 1px; }
.cd-unit b { font-size: .95rem; }
.cd-unit small { font-size: .7rem; font-weight: 600; opacity: .75; }
.cd-sep { opacity: .45; }
/* the bigger clock on a tournament's page: a box per unit */
.countdown.big { flex-direction: column; align-items: flex-start; gap: 6px; font-size: .95rem; }
.countdown.big .cd-clock { gap: 6px; align-items: center; }
.countdown.big .cd-unit { flex-direction: column; align-items: center; min-width: 58px; padding: 6px 8px; border-radius: 10px;
  background: var(--brand); color: #fff; line-height: 1.1; }
.countdown.big .cd-unit b { font-size: 1.6rem; }
.countdown.big .cd-unit small { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; opacity: .85; }
.countdown.big .cd-sep { font-size: 1.4rem; font-weight: 700; color: var(--muted); }
.countdown.big.urgent .cd-unit { background: var(--warn); color: #1b1d3a; }
:root[data-theme="blallow"] .countdown.big .cd-unit { color: #111; box-shadow: 0 0 12px rgba(255,196,0,.35); }
@media (max-width: 420px) { .countdown.big .cd-unit { min-width: 48px; padding: 5px 6px; } .countdown.big .cd-unit b { font-size: 1.3rem; } }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.badge.open { background: var(--ok-soft); color: var(--ok-text); }
.badge.soon { background: var(--warn-soft); color: var(--warn-text); }
.badge.closed { background: var(--chip-bg); color: var(--muted); }
.badge.draw, .badge.info { background: var(--brand-soft); color: var(--brand-text); }
.badge.resched { background: var(--notice-bg); color: var(--ink); border: 1px solid var(--notice-line); font-size: .65rem; vertical-align: 1px; }
/* Player of the Tournament: a gold-accented strip on the tournament page, a line on cards */
.pot-banner { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 10px 14px; border-radius: 8px;
  background: var(--gold-soft); border: 1px solid var(--gold); }
.pot-banner > span { font-size: 1.6rem; line-height: 1; }
.pot-banner .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.pot-banner .who { font-size: 1.1rem; font-weight: 700; }
.pot-line { font-size: .85rem; margin-top: 6px; }
.pot-line b, .gold-text { color: var(--gold-text); font-weight: 700; }
/* admin-only seeds */
.seed-input { width: 64px; padding: 4px 6px; }
.seed-tag { display: inline-block; min-width: 22px; text-align: center; font-size: .75rem; font-weight: 700; padding: 1px 6px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-text); }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink);
  border-radius: 8px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: var(--surface); color: var(--brand-text); }
.btn.cta { background: var(--accent); border-color: var(--accent); }
.btn.danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

form.stack { display: grid; gap: 14px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
label .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
input, select, textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: var(--focus); }
textarea { min-height: 80px; resize: vertical; }

/* layout for detail page */
.detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.detail > *, .admin-grid > * { min-width: 0; } /* let wide brackets scroll inside their card */
.back { display: inline-block; margin-bottom: 12px; text-decoration: none; }
.participants { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 16px; }
.participants li { padding: 4px 0; border-bottom: 1px dashed var(--line); break-inside: avoid; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; }

/* admin */
.admin-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; }
.admin-tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; }
.admin-tabs a:hover { color: var(--brand-text); }
.admin-tabs a.active { color: var(--brand-text); box-shadow: inset 0 -3px 0 var(--accent); }
.admin-tabs .count { background: var(--accent); color: #fff; border-radius: 999px; font-size: .72rem; min-width: 20px; padding: 1px 6px; text-align: center; }
.admin-narrow { max-width: 760px; }
.card.attention { border-left: 5px solid var(--accent); margin-bottom: 18px; }
.card.attention h3 { margin-bottom: 6px; }
.card.attention ul { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }
.archive-admin-list { list-style: none; padding: 0; margin: 0; }
.archive-admin-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.admin-grid { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .spacer { flex: 1; }
.sport-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
fieldset.formats { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
fieldset.formats legend { font-weight: 600; font-size: .9rem; padding: 0 4px; }
.formats.inline { display: flex; flex-wrap: wrap; gap: 4px 14px; }
label.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; font-size: .88rem; cursor: pointer; }
label.check input { width: auto; margin: 0; accent-color: var(--brand); }
.sport-rows { display: grid; margin-top: 14px; border-top: 1px solid var(--line); }
.sport-row { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.sport-row-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sport-pill { background: var(--brand-soft); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: .85rem; display: inline-flex; align-items: center; gap: 4px; }
.sport-pill button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; padding: 0 4px; }
details.manage { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 12px;
  box-shadow: var(--card-shadow); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
/* closed rows lift on hover like the public cards; an open panel stays put while you work in it */
details.manage:not([open]):hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(20,22,60,.18); border-color: color-mix(in srgb, var(--brand-text) 35%, var(--line)); }
@media (prefers-reduced-motion: reduce) { details.manage:not([open]):hover { transform: none; } }
details.manage > summary { cursor: pointer; padding: 14px 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; list-style: none; }
details.manage > summary::-webkit-details-marker { display: none; }
details.manage > summary::before { content: "▸"; color: var(--muted); }
details.manage[open] > summary::before { content: "▾"; }
details.manage .body { padding: 0 18px 18px; display: grid; gap: 16px; }
details.manage .body > * { min-width: 0; } /* wide brackets scroll inside the panel instead of stretching the page */

/* bracket */
/* Knockout draw sheet: columns per round; each .pair of matches feeds one match in the next round */
.bracket { --link: var(--connector); --gap: 32px; display: flex; gap: var(--gap); overflow-x: auto; padding: 4px 2px 12px; }
.round { display: flex; flex-direction: column; min-width: 200px; flex: none; }
.round h4 { margin: 0 0 10px; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.round .matches { display: flex; flex-direction: column; flex: 1; }
.pair { flex: 1; display: flex; flex-direction: column; position: relative; }
.cell { flex: 1; display: flex; align-items: center; position: relative; padding: 6px 0; }
.cell > * { width: 100%; }
/* "]" joining the two matches of a pair, out into the gap */
.pair:not(.single)::after { content: ""; position: absolute; right: calc(var(--gap) / -2); width: calc(var(--gap) / 2);
  top: 25%; bottom: 25%; border: 2px solid var(--link); border-left: 0; border-radius: 0 6px 6px 0; }
/* the final feeds straight into the champion box */
.round:not(.champion-col) .pair.single::after { content: ""; position: absolute; right: calc(var(--gap) / -2);
  width: calc(var(--gap) / 2); top: 50%; border-top: 2px solid var(--link); }
/* stub from the bracket line into each later-round match */
.round + .round .cell::before { content: ""; position: absolute; left: calc(var(--gap) / -2); width: calc(var(--gap) / 2);
  top: 50%; border-top: 2px solid var(--link); }
.champion-col { min-width: 170px; }
.champ-box { border: 2px dashed var(--line); border-radius: 8px; padding: 12px; font-weight: 700; color: var(--muted); text-align: center; }
.champ-box.won { border: 0; background: var(--gold-grad); color: #3a2a00; }
.draw-meta { margin: -4px 0 10px; }

/* big-draw navigation: search, round tabs, sticky round headings */
.draw-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 8px; }
.find { flex: 1 1 240px; max-width: 360px; }
.find input { border-radius: 999px; padding: 8px 14px; }
.round-tabs { display: flex; gap: 4px; overflow-x: auto; flex: 1 1 auto; padding-bottom: 2px; }
.round-tabs button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px;
  font: inherit; font-size: .82rem; white-space: nowrap; cursor: pointer; }
.round-tabs button[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.find-result:empty { display: none; }
.path { background: var(--brand-soft); border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; font-size: .9rem; }
.path ol { margin: 6px 0 0; padding-left: 0; list-style: none; display: grid; gap: 3px; }
.path-round { display: inline-block; min-width: 110px; color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.slot.hl { background: var(--hl-bg) !important; color: var(--ink) !important; text-decoration: none !important; }
.match.hl-match { border-color: #e0a800; box-shadow: 0 0 0 2px #ffe08a; }
/* the full sheet scrolls inside its own box so round headings can stay visible */
.bracket { max-height: 78vh; overflow: auto; }
.round h4 { position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 4px 0 6px; margin-bottom: 4px; }
.round-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.list-match { display: grid; gap: 4px; }
.match-no { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.draw-card { margin-top: 20px; }

/* admin: tournament stage tracker */
.stages { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; counter-reset: st; }
.stages li { counter-increment: st; font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--chip-bg); padding: 4px 12px 4px 8px; border-radius: 999px; }
.stages li::before { content: counter(st); display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); margin-right: 6px; font-size: .7rem; }
.stages li.done { background: var(--brand-soft); color: var(--brand-text); }
.stages li.done::before { content: "✓"; background: var(--brand); color: #fff; }
.stages li.now { background: var(--accent); color: #fff; }
.stages li.now::before { color: var(--accent-text); }
.enroll-line { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; font-size: .9rem; }
.notice { background: var(--notice-bg); border: 1px solid var(--notice-line); border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; font-size: .9rem; }
.bracket.compact { --gap: 26px; }
.bracket.compact .round { min-width: 170px; }
.bracket.compact .cell { padding: 3px 0; }
.bracket.compact .match { font-size: .8rem; }
.bracket.compact .match .slot { padding: 3px 8px; min-height: 24px; }
.match { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; font-size: .9rem; }
.match .slot { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; gap: 8px; min-height: 34px; }
.match .slot + .slot { border-top: 1px solid var(--line); }
.match .slot.win { background: var(--brand-soft); color: var(--brand-text); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.match .slot.lose { color: var(--muted); text-decoration: line-through; }
.match .slot.tbd, .match .slot.bye { color: var(--muted); font-style: italic; }
.match .score { padding: 4px 10px; font-size: .78rem; font-weight: 600; color: var(--brand-text); background: var(--score-bg);
  border-top: 1px dashed var(--line); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.match.clickable { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.match.clickable:hover, .match.clickable:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.match.clickable.pending { border-style: dashed; border-color: var(--brand); }
/* live score while a match is being played */
.match.live { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
/* live matches: a thin band of moving fire colours along the top edge and a soft warm glow */
.match.live, .fixture.live { position: relative; border-color: #ff7a00; animation: fire-glow 1.6s ease-in-out infinite alternate; }
.match.live::before, .fixture.live::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 1;
  pointer-events: none; border-radius: 7px 7px 0 0;
  background: linear-gradient(90deg, #e1251b, #ff7a00, #ffc400, #ff7a00, #e1251b) 0 0 / 200% 100%;
  animation: fire-band 2.4s linear infinite; }
.fixture.live { overflow: hidden; }
@keyframes fire-band { to { background-position: 200% 0; } }
@keyframes fire-glow {
  from { box-shadow: 0 0 0 1px rgba(255,122,0,.35), 0 0 10px rgba(255,122,0,.18); }
  to { box-shadow: 0 0 0 1px rgba(255,122,0,.6), 0 0 16px rgba(255,122,0,.32); }
}
@media (prefers-reduced-motion: reduce) { .match.live, .fixture.live, .match.live::before, .fixture.live::before { animation: none; } }

.match .score.live { color: var(--accent-text); background: var(--accent-soft); }
.live-dot { font-weight: 800; letter-spacing: .04em; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live-dot, .live-badge { animation: none; } }
.draw-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.live-badge { background: var(--accent); color: #fff; font-size: .75rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; animation: blink 1.4s ease-in-out infinite; }
.winner-pick .live-pick:has(input:checked) { border-color: var(--accent); }
.bracket.compact .match .score { padding: 2px 8px; font-size: .72rem; }

/* result dialog (admin) */
.result-dialog { background: var(--surface); border: 0; border-radius: 14px; padding: 22px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(27,29,58,.35); color: var(--ink); }
.result-dialog::backdrop { background: rgba(27,29,58,.55); }
.winner-pick { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.winner-pick legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.winner-pick .pick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 600; }
.winner-pick .pick input { width: auto; margin: 0; accent-color: var(--accent); }
.winner-pick .pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.champion { margin-top: 12px; padding: 12px 16px; border-radius: 8px; background: var(--gold-grad); color: #3a2a00; font-weight: 700; display: inline-block; }

/* archives: tiles */
.archive-tile { padding: 0; overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.archive-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(46,49,146,.12); }
.archive-cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--brand), #4a4fc4 60%, var(--accent)) center / cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.archive-body { padding: 16px 18px 18px; display: grid; gap: 6px; }
.archive-body h3 { margin: 0; }

/* archives: detail page */
.archive-hero { border-radius: var(--radius); padding: 40px 28px 28px; margin-bottom: 20px; color: #fff; min-height: 200px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  background: linear-gradient(135deg, var(--brand), #3b3fae 65%, var(--accent)) center / cover no-repeat; }
.archive-hero.has-cover { min-height: 320px; }
.archive-hero h1 { margin: 0; font-size: 2rem; }
.archive-hero p { margin: 0; opacity: .9; max-width: 70ch; }
.podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 16px; }
.place { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-shadow); }
.place.first { border-left: 5px solid var(--gold); background: linear-gradient(90deg, var(--gold-soft), var(--surface) 70%); }
.place.second { border-left: 5px solid var(--brand); }
.place .medal { font-size: 2rem; }
.place .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.place .who { font-size: 1.25rem; font-weight: 700; color: var(--brand-text); }
.place.first .who { color: var(--gold-text); }
.place.pot { border-left: 5px solid var(--gold); }
.place.pot .who { color: var(--ink); }
.mentions { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.mentions li { display: grid; gap: 2px; padding: 10px 14px; border-radius: 8px; background: var(--brand-soft); }
.mentions .award { font-size: .8rem; color: var(--muted); font-weight: 600; }
.writeup p { margin: 0 0 1em; max-width: 75ch; line-height: 1.7; }
.writeup p:last-child { margin-bottom: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.thumb { padding: 0; border: 0; border-radius: 8px; overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; background: var(--brand-soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.thumb:hover img { transform: scale(1.04); }
.thumb:focus-visible { outline-width: 3px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(10,11,30,.92); z-index: 20; display: flex; align-items: center; justify-content: center; padding: 48px 16px; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lightbox img { max-width: min(1200px, 100%); max-height: calc(100vh - 140px); object-fit: contain; border-radius: 6px; }
.lightbox figcaption { color: #fff; font-size: .9rem; text-align: center; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 50%; width: 44px; height: 44px; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: var(--accent); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

/* archives: editor */
.mentions-edit { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 0; display: grid; gap: 8px; }
.mentions-edit legend { font-weight: 600; font-size: .9rem; padding: 0 4px; }
#mention-rows { display: grid; gap: 8px; }
.mention-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.mentions-edit > .btn { justify-self: start; }
.dropzone { display: grid; gap: 4px; place-items: center; text-align: center; padding: 22px 16px; border: 2px dashed var(--brand); border-radius: var(--radius);
  background: var(--brand-soft); cursor: pointer; font-weight: 400; color: var(--brand-text); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
#upload-status { margin: 8px 0; color: var(--brand-text); font-weight: 600; }
.photo-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.photo-item { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: grid; gap: 8px; padding-bottom: 8px; }
.photo-item.is-cover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.photo-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.photo-item input, .photo-item .toolbar { margin: 0 8px; width: calc(100% - 16px); }
.photo-item input { padding: 6px 8px; font-size: .85rem; }

/* league: points table, fixtures */
.format-chip { background: var(--brand-soft); color: var(--brand-text); font-weight: 700; font-size: .75rem; padding: 1px 8px; border-radius: 999px; }
.league-tabs { margin-bottom: 14px; }
.league-group + .league-group { margin-top: 16px; }
.league-group h4, .matchday h4 { margin: 0 0 8px; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.league-table { font-variant-numeric: tabular-nums; }
.league-table th:not(:nth-child(2)), .league-table td:not(:nth-child(2)) { text-align: center; width: 48px; }
.league-table td.team { font-weight: 600; }
.team-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--brand-text); cursor: pointer;
  text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand-text) 40%, transparent); text-underline-offset: 3px; text-align: left; }
.team-link:hover, .team-link:focus-visible { color: var(--accent-text); text-decoration-color: currentColor; }
.slot .team-link { font-weight: inherit; color: inherit; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.team-members.big { margin: 0; font-size: 1rem; gap: 6px; }
.team-dialog textarea { min-height: 160px; }
.league-table tr.qualify td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.league-table tr.qualify { background: var(--brand-soft); }
.league-table tr.champ { background: var(--gold-soft); }
.matchday + .matchday { margin-top: 16px; }
.fixture-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.fixture { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); display: grid; gap: 6px; }
.fixture .fx-teams { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.fixture .fx-vs { color: var(--muted); font-weight: 400; font-size: .8rem; }
.fixture .fx-team.win { color: var(--brand-text); }
.fixture .fx-team.win::after { content: " ✓"; }
.fixture .fx-team.lose { color: var(--muted); font-weight: 400; }
.fixture .fx-status { font-size: .82rem; color: var(--muted); }
.fixture .fx-status b { color: var(--ink); }
.fixture.live { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.fixture.live .fx-status { color: var(--accent-text); font-weight: 600; }
.fixture.clickable { cursor: pointer; }
.fixture.clickable.pending { border-style: dashed; border-color: var(--brand); }
.fixture.clickable:hover, .fixture.clickable:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.format-form { display: grid; gap: 8px; width: 100%; }
.format-form .draw-type-fields { display: grid; gap: 8px; }
.format-form .btn { justify-self: start; }
.draw-type-fields { display: grid; gap: 10px; }
.league-toggle-label { margin-top: 2px; }
.day-toggle { margin-bottom: 12px; }

/* confirmation pop-ups */
.ask-dialog { width: min(460px, calc(100vw - 32px)); }
.ask-body p { margin: 0 0 10px; line-height: 1.55; }
.ask-body p:last-child { margin-bottom: 0; }
.btn.danger-solid { background: #c4161c; border-color: #c4161c; color: #fff; }

/* tournaments page heading + empty state */
.page-head { margin-bottom: 16px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; }
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state .empty-icon { font-size: 2.6rem; margin-bottom: 6px; }
.empty-state p { max-width: 52ch; margin: 0 auto 16px; }

/* expandable team entries */
.participants.teams { columns: 1; }
.team-entry { display: flex; align-items: baseline; gap: 8px; }
.team-members { list-style: none; margin: 6px 0 4px 18px; padding: 0; display: grid; gap: 2px; font-size: .9rem; }
.team-members .badge { font-size: .65rem; padding: 1px 6px; margin-left: 4px; }

/* bracket hover: every match of the hovered player */
.slot.hov { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand-text); }

/* page transitions: the old page fades out, the new one fades in (no slide for reduced motion) */
#app { transition: opacity .16s ease-in; }
#app.page-out { opacity: 0; }
#app.page-in { animation: page-in .22s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes page-in-plain { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #app.page-in { animation-name: page-in-plain; } }

/* loading placeholders */
.skel { background: linear-gradient(90deg, var(--chip-bg) 25%, var(--surface) 50%, var(--chip-bg) 75%); background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite; border-radius: 8px; height: 14px; margin-bottom: 10px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.skel-hero { height: 120px; border-radius: var(--radius); margin-bottom: 20px; }
.skel-chips { display: flex; gap: 8px; margin-bottom: 20px; }
.skel.chip-skel { width: 90px; height: 32px; border-radius: 999px; margin: 0; }
.skel-card .w40 { width: 40%; } .skel-card .w80 { width: 80%; } .skel-card .w60 { width: 60%; } .skel-card .w30 { width: 30%; }
.skel-card .tall { height: 22px; }
.skel-card .btn-skel { height: 34px; margin: 16px 0 0; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--toast-bg); color: #fff;
  padding: 10px 18px; border-radius: 8px; opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100% - 32px); z-index: 10; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--danger); }

/* Blallow: surfaces that use the brand colour as a background become charcoal, and anything on yellow gets black text */
:root[data-theme="blallow"] .site-header, :root[data-theme="blallow"] .site-footer { background: #0f0f0f; }
:root[data-theme="blallow"] .b-blue { color: #fff; }
:root[data-theme="blallow"] .hero { background-color: #141414; border: 1px solid #2b2b2b; }
:root[data-theme="blallow"] .about-hero { background: radial-gradient(circle at 88% 12%, rgba(255,196,0,.22), transparent 42%), linear-gradient(135deg, #1a1a1a, #0d0d0d); }
:root[data-theme="blallow"] .hero h1 em { color: #FFC400; }
:root[data-theme="blallow"] .archive-hero, :root[data-theme="blallow"] .archive-cover { background-image: linear-gradient(135deg, #1a1a1a, #2a2410 65%, #6b5a12); }
:root[data-theme="blallow"] .btn.secondary { background: transparent; }
:root[data-theme="blallow"] .sport-tile { background: linear-gradient(180deg, #1f1f1f, transparent); }
:root[data-theme="blallow"] .sport-tile.suggest { background: none; }
:root[data-theme="blallow"] .sport-icon { background: #222; }
:root[data-theme="blallow"] :is(.btn:not(.secondary):not(.ghost):not(.danger):not(.danger-solid), .step .num, .round-tabs button[aria-selected="true"],
  .stages li.done::before, .stages li.now, .confirm-tick, .champ-box.won, .champion, .admin-tabs .count, .live-badge, .chip-hot,
  .chip.interest[aria-current="page"]) { color: #111; }
:root[data-theme="blallow"] .stages li.now::before { color: #8a6d00; }
/* Blallow: a slight glow on the yellow */
:root[data-theme="blallow"] :is(.btn:not(.secondary):not(.ghost):not(.danger):not(.danger-solid), .chip[aria-pressed="true"], .round-tabs button[aria-selected="true"],
  .step .num, .live-badge, .champ-box.won, .champion, .chip-hot) { box-shadow: 0 0 12px rgba(255,196,0,.35); }
:root[data-theme="blallow"] .btn:not(.secondary):not(.ghost):not(.danger):not(.danger-solid):hover { box-shadow: 0 0 18px rgba(255,196,0,.55); }
:root[data-theme="blallow"] :is(.b-red, .hero h1 em, .stat b) { text-shadow: 0 0 12px rgba(255,196,0,.45); }
:root[data-theme="blallow"] .site-header::after { box-shadow: 0 0 10px rgba(255,196,0,.6); }
:root[data-theme="blallow"] .meter span { box-shadow: 0 0 8px rgba(255,196,0,.5); }

@media (max-width: 780px) {
  /* logo on top, nav links in a full-width row underneath */
  .header-inner { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 2px; gap: 4px; }
  .theme-toggle { order: 2; margin-left: auto; }            /* stays top-right, beside the logo */
  .nav { order: 3; width: 100%; justify-content: space-between; margin-left: 0; }
  .nav a { padding: 8px 6px; flex: 1; text-align: center; }
}
@media (max-width: 860px) {
  .detail, .admin-grid { grid-template-columns: 1fr; }
  .hero::after { display: none; }
  .card.interest-feature { grid-template-columns: 1fr; }
  .about-hero::before { background-position: right -200px center; background-size: auto 112%; }
}
@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; }
  .participants { columns: 1; }
  .hero { padding: 20px; }
  .brand-name { font-size: 1.5rem; }
  .brand-tag { letter-spacing: .25em; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-tag { display: none; }
  .mention-row { grid-template-columns: 1fr auto; }
  .mention-row input[data-f="name"] { grid-column: 1; }
  .mention-row [data-rm] { grid-row: 1 / span 2; grid-column: 2; }
  .archive-hero h1 { font-size: 1.5rem; }
  .about-hero { padding: 28px 20px; }
  .about-hero::before { background-position: right -230px bottom -10px; background-size: auto 85%; opacity: .35; } /* behind the text on phones: keep it faint */
  .about-hero h1 { font-size: 1.7rem; }
  .stats { grid-template-columns: 1fr; gap: 8px; }
  .stat { padding: 12px 16px; }
  .stat-icon { width: 44px; height: 44px; font-size: 1.35rem; }
  .stat b { font-size: 1.6rem; }
  .nav a { font-size: .9rem; padding: 8px 2px; }
  h1 { font-size: 1.5rem; }
}

/* enrollment celebration: fireworks + "Hurray, you are enrolled!" banner */
.cel-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px;
  background: rgba(10, 12, 40, .55); animation: cel-fade .25s ease-out; }
.cel-overlay canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cel-banner { position: relative; max-width: 440px; width: 100%; text-align: center; padding: 28px 24px 22px;
  border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35);
  border-top: 6px solid var(--accent); animation: cel-pop .55s cubic-bezier(.2, 1.6, .4, 1) both .15s; }
.cel-icon { font-size: 3.2rem; line-height: 1; display: inline-block; animation: cel-bounce 1s ease-in-out infinite alternate .7s; }
.cel-banner h2 { margin: 10px 0 4px; font-size: 1.7rem; color: var(--brand-text); }
.cel-who { margin: 0 0 12px; font-weight: 600; color: var(--muted); }
.cel-msg { margin: 0 0 18px; font-size: 1.05rem; }
:root[data-theme="blallow"] .cel-banner { box-shadow: 0 0 28px rgba(255,196,0,.35), 0 20px 60px rgba(0,0,0,.5); }
@keyframes cel-fade { from { opacity: 0; } }
@keyframes cel-pop { from { opacity: 0; transform: scale(.6) translateY(30px); } }
@keyframes cel-bounce { to { transform: translateY(-8px) rotate(-8deg); } }
@media (prefers-reduced-motion: reduce) { .cel-banner, .cel-icon, .cel-overlay { animation: none; } }

/* ---------- motion ----------
   Devices set to reduce motion get gentler versions (fades instead of movement), see the media query at the end. */
/* tournament cards lift on hover, like the archive tiles */
.t-card { transition: transform .15s ease, box-shadow .15s ease; }
.t-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(20,22,60,.18); }
/* new page: cards and tiles fade up one after another (app.js sets --i and removes the class when done) */
.card-in { animation: card-in .4s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes card-in-plain { from { opacity: 0; } }
/* new page: progress bars (spots filled, votes, ratings) fill from empty */
#app.fresh .meter span { animation: meter-fill .9s cubic-bezier(.2,.8,.2,1) .2s both; }
@keyframes meter-fill { from { width: 0; } }
/* countdown: a digit that changes rolls in from above */
.cd-unit b { display: inline-block; }
.cd-unit b.roll { animation: cd-roll .35s cubic-bezier(.2,.8,.2,1); }
/* starts half visible: if the browser pauses animations (background tab), a digit never gets stuck invisible */
@keyframes cd-roll { from { transform: translateY(-45%); opacity: .45; } }
@keyframes digit-fade { from { opacity: .45; } }
/* theme button: the old look blends into the new one */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
/* buttons and chips press in slightly */
.btn, .chip { transition: transform .1s ease, filter .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease; }
.btn:active:not(:disabled), .chip:active { transform: scale(.96); }
/* vote: "+1" floats up from the button */
.plus-one { position: fixed; z-index: 20; pointer-events: none; font-weight: 800; font-size: 1.25rem; color: var(--ok-text);
  transform: translate(-50%, -100%); animation: plus-one 1s ease-out forwards; }
@keyframes plus-one {
  0% { opacity: 0; transform: translate(-50%, -60%) scale(.8); }
  20% { opacity: 1; transform: translate(-50%, -110%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -260%); }
}
@keyframes plus-fade { 0%, 100% { opacity: 0; } 25%, 60% { opacity: 1; } }
/* result saved: the winner's name glows gold where it won and where it moves on to */
.match .slot.glow { animation: win-glow 1.8s ease-out; }
@keyframes win-glow { 0%, 35% { background: var(--gold-soft); box-shadow: inset 0 0 0 2px var(--gold), 0 0 16px var(--gold); } }
/* champion: a shine sweeps across the gold every few seconds */
.champion, .champ-box.won { position: relative; overflow: hidden; }
.champion::after, .champ-box.won::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.65) 50%, transparent 65%);
  transform: translateX(-120%); animation: shine 4s ease-in-out 1s infinite; }
@keyframes shine { 0% { transform: translateX(-120%); } 30%, 100% { transform: translateX(120%); } }

@media (prefers-reduced-motion: reduce) {
  .t-card:hover { transform: none; }
  .btn:active:not(:disabled), .chip:active { transform: none; filter: brightness(.9); }
  .card-in { animation-name: card-in-plain; }
  .cd-unit b.roll { animation-name: digit-fade; }
  .plus-one { animation-name: plus-fade; }
  .champion::after, .champ-box.won::after { display: none; }
}
