/* ── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #f5f8fc;   /* off-white with cool blue tint — RG page body */
  --bg2:      #ffffff;   /* pure white cards */
  --bg3:      #eaf0f7;   /* light blue-grey — inputs, sub-cards */
  --border:   #c5d8e8;   /* light blue-steel border */
  --gold:     #b07d00;   /* dark amber — passes WCAG AA on white (4.6:1) */
  --lime:     #3b7700;   /* dark green — passes WCAG AA on white (5.1:1) */
  --rg-blue:  #064874;   /* Restoration Games primary blue */
  --text:     #0c2e40;   /* RG dark navy — 14:1 contrast on white */
  --muted:    #4a6a80;   /* blue-grey muted — 5.2:1 on white */
  --danger:   #b92b2b;   /* darkened red for light bg */
  --success:  #1a7a32;   /* darkened green for light bg */
  --radius:   6px;
  --shadow:   0 2px 14px rgba(6,72,116,.10);
}

/* ── Dark mode ───────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #0d1117;   /* deep navy page body */
    --bg2:      #161b22;   /* dark card background */
    --bg3:      #1c2128;   /* darker input / sub-card */
    --border:   #30363d;   /* dark border */
    --gold:     #d4af37;   /* brighter gold on dark */
    --lime:     #a3e635;   /* bright lime on dark */
    --rg-blue:  #58a6d4;   /* lighter blue on dark */
    --text:     #cdd9e5;   /* light text */
    --muted:    #768390;   /* muted grey */
    --danger:   #f47067;   /* bright red on dark */
    --success:  #57ab5a;   /* bright green on dark */
    --shadow:   0 2px 14px rgba(0,0,0,.40);
  }
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  line-height: 1.55;
}

