/* RAEC Badminton — public portal + admin panel. Mobile first. */
:root {
  --bg: #F4F4F5;
  --surface: #FFFFFF;
  --surface-2: #EDEDEF;
  --ink: #141414;
  --ink-2: #4E4E55;
  --ink-3: #7D7D85;
  --line: #E2E2E5;
  --brand: #111111;
  --brand-2: #000000;
  --on-brand: #FFFFFF;
  --accent: #E30613;
  --on-accent: #FFFFFF;
  --live: #E30613;
  --live-soft: #FDECEC;
  --ok: #0D7A55;
  --warn: #B45309;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 20px rgba(0, 0, 0, .06);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --nav-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0B0C;
    --surface: #161618;
    --surface-2: #1F1F22;
    --ink: #F2F2F3;
    --ink-2: #B3B3B8;
    --ink-3: #85858C;
    --line: #2A2A2E;
    --brand: #000000;
    --brand-2: #000000;
    --accent: #FF2D3A;
    --live: #FF2D3A;
    --live-soft: #3A1418;
    --ok: #3CCB91;
    --warn: #F0A33A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar {
  position: relative;
  background: var(--brand);
  color: var(--on-brand);
  overflow: hidden;
  padding: calc(14px + env(safe-area-inset-top)) 16px 64px;
}
/* faint court lines */
.topbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(255,255,255,.10) calc(50% - 1px), rgba(255,255,255,.10) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(transparent 38%, rgba(255,255,255,.08) 38%, rgba(255,255,255,.08) calc(38% + 2px), transparent calc(38% + 2px)),
    linear-gradient(90deg, transparent 12%, rgba(255,255,255,.07) 12%, rgba(255,255,255,.07) calc(12% + 2px), transparent calc(12% + 2px), transparent 88%, rgba(255,255,255,.07) 88%, rgba(255,255,255,.07) calc(88% + 2px), transparent calc(88% + 2px));
  pointer-events: none;
}
.topbar-inner { position: relative; max-width: 1080px; margin: 0 auto; }
.brand-row { display: flex; align-items: center; gap: 12px; }
/* Transparent logo with white lettering, made for the black bar */
.logo { width: 64px; height: 64px; flex: none; object-fit: contain; }
.brand-text { min-width: 0; }
.brand-org { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.brand-title { font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.05; letter-spacing: .01em; }
.conn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; opacity: .9; white-space: nowrap; }
.conn::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #FFB020; }
.conn.on::before { background: var(--accent); box-shadow: 0 0 0 0 rgba(227, 6, 19, .6); animation: pulse 2s infinite; }
.meta-line { margin-top: 10px; font-size: 13px; opacity: .85; display: flex; flex-wrap: wrap; gap: 4px 14px; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(200,242,79,.55); } 70% { box-shadow: 0 0 0 8px rgba(200,242,79,0); } 100% { box-shadow: 0 0 0 0 rgba(200,242,79,0); } }
@keyframes livepulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- layout ---------- */
.wrap { max-width: 1080px; margin: -48px auto 0; padding: 0 16px; position: relative; }
.announce {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--accent); color: var(--on-accent);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 12px;
  font-weight: 600; font-size: 14px;
}

/* segmented control */
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--surface); border-radius: 14px; padding: 4px;
  box-shadow: var(--shadow);
}
.seg button {
  border: 0; background: transparent; border-radius: 10px; padding: 10px 8px;
  font-weight: 800; font-size: 15px; color: var(--ink-2);
}
.seg button[aria-selected="true"] { background: var(--ink); color: var(--surface); }

