/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
  --bg:       #0d1117;
  --bg2:      #161b22;
  --bg3:      #1c2128;
  --surface:  #21262d;
  --surface2: #2d333b;
  --border:   rgba(240,246,252,0.1);
  --accent:   #238636;
  --accent-l: #3fb950;
  --accent-d: #196127;
  --gold:     #d29922;
  --gold-l:   #e3b341;
  --red:      #da3633;
  --red-l:    #f85149;
  --text:     #e6edf3;
  --text2:    #8b949e;
  --text3:    #6e7681;
  --fh:       'Barlow Condensed', sans-serif;
  --fb:       'Barlow', sans-serif;
  --radius:   6px;
  --sidebar-w: 210px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── Shell ──────────────────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--fb);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 14px;
  font-family: var(--fh);
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  letter-spacing: .3px;
  text-decoration: none;
}
.sidebar-logo .logo-icon { font-size: 20px; }
.sidebar-logo .logo-accent { color: var(--accent-l); }

.sidebar-section {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  padding: 4px 14px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  color: var(--text2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all .12s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: rgba(35,134,54,.12); color: var(--accent-l); border-left-color: var(--accent-l); font-weight: 600; }
.nav-item.admin-link { color: #a78bfa; }
.nav-item.admin-link:hover { color: #c4b5fd; }
.nav-item.admin-link.active { color: #c4b5fd; border-left-color: #a78bfa; background: rgba(167,139,250,.1); }
.nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.sidebar-footer form { display: block; }
.sidebar-footer .nav-item { font-size: 12px; }

/* ── Main area ──────────────────────────────────────────────────────────────── */
.container {
  margin-left: var(--sidebar-w);
  padding: 24px 28px;
  max-width: calc(var(--sidebar-w) + 1100px);
}

footer {
  margin-left: var(--sidebar-w);
  padding: 12px 28px;
  color: var(--text3);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

/* ── Typography ─────────────────────────────────────────────────────────────── */
h1 {
  font-family: var(--fh);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
h2 {
  font-family: var(--fh);
  font-size: 16px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
h3 { font-family: var(--fh); font-size: 15px; font-weight: 700; color: var(--text); }
p  { color: var(--text2); margin-bottom: .6rem; }

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 13px; }
.alert-success { background: rgba(35,134,54,.15);  border: 1px solid rgba(63,185,80,.3);  color: #3fb950; }
.alert-error   { background: rgba(218,54,51,.15);  border: 1px solid rgba(248,81,73,.3);  color: #f85149; }
.alert-info    { background: rgba(56,139,253,.15); border: 1px solid rgba(56,139,253,.3); color: #79c0ff; }

/* ── Cards / Sections ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.card-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  background: var(--bg3);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-body { padding: 16px; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.form-input, .form-select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--fb);
  font-size: 13px;
  padding: 7px 10px;
  border-radius: var(--radius);
  outline: none;
  transition: border-color .12s;
  appearance: none;
}
.form-input:focus, .form-select:focus { border-color: var(--accent-l); }
.select-wrap { position: relative; display: block; }
.select-wrap::after { content: '▾'; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text2); font-size: 20px; }
.form-input::placeholder { color: var(--text3); }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.check-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text2); }
.check-label input[type=checkbox] { width: 14px; height: 14px; cursor: pointer; accent-color: var(--accent-l); }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--fb);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all .12s;
  text-align: center;
  line-height: 1.4;
}
.btn-primary   { background: var(--accent); border-color: var(--accent-l); color: #fff; }
.btn-primary:hover { background: var(--accent-l); }
.btn-secondary { background: var(--surface2); border-color: var(--border); color: var(--text2); }
.btn-secondary:hover { border-color: var(--text3); color: var(--text); }
.btn-danger    { background: rgba(218,54,51,.15); border-color: rgba(248,81,73,.3); color: var(--red-l); }
.btn-danger:hover { background: rgba(218,54,51,.25); }
.btn-gold      { background: var(--gold); border-color: var(--gold-l); color: #0d1117; font-weight: 700; }
.btn-gold:hover { background: var(--gold-l); }
.btn-sm { font-size: 12px; padding: 4px 10px; }
.btn-block { width: 100%; display: block; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Auth cards ─────────────────────────────────────────────────────────────── */
.auth-wrap  { max-width: 400px; margin: 60px auto; }
.auth-card  { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 28px; }
.auth-title { font-family: var(--fh); font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.auth-sub   { color: var(--text3); font-size: 13px; margin-bottom: 20px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text2); }
.auth-switch a { color: var(--accent-l); text-decoration: none; }
.qr-wrap { text-align: center; margin: 12px 0; }
.qr-wrap img { border: 4px solid #fff; border-radius: 6px; width: 160px; height: 160px; }
.otp-hint { background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; padding: 12px; margin: 12px 0; font-size: 12px; color: var(--text2); line-height: 1.6; }
.otp-hint code { color: var(--gold-l); font-family: monospace; font-size: 13px; word-break: break-all; }
.totp-step { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.totp-step:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.totp-step-num { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-family: var(--fh); font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.totp-step-body { flex: 1; min-width: 0; }

/* ── Stats row ──────────────────────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.stat-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--text3); margin-bottom: 4px; }
.stat-value { font-family: var(--fh); font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-value.gold  { color: var(--gold-l); }
.stat-value.green { color: var(--accent-l); }

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 20px; text-transform: uppercase; letter-spacing: .4px; border: 1px solid transparent; }
.badge-open    { background: rgba(35,134,54,.2);  color: var(--accent-l); border-color: rgba(63,185,80,.35); }
.badge-closed  { background: rgba(110,118,129,.15); color: var(--text3); border-color: rgba(110,118,129,.25); }
.badge-tipped  { background: rgba(210,153,34,.2); color: var(--gold-l); border-color: rgba(227,179,65,.35); }
.badge-pts     { background: rgba(210,153,34,.2); color: var(--gold-l); border-color: rgba(227,179,65,.35); }
.badge-exact   { background: rgba(35,134,54,.3);  color: #56d364; border-color: rgba(63,185,80,.5); }
.badge-zero    { background: rgba(110,118,129,.15); color: var(--text3); border-color: rgba(110,118,129,.25); }
.badge-blocked { background: rgba(218,54,51,.2);  color: var(--red-l); border-color: rgba(248,81,73,.35); }

/* ── Tables (admin) ─────────────────────────────────────────────────────────── */
.admin-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text3);
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.admin-table td { padding: 6px 10px; border-bottom: 1px solid rgba(240,246,252,.05); vertical-align: middle; color: var(--text); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: rgba(240,246,252,.03); }
.table-actions { display: flex; gap: 5px; flex-wrap: wrap; }

/* ── Tips table ─────────────────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; }
.tips-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.tips-table th {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text3);
  padding: 7px 10px;
  background: var(--bg3);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.tips-table th.team-col.home { text-align: right; }
.tips-table td { padding: 5px 10px; border-top: 1px solid rgba(240,246,252,.05); vertical-align: middle; line-height: 1.4; color: var(--text); }
.tips-table .meta-col { font-size: 12px; color: var(--text); white-space: nowrap; }
.tips-table .meta-col small { font-size: 11px; color: var(--text2); display: block; }
.tips-table .team-col { font-family: var(--fh); font-size: 15px; font-weight: 700; white-space: nowrap; }
.meta-date-mobile { display: none; font-size: 10px; color: var(--text3); margin-top: 2px; }
.tips-table .team-col.home { text-align: right; }
.tips-table .score-col { text-align: center; width: 36px; }
.tips-table .sep-col { text-align: center; width: 10px; color: var(--text2); font-weight: 700; }
.tips-table .tip-val { font-family: var(--fh); font-size: 15px; font-weight: 700; }
.tips-table .tip-val.empty { color: var(--text2); }
.tips-table .status-col { white-space: nowrap; }
.tips-table .result-display { display: block; font-size: 11px; color: var(--text2); margin-top: 2px; }
.tips-table .tips-link { display: block; font-size: 11px; color: var(--accent-l); text-decoration: none; margin-top: 2px; }
.tips-table .tips-link:hover { text-decoration: underline; }
.row-untipped { opacity: .7; }
.row-untipped:hover { opacity: 1; }
.row-finished { }

/* ── Compact table ──────────────────────────────────────────────────────────── */
.compact-table { width: 100%; border-collapse: collapse; font-size: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.compact-table th { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .7px; color: var(--text3); padding: 5px 8px; background: var(--bg3); text-align: left; }
.compact-table td { padding: 4px 8px; border-top: 1px solid rgba(240,246,252,.05); vertical-align: middle; line-height: 1.3; }
.compact-table tbody tr:hover td { background: rgba(240,246,252,.03); }
.compact-table tr.me td { background: rgba(35,134,54,.08); }
.compact-table tr.me td:first-child { border-left: 2px solid var(--accent-l); }
.you-tag { font-size: 10px; color: var(--accent-l); }

/* ── Score inputs ───────────────────────────────────────────────────────────── */
.score-input-sm {
  width: 32px; height: 26px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 4px; text-align: center;
  font-family: var(--fh); font-size: 14px; font-weight: 700; color: var(--text);
  outline: none; padding: 0;
  -moz-appearance: textfield;
}
.score-input-sm::-webkit-outer-spin-button,
.score-input-sm::-webkit-inner-spin-button { -webkit-appearance: none; }
.score-input-sm:focus { border-color: var(--accent-l); }

.score-input {
  width: 44px; height: 44px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; text-align: center;
  font-family: var(--fh); font-size: 22px; font-weight: 700; color: var(--text);
  outline: none; padding: 0;
  -moz-appearance: textfield;
}
.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.score-input:focus { border-color: var(--accent-l); background: var(--bg2); }

/* ── Leaderboard ────────────────────────────────────────────────────────────── */
.leaderboard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.lb-thead { display: grid; grid-template-columns: 30px 1fr 56px 56px 56px; padding: 5px 10px; background: var(--bg3); font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .8px; border-bottom: 1px solid var(--border); }
.lb-row   { display: grid; grid-template-columns: 30px 1fr 56px 56px 56px; padding: 5px 10px; border-top: 1px solid rgba(240,246,252,.05); align-items: center; transition: background .1s; cursor: pointer; }
.lb-row:hover { background: var(--surface2); }
.lb-row.me { background: rgba(35,134,54,.1); border-left: 2px solid var(--accent-l); }
.lb-row.selected { background: rgba(35,134,54,.15) !important; }
.lb-rank  { font-family: var(--fh); font-size: 13px; font-weight: 700; color: var(--text3); }
.lb-rank.gold { color: var(--gold-l); }
.lb-name  { font-size: 13px; font-weight: 500; }
.lb-num   { font-family: var(--fh); font-size: 13px; font-weight: 700; text-align: center; color: var(--text2); }
.lb-pts   { color: var(--gold-l) !important; }
.lb-exact { color: var(--accent-l) !important; }

/* ── Tips layout ────────────────────────────────────────────────────────────── */
.tips-layout { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: flex-start; }
.user-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 70vh;
  overflow-y: auto;
  position: sticky;
  top: 16px;
}
.sidebar-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--text3); padding: 6px 10px; background: var(--bg3); border-bottom: 1px solid var(--border); }
.user-item { display: flex; align-items: center; padding: 5px 10px; font-size: 12px; color: var(--text2); text-decoration: none; border-top: 1px solid rgba(240,246,252,.05); transition: all .1s; }
.user-item:first-of-type { border-top: none; }
.user-item:hover { background: var(--surface2); color: var(--text); }
.user-item.active { background: rgba(35,134,54,.15); color: var(--accent-l); font-weight: 600; border-left: 2px solid var(--accent-l); }
.tips-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.save-row { text-align: left; }

/* ── Group tabs ─────────────────────────────────────────────────────────────── */
.group-tab {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text3);
  transition: all .12s;
  cursor: pointer;
}
.group-tab:hover { border-color: var(--text3); color: var(--text2); }
.group-tab.active { background: var(--accent); border-color: var(--accent-l); color: #fff; }

/* ── Lb layout ──────────────────────────────────────────────────────────────── */
.lb-layout { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; }
.lb-sidebar-col { width: 260px; flex-shrink: 0; }
.lb-main-col    { flex: 1; min-width: 0; }
.lb-tips-panel  {
  width: 380px; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; position: sticky; top: 16px;
  max-height: calc(100vh - 40px); overflow-y: auto;
}
.lb-tips-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--bg3); border-bottom: 1px solid var(--border); }
.lb-tips-header strong { font-family: var(--fh); font-size: 15px; font-weight: 700; }
.lb-tips-close { background: none; border: none; color: var(--text3); font-size: 16px; cursor: pointer; padding: 0 4px; line-height: 1; }
.lb-tips-close:hover { color: var(--text); }

/* ── Admin group details ─────────────────────────────────────────────────────── */
.group-details { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 6px; }
.group-details summary { cursor: pointer; list-style: none; font-size: 13px; }
.group-details summary::-webkit-details-marker { display: none; }
.group-details[open] { background: var(--bg3); }

/* ── Match cards ────────────────────────────────────────────────────────────── */
.match-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; transition: border-color .12s; margin-bottom: 8px; }
.match-card:hover { border-color: rgba(63,185,80,.35); }
.match-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.match-meta { font-size: 11px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.match-body { display: flex; align-items: center; gap: 10px; }
.team-name { font-family: var(--fh); font-size: 19px; font-weight: 700; flex: 1; }
.team-name.home { text-align: right; }
.score-area { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.score-box { width: 42px; height: 42px; background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-family: var(--fh); font-size: 22px; font-weight: 700; }
.score-sep { font-family: var(--fh); font-size: 18px; color: var(--text3); font-weight: 700; }
.match-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text3); }

/* ── Light mode ─────────────────────────────────────────────────────────────── */
html.light {
  --bg:       #f0f2f5;
  --bg2:      #ffffff;
  --bg3:      #e8eaed;
  --surface:  #ffffff;
  --surface2: #f3f4f6;
  --border:   rgba(0,0,0,0.1);
  --accent:   #1a7a42;
  --accent-l: #1f9850;
  --accent-d: #155e33;
  --gold:     #b07800;
  --gold-l:   #9a6600;
  --red:      #c0392b;
  --red-l:    #e53e3e;
  --text:     #111827;
  --text2:    #374151;
  --text3:    #6b7280;
}
html.light .alert-success { background: rgba(26,122,66,.1); color: #155e33; }
html.light .alert-error   { background: rgba(192,57,43,.1); color: #8b1a0f; }
html.light .badge-open    { background: rgba(26,122,66,.12); color: #155e33; border-color: rgba(26,122,66,.3); }
html.light .badge-tipped  { background: rgba(176,120,0,.12); color: #7a5200; border-color: rgba(176,120,0,.3); }
html.light .badge-pts     { background: rgba(176,120,0,.12); color: #7a5200; border-color: rgba(176,120,0,.3); }
html.light .badge-exact   { background: rgba(26,122,66,.18); color: #0f4520; border-color: rgba(26,122,66,.4); }
html.light .badge-blocked { background: rgba(192,57,43,.1);  color: #8b1a0f; border-color: rgba(192,57,43,.3); }
html.light .lb-row.me     { background: rgba(26,122,66,.07); }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; width: 200px; }
  .sidebar.open { transform: translateX(0); }
  .container { margin-left: 0; padding: 14px 16px; }
  footer { margin-left: 0; }
  .mobile-header {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
  }
  .hamburger { background: none; border: 1px solid var(--border); color: var(--text2); font-size: 18px; padding: 4px 8px; border-radius: 4px; cursor: pointer; line-height: 1; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 199; }
  .sidebar-overlay.open { display: block; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .lb-thead, .lb-row { grid-template-columns: 26px 1fr 48px 48px; }
  .lb-thead > :last-child, .lb-row > :last-child { display: none; }
  .tips-table { font-size: 12px; }
  .tips-table td { padding: 4px 5px; }
  .tips-table th { padding: 4px 5px; }
  .tips-table .team-col { font-size: 12px; white-space: normal; max-width: 80px; }
  .tips-table .meta-col { white-space: normal; }
  .meta-date-desktop { display: none; }
  .meta-date-mobile { display: block; }
  .score-input-sm { width: 28px; height: 24px; font-size: 13px; }
  .tips-layout { grid-template-columns: 1fr; }
  .lb-layout { flex-direction: column; }
  .lb-sidebar-col { display: none; }
  .tips-user-sidebar { display: none; }
  .lb-main-col, .lb-tips-panel { width: 100%; }
  .lb-tips-panel { position: static; max-height: none; }
  .lb-group-select-wrap { display: block; }
  .sidebar-title { padding: 4px 8px; width: 100%; }
  .user-item { border-top: none; border-left: 1px solid rgba(240,246,252,.05); padding: 3px 8px; font-size: 11px; }
}
@media (min-width: 769px) {
  .mobile-header { display: none !important; }
  .sidebar-overlay { display: none !important; }
  .lb-group-select-wrap { display: none; }
}

/* ── Collapsible admin sections ─────────────────────────────────────────────── */
h2.admin-toggle { cursor: pointer; user-select: none; display: flex; justify-content: space-between; align-items: center; }
h2.admin-toggle::after { content: '▾'; font-size: 20px; color: var(--text2); transition: transform .15s; }
h2.admin-toggle.collapsed::after { content: '▸'; }
h2.admin-toggle + .admin-section { transition: none; }
h2.admin-toggle.collapsed + .admin-section { display: none; }
h2.admin-toggle.collapsed + .lb-section { display: none; }

/* ── Tournament overview ─────────────────────────────────────────────────────── */
.tournament-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.tournament-group-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tournament-group-card h4 { margin: 0; padding: 8px 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text2); background: var(--surface2); border-bottom: 1px solid var(--border); }
.tournament-group-card table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tournament-group-card th { padding: 4px 8px; font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--text3); text-align: center; border-bottom: 1px solid var(--border); }
.tournament-group-card th:first-child { text-align: left; }
.tournament-group-card td { padding: 5px 8px; border-top: 1px solid rgba(240,246,252,.05); text-align: center; color: var(--text); }
.tournament-group-card td:first-child { text-align: left; font-weight: 600; }
.tournament-group-card tr.qualified td:first-child { color: var(--accent-l); }
.knockout-phase { margin-bottom: 1.25rem; }
.knockout-phase h4 { font-size: 13px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; margin: 0 0 .5rem; }
.knockout-matches { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .5rem; }
.knockout-match { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.knockout-match .km-teams { flex: 1; display: flex; align-items: center; gap: 6px; font-family: var(--fh); font-weight: 700; font-size: 14px; }
.knockout-match .km-score { font-family: var(--fh); font-weight: 800; font-size: 16px; color: var(--accent-l); white-space: nowrap; }
.knockout-match .km-score.pending { color: var(--text3); font-size: 12px; font-weight: 400; font-family: var(--fb); }

/* ── Print / PDF export ──────────────────────────────────────────────────────── */
.pdf-export-btn { position: fixed; top: 14px; right: 18px; z-index: 999; opacity: .75; transition: opacity .15s; }
.pdf-export-btn:hover { opacity: 1; }
@media print {
  .user-sidebar, .tips-col, .table-scroll, .lb-tips-panel { max-height: none !important; overflow: visible !important; }
  .tips-layout { display: block !important; }
  .user-sidebar { display: none !important; }
  .sidebar, .mobile-header, .sidebar-overlay, footer,
  .pdf-export-btn, .group-tab, .btn-primary, button[type="submit"] { display: none !important; }
  .score-input-sm { border: none !important; background: transparent !important; box-shadow: none !important; font-family: var(--fh); font-weight: 700; font-size: 16px; color: #000 !important; width: 2ch !important; padding: 0 !important; text-align: center; }
  body { background: #fff !important; color: #000 !important; }
  .lb-layout { display: block !important; }
  .lb-sidebar-col { display: none !important; }
  .container { margin: 0 !important; padding: 0 !important; max-width: 100% !important; }
  .instr-section, .admin-section, .leaderboard, .lb-section { border-color: #ccc !important; background: #fff !important; break-inside: avoid; }
  h1, h2, h3, .instr-section h3 { color: #000 !important; }
  p, li, td, th { color: #333 !important; }
  code { background: #f0f0f0 !important; color: #333 !important; border-color: #ccc !important; }
}
