:root {
  --navy:       #001F60;
  --navy-dark:  #001040;
  --green:      #6CB520;
  --green-dark: #4E8515;
  --green-light:#EDF5DB;
  --gray-100:   #F4F5F7;
  --gray-200:   #DDE3ED;
  --gray-400:   #8A9BB5;
  --gray-600:   #4A5A70;
  --gray-900:   #1A2B4A;
  --amber:      #C9A227;
  --red:        #D93025;
  --serif:  'Libre Baskerville', Georgia, serif;
  --sans:   'Source Sans 3', system-ui, sans-serif;
  --mono:   'JetBrains Mono', monospace;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--sans);
  color: var(--gray-900);
  background: #f0f2f5;
  min-height: 100vh;
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
}

/* ── Login ─────────────────────────────────────────────────────────── */
#view-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, #003080 100%);
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 36px 40px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 40px rgba(0,0,0,.35);
}

@media (max-width: 420px) {
  .login-card { padding: 28px 24px 24px; }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.login-brand img { width: 30px; height: auto; }
.login-brand-text .name { font-size: 15px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.login-brand-text .sub  { font-size: 10px; color: var(--gray-400); letter-spacing: .06em; text-transform: uppercase; }

.login-card h1 {
  font-family: var(--serif);
  font-size: 22px; font-weight: 700;
  color: var(--navy); margin: 0 0 4px;
}
.login-card h1 em { font-style: italic; color: var(--green); }

.login-subtitle {
  font-size: 12px; color: var(--gray-400);
  margin: 0 0 24px;
  letter-spacing: .04em; text-transform: uppercase;
}

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block; font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--gray-600); margin-bottom: 6px;
}

.form-group input {
  width: 100%; padding: 11px 12px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius);
  font-family: var(--sans); font-size: 15px; color: var(--gray-900);
  transition: border-color .15s; outline: none;
  -webkit-appearance: none;
}
.form-group input:focus { border-color: var(--navy); }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: none; border-radius: var(--radius);
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s, opacity .15s, border-color .15s;
  text-decoration: none; white-space: nowrap; user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary     { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); }

.btn-green       { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); }

.btn-ghost       { background: transparent; color: var(--gray-600); border: 1.5px solid var(--gray-200); }
.btn-ghost:hover { background: var(--gray-100); }

.btn-outline-white {
  background: transparent; color: rgba(255,255,255,.9);
  border: 1.5px solid rgba(255,255,255,.4);
}
.btn-outline-white:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.7); }