/* ---------- tie scoreboard ---------- */
.tie {
  margin-top: 12px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 16px 16px;
}
.tie-label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.tie-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-top: 12px; }
.tie-team { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tie-team.right { align-items: flex-end; text-align: right; }
.crest {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--team); color: #fff; font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .02em;
}
.crest.has-logo, .logo-preview { background: #fff; padding: 3px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.crest.has-logo img, .logo-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tie-name { font-weight: 800; font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.tie-score { font-family: var(--display); font-weight: 700; font-size: 56px; line-height: 1; display: flex; gap: 10px; align-items: center; font-variant-numeric: tabular-nums; }
.tie-score .dash { color: var(--ink-3); font-size: 36px; }
.tie-score .lead { color: var(--ink); }
.tie-score .trail { color: var(--ink-3); }
.tie-sub { text-align: center; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.champion { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 800; }

.rubbers { display: flex; gap: 6px; margin-top: 14px; }
.rubber {
  flex: 1; min-width: 0; height: 8px; border-radius: 999px; background: var(--surface-2);
}
.rubber.done { background: var(--team); }
.rubber.live { background: var(--live); animation: livepulse 1.6s infinite; }

/* ---------- tabs / bottom nav ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabs button {
  border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 700; color: var(--ink-3); position: relative;
}
.tabs svg { width: 24px; height: 24px; }
.tabs button[aria-selected="true"] { color: var(--brand); }
@media (prefers-color-scheme: dark) { .tabs button[aria-selected="true"] { color: var(--accent); } }
.tabs .dot { position: absolute; top: 10px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: livepulse 1.6s infinite; }

.view { margin-top: 18px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 22px 2px 10px; }
.section-head:first-child { margin-top: 0; }
.section-head h2 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: .01em; }
.section-head small { color: var(--ink-3); font-size: 12px; font-weight: 600; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; margin: 0 -2px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13px;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip .n { opacity: .6; margin-left: 4px; }

/* ---------- match card ---------- */
.match-list { display: grid; gap: 10px; }
.match {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; border: 1px solid transparent;
}
.match.is-live { border-color: color-mix(in srgb, var(--live) 45%, transparent); }
.match-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); font-weight: 600; margin-bottom: 8px; flex-wrap: wrap; }
.match-meta .mno { color: var(--ink); font-weight: 800; }
.badge { margin-left: auto; border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; background: var(--surface-2); color: var(--ink-2); }
.badge.live { background: var(--live); color: #fff; }
.badge.live::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #fff; margin-right: 5px; vertical-align: 1px; animation: livepulse 1.2s infinite; }
.badge.final { background: var(--ink); color: var(--surface); }

.side { display: grid; grid-template-columns: 4px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.side + .side { border-top: 1px dashed var(--line); }
.tbar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--team); }
.side-names { min-width: 0; }
.side-team { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.side-players { font-weight: 700; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.side.loser .side-players { color: var(--ink-2); font-weight: 600; }
.side.winner .side-players::after { content: 'W'; font-size: 10px; font-weight: 900; background: var(--ok); color: #fff; border-radius: 4px; padding: 1px 5px; }
.serve { width: 16px; height: 16px; color: var(--accent); filter: drop-shadow(0 0 0 var(--ink)); }
.serve svg { width: 16px; height: 16px; display: block; color: var(--brand); }
@media (prefers-color-scheme: dark) { .serve svg { color: var(--accent); } }
.gp { font-size: 10px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: var(--warn); }
.games { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.games li {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px;
  font-family: var(--display); font-weight: 600; font-size: 20px; font-variant-numeric: tabular-nums;
  color: var(--ink-3); background: transparent;
}
.games li.w { color: var(--ink); font-weight: 700; }
.games li.cur { background: var(--live-soft); color: var(--live); font-weight: 700; }
.games li.empty { color: transparent; }
.match-foot { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.potm-tag { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; color: var(--ink); }
.potm-tag .star { color: #E2A400; }
.note { color: var(--warn); font-weight: 700; }

/* ---------- tables ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-pad { padding: 16px; }
.table-scroll { overflow-x: auto; }
table.standings { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.standings th, .standings td { padding: 11px 8px; text-align: center; white-space: nowrap; }
.standings th { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); }
.standings td { border-top: 1px solid var(--line); font-weight: 600; }
.standings th:first-child, .standings td:first-child { padding-left: 14px; width: 28px; color: var(--ink-3); }
.standings .name { text-align: left; white-space: normal; min-width: 140px; }
.standings .name strong { display: block; font-weight: 800; line-height: 1.25; }
.standings .name span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.standings .pts { font-family: var(--display); font-size: 20px; font-weight: 700; }
.standings td:last-child, .standings th:last-child { padding-right: 14px; }
.standings tr.leader td:first-child { box-shadow: inset 4px 0 0 var(--team); color: var(--ink); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--team); margin-right: 6px; vertical-align: 0; }
.pos { color: var(--ok); } .neg { color: var(--live); }
.legend { font-size: 12px; color: var(--ink-3); padding: 10px 14px 12px; border-top: 1px solid var(--line); }

.potm-list { list-style: none; margin: 0; padding: 0; }
.potm-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.potm-list li:first-child { border-top: 0; }
.potm-list .count { margin-left: auto; font-family: var(--display); font-size: 22px; font-weight: 700; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 800; font-size: 13px; color: var(--ink-2); }

/* ---------- teams ---------- */
.team-grid { display: grid; gap: 12px; }
.team-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.team-card header { display: flex; gap: 12px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, color-mix(in srgb, var(--team) 14%, transparent), transparent 70%); }
.team-card h3 { margin: 0; font-size: 17px; font-weight: 800; }
.team-card header small { color: var(--ink-3); font-weight: 600; }
.pair-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); }
.pair-row:first-of-type { border-top: 0; }
.pair-no { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font-weight: 800; font-size: 13px; color: var(--ink-2); flex: none; }
.pair-row .rec { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }

/* ---------- info ---------- */
.info-grid { display: grid; gap: 12px; }
.info-card h3 { margin: 0 0 8px; font-family: var(--display); font-size: 20px; }
.info-card p, .info-card li { color: var(--ink-2); }
.info-card ul { margin: 0; padding-left: 18px; }
.info-card li { margin: 4px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--ink-3); font-weight: 700; font-size: 13px; }
.kv dd { margin: 0; font-weight: 700; }

.empty-state { text-align: center; padding: 34px 20px; color: var(--ink-3); background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--line); }
.empty-state strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.site-foot { text-align: center; color: var(--ink-3); font-size: 12px; margin: 28px 0 8px; }
.site-foot a { font-weight: 700; }

/* ---------- desktop ---------- */
@media (min-width: 760px) {
  body { padding-bottom: 40px; }
  .topbar { padding-bottom: 76px; }
  .brand-title { font-size: 32px; }
  .logo { width: 88px; height: 88px; }
  .wrap { margin-top: -56px; }
  .tabs {
    position: static; height: auto; padding: 4px; margin-top: 16px;
    display: inline-grid; grid-auto-flow: column; grid-template-columns: none;
    background: var(--surface); border: 0; border-radius: 14px; box-shadow: var(--shadow);
    backdrop-filter: none;
  }
  .tabs button { flex-direction: row; gap: 8px; font-size: 14px; padding: 9px 16px; border-radius: 10px; }
  .tabs button[aria-selected="true"] { background: var(--surface-2); }
  .tabs svg { width: 18px; height: 18px; }
  .tabs .dot { top: 8px; left: auto; right: 6px; }
  .top-controls { display: flex; gap: 12px; align-items: center; }
  .top-controls .seg { width: 280px; }
  .tie { padding: 22px 26px 20px; }
  .tie-score { font-size: 80px; }
  .crest { width: 52px; height: 52px; font-size: 22px; }
  .tie-name { font-size: 19px; }
  .match-list { grid-template-columns: 1fr 1fr; }
  .team-grid, .info-grid { grid-template-columns: 1fr 1fr; }
  .split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
  .split .section-head:first-child { margin-top: 0; }
}

/* =================== ADMIN =================== */
.admin body, body.admin { padding-bottom: 40px; }
.admin .topbar { padding-bottom: 18px; }
.admin .wrap { margin-top: 16px; }
.admin-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-top: 14px; }
.admin-nav button { flex: none; border: 0; background: rgba(255,255,255,.12); color: #fff; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 14px; }
.admin-nav button[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
@media (max-width: 480px) {
  .admin .brand-row { flex-wrap: wrap; }
  .admin .top-actions { order: 3; width: 100%; margin-left: 0; }
}
.link-btn { background: rgba(255,255,255,.14); border: 0; color: #fff; border-radius: 10px; padding: 7px 12px; font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 12px; padding: 10px 16px; font-weight: 800; font-size: 14px; min-height: 44px; text-decoration: none;
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.danger { color: var(--live); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.field { display: grid; gap: 5px; }
.field > span { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.field input, .field select, .field textarea, .input {
  width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px;
  background: var(--bg); color: var(--ink);
}
.field input[type="color"] { padding: 4px; height: 44px; }
.form-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } .form-grid.three { grid-template-columns: 1fr 1fr 1fr; } }
.hint { font-size: 12px; color: var(--ink-3); margin: 0; }

.login { max-width: 380px; margin: 40px auto; }
.error { color: var(--live); font-weight: 700; font-size: 14px; min-height: 1.2em; margin: 0; }

/* scorer */
.pick-list { display: grid; gap: 8px; }
.pick {
  text-align: left; width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 12px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
}
.pick[aria-current="true"] { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; }
.pick .mno { font-family: var(--display); font-weight: 700; font-size: 20px; width: 34px; text-align: center; color: var(--ink-3); }
.pick .vs { font-size: 13px; font-weight: 700; line-height: 1.3; }
.pick .vs em { font-style: normal; color: var(--ink-3); font-weight: 600; }

.scorer { display: grid; gap: 12px; }
.scorer-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.scorer-head h2 { margin: 0; font-family: var(--display); font-size: 24px; }
.court-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.court-side {
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 12px;
  display: grid; gap: 10px; border-top: 5px solid var(--team); text-align: center;
}
.court-side .who { font-size: 13px; font-weight: 800; line-height: 1.3; min-height: 2.6em; }
.court-side .who small { display: block; font-size: 11px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.big-score { font-family: var(--display); font-weight: 700; font-size: 72px; line-height: 1; font-variant-numeric: tabular-nums; }
.games-won { font-size: 12px; font-weight: 800; color: var(--ink-3); }
.plus {
  min-height: 96px; border: 0; border-radius: 16px; background: var(--team); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 40px; touch-action: manipulation;
}
.plus:active { transform: scale(.98); }
.plus:disabled { opacity: .3; transform: none; }
.minus { min-height: 40px; }
.serving-tag { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); min-height: 1.4em; }
@media (prefers-color-scheme: dark) { .serving-tag { color: var(--accent); } }
.game-strip { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.game-strip span { background: var(--surface-2); border-radius: 8px; padding: 4px 10px; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px; }
.game-strip span.cur { background: var(--live-soft); color: var(--live); }

.warn-banner {
  background: var(--live); color: #fff; border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; line-height: 1.4;
  animation: livepulse 2.4s infinite;
}
.next-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 2px solid var(--brand); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
}
.next-card small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.next-card strong { display: block; font-size: 16px; }
.next-card span { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.link-row { display: grid; grid-template-columns: 80px 1fr auto; gap: 8px; align-items: center; }
.link-row .input { min-height: 36px; font-size: 13px; }
@media (max-width: 480px) { .link-row { grid-template-columns: 1fr auto; } .link-row strong { grid-column: 1 / -1; } }
code { font-size: .92em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

.admin-list { display: grid; gap: 8px; }
.admin-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--surface); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); }
.admin-row .grow { flex: 1; min-width: 180px; }
.admin-row .title { font-weight: 800; font-size: 14px; }
.admin-row .sub { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.pair-edit { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .pair-edit { grid-template-columns: 1fr 1fr; } }

dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(560px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(8, 17, 29, .6); }
dialog form { padding: 18px; display: grid; gap: 14px; }
dialog h3 { margin: 0; font-family: var(--display); font-size: 24px; }
.games-edit { display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; align-items: center; }
.games-edit .lbl { font-size: 12px; font-weight: 800; color: var(--ink-3); }
.games-edit .colhead { font-size: 12px; font-weight: 800; color: var(--ink-2); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px;
  transition: .2s; z-index: 50; max-width: calc(100vw - 32px); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--live); color: #fff; }

/* knockout */
.standings tr.q td:first-child { color: var(--accent); font-weight: 800; }
.champs-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--brand); color: var(--on-brand); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.champs-banner span { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.champs-banner strong { font-family: var(--display); font-size: 26px; line-height: 1.1; }
.side-players.tbd { color: var(--ink-3); font-style: italic; font-weight: 600; }
.site-foot .credit { display: inline-block; margin-top: 4px; opacity: .8; }
.logo-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo-preview { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; color: #fff; }
.logo-preview.empty { background: var(--team); box-shadow: none; }