a { color: var(--rg-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

input, select, textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .95rem;
  padding: .45rem .75rem;
  width: 100%;
  outline: none;
  transition: border-color .2s;
}
input:focus, select:focus { border-color: var(--rg-blue); }
input[readonly] { opacity: .75; cursor: default; }

/* ── Site Header ─────────────────────────────────────────────────────────── */
.site-header {
  /* Blueprint grid — RG's signature header texture */
  background:
    linear-gradient(135deg, rgba(6,72,116,.97) 0%, rgba(6,14,24,.99) 100%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 29px,
      rgba(120,190,255,.07) 29px,
      rgba(120,190,255,.07) 30px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 29px,
      rgba(120,190,255,.07) 29px,
      rgba(120,190,255,.07) 30px
    );
  border-bottom: 2px solid var(--rg-blue);
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: .05em;
  text-transform: uppercase;
}
/* ── Site Nav ────────────────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.site-nav a {
  font-size: .88rem;
  font-weight: 600;
  color: rgba(200,225,255,.75);
  text-decoration: none;
  transition: color .15s;
  white-space: nowrap;
}
.site-nav a:hover { color: #ffffff; }
.site-nav .nav-accent { color: var(--gold); }
.site-nav .nav-logout { color: var(--muted); font-weight: 400; }
@media (max-width: 480px) {
  .site-nav { gap: .75rem; }
  .site-nav a { font-size: .78rem; }
}

.live-badge {
  font-size: .75rem;
  color: var(--lime);
  font-weight: 600;
  letter-spacing: .08em;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.4 } }

/* ── Main ────────────────────────────────────────────────────────────────── */
main { max-width: 900px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: .5rem 1.2rem;
  border-radius: 7px;
  border: none;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
  touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn:hover  { opacity: .88; }
.btn-primary   { background: var(--gold);   color: #0a1422; font-weight: 700; letter-spacing: .02em; }
.btn-secondary { background: var(--rg-blue); color: #fff;    border: 1px solid rgba(100,160,220,.25); }
.btn-lg  { font-size: 1.05rem; padding: .7rem 1.8rem; }
.btn-sm  { font-size: .82rem;  padding: .3rem .8rem; }
.btn-danger { background: var(--danger); color: #fff; }

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 1rem;
  color: var(--rg-blue);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .5rem;
}

/* ── Helpers ─────────────────────────────────────────────────────────────── */
.hidden   { display: none !important; }
.gold     { color: var(--gold); }
.lime     { color: var(--lime); }
.muted    { color: var(--muted); }
.hint     { font-size: .85rem; color: var(--muted); margin-top: .4rem; }
.error-msg   { color: var(--danger); font-size: .88rem; margin-top: .4rem; }
.status-msg  { font-size: .9rem; margin-top: .6rem; min-height: 1.2em; }
.status-msg.ok  { color: var(--lime); }
.status-msg.err { color: var(--danger); }

.centered-box {
  text-align: center;
  margin: 5rem auto;
  max-width: 400px;
}
.centered-box h1 { margin-bottom: 1rem; }
.centered-box p  { color: var(--muted); margin-bottom: 1.5rem; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
  /* Faint blueprint grid echo behind the hero */
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      rgba(100,160,220,.04) 39px,
      rgba(100,160,220,.04) 40px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      rgba(100,160,220,.04) 39px,
      rgba(100,160,220,.04) 40px
    );
}
.hero-title {
  font-size: clamp(2rem, 7vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: .8rem;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 2rem;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.join-box {
  max-width: 400px;
  margin: 0 auto;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.join-hint { color: var(--muted); margin-bottom: .8rem; font-size: .95rem; }
.join-form { display: flex; gap: .5rem; }
.join-form input { flex: 1; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }

/* ── Home Page ──────────────────────────────────────────────────────────── */
.home-wrap              { max-width: 680px; margin: 0 auto; padding: 0 1rem 3rem; }
.home-hero              {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  /* Wider blueprint grid on homepage hero */
  background:
    linear-gradient(to bottom, rgba(6,72,116,.12) 0%, transparent 100%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      rgba(100,160,220,.05) 39px,
      rgba(100,160,220,.05) 40px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      rgba(100,160,220,.05) 39px,
      rgba(100,160,220,.05) 40px
    );
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.home-hero .hero-sub    { margin-bottom: 0; }
.home-primary-card {
  background: var(--bg2);
  border: 1px solid var(--rg-blue);
  border-top: 3px solid var(--rg-blue);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1rem;
}
.home-secondary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.home-secondary-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}
.home-card-icon   { font-size: 1.75rem; margin-bottom: .4rem; }
.home-card-title  { font-size: 1.1rem; font-weight: 800; margin: 0 0 .5rem; color: var(--text); }
.home-card-desc   { font-size: .88rem; color: var(--muted); line-height: 1.45; margin-bottom: 1rem; }
.home-card-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
@media (max-width: 540px) {
  .home-secondary-grid { grid-template-columns: 1fr; }
}

/* ── Create Page ─────────────────────────────────────────────────────────── */
.create-page h1 { margin-bottom: 1.5rem; font-size: 1.8rem; }
.field-label { display: block; font-size: .88rem; color: var(--muted); margin-bottom: .35rem; margin-top: .8rem; }
.field-label:first-child { margin-top: 0; }
.inline-row { display: flex; align-items: center; gap: 1rem; }
.inline-row .field-label { margin: 0; white-space: nowrap; }
.inline-row select { max-width: 100px; }
.radio-group { display: flex; flex-direction: column; gap: .5rem; margin-top: .4rem; }
.radio-opt { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .95rem; }
.radio-opt input { width: auto; }

#round-name-fields { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
#round-name-fields input { width: 120px; flex: 0 0 120px; }

.player-select-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .75rem;
}
.player-select-header span { font-size: .9rem; color: var(--muted); }
.player-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.player-chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .3rem .9rem;
  font-size: .88rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  display: flex; align-items: center; gap: .4rem;
}
.player-chip input { width: auto; accent-color: var(--gold); }
.player-chip:hover { border-color: var(--gold); }
.add-player-row { display: flex; gap: .5rem; margin-top: .8rem; }
.add-player-row input { flex: 1; }
.create-actions { display: flex; justify-content: flex-end; margin-top: .5rem; }
.error-banner {
  background: rgba(224,85,85,.15);
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: .75rem 1rem;
  color: var(--danger);
  margin-top: 1rem;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow);
}
.modal-box h2 { margin-bottom: 1rem; }
.share-row { display: flex; gap: .5rem; margin-top: .4rem; }
.share-row input { flex: 1; font-size: .82rem; }

/* ── Tournament Header ───────────────────────────────────────────────────── */
.t-header {
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.t-header h1 { font-size: 1.6rem; margin-bottom: .25rem; }
.t-meta { color: var(--muted); font-size: .9rem; }
.admin-badge {
  background: var(--gold);
  color: #111;
  padding: .1rem .5rem;
  border-radius: 4px;
  font-size: .78rem;
  font-weight: 700;
}
.share-strip {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .75rem;
  font-size: .85rem;
  flex-wrap: wrap;
}
.share-strip input { max-width: 300px; font-size: .82rem; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: .3rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  padding: .5rem 1rem;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--rg-blue); border-bottom-color: var(--rg-blue); }
.tab-admin { color: #ff9f43 !important; }
.tab-admin.active { color: #ff9f43 !important; border-bottom-color: #ff9f43 !important; }
.conflict-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: #ef4444; color: #fff; font-size: .65rem; font-weight: 800;
  width: 1.1rem; height: 1.1rem; border-radius: 50%; margin-left: .25rem;
  vertical-align: middle;
}
.conflict-badge-pulse {
  animation: conflictBadgePulse 0.9s ease-in-out infinite;
}
@keyframes conflictBadgePulse {
  0%, 100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(239,68,68,.7); }
  50%       { transform: scale(1.3); box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}
@keyframes conflictPulse {
  0%, 100% { border-color: #ef4444; }
  50%       { border-color: #fca5a5; }
}
@keyframes conflictToastIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Closed Tournament Banner ──────────────────────────────────────────────── */
.closed-banner {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: linear-gradient(135deg, #e8f3fb 0%, #ddeef8 100%);
  border: 1px solid var(--rg-blue); border-left: 4px solid var(--rg-blue);
  border-radius: var(--radius);
  padding: .9rem 1.25rem; margin-bottom: 1.25rem;
}
.closed-trophy { font-size: 2rem; flex-shrink: 0; }
.closed-info   { flex: 1; min-width: 0; }
.closed-title  { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
                 color: var(--rg-blue); font-weight: 700; margin-bottom: .15rem; }
.closed-winner { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.closed-winner strong { color: var(--rg-blue); }
.closed-date   { font-size: .78rem; color: var(--muted); margin-top: .1rem; }
.closed-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ── History Page ──────────────────────────────────────────────────────────── */
.history-stage   { margin-bottom: 1.5rem; }
.history-stage h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .07em;
                    color: var(--muted); margin-bottom: .6rem; padding-bottom: .35rem;
                    border-bottom: 1px solid var(--border); }
.history-match   { background: var(--bg3); border: 1px solid var(--border);
                   border-radius: 8px; padding: .65rem 1rem; margin-bottom: .5rem;
                   display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.history-match .hm-winner { font-weight: 700; color: var(--gold); }
.history-match .hm-loser  { color: var(--muted); }
.history-match .hm-score  { font-size: .82rem; color: var(--muted); margin-left: auto; white-space: nowrap; }
.history-match .hm-char   { font-size: .78rem; color: var(--muted); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Standings Table ─────────────────────────────────────────────────────── */
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}
.standings-table th {
  text-align: left;
  padding: .5rem .75rem;
  color: var(--muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}
.standings-table td { padding: .55rem .75rem; border-bottom: 1px solid rgba(6,72,116,.08); }
.standings-table tr:last-child td { border-bottom: none; }
.standings-table tr.rank-1 td { color: var(--gold); font-weight: 700; }
.standings-table tr.rank-top td:first-child { color: var(--lime); }
.rank-cell { font-weight: 700; width: 2.5rem; }
.name-cell { font-weight: 600; }
.empty-msg { color: var(--muted); padding: 1rem 0; font-size: .95rem; }

/* ── Schedule filter bar ────────────────────────────────────────────────── */
.schedule-filter-bar {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .9rem;
}
.schedule-filter-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.schedule-filter-select {
  padding: .28rem .6rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .85rem;
  cursor: pointer;
}
.schedule-filter-select:focus { outline: none; border-color: var(--gold); }

/* ── Schedule ────────────────────────────────────────────────────────────── */
.round-block { margin-bottom: 1.5rem; }
.round-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--rg-blue);
  margin-bottom: .6rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.done-badge {
  background: var(--success);
  color: #fff;
  font-size: .7rem;
  padding: .1rem .4rem;
  border-radius: 4px;
}
.match-list { display: flex; flex-direction: column; gap: .4rem; }
.match-row {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .55rem 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .92rem;
}
.match-row.match-done { border-color: rgba(59,119,0,.25); background: rgba(59,119,0,.04); }
.match-player { font-weight: 600; min-width: 100px; }
.match-player.winner { color: var(--lime); }
.match-vs { color: var(--muted); font-size: .8rem; }
.match-result-badge {
  margin-left: auto;
  color: var(--lime);
  font-size: .82rem;
}
.match-result-badge small { color: var(--muted); }

/* ── Matchup edit (admin schedule tab) ───────────────────────────────────── */
.match-edit-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .95rem;
  opacity: .45;
  padding: 0 .2rem;
  transition: opacity .15s;
  line-height: 1;
}
.match-edit-btn:hover { opacity: 1; }
.match-edit-form {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: .55rem .9rem .6rem;
  margin-top: -4px;
}
.match-edit-inner {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.match-edit-inner select {
  flex: 1;
  min-width: 120px;
  font-size: .83rem;
  padding: .3rem .5rem;
}
.match-edit-vs {
  font-size: .78rem;
  color: var(--muted);
  flex-shrink: 0;
}
.match-edit-save {
  font-size: .82rem;
  padding: .3rem .75rem;
  flex-shrink: 0;
}
.match-edit-cancel {
  font-size: .82rem;
  padding: .3rem .6rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}
.match-edit-cancel:hover { border-color: var(--danger); color: var(--danger); }
.match-edit-msg {
  font-size: .78rem;
  margin-top: .35rem;
  min-height: 1em;
}

/* ── Bracket ─────────────────────────────────────────────────────────────── */
#bracket-container {
  overflow-x: auto;
  padding: .5rem 0;
}
.bracket-wrap {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  min-width: max-content;
  padding: 1rem;
}
.bracket-col { display: flex; flex-direction: column; gap: 0; }
.bracket-col-title {
  text-align: center;
  font-size: .78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .75rem;
}
.b-match {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 160px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.b-match.b-done { border-color: rgba(59,119,0,.3); background: rgba(59,119,0,.03); }
.b-player {
  padding: .4rem .75rem;
  font-size: .88rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.b-player:last-child { border-bottom: none; }
.b-player.b-winner { color: var(--lime); }
.b-player.b-bye { color: var(--muted); font-style: italic; font-weight: 400; }
.b-player.b-tbd { color: var(--muted); font-style: italic; font-weight: 400; }
.b-seed { font-size: .7rem; color: var(--muted); font-weight: 400; }
.b-spacer { height: 32px; }  /* vertical spacing between matches in a column */

/* ── Double Elimination sections ─────────────────────────────────────────── */
.de-section { margin-bottom: .5rem; }
.de-section-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  padding: .35rem .5rem .35rem 0;
  margin-bottom: .35rem;
  border-bottom: 1px solid var(--border);
}

.b-champion {
  background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 100%);
  border: 1px solid #b07d00;
  border-top: 3px solid #b07d00;
  border-radius: 8px;
  min-width: 160px;
  padding: .75rem;
  text-align: center;
  box-shadow: 0 2px 12px rgba(176,125,0,.15);
}
.b-champion .b-crown { font-size: 1.2rem; }
.b-champion .b-champ-name { color: #7a5200; font-size: 1rem; font-weight: 700; margin-top: .25rem; }
.b-champion .b-champ-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ── Projected Playoff Bracket (standings tab) ────────────────────────────── */
#projected-bracket-container {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.proj-bracket-header {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.proj-bracket-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}
.proj-bracket-status {
  font-size: .78rem;
  color: var(--muted);
  font-style: italic;
}
.proj-bracket-warning {
  font-size: .8rem;
  color: #b45309;
  background: rgba(180, 83, 9, .1);
  border: 1px solid rgba(180, 83, 9, .3);
  border-radius: 6px;
  padding: .4rem .75rem;
  margin-bottom: .75rem;
}
.proj-bracket-scroll { overflow-x: auto; }
.proj-bracket-wrap {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  min-width: max-content;
  padding: .75rem 0 .5rem;
}
/* Projected match card: dashed border, slightly muted */
.b-match.b-proj {
  border-style: dashed;
  opacity: .9;
}
.b-match.b-proj .b-player { font-weight: 500; }

/* ── DE Seed Order list ───────────────────────────────────────────────────── */
.de-seed-list { display: flex; flex-direction: column; gap: .35rem; }
.seed-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .45rem .75rem;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 7px;
  cursor: grab; user-select: none; font-size: .9rem;
  transition: background .15s;
}
.seed-item:hover { background: var(--bg3); }
.seed-item.dragging { opacity: .45; cursor: grabbing; }
.seed-handle { color: var(--muted); font-size: 1rem; flex-shrink: 0; }
.seed-num { font-weight: 700; color: var(--muted); min-width: 2.2rem; font-size: .82rem; }
.seed-name { flex: 1; }
.seed-bye-tag {
  font-size: .72rem; font-weight: 600; padding: .15rem .45rem;
  background: rgba(176,125,0,.10); color: var(--gold);
  border: 1px solid rgba(176,125,0,.25); border-radius: 4px;
}
.seed-wbtag {
  font-size: .72rem; font-weight: 600; padding: .15rem .45rem;
  background: rgba(59,119,0,.08); color: var(--lime);
  border: 1px solid rgba(59,119,0,.2); border-radius: 4px;
}

/* ── Admin panel ─────────────────────────────────────────────────────────── */
.admin-card { margin-bottom: 1.2rem; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
}
.form-group label {
  display: block;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: .3rem;
}
.admin-actions { display: flex; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }
.score-preview {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: .75rem 1rem;
  margin-top: .75rem;
  font-size: .88rem;
  line-height: 1.6;
}
.score-preview .pts { color: var(--gold); font-weight: 700; font-size: 1.1rem; }

/* ── Utility classes ─────────────────────────────────────────────────────── */
.flex-center   { display: flex; align-items: center; }
.flex-between  { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap     { display: flex; flex-wrap: wrap; }
.stat-number   { font-size: 2rem; font-weight: 800; color: var(--gold); }
.upper-muted   { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sub-card      { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; }
.text-center   { text-align: center; }
.text-sm       { font-size: .82rem; }
.text-muted    { color: var(--muted); }
.mt-1          { margin-top: .6rem; }
.mt-2          { margin-top: 1.2rem; }
.mb-1          { margin-bottom: .6rem; }
.gap-sm        { gap: .5rem; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  main { padding: 1rem .75rem 3rem; }
  .hero { padding: 2.5rem .5rem 2rem; }
  .form-grid { grid-template-columns: 1fr; }
  .match-row { font-size: .85rem; }
  .standings-table { font-size: .85rem; }
  .tab-btn { padding: .45rem .7rem; font-size: .88rem; }
}