.btn-danger      { background: var(--red); color: #fff; }
.btn-danger:hover{ background: #b02020; }

.btn-sm   { padding: 6px 14px; font-size: 12px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

.error-msg {
  background: #fff0f0; border: 1px solid #f5c0c0;
  border-radius: var(--radius); padding: 10px 14px;
  font-size: 13px; color: var(--red); margin-top: 12px;
}

/* ── App shell ─────────────────────────────────────────────────────── */
#view-app { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Banner ─────────────────────────────────────────────────────────  */
.banner {
  background: var(--navy); color: #fff;
  padding: 10px 20px;
  display: flex; align-items: center; gap: 16px;
  position: relative; overflow: hidden; flex-shrink: 0;
}

.banner-chev {
  position: absolute; right: -10px; top: 50%;
  transform: translateY(-50%); opacity: .06;
}

.banner-brand {
  display: flex; align-items: center; gap: 10px;
  padding-right: 16px; border-right: 1px solid rgba(255,255,255,.18);
  flex-shrink: 0;
}

.banner-brand img { width: 26px; height: auto; filter: brightness(0) invert(1); }
.banner-brand-text .name { font-size: 12px; font-weight: 600; line-height: 1.1; }
.banner-brand-text .sub  { font-size: 9px; letter-spacing: .07em; text-transform: uppercase; color: rgba(255,255,255,.5); }

.banner-title { flex: 1; min-width: 0; }
.banner-title .ey { font-size: 9px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--green); margin-bottom: 1px; }
.banner-title h1  { font-family: var(--serif); font-size: 18px; font-weight: 700; margin: 0; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner-title h1 em { font-style: italic; color: var(--green); }

.banner-user {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; font-size: 12px; color: rgba(255,255,255,.8);
  position: relative; z-index: 1;
}

.banner-username { white-space: nowrap; }
.banner-username strong { color: #fff; }

/* Mobile banner: hide subtitle and brand text, keep tight */
@media (max-width: 600px) {
  .banner { padding: 8px 14px; gap: 10px; }
  .banner-brand-text .sub { display: none; }
  .banner-title .ey { display: none; }
  .banner-title h1  { font-size: 15px; }
  .banner-username  { display: none; }
}

@media (max-width: 400px) {
  .banner-brand { display: none; }
}

/* ── Nav tabs ──────────────────────────────────────────────────────── */
.nav-tabs {
  background: #fff; border-bottom: 2px solid var(--gray-200);
  display: flex; padding: 0 16px; gap: 0; flex-shrink: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  padding: 12px 16px; font-size: 13px; font-weight: 600;
  color: var(--gray-600); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  user-select: none; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.nav-tab:hover  { color: var(--navy); }
.nav-tab.active { color: var(--navy); border-bottom-color: var(--green); }

/* ── Content ───────────────────────────────────────────────────────── */
.content { flex: 1; padding: 16px 20px; overflow-y: auto; }

@media (max-width: 520px) { .content { padding: 12px 14px; } }

.tab-panel         { display: none; }
.tab-panel.active  { display: block; }

/* ── Group grid ────────────────────────────────────────────────────── */
.ggrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 1100px) { .ggrid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px)  { .ggrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px)  { .ggrid { grid-template-columns: 1fr; } }

.gcard {
  border: 1.5px solid var(--gray-200); border-radius: 8px;
  overflow: hidden; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.ghead {
  display: flex; align-items: center; gap: 8px;
  background: var(--navy); color: #fff; padding: 7px 10px;
}
.ghead .badge {
  width: 22px; height: 22px; border-radius: 5px; background: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.ghead .gt { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.ghead .codes { margin-left: auto; display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.ghead .codes span {
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  color: rgba(255,255,255,.6); background: rgba(255,255,255,.12);
  border-radius: 3px; padding: 1px 4px;
}

/* Match rows */
.match-row {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 8px; border-top: 1px solid #EEF1F5;
}
.match-row:first-child { border-top: none; }

.match-when {
  flex-shrink: 0; width: 50px;
  font-family: var(--mono); font-size: 9px; line-height: 1.4; color: var(--gray-400);
}
.match-when b { color: var(--gray-600); font-weight: 600; display: block; }

.match-team {
  flex: 1; min-width: 0;
  font-size: 11px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.match-team.home { text-align: right; }
.match-team.away { text-align: left; }

.match-team .tcode {
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  color: var(--navy); background: var(--gray-100);
  border: 1px solid var(--gray-200); border-radius: 3px;
  padding: 1px 4px; margin: 0 2px;
}

.match-tip {
  display: flex; align-items: center; gap: 3px; flex-shrink: 0;
}

.tip-input {
  width: 30px; height: 28px;
  text-align: center;
  border: 1.5px solid var(--gray-200); border-radius: 4px;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--navy); background: #fff; outline: none;
  transition: border-color .15s, background .15s;
  -moz-appearance: textfield; padding: 0;
  /* Larger touch target on mobile */
  min-height: 36px;
}
.tip-input::-webkit-inner-spin-button,
.tip-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.tip-input:focus { border-color: var(--navy); }

@media (max-width: 500px) {
  .tip-input { width: 34px; min-height: 40px; font-size: 15px; }
}

.tip-sep { font-family: var(--mono); font-weight: 700; color: var(--gray-400); font-size: 13px; }

/* Tip states */
.match-row.saved  .tip-input { border-color: var(--green); background: var(--green-light); }
.match-row.locked .tip-input {
  background: var(--gray-100); color: var(--gray-400);
  cursor: not-allowed; border-color: var(--gray-200);
}

/* Result + points badge */
.result-badge {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 4px; white-space: nowrap;
}
.pts-3 { background: var(--green); color: #fff; }
.pts-2 { background: #2196F3; color: #fff; }
.pts-1 { background: var(--amber); color: #fff; }
.pts-0 { background: var(--gray-200); color: var(--gray-600); }

.lock-icon { font-size: 11px; color: var(--gray-400); }

.live-badge {
  display: inline-block;
  font-size: 9px; font-weight: 700; letter-spacing: .04em;
  padding: 1px 5px; border-radius: 4px;
  background: #D93025; color: #fff;
  animation: live-pulse 1.4s ease-in-out infinite;
  white-space: nowrap;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .55; }
}

/* deadline badge */
.deadline-badge {
  font-family: var(--mono); font-size: 9px; color: var(--gray-400);
  background: var(--gray-100); border-radius: 3px;
  padding: 1px 4px; white-space: nowrap;
}

/* ── KO Phase ──────────────────────────────────────────────────────── */
.ko-stack { display: flex; flex-direction: column; gap: 20px; }

.ko-round-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap;
}
.ko-round-title::before {
  content: ''; display: inline-block; width: 0; height: 0;
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  border-left: 8px solid var(--green);
}
.ko-round-title h3 { font-size: 14px; font-weight: 700; color: var(--navy); margin: 0; }
.ko-round-title .span { font-family: var(--mono); font-size: 11px; color: var(--gray-400); margin-left: auto; }

.ko-grid { display: grid; gap: 8px; grid-template-columns: 1fr; }

.ko-grid[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }
.ko-grid[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.ko-grid[data-cols="1"] { grid-template-columns: 1fr; }

@media (max-width: 900px) {
  .ko-grid[data-cols="4"] { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .ko-grid[data-cols="4"],
  .ko-grid[data-cols="2"] { grid-template-columns: 1fr; }
}

.ko-card {
  display: flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--gray-200); border-radius: 6px;
  padding: 7px 10px; background: #fff;
}
.ko-card.fin-card { border-color: var(--green); border-width: 2px; background: #fbfdf6; }
.ko-card .match-team { font-size: 10px; }

/* ── Leaderboard ──────────────────────────────────────────────────── */
.leaderboard-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.leaderboard-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  min-width: 480px;
}

.leaderboard-table th {
  background: var(--navy); color: rgba(255,255,255,.8);
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  padding: 10px 14px; text-align: left;
}
.leaderboard-table td { padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--gray-100); }
.leaderboard-table tr:last-child td { border-bottom: none; }
.leaderboard-table tr.me td { background: #EDF5DB; font-weight: 600; }
.leaderboard-table tr:hover:not(.me) td { background: #f8f9fb; }

.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  font-family: var(--mono); font-weight: 700; font-size: 12px;
}
.rank-1     { background: #FFD700; color: #6b4f00; }
.rank-2     { background: #C0C0C0; color: #333; }
.rank-3     { background: #CD7F32; color: #fff; }
.rank-other { background: var(--gray-200); color: var(--gray-600); }

.pts-total { font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--navy); }

/* ── Admin ────────────────────────────────────────────────────────── */
.admin-tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--gray-200); margin-bottom: 20px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab {
  padding: 8px 16px; font-size: 12px; font-weight: 600; color: var(--gray-600);
  cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: color .15s; user-select: none; white-space: nowrap;
}
.admin-tab:hover  { color: var(--navy); }
.admin-tab.active { color: var(--navy); border-bottom-color: var(--green); }

.admin-panel        { display: none; }
.admin-panel.active { display: block; }

/* Admin table */
.admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.admin-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06);
  margin-bottom: 20px; min-width: 540px;
}
.admin-table th {
  background: var(--gray-100); color: var(--gray-600);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 9px 12px; text-align: left; border-bottom: 1.5px solid var(--gray-200);
}
.admin-table td {
  padding: 9px 12px; font-size: 12px; border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }

.badge-role {
  display: inline-block; padding: 2px 7px; border-radius: 3px;
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.role-admin        { background: var(--navy); color: #fff; }
.role-turnierleiter{ background: var(--amber); color: #fff; }
.role-user         { background: var(--gray-200); color: var(--gray-600); }

/* Add user form */
.add-user-form {
  background: #fff; border: 1.5px solid var(--gray-200); border-radius: 8px;
  padding: 16px; display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  margin-bottom: 20px;
}
.add-user-form .form-group { margin: 0; flex: 1; min-width: 130px; }
.add-user-form label {
  font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--gray-600); margin-bottom: 5px; display: block;
}
.add-user-form input, .add-user-form select {
  width: 100%; padding: 8px 10px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius);
  font-size: 13px; font-family: var(--sans); color: var(--gray-900); outline: none;
  -webkit-appearance: none;
}
.add-user-form input:focus, .add-user-form select:focus { border-color: var(--navy); }

/* Results admin */
.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 900px) { .results-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .results-grid { grid-template-columns: 1fr; } }

.result-card {
  background: #fff; border: 1.5px solid var(--gray-200); border-radius: 7px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
}
.result-card.has-result { border-color: var(--green); }

.result-card-header {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; color: var(--gray-400); font-family: var(--mono);
}
.result-card-teams {
  font-size: 11px; font-weight: 600; color: var(--gray-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-card-input { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.result-input {
  width: 44px; height: 32px; text-align: center;
  border: 1.5px solid var(--gray-200); border-radius: 4px;
  font-family: var(--mono); font-size: 15px; font-weight: 700;
  color: var(--navy); outline: none; -moz-appearance: textfield;
  -webkit-appearance: none;
}
.result-input::-webkit-inner-spin-button,
.result-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.result-input:focus { border-color: var(--navy); }
.result-card.has-result .result-input { border-color: var(--green); background: var(--green-light); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  padding: 16px;
}
.modal {
  background: #fff; border-radius: 10px; padding: 28px 32px;
  max-width: 420px; width: 100%; box-shadow: 0 12px 48px rgba(0,0,0,.3);
}
@media (max-width: 480px) { .modal { padding: 22px 20px; } }

.modal h2 { font-size: 17px; font-weight: 700; color: var(--navy); margin: 0 0 14px; font-family: var(--serif); }
.modal p  { font-size: 13px; color: var(--gray-600); margin: 0 0 16px; line-height: 1.6; }

.pw-display {
  background: var(--green-light); border: 1.5px solid var(--green); border-radius: 6px;
  padding: 12px 16px; font-family: var(--mono); font-size: 22px; font-weight: 700;
  color: var(--navy); text-align: center; letter-spacing: .12em; margin-bottom: 8px;
}
.modal-hint { font-size: 11px; color: var(--gray-400); text-align: center; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Toasts */
#toast-container {
  position: fixed; bottom: 20px; right: 16px;
  display: flex; flex-direction: column; gap: 8px; z-index: 2000;
}
@media (max-width: 480px) {
  #toast-container { left: 16px; right: 16px; bottom: 16px; }
}

.toast {
  padding: 10px 16px; border-radius: 6px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  animation: slideIn .2s ease; max-width: 360px;
}
.toast-success { background: var(--green); color: #fff; }
.toast-error   { background: var(--red);   color: #fff; }
.toast-info    { background: var(--navy);  color: #fff; }

@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@media (max-width: 480px) {
  @keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
}

/* Loading */
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; color: var(--gray-400); font-size: 14px; gap: 10px;
}
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--gray-200); border-top-color: var(--navy);
  border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Section headers */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 10px; flex-wrap: wrap;
}
.section-header h2 {
  font-family: var(--serif); font-size: 18px; font-weight: 700;
  color: var(--navy); margin: 0;
}
.section-header .meta { font-size: 11px; color: var(--gray-400); font-family: var(--mono); }

/* Overview filter */
.overview-filter {
  display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center;
}
.overview-filter select {
  padding: 7px 10px; border: 1.5px solid var(--gray-200); border-radius: var(--radius);
  font-size: 12px; font-family: var(--sans); color: var(--gray-900); outline: none;
  flex: 1; min-width: 200px; -webkit-appearance: none;
}
.overview-filter select:focus { border-color: var(--navy); }

/* Overview table wrapper for mobile scroll */
.overview-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.site-footer { text-align:center; padding:16px; font-family:var(--sans); font-size:12px; color:var(--gray-400); }
.site-footer a { color:var(--gray-400); text-decoration:none; }
.site-footer a:hover { color:var(--navy); text-decoration:underline; }

/* Bonus tip banner */
.bonus-card {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--navy) 0%, #003090 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 12px 0 18px;
}
.bonus-card.bonus-locked { background: linear-gradient(135deg, #2a3a5c 0%, #1a2a4a 100%); }
.bonus-trophy { font-size: 24px; flex-shrink: 0; }
.bonus-body { flex: 1; min-width: 180px; }
.bonus-title { font-family: var(--serif); font-size: 15px; font-weight: 700; }
.bonus-pts { background: var(--green); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 10px; margin-left: 8px; font-family: var(--sans); font-weight: 700; vertical-align: middle; }
.bonus-dl { font-size: 12px; opacity: .75; margin-top: 2px; }

/* Scoring info */
.scoring-info {
  margin: 0 0 18px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--sans);
}
.scoring-info summary {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-100);
  list-style: none;
  user-select: none;
}
.scoring-info summary::-webkit-details-marker { display: none; }
.scoring-info[open] summary { border-bottom: 1.5px solid var(--gray-200); }
.scoring-grid { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.scoring-row { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--gray-900); }
.scoring-row em { color: var(--gray-400); font-style: normal; }
.scoring-badge { display: inline-block; min-width: 44px; text-align: center; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 10px; flex-shrink: 0; font-family: var(--mono); }
.scoring-badge.s3 { background: #e8f5e9; color: #2e7d32; }
.scoring-badge.s2 { background: #e3f2fd; color: #1565c0; }
.scoring-badge.s1 { background: #fff8e1; color: #f57f17; }
.scoring-badge.s0 { background: var(--gray-100); color: var(--gray-400); }
.scoring-badge.s5 { background: var(--navy); color: #fff; }

/* Sortable leaderboard headers */
.lb-th { user-select: none; white-space: nowrap; }
.lb-th:hover { background: #0a2d7a; }
.lb-th-active { color: #fff; opacity: 1; }
