/* ═══════════════════════════════════════════════════
   EpiqScores — Design System
   Inspired by Fotmob's compact, clean aesthetic
   ═══════════════════════════════════════════════════ */

/* ── THEME TOKENS ─────────────────────────────────── */
:root {
  --bg:            #f0f2f5;
  --surface:       #ffffff;
  --surface-2:     #f5f7fa;
  --surface-hover: #eef1f6;
  --border:        #dde1ea;
  --text:          #111827;
  --text-muted:    #6b7280;
  --primary:       #92400e;
  --primary-light: #f59e0b;
  --accent:        #f59e0b;
  --accent-dark:   #d97706;
  --green:         #059669;
  --red:           #dc2626;
  --radius:        10px;
  --shadow:        0 1px 6px rgba(0,0,0,0.08);
  --shadow-lg:     0 4px 20px rgba(0,0,0,0.12);
  --nav-bg:        #0f172a;
  --nav-text:      rgba(255,255,255,0.65);
  --nav-accent:    var(--accent);
  --medal-gold:    #d4a017;
  --medal-bronze:  #b87333;
  --podium-gold-start:   #f59e0b;
  --podium-gold-end:     #d97706;
  --podium-silver-start: #d1d5db;
  --podium-silver-end:   #9ca3af;
  --podium-bronze-start: #c2773a;
  --podium-bronze-end:   #92400e;
}

[data-theme="dark"] {
  --bg:            #111827;
  --surface:       #1f2937;
  --surface-2:     #283242;
  --surface-hover: #2d3a4d;
  --border:        #374151;
  --text:          #f9fafb;
  --text-muted:    #9ca3af;
  --primary-light: #fbbf24;
  --accent:        #fbbf24;
  --accent-dark:   #f59e0b;
  --primary:       #d97706;
  --green:         #34d399;
  --red:           #f87171;
  --shadow:        0 1px 6px rgba(0,0,0,0.45);
  --shadow-lg:     0 4px 20px rgba(0,0,0,0.65);
  --nav-bg:        #070d18;
}

/* ── BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── TOP NAV ──────────────────────────────────────── */
nav.top-nav {
  background: var(--nav-bg);
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-tournament {
  position: absolute;
  left: max(calc(50% - 340px), 20px);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
  pointer-events: none;
  opacity: 0.8;
}

.nav-brand {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.nav-brand span { color: var(--nav-accent); }
.nav-right { display: flex; align-items: center; gap: 4px; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  color: var(--nav-text);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color: #fff;
  background: rgba(255,255,255,0.09);
}
.nav-links .btn-accent {
  background: color-mix(in srgb, var(--nav-accent) 18%, transparent);
  color: var(--nav-accent);
  border: 1px solid color-mix(in srgb, var(--nav-accent) 30%, transparent);
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-left: 6px;
}
.nav-links .btn-accent:hover { background: color-mix(in srgb, var(--nav-accent) 28%, transparent); }

/* Profile dropdown */
.nav-profile { position: relative; margin-left: 6px; }
.nav-profile-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: color-mix(in srgb, var(--nav-accent) 18%, transparent);
  color: var(--nav-accent);
  border: 1px solid color-mix(in srgb, var(--nav-accent) 30%, transparent);
  border-radius: 16px;
  padding: 4px 10px 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.nav-profile-btn:hover { background: color-mix(in srgb, var(--nav-accent) 28%, transparent); }
.nav-profile-chevron { width: 14px; height: 14px; stroke-width: 2.5; flex-shrink: 0; }
.nav-profile-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 168px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 300;
}
.nav-profile-dropdown.open { display: block; }
.nav-profile-dropdown .nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 14px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: none;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
}
.nav-profile-dropdown .nav-dropdown-item svg { width: 15px; height: 15px; stroke-width: 2; flex-shrink: 0; color: var(--text-muted); }
.nav-profile-dropdown .nav-dropdown-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-profile-dropdown .nav-dropdown-item + .nav-dropdown-item { border-top: 1px solid var(--border); }
.nav-profile-dropdown .nav-dropdown-signout,
.nav-profile-dropdown .nav-dropdown-signout:hover { color: var(--red); }
.nav-profile-dropdown .nav-dropdown-signout svg { color: var(--red); }

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--nav-text);
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.theme-toggle:hover { color: #fff; background: rgba(255,255,255,0.09); }

@media (max-width: 639px) { .nav-links { display: none; } }
@media (min-width: 640px) { nav.top-nav { padding: 0 24px; } }

/* ── BOTTOM NAV (mobile only) ─────────────────────── */
nav.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--nav-bg);
  border-top: 1px solid rgba(255,255,255,0.07);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 639px) {
  nav.bottom-nav { display: flex; }
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
}
.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--nav-text);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 8px 0;
  min-height: 58px;
  transition: color 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  text-transform: uppercase;
}
.bnav-item.active, .bnav-item:hover { color: #fff; }
.bnav-item svg { width: 20px; height: 20px; stroke-width: 1.75; }

/* ── BOTTOM NAV SHEET (mobile More/Profile drawer) ── */
.bnav-sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 298;
  opacity: 0;
  transition: opacity 0.2s;
}
.bnav-sheet-overlay.open { opacity: 1; }
@media (max-width: 639px) {
  .bnav-sheet-overlay { display: block; pointer-events: none; }
  .bnav-sheet-overlay.open { pointer-events: auto; }
}

.bnav-sheet {
  display: none;
  position: fixed;
  top: 50px;
  left: 0; right: 0;
  background: var(--nav-bg);
  border-radius: 0 0 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  z-index: 299;
  transform: translateY(-120%);
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  padding-top: 4px;
  padding-bottom: 12px;
}
.bnav-sheet.open { transform: translateY(0); }
@media (max-width: 639px) { .bnav-sheet { display: block; } }

.bnav-sheet-handle { display: none; }
.bnav-sheet-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 20px;
  color: var(--nav-text);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.bnav-sheet-item:hover, .bnav-sheet-item:active { background: rgba(255,255,255,0.08); color: #fff; }
.bnav-sheet-item svg { width: 20px; height: 20px; stroke-width: 1.75; flex-shrink: 0; }
.bnav-sheet-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 4px 0; }
.bnav-sheet-signout { color: var(--red); }
.bnav-sheet-signout:hover { background: rgba(239,68,68,0.12); color: var(--red); }

/* ── LAYOUT ───────────────────────────────────────── */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 12px;
}
@media (min-width: 640px) { main { padding: 20px; } }

.page-header { margin-bottom: 14px; }
.page-header h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-header p { color: var(--text-muted); margin-top: 2px; font-size: 0.84rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 639px) { .two-col { grid-template-columns: 1fr; } .two-col > div:last-child { order: -1; } }

/* ── WARNING BANNER ───────────────────────────────── */
/* ── PWA INSTALL BANNER ──────────────────────────── */
.pwa-install-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--nav-bg);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
  font-size: 0.84rem;
  flex-wrap: wrap;
}
.pwa-install-text { flex: 1; min-width: 0; }
.pwa-install-text strong { color: #fff; }
.pwa-install-action { flex-shrink: 0; }
.pwa-install-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  font-size: 1rem;
  padding: 2px 4px;
  line-height: 1;
}
.pwa-install-dismiss:hover { color: #fff; }

.warning-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.35);
  color: var(--text);
  font-size: 0.84rem;
}
.warning-banner a { color: var(--accent-dark); font-weight: 600; }
[data-theme="dark"] .warning-banner a { color: var(--accent); }
.warning-banner-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.warning-banner-close:hover { color: var(--text); }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-header h2 { font-size: 0.85rem; font-weight: 700; }

/* ── CARDS ────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.card-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ── BUTTONS ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s;
  text-decoration: none;
  line-height: 1;
}
.btn-primary { background: var(--primary-light); color: #111; }
.btn-primary:hover { filter: brightness(0.9); }
.btn-accent { background: var(--accent); color: #111; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary-light); color: var(--primary-light); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(0.88); }
.btn-sm { padding: 4px 10px; font-size: 0.75rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* Selected-state modifier for toggle/chip buttons that are otherwise .btn-ghost — stacking
   .btn-primary onto .btn-ghost doesn't work since .btn-ghost is declared later with equal
   specificity and silently wins the cascade. Use .active instead (same pattern as .filter-chip.active). */
.btn-ghost.active { background: var(--primary-light); border-color: var(--primary-light); color: #111; }
.btn-ghost.active:hover { filter: brightness(0.9); color: #111; }

/* ── GLOBAL SELECT THEMING ────────────────────────── */
/* Applies to all <select> elements; ensures dropdowns respect dark/light theme */
select {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
select option {
  background-color: var(--surface);
  color: var(--text);
}

/* ── FORMS ────────────────────────────────────────── */
.form-group { margin-bottom: 13px; }
.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.12);
}
[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus { box-shadow: 0 0 0 3px rgba(251,191,36,0.25); }
.form-error  { color: var(--red);   font-size: 0.8rem; margin-top: 5px; }
.form-success{ color: var(--green); font-size: 0.8rem; margin-top: 5px; }
.form-input {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 0.9rem; color: var(--text); background: var(--surface);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.12);
}
[data-theme="dark"] .form-input:focus { box-shadow: 0 0 0 3px rgba(251,191,36,0.25); }

/* Standalone input — same appearance as .form-group input but without width:100% */
.text-input {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  min-width: 0;
}
.text-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.12);
}
[data-theme="dark"] .text-input:focus { box-shadow: 0 0 0 3px rgba(251,191,36,0.25); }
.text-input::placeholder { color: var(--text-muted); }

/* ── MATCH GROUP + CARD ───────────────────────────── */
.match-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: clip; /* clip (not hidden) so position:sticky works on children */
}
.match-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 6px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 52px;
  z-index: 10;
  box-shadow: 0 1px 0 var(--border);
}
.match-group-label { flex: 1; }
.section-progress { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.section-progress-bar { width: 60px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.section-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.4s; }
.section-progress-fill.done { background: var(--green); }
.section-progress-label { font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; }
.match-card {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.match-card:last-child { border-bottom: none; }
.match-card:hover { background: var(--surface-hover); }

/* match cards inside .card (dashboard) – no extra nesting needed */
.card .match-card { margin: 0 -16px; }
.card .match-card:first-child { margin-top: -2px; }
.card .match-card:last-child {
  border-bottom: none;
  border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px);
}

.match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.team-flag {
  width: 52px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
}
.team-name {
  font-weight: 600;
  font-size: 0.78rem;
  text-align: center;
  line-height: 1.2;
}
.team-code { font-size: 0.65rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }
.match-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 70px;
}
.score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.score-display {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.score-sep { color: var(--text-muted); font-weight: 400; }
.match-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
}
.match-meta { font-size: 0.72rem; color: var(--text-muted); text-align: center; }

/* ── PREDICTION INPUT ─────────────────────────────── */
.pred-status-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 8px;
  gap: 5px;
}
.pred-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
.score-input {
  width: 44px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 6px 4px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -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);
  box-shadow: 0 0 0 2px rgba(245,158,11,0.2);
}
.pred-sep { font-size: 1.1rem; font-weight: 600; color: var(--text-muted); }
.pred-meta-row { display: flex; align-items: center; gap: 6px; }
.saved-indicator {
  font-size: 0.7rem;
  color: var(--green);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
}
.saved-indicator.show { opacity: 1; }
.wizard-btn {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1;
  color: var(--text);
  transition: all 0.15s;
}
.wizard-btn:hover { border-color: var(--primary-light); color: var(--primary-light); }

/* ── DOUBLE OR NOTHING ROW ───────────────────────── */
.don-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  cursor: pointer;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
  box-sizing: border-box;
}
.don-row:hover { background: color-mix(in srgb, var(--primary-light) 7%, transparent); }
.don-row-active {
  background: color-mix(in srgb, var(--primary-light) 11%, transparent);
  border-color: var(--primary-light);
}
.don-row-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: 5px;
  padding: 3px 7px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  transition: all 0.15s;
  line-height: 1;
}
.don-row-badge-active {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: #111;
}
.don-row-label {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.don-row-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  transition: color 0.15s;
}
.don-row-active .don-row-title { color: var(--primary-light); }
.don-row-sub {
  font-size: 0.67rem;
  color: var(--text-muted);
  line-height: 1.2;
}
.don-row-toggle {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 3px 9px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.don-row-toggle-active {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: #111;
}
.don-badge {
  display: inline-flex;
  align-items: center;
  background: var(--primary-light);
  color: #111;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  vertical-align: middle;
  margin-left: 5px;
}
.don-stat-full { color: var(--primary-light) !important; }
.pts-pop-don { }
.pts-pop-don-good .pts-pop-val { color: var(--green); }
.pts-pop-don-bad .pts-pop-val { color: var(--red); }

.lock-notice { font-size: 0.7rem; color: var(--text-muted); }
.autosave-indicator { font-size: 0.72rem; color: var(--text-muted); min-width: 44px; }
.autosave-indicator.saving { color: var(--text-muted); }
.autosave-indicator.saved  { color: var(--green, #22c55e); }
.autosave-indicator.error  { color: var(--red, #ef4444); }

/* ── PTS BREAKDOWN POPOVER ───────────────────────── */
.pts-badge-click { cursor: pointer; }
.pts-badge-click:hover { opacity: 0.75; }
.pts-pop {
  display: none;
  position: fixed;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 10px 14px;
  min-width: 180px;
  max-width: 260px;
  font-size: 0.82rem;
  pointer-events: none;
  animation: pop-in 0.16s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
/* Replays every time display flips from none → block (animations restart on re-display) —
   shared by .pts-pop and .ach-pop (achievement + early-bird popovers). */
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.92) translateY(4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.pts-pop-row { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; color: var(--text); }
.pts-pop-val { font-weight: 600; color: var(--green); white-space: nowrap; }
.pts-pop-sep { border-top: 1px solid var(--border); margin: 6px 0; }
.pts-pop-stage .pts-pop-val { color: var(--accent); }
.pts-pop-total {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 5px 0 0; margin-top: 5px;
  border-top: 1px solid var(--border);
  font-weight: 700; color: var(--text);
}
.pts-pop-none { color: var(--text-muted); font-size: 0.82rem; padding: 2px 0; }
.pts-pop-note { color: var(--text-muted); font-size: 0.72rem; line-height: 1.35; margin-top: 6px; }

/* ── PENALTY WINNER SELECTOR ──────────────────────── */
.kw-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.kw-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.kw-btn {
  font-size: 0.78rem;
  padding: 4px 10px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.kw-btn:hover { border-color: var(--accent); }
.kw-btn.kw-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.kw-row.kw-warn .kw-label { color: var(--accent-dark, #d97706); }
.kw-row.kw-warn .kw-label::before { content: '⚠ '; }
.kw-row.kw-warn .kw-btn { border-color: var(--accent-dark, #d97706); }

/* ── BRACKET SAVE STATUS ─────────────────────────────── */
.bracket-save-status {
  font-size: 0.75rem;
  color: var(--green);
  margin-left: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}
.bracket-save-status.visible { opacity: 1; }

/* ── LEADERBOARD ACTIVE FILTER CHIPS ─────────────────── */
.lb-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px 2px 10px;
  font-size: 0.75rem;
  color: var(--text);
}
.lb-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 0;
  line-height: 1;
}
.lb-chip-remove:hover { color: var(--text); }

/* ── SUMMARY BAR ──────────────────────────────────── */
/* ── PREDICTION SUMMARY CARD ────────────────────────── */
.pred-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
}
.pred-stats-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 8px;
}
.pred-stat {
  display: flex;
  flex-direction: column;
  padding: 0 14px;
}
.pred-stat:first-child { padding-left: 0; }
.pred-stat-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.pred-stat-pts { color: var(--primary-light); }
.pred-stat-of {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}
.pred-stat-lbl {
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
  margin-top: 2px;
}
.pred-stat-sep {
  width: 1px;
  height: 30px;
  background: var(--border);
  flex-shrink: 0;
}
.pred-stats-actions { margin-left: auto; padding-left: 12px; }
@media (max-width: 639px) { .pred-stat-secondary { display: none; } }
.pred-summary-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.pred-prog-track {
  flex: 1;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}
.pred-prog-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s;
}
.pred-prog-fill.done { background: var(--green); }
.pred-prog-label {
  font-size: 0.69rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── TABS ─────────────────────────────────────────── */
.pred-tabs { display: flex; gap: 5px; margin-bottom: 12px; flex-wrap: wrap; }
.pred-tab {
  padding: 5px 13px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.77rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-muted);
  transition: all 0.15s;
  white-space: nowrap;
}
.pred-tab.active { background: var(--primary-light); color: #111; border-color: var(--primary-light); }
.pred-tab:hover:not(.active) { border-color: var(--primary-light); color: var(--primary-light); }

.group-tabs { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.group-tab {
  padding: 4px 11px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-muted);
  transition: all 0.15s;
}
.group-tab.active { background: var(--primary-light); color: #111; border-color: var(--primary-light); }
.group-tab:hover:not(.active) { border-color: var(--primary-light); color: var(--primary-light); }

/* ── BADGES ───────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-finished { background: rgba(5,150,105,0.12); color: var(--green); }
.badge-live {
  background: rgba(220,38,38,0.12);
  color: var(--red);
  animation: blink 1.4s ease-in-out infinite;
}
.live-phase {
  display: inline-block;
  background: rgba(220,38,38,0.18);
  border-radius: 3px;
  padding: 0 3px;
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.03em;
  vertical-align: middle;
  margin-left: 2px;
}
.badge-scheduled { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.badge-open { background: rgba(245,158,11,0.1); color: var(--primary-light); }
.badge-closes-soon { background: var(--red); color: #fff; margin-left: 4px; }
.badge-danger { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.55} }

.match-stage-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.67rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ── POINTS BADGE ─────────────────────────────────── */
.points-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
}
.points-perfect { background: rgba(245,158,11,0.15); color: var(--accent); }
.points-good    { background: rgba(5,150,105,0.12);  color: var(--green); }
.points-some    { background: rgba(245,158,11,0.1);   color: var(--primary-light); }
.points-none    { background: rgba(220,38,38,0.1);   color: var(--red); }

/* Predicted advancing team on a knockout-draw prediction — see match.js _rerenderPreds() */
.pred-advancer { color: var(--primary-light); font-weight: 700; }

/* ── SCOREBOARD ───────────────────────────────────── */
.scoreboard-table { width: 100%; border-collapse: collapse; }
.scoreboard-table th {
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 7px 12px;
  text-align: left;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.scoreboard-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.scoreboard-table tr:last-child td { border-bottom: none; }
.scoreboard-table tr:hover td { background: var(--surface-hover); }
.rank-1 td:first-child { color: var(--medal-gold);   font-weight: 700; }
.rank-2 td:first-child { color: var(--text-muted);   font-weight: 700; }
.rank-3 td:first-child { color: var(--medal-bronze);  font-weight: 700; }

/* ── STATS ────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.stat-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 11px;
  text-align: center;
}
.stat-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.stat-label { font-size: 0.66rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 3px; }

/* ── AUTH ─────────────────────────────────────────── */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nav-bg);
  padding: 20px;
}
.auth-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}
@media (max-width: 480px) { .auth-card { padding: 24px 18px; } }
.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-logo h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.auth-logo h1 span { color: var(--nav-accent); }
.auth-logo p { color: var(--text-muted); font-size: 0.82rem; margin-top: 3px; }
.auth-footer { text-align: center; margin-top: 18px; font-size: 0.82rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary-light); text-decoration: none; font-weight: 600; }

/* ── SPINNER / LOADING ────────────────────────────── */
.spinner {
  border: 2px solid var(--border);
  border-top: 2px solid var(--primary-light);
  border-radius: 50%;
  width: 20px; height: 20px;
  animation: spin 0.7s linear infinite;
  margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading    { text-align: center; color: var(--text-muted); padding: 32px; }
.empty-state{ text-align: center; color: var(--text-muted); padding: 32px; font-size: 0.85rem; }
.empty-state p { margin-top: 6px; }
/* Decorative icon, app-wide via ::before so every empty-state benefits without touching
   each call site. A plain dashed ring (not an emoji) keeps it theme-aware and avoids
   picking an icon that mismatches an unrelated context (e.g. a football for "no chat yet"). */
.empty-state::before {
  content: '';
  display: block;
  width: 46px; height: 46px;
  margin: 0 auto 12px;
  border: 2px dashed var(--border);
  border-radius: 50%;
  opacity: 0.7;
}

/* ── PROGRESS ─────────────────────────────────────── */
.progress-container { margin-top: 10px; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); margin-bottom: 4px; }
.progress-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--accent));
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ── ADMIN LAYOUT ─────────────────────────────────── */
.admin-layout {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 50px);
}

.admin-sidebar {
  width: 210px;
  flex-shrink: 0;
  background: var(--nav-bg);
  border-right: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 50px;
  height: calc(100vh - 50px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: width 0.2s ease;
}
.admin-sidebar.collapsed { width: 0; overflow: hidden; }

.sidebar-header {
  padding: 13px 16px 11px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.sidebar-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.3);
  font-size: 1rem;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.1s;
}
.sidebar-collapse-btn:hover { color: rgba(255,255,255,0.65); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 0 20px; }

.sidebar-group { margin-bottom: 2px; }
.sidebar-group-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.27);
  padding: 12px 16px 4px;
  white-space: nowrap;
}
.sidebar-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.52);
  cursor: pointer;
  border: none;
  border-left: 2px solid transparent;
  background: none;
  transition: color 0.1s, background 0.1s;
  white-space: nowrap;
}
.sidebar-item:hover { color: rgba(255,255,255,0.87); background: rgba(255,255,255,0.05); }
.sidebar-item.active { color: var(--primary-light); border-left-color: var(--primary-light); background: rgba(255,255,255,0.07); font-weight: 600; }

.sidebar-expand-btn {
  position: fixed;
  top: 62px;
  left: 0;
  z-index: 51;
  background: var(--nav-bg);
  border: 1px solid rgba(255,255,255,0.1);
  border-left: none;
  border-radius: 0 6px 6px 0;
  padding: 7px 9px;
  cursor: pointer;
  color: rgba(255,255,255,0.45);
  font-size: 0.85rem;
  line-height: 1;
  display: none;
  transition: color 0.1s;
}
.sidebar-expand-btn:hover { color: rgba(255,255,255,0.8); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 49;
}
.sidebar-overlay.active { display: block; }

.sidebar-menu-btn {
  display: none;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.82rem;
  margin-bottom: 16px;
}

.admin-content {
  flex: 1;
  min-width: 0;
  padding: 20px 24px;
}

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

@media (max-width: 900px) {
  .admin-sidebar {
    position: fixed;
    top: 50px;
    left: 0;
    height: calc(100vh - 50px);
    width: 210px !important;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-sidebar.collapsed { transform: translateX(-100%); }
  .sidebar-collapse-btn { display: none; }
  .sidebar-expand-btn { display: none !important; }
  .sidebar-menu-btn { display: inline-flex; }
  .admin-content { padding: 14px 16px; }
}

.toggle-switch { position: relative; width: 40px; height: 22px; cursor: pointer; display: inline-block; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--border); border-radius: 22px; transition: 0.2s; }
.slider:before { content: ""; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
input:checked + .slider { background: var(--primary-light); }
input:checked + .slider:before { transform: translateX(18px); }

.rule-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.rule-row:last-child { border-bottom: none; }
.rule-label { font-weight: 600; font-size: 0.87rem; }
.rule-desc { font-size: 0.75rem; color: var(--text-muted); }
.rule-input { width: 58px; text-align: center; font-size: 0.95rem; font-weight: 700; }
.match-score-form { display: flex; align-items: center; gap: 4px; }
.mini-score { width: 40px; text-align: center; font-size: 0.85rem; padding: 4px; }
.fetch-status { margin-top: 10px; font-size: 0.82rem; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.admin-table th {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 7px 10px;
  text-align: left;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.admin-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface-hover); }
.admin-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.admin-table th.sortable:hover { color: var(--text); }
.admin-table th.sort-active { color: var(--primary-light); }
.sort-icon { font-size: 0.65rem; margin-left: 3px; opacity: 0.4; }
.sort-icon.active { opacity: 1; }

/* ── USER ACTION DROPDOWN ─────────────────────────── */
.user-action-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 152px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 150;
  overflow: hidden;
}
.user-action-menu.open { display: block; }
.user-action-menu button {
  display: block;
  width: 100%;
  padding: 8px 13px;
  text-align: left;
  background: none;
  border: none;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
}
.user-action-menu button:hover { background: var(--surface-hover); }
.user-action-menu button + button { border-top: 1px solid var(--border); }
.user-action-menu button.danger { color: var(--red); }

/* ── SAVE BAR ─────────────────────────────────────── */
.save-bar {
  position: sticky;
  top: 50px;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.save-bar-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── TOAST ────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: var(--surface);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateY(14px);
  opacity: 0;
  transition: all 0.22s;
  pointer-events: none;
}
#toast.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
#toast.success { background: var(--green); color: #fff; }
#toast.error   { background: var(--red);   color: #fff; }
@media (max-width: 639px) {
  #toast {
    bottom: calc(66px + env(safe-area-inset-bottom));
    left: 12px; right: 12px;
    text-align: center;
    border-radius: 8px;
  }
}

/* ── CONFETTI ─────────────────────────────────────── */
#confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 10000; overflow: hidden; }
.confetti-piece {
  position: absolute;
  border-radius: 1px;
  opacity: 1;
  animation: confetti-burst 1.1s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}
@keyframes confetti-burst {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) + 160px)) rotate(var(--rot)); opacity: 0; }
}

/* ── ACHIEVEMENT UNLOCK TOAST ─────────────────────── */
.achievement-toast {
  position: fixed;
  top: 64px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--primary-light) 45%, transparent);
  box-shadow: var(--shadow-lg), 0 0 24px color-mix(in srgb, var(--primary-light) 22%, transparent);
  border-radius: 14px;
  padding: 12px 20px;
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-14px) scale(0.94);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.achievement-toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.achievement-toast-icon { font-size: 1.9rem; line-height: 1; }
.achievement-toast-title { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary-light); }
.achievement-toast-name { font-size: 0.98rem; font-weight: 700; color: var(--text); }
@media (max-width: 639px) {
  .achievement-toast { left: 12px; right: 12px; transform: translateY(-14px) scale(0.96); }
  .achievement-toast.show { transform: translateY(0) scale(1); }
}

/* ── SCOREBOARD — clickable rows + filters ────────── */
.scoreboard-row { cursor: pointer; }
.scoreboard-row:hover td { background: var(--surface-hover); }
.scoreboard-row-me td { background: rgba(245,158,11,0.07); }
.scoreboard-row-me td:first-child { border-left: 3px solid var(--accent); padding-left: 9px; }
.scoreboard-row-me:hover td { background: rgba(245,158,11,0.12); }
@media (max-width: 639px) { .lb-col-field { display: none; } }
.scoreboard-table.winner-overflow-hidden .lb-col-winner { display: none; }

.lb-filter-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.lb-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.lb-pill:hover { border-color: var(--primary-light); color: var(--primary-light); }
.lb-pill.active { background: var(--primary-light); border-color: var(--primary-light); color: #111; }

.chat-room-tab {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.chat-room-tab:hover { border-color: var(--primary-light); color: var(--primary-light); }
.chat-room-tab.active { background: var(--primary-light); border-color: var(--primary-light); color: #111; }
.chat-room-tab-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--red);
  color: #fff;
  border-radius: 8px;
  text-align: center;
  vertical-align: middle;
}

/* ── LEADERBOARD PAGE ─────────────────────────────── */
.lb-date-row { align-items: center; }

/* ── FUN STATS ────────────────────────────────────── */
.fun-stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.fun-stat-row:last-child { border-bottom: none; }
.fun-stat-icon  { font-size: 1rem; flex-shrink: 0; }
.fun-stat-label { color: var(--text-muted); flex: 1; min-width: 0; }
.fun-stat-name  { font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.fun-stat-name:hover { text-decoration: underline; }
.fun-stat-val   { color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; }

/* ── AWARD CARDS ──────────────────────────────────── */
.award-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.award-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.award-icon     { font-size: 1.75rem; line-height: 1; margin-bottom: 6px; }
.award-title    { font-weight: 700; font-size: 0.78rem; color: var(--text); }
.award-subtitle { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; line-height: 1.3; min-height: 2.6em; }
.award-winner   { font-size: 0.82rem; font-weight: 600; color: var(--primary-light); text-decoration: none; margin-top: 8px; }
a.award-winner:hover { text-decoration: underline; }
.award-value    { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* ── COUNTDOWN ────────────────────────────────────── */
#countdown-area {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
}
#countdown-area a { color: var(--text); text-decoration: none; }
#countdown-area a:hover { text-decoration: underline; }
#countdown-area strong { color: var(--text); }

/* ── NEWSFLASH BAR ────────────────────────────────── */
#newsflash-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  transition: opacity 0.15s;
}
#newsflash-bar:hover { opacity: 0.8; }
#newsflash-bar #newsflash-inner { flex: 1; min-width: 0; overflow: hidden; }
.nf-badge { font-size: 1rem; flex-shrink: 0; }
.nf-hint  { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
body.has-newsflash { padding-bottom: 44px; }
@media (max-width: 639px) {
  #newsflash-bar { bottom: calc(58px + env(safe-area-inset-bottom)); }
  body.has-newsflash { padding-bottom: calc(58px + env(safe-area-inset-bottom) + 44px); }
}

.newsflash-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
}
.newsflash-item .fun-stat-label { overflow: hidden; text-overflow: ellipsis; }
@keyframes nf-in  { from { opacity:0; transform:translateY(6px);  } to { opacity:1; transform:translateY(0);   } }
@keyframes nf-out { from { opacity:1; transform:translateY(0);    } to { opacity:0; transform:translateY(-6px);} }
.newsflash-fadein  { animation: nf-in  0.5s ease both; }
.newsflash-fadeout { animation: nf-out 0.4s ease both; }

/* ── EDIT PROFILE PAGE ────────────────────────────── */
.profile-identity-header {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 480px;
  margin: 16px 0 20px;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: #111;
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.03em;
}
.profile-identity-name {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.profile-identity-email {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.profile-identity-pts {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
}
.profile-card {
  max-width: 480px;
  margin-top: 1rem;
}
.profile-notif-row {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.profile-notif-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}
.profile-actions {
  max-width: 480px;
  margin-top: 1.25rem;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.profile-signout { color: var(--red); border-color: var(--red); }
.profile-signout:hover { background: rgba(239,68,68,0.08); }

/* ── USER PROFILE PAGE ────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 10px;
}
.back-link:hover { color: var(--primary-light); }

.user-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.user-shared-groups { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.user-group-link {
  font-size: 0.68rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.user-group-link:hover { border-color: var(--primary-light); color: var(--primary-light); text-decoration: none; }

.compare-controls { display: flex; align-items: center; gap: 8px; }
.compare-label    { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }

/* ── COMPARE BANNER ───────────────────────────────── */
.compare-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.compare-banner-player { text-align: center; }
.compare-banner-name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
}
.compare-banner-name:hover { text-decoration: underline; }
.compare-banner-pts  { font-size: 0.78rem; color: var(--text-muted); }
.compare-banner-vs   { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ── COMPARE COLUMN HEADERS ───────────────────────── */
.compare-col-header {
  display: flex;
  padding: 4px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.compare-col-name {
  flex: 1;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 0;
}

/* ── COMPARE CARD ─────────────────────────────────── */
.compare-card { padding-bottom: 0; }
.compare-pred-row {
  display: flex;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.compare-pred-cell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  transition: background 0.15s;
}
.compare-pred-cell + .compare-pred-cell { border-left: 1px solid var(--border); }
.compare-pred-score { font-size: 1rem; font-weight: 700; }
.compare-no-pred    { color: var(--text-muted); font-size: 0.9rem; }
.compare-cell-win   { background: rgba(5, 150, 105, 0.08); }
@media (max-width: 639px) {
  .compare-pred-score { font-size: 0.88rem; }
}

/* ── BRACKET PAGE ─────────────────────────────────── */
.bracket-summary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.84rem;
  color: var(--text-muted);
}
.bracket-summary-text { margin-bottom: 4px; }

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 639px) { .groups-grid { grid-template-columns: 1fr; } }

.group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.group-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.group-card-title   { font-weight: 700; font-size: 0.9rem; }
.group-card-progress {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--border);
  padding: 2px 7px;
  border-radius: 10px;
}
.group-card-progress.complete { background: rgba(5,150,105,0.15); color: var(--green); }

.group-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.group-table thead th {
  padding: 5px 6px;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.group-table thead th:nth-child(1),
.group-table thead th:nth-child(2) { text-align: left; }
.group-table td {
  padding: 6px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.group-table tr:last-child td { border-bottom: none; }
.group-team-flag { width: 24px; padding-right: 0; }
.group-team-name {
  text-align: left !important;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-weight: 500;
  min-width: 100px;
}
.group-pts { font-weight: 700; }
.gd-pos { color: var(--green); }
.gd-neg { color: var(--red); }

/* Row status backgrounds */
.row-advances    { background: rgba(5,150,105,0.06); }
.row-third-adv   { background: rgba(245,158,11,0.05); }
.row-third       {}
.row-out td      { color: var(--text-muted); }

/* Rank badges inline with team name */
.rank-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.rank-advances   { background: rgba(5,150,105,0.18);  color: var(--green); }
.rank-third      { background: rgba(245,158,11,0.15);  color: var(--primary-light); }
.rank-third-out  { background: var(--surface-2);      color: var(--text-muted); }
.rank-out        { background: rgba(220,38,38,0.1);   color: var(--red); }

/* Legend */
.bracket-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 4px 0;
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.legend-dot.advances { background: rgba(5,150,105,0.4); }
.legend-dot.third    { background: rgba(245,158,11,0.35); }
.legend-dot.out      { background: rgba(220,38,38,0.2); }

/* ── KNOCKOUT BRACKET ─────────────────────────────────── */
.knockout-section { margin-top: 2.5rem; }

.knockout-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.knockout-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}
.knockout-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.knockout-clear-btn {
  font-size: 0.75rem;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.knockout-clear-btn:hover { color: var(--red); border-color: var(--red); }

.knockout-round { margin-bottom: 1.75rem; }
.knockout-round-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.6rem;
}
.knockout-matches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 0.6rem;
}
.knockout-matches--final {
  grid-template-columns: repeat(auto-fill, minmax(220px, 280px));
}

.ko-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ko-date {
  font-size: 0.68rem;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.ko-team {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  cursor: pointer;
  transition: background 0.12s;
  min-height: 36px;
}
.ko-team:hover:not(.ko-unknown) { background: var(--surface-hover); }
.ko-team.ko-picked {
  background: rgba(245,158,11,0.12);
}
[data-theme="dark"] .ko-team.ko-picked { background: rgba(251,191,36,0.14); }
.ko-team.ko-unknown { cursor: default; opacity: 0.55; }

.ko-team-name {
  font-size: 0.78rem;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ko-tbd { color: var(--text-muted); font-style: italic; font-weight: 400; }
.ko-team-name--predicted { border-bottom: 1px dashed var(--text-muted); }
.ko-pick-mark {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}
.ko-vs {
  text-align: center;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding: 2px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ko-team .team-flag { width: 20px; height: 14px; border-radius: 2px; flex-shrink: 0; }
.team-code { font-size: 0.65rem; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }

.ko-card--finished .ko-team { cursor: default; }
.ko-team.ko-winner { background: rgba(16,185,129,0.1); font-weight: 600; }
[data-theme="dark"] .ko-team.ko-winner { background: rgba(52,211,153,0.12); }
.ko-team.ko-team--guessed-right { background: rgba(16,185,129,0.1); font-weight: 600; }
[data-theme="dark"] .ko-team.ko-team--guessed-right { background: rgba(52,211,153,0.12); }
.ko-r32-compare { font-size: 0.7rem; text-align: center; padding: 2px 8px; }
.ko-r32-compare--hit  { color: var(--green); font-weight: 600; }
.ko-r32-compare--miss { color: var(--text-muted); font-style: italic; }
.ko-score { font-size: 0.82rem; font-weight: 700; color: var(--text); letter-spacing: 0.03em; }
.ko-score-suffix { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); margin-left: 3px; }
.ko-pick-result { font-size: 0.75rem; font-weight: 600; text-align: center; padding: 4px 8px; border-radius: 0 0 8px 8px; margin-top: 2px; }
.ko-pick-result--correct { background: rgba(16,185,129,0.12); color: var(--green); }
.ko-pick-result--wrong   { background: rgba(239,68,68,0.08); color: var(--text-muted); }
.ko-pick-result--pending { background: rgba(251,191,36,0.1); color: var(--text-muted); }
.ko-pick-result--none    { background: transparent; color: var(--text-muted); font-weight: 400; font-style: italic; }
.ko-pick-result-note { font-weight: 400; opacity: 0.8; }

/* ── KNOCKOUT PICKS SUMMARY (slot-agnostic results list) ──── */
.picks-summary { margin-top: 24px; }
.picks-summary-sub { font-size: 0.78rem; color: var(--text-muted); margin: 0 0 14px; }
.picks-summary-round { margin-bottom: 12px; }
.picks-summary-round:last-child { margin-bottom: 0; }
.picks-summary-round-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 6px; }
.picks-summary-list { display: flex; flex-direction: column; gap: 4px; }
.picks-summary-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; font-size: 0.82rem; }
.picks-summary-flag { width: 18px; height: 13px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.picks-summary-name { font-weight: 500; flex: 1; }
.picks-summary-note { font-size: 0.75rem; font-weight: 600; flex-shrink: 0; }
.picks-summary-item--advanced { background: rgba(16,185,129,0.08); }
.picks-summary-item--advanced .picks-summary-note { color: var(--green); }
.picks-summary-item--eliminated { color: var(--text-muted); }
.picks-summary-item--eliminated .picks-summary-note { color: var(--text-muted); }
.picks-summary-item--pending .picks-summary-note { color: var(--text-muted); }
.bracket-pick-hint { display: flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--text-muted); padding: 5px 12px 0; flex-wrap: wrap; }
.bracket-pick-hint-label { color: var(--text-muted); margin-right: 2px; }
.early-bird-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 600; color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); border-radius: 20px; padding: 2px 8px; margin: 4px 12px 0; width: fit-content; }

/* ── MATCH DETAIL PAGE ─────────────────────────────── */
.match-detail-flag { width: 52px; height: 36px; object-fit: cover; border-radius: 4px; }
.match-detail-score { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.match-detail-vs { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.pts-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.82rem; font-weight: 600; }

/* ── MATCH VIEW FILTERS ──────────────────────────────── */
.match-filter-bar { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }
.match-filter-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.match-filter-label { font-size: 0.78rem; color: var(--text-muted); min-width: 52px; flex-shrink: 0; }

/* ── HERO STRIP ──────────────────────────────────── */
.hero-strip {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 6px 0 2px;
}
.hero-rank {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.03em;
}
.hero-of { font-size: 0.9rem; color: var(--text-muted); font-weight: 400; }
.hero-pts { font-size: 1rem; font-weight: 700; }
.hero-meta { font-size: 0.82rem; color: var(--text-muted); }
.hero-delta { font-size: 0.82rem; font-weight: 600; }
.hero-delta.up   { color: var(--green); }
.hero-delta.down { color: var(--red); }
.hero-delta.same { color: var(--text-muted); }
.hero-form { display: inline-flex; align-items: center; gap: 4px; margin-left: 2px; }
.form-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
}
.form-dot-win  { background: var(--green); }
.form-dot-pts  { background: #f59e0b; }
.form-dot-miss { background: var(--red); }
.form-dot-none { background: var(--border); }
.team-form { display: flex; align-items: center; gap: 4px; margin-top: 5px; }

/* ── Team page prediction stats ──────────────────────────────────────────── */
.pred-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
@media (max-width: 500px) { .pred-stats { grid-template-columns: 1fr; } }
.ps-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  border-top: 3px solid var(--border);
  position: relative;
}
.ps-card--info { cursor: pointer; }
.ps-card--info::after {
  content: 'i';
  position: absolute;
  top: 7px; right: 8px;
  font-size: 0.62rem;
  font-style: italic;
  font-weight: 700;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 13px; height: 13px;
  display: flex; align-items: center; justify-content: center;
  line-height: 13px; text-align: center;
  opacity: 0.6;
}
.ps-value {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.ps-denom { font-size: 0.88rem; font-weight: 500; color: var(--text-muted); }
.ps-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px; }
.ps-goal-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ps-goal-dot--for { background: var(--green); }
.ps-goal-dot--against { background: var(--red); }

/* goal prediction diverging bar (pred ←|→ actual) */
.ps-cmp { display: flex; flex-direction: column; gap: 8px; }
.ps-cmp-row { display: flex; align-items: center; gap: 4px; }
.ps-cmp-lbl { display: flex; align-items: center; gap: 4px; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); width: 70px; flex-shrink: 0; }
.ps-cmp-side { flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; }
.ps-cmp-track { flex: 1; height: 5px; background: var(--border); overflow: hidden; min-width: 0; }
.ps-cmp-track--left { border-radius: 3px 0 0 3px; display: flex; justify-content: flex-end; }
.ps-cmp-track--right { border-radius: 0 3px 3px 0; }
.ps-cmp-bar { height: 100%; transition: width 0.45s cubic-bezier(0.4,0,0.2,1); }
.ps-cmp-bar--pred { background: var(--text-muted); opacity: 0.4; }
.ps-cmp-bar--for { background: var(--green); }
.ps-cmp-bar--against { background: var(--red); }
.ps-cmp-axis { width: 2px; height: 14px; background: var(--border); flex-shrink: 0; }
.ps-cmp-val { font-size: 0.78rem; font-weight: 700; flex-shrink: 0; width: 18px; }
.ps-cmp-side--left .ps-cmp-val { text-align: right; }
.ps-cmp-side--right .ps-cmp-val { text-align: left; }
.ps-cmp-delta { font-size: 0.68rem; color: var(--text-muted); flex-shrink: 0; min-width: 24px; text-align: right; }

/* form dot tap popover */
.team-form-dot { cursor: pointer; }

/* team record strip */
.team-record { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.78rem; color: var(--text-muted); margin-top: 5px; }
.record-w { color: var(--green); font-weight: 700; }
.record-d { color: #f59e0b; font-weight: 700; }
.record-l { color: var(--red); font-weight: 700; }
.record-gd { font-size: 0.72rem; }

/* relative countdown on scheduled match cards */
.team-rel-time { display: block; font-size: 0.68rem; font-weight: 600; color: var(--primary-light); margin-top: 2px; }

.hero-streak {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  animation: streak-flicker 1.8s ease-in-out infinite;
}
@keyframes streak-flicker {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.72; }
}

/* ── POINTS RACE CHART ───────────────────────────── */
.chart-container { position: relative; height: 200px; }

/* ── UPCOMING MATCHES STRIP ─────────────────────── */
.upcoming-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.upcoming-strip::-webkit-scrollbar { height: 4px; }
.upcoming-strip::-webkit-scrollbar-track { background: transparent; }
.upcoming-strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.upcoming-card {
  flex: 0 0 148px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  scroll-snap-align: start;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.upcoming-card:hover { background: var(--surface-hover); }
.upcoming-teams {
  font-size: 0.79rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.upcoming-time { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 5px; }
.upcoming-status { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.upcoming-status.predicted { color: var(--green); }
.upcoming-status.unpredicted { color: var(--accent); }
.upcoming-status.closed { color: var(--text-muted); }

/* ── RANK MOVEMENT ───────────────────────────────── */
.rank-delta { font-size: 0.7rem; font-weight: 700; margin-left: 3px; vertical-align: middle; }
.rank-delta.up   { color: var(--green); }
.rank-delta.down { color: var(--red); }
.rank-delta.same { color: var(--text-muted); opacity: 0.5; }

/* ── MATCH DAY RECAP ─────────────────────────────── */
.matchday-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 10px 0 6px;
}
.matchday-label:first-child { margin-top: 0; }
.recap-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  background: var(--surface-2);
  transition: background 0.12s;
}
.recap-row:hover { background: var(--surface-hover); }
.recap-result { display: flex; align-items: center; gap: 8px; width: 100%; font-size: 0.82rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.recap-home  { flex: 1; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-flag  { flex-shrink: 0; display: flex; align-items: center; }
.recap-score { flex-shrink: 0; text-align: center; white-space: nowrap; min-width: 36px; }
.recap-away  { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-pred-line { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; white-space: nowrap; }
.recap-no-pick { font-size: 0.72rem; color: var(--text-muted); font-style: italic; }

/* ── BRACKET CTA ─────────────────────────────────── */
.bracket-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  margin-top: 16px;
  border-radius: var(--radius);
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.3);
  flex-wrap: wrap;
}
.bracket-cta-text {
  font-size: 0.84rem;
  color: var(--text);
  flex: 1;
  min-width: 200px;
  line-height: 1.5;
}

/* ── NAV LIVE INDICATOR ──────────────────────────── */
.nav-live-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--red);
  font-size: 0.71rem;
  font-weight: 700;
  text-decoration: none;
  padding: 3px 9px;
  border-radius: 12px;
  background: rgba(220,38,38,0.1);
  border: 1px solid rgba(220,38,38,0.2);
  margin-right: 4px;
  white-space: nowrap;
  transition: background 0.15s;
}
.nav-live-indicator:hover { background: rgba(220,38,38,0.18); }
.nav-live-indicator .live-dot { margin-right: 0; flex-shrink: 0; }
.nav-live-indicator[data-reconnecting] { opacity: 0.45; }
.nav-live-indicator[data-reconnecting] .live-dot { animation: none; }

/* ── LIVE PULSE ──────────────────────────────────── */
.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  animation: live-pulse 1.4s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.65); }
}

/* SSE score update flash */
@keyframes score-flash { 0%,100%{background:transparent} 30%{background:var(--accent-dim,rgba(245,158,11,0.15))} }
.score-flash { animation: score-flash 1.2s ease; }

/* Admin broadcast banner (api.js _dispatchSseEvent 'admin_announcement') */
@keyframes fadeInDown { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Jump-to-next button in summary bar */
.jump-btn { background:none; border:1px solid var(--accent); color:var(--accent); border-radius:20px; padding:3px 12px; font-size:0.78rem; font-weight:600; cursor:pointer; white-space:nowrap; transition:background 0.15s,color 0.15s; }
.jump-btn:hover { background:var(--accent); color:#fff; }

/* Inline prediction reveal */
.reveal-row-wrapper { padding:6px 12px 10px; border-top:1px solid var(--border); margin-top:4px; }
.reveal-toggle-btn { background:none; border:none; color:var(--accent); font-size:0.78rem; font-weight:600; cursor:pointer; padding:0; text-decoration:underline; text-underline-offset:2px; }
.reveal-toggle-btn:disabled { opacity:0.5; cursor:default; }
.reveal-panel { margin-top:8px; }
.reveal-list { display:flex; flex-direction:column; gap:2px; }
.reveal-entry { display:flex; align-items:center; gap:8px; padding:4px 6px; border-radius:6px; font-size:0.82rem; }
.reveal-entry:nth-child(odd) { background:var(--surface-2); }
.reveal-me { font-weight:700; }
.reveal-best { outline:1px solid var(--green); }
.reveal-name { flex:1; }
.reveal-you { font-size:0.72rem; color:var(--text-muted); font-weight:400; }
.reveal-score { font-variant-numeric:tabular-nums; min-width:32px; text-align:center; }
.reveal-pts { min-width:40px; text-align:right; font-weight:700; }
.reveal-pts.pos { color:var(--green); }
.reveal-pts.zero { color:var(--text-muted); }
.reveal-exact-count { font-size:0.75rem; color:var(--text-muted); margin-top:6px; padding-top:6px; border-top:1px solid var(--border); }
.reveal-empty { font-size:0.82rem; color:var(--text-muted); padding:6px 0; }

/* ── MATCHES PAGE FILTERS ─────────────────────────── */
.match-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--primary-light); color: var(--primary-light); }
.filter-chip.active { background: var(--primary-light); border-color: var(--primary-light); color: #111; }
.filter-chip-clear:hover { border-color: var(--red); color: var(--red); }

/* Custom team dropdown */
.filter-dropdown { position: relative; }
.filter-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  max-width: 180px;
}
.filter-dropdown-btn:hover { border-color: var(--primary-light); color: var(--primary-light); }
.filter-dropdown-btn.active { border-color: var(--primary-light); color: var(--primary-light); background: rgba(245,158,11,0.08); }
.filter-dropdown-btn img { width: 18px; height: 13px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.filter-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 280px;
  overflow-y: auto;
  min-width: 190px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.filter-dropdown-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text);
  transition: background 0.1s;
}
.filter-dropdown-option:hover { background: var(--surface-hover); }
.filter-dropdown-option.selected { color: var(--primary-light); font-weight: 600; }
.filter-dropdown-option img { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.filter-multiselect-option { user-select: none; }
.multiselect-check {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  color: #111;
  background: transparent;
  transition: all 0.1s;
}
.filter-multiselect-option.selected .multiselect-check {
  background: var(--primary-light);
  border-color: var(--primary-light);
}

/* Match context label (group/stage) below score in match cards */
.match-context-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 3px;
  text-align: center;
  white-space: nowrap;
}

.filter-select {
  font-size: 0.75rem;
  padding: 4px 8px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  outline: none;
  max-width: 160px;
  transition: border-color 0.15s;
}
.filter-select:focus { border-color: var(--primary-light); }

/* Bracket page info card */
.bracket-info-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.bracket-info-ok {
  background: color-mix(in srgb, var(--green) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--green) 30%, transparent);
  color: var(--green);
}
.bracket-info-warn {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--text);
}
.bracket-info-icon {
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.bracket-info-ok .bracket-info-icon { color: var(--green); }
.bracket-info-warn .bracket-info-icon { color: var(--primary-light); }
.bracket-viewer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.bracket-viewer-label {
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.bracket-viewer-select {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border);
  background: var(--surface-alt, var(--bg));
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}
.bracket-viewer-select:focus {
  outline: none;
  border-color: var(--primary-light);
}
.bracket-info-sub {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 8px;
}
.bracket-info-cd { display: block; margin-left: 0; margin-top: 5px; }
.bracket-info-rounds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}
.bracket-info-round {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text-muted);
}
.bracket-info-round em { font-style: normal; font-weight: 700; color: var(--primary-light); margin-left: 3px; }

/* Past matches collapsible */
.past-matches-section { margin-top: 8px; }
.past-toggle-btn {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.past-toggle-btn:hover { background: var(--surface-hover); color: var(--text); }

/* ── GETTING STARTED CARD ──────────────────────────────── */
.gs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.gs-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}
.gs-title { font-size: 0.95rem; font-weight: 700; }
.gs-subtitle { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.gs-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
  flex-shrink: 0;
}
.gs-dismiss:hover { color: var(--text); }
.gs-progress {
  height: 5px;
  background: var(--surface-2);
  border-radius: 3px;
  margin-bottom: 14px;
  overflow: hidden;
}
.gs-progress-fill {
  height: 100%;
  background: var(--primary-light);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.gs-steps { display: flex; flex-direction: column; gap: 10px; }
.gs-step {
  display: flex;
  align-items: center;
  gap: 12px;
}
.gs-step-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  background: var(--surface-2);
}
.gs-step--done .gs-step-check {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: #111;
}
.gs-step-body { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gs-step-label { font-size: 0.85rem; }
.gs-step--done .gs-step-label { color: var(--text-muted); text-decoration: line-through; }
.gs-step-link { font-size: 0.8rem; color: var(--primary-light); font-weight: 600; }
.gs-step-link:hover { text-decoration: underline; }

/* ── SCORE STEPPER ─────────────────────────────────────── */
.score-stepper {
  display: flex;
  align-items: center;
  gap: 0;
}
.stepper-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  border-radius: 0;
  flex-shrink: 0;
  transition: background 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stepper-btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.stepper-btn:last-child  { border-radius: 0 var(--radius) var(--radius) 0; }
.stepper-btn:hover       { background: var(--surface-hover); }
.stepper-btn:active      { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.score-stepper .score-input {
  width: 44px;
  text-align: center;
  border-radius: 0;
  border-left: none;
  border-right: none;
}

/* ── BRACKET LOCKED ────────────────────────────────────── */
.bracket-info-locked {
  background: rgba(107,114,128,0.08);
  border: 1px solid rgba(107,114,128,0.3);
  color: var(--text-muted);
}
.ko-card--locked .ko-team[data-mid] { cursor: default; }
.ko-card--locked .ko-team[data-mid]:hover { background: inherit; }

/* ── MODAL ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: modal-fade-in 0.18s ease both;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  width: 100%; max-width: 440px;
  margin: 16px;
  animation: modal-scale-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-scale-in {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.confirm-dialog { max-width: 360px; }
.confirm-dialog-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.confirm-dialog-body  { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; white-space: pre-line; }

/* ── CHAT ─────────────────────────────────────────── */
.chat-main { overflow: hidden; }
.chat-card {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 138px);
  min-height: 300px;
  padding: 0;
  overflow: hidden;
}
@media (max-width: 639px) {
  .chat-card { height: calc(100dvh - 206px); }
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.chat-messages,
.chat-widget-messages {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.chat-messages::-webkit-scrollbar,
.chat-widget-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-track,
.chat-widget-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb,
.chat-widget-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.chat-messages::-webkit-scrollbar-thumb:hover,
.chat-widget-messages::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.chat-msg { max-width: 78%; align-self: flex-start; }
.chat-msg-self { align-self: flex-end; }
.chat-msg-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 3px;
}
.chat-msg-self .chat-msg-meta { flex-direction: row-reverse; }
.chat-msg-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-light);
  text-decoration: none;
  flex-shrink: 0;
}
.chat-msg-name:hover { text-decoration: underline; }
.chat-msg-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.chat-msg-delete-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.68rem;
  padding: 0 3px;
  line-height: 1;
  border-radius: 3px;
  transition: color 0.12s;
}
.chat-msg-delete-btn:hover { color: var(--red); }
.chat-msg:hover .chat-msg-delete-btn { display: inline-flex; }
.chat-banned-notice {
  text-align: center;
  font-size: 0.8rem;
  color: var(--red);
  padding: 8px 14px;
  background: color-mix(in srgb, var(--red) 8%, transparent);
  border-radius: 8px;
  margin: 0 12px 6px;
}
.chat-msg-bubble {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px 14px 14px 3px;
  padding: 8px 12px;
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-msg-self .chat-msg-bubble {
  background: var(--primary-light);
  color: #111;
  border-color: transparent;
  border-radius: 14px 14px 3px 14px;
}
.chat-msg-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  padding: 0 4px;
  min-height: 26px;
}
.chat-msg-self .chat-msg-footer { justify-content: flex-end; }
.chat-reaction-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 2px 8px 2px 6px;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: border-color 0.13s, background 0.13s, transform 0.1s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  line-height: 1.4;
}
.chat-reaction-badge:hover { border-color: var(--primary-light); background: var(--surface-hover); transform: scale(1.08); }
.chat-reaction-badge.reacted { border-color: var(--primary-light); background: color-mix(in srgb, var(--primary-light) 12%, transparent); }
.chat-reaction-badge .reaction-emoji { font-size: 1rem; line-height: 1; }
.chat-reaction-badge .reaction-count { font-size: 0.73rem; font-weight: 600; color: var(--text-muted); }
.chat-reaction-badge.reacted .reaction-count { color: var(--primary-light); }
/* Reactor-name tooltip */
.chat-reaction-badge[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.4;
  padding: 5px 9px;
  border-radius: 7px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 3px 12px rgba(0,0,0,0.14);
}
.chat-reaction-badge[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
/* Small downward caret connecting tooltip to badge */
.chat-reaction-badge[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top: 5px solid var(--border);
  pointer-events: none;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.15s;
}
.chat-reaction-badge[data-tooltip]:hover::after { opacity: 1; }
.chat-add-reaction-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  width: 30px;
  height: 24px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  opacity: 0.45;
  transition: opacity 0.15s, border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.chat-add-reaction-btn:hover,
.chat-msg:hover .chat-add-reaction-btn { opacity: 1; border-style: solid; border-color: var(--primary-light); background: var(--surface-hover); }
.reaction-picker {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.16);
  display: none;
  grid-template-columns: repeat(4, auto);
  gap: 2px;
  z-index: 2000;
}
.reaction-picker.open { display: grid; }
.reaction-picker-btn {
  background: none;
  border: none;
  font-size: 1.45rem;
  cursor: pointer;
  padding: 5px 6px;
  border-radius: 9px;
  transition: background 0.12s, transform 0.1s;
  line-height: 1;
}
.reaction-picker-btn:hover { background: var(--surface-hover); transform: scale(1.25); }
.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
}
.chat-input:focus { border-color: var(--primary-light); }
.chat-send-btn { border-radius: 20px; padding: 9px 18px; flex-shrink: 0; }
@keyframes chat-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── NOTIFICATION BELL ────────────────────────────── */
.nav-more-btn-wrap { display: none; }
@media (max-width: 639px) { .nav-more-btn-wrap { display: flex; align-items: center; } }
.nav-more-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--nav-text);
  padding: 6px 7px;
  border-radius: 6px;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}
.nav-more-btn:hover, .nav-more-btn.active { color: #fff; background: rgba(255,255,255,0.09); }
.notif-bell-wrap { position: relative; }
.notif-bell-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--nav-text);
  padding: 6px 7px;
  border-radius: 6px;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}
.notif-bell-btn:hover { color: #fff; background: rgba(255,255,255,0.09); }
.notif-badge {
  position: absolute;
  top: 2px; right: 1px;
  background: var(--red);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  pointer-events: none;
}
.chat-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  padding: 0 3px;
  line-height: 1;
  pointer-events: none;
  vertical-align: middle;
  margin-left: 3px;
}
.bnav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bnav-badge {
  position: absolute;
  top: -5px;
  right: -7px;
  margin-left: 0;
}
.notif-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 290px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 300;
}
.notif-bell-wrap.open .notif-dropdown { display: block; }
.notif-item {
  display: block;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-hover); }
.notif-item.notif-unread { background: color-mix(in srgb, var(--primary-light) 8%, transparent); }
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}
.notif-clear-all-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.12s;
}
.notif-clear-all-btn:hover { color: var(--red); }
.notif-item-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}
.notif-item-wrap:last-child { border-bottom: none; }
.notif-item-wrap .notif-item { flex: 1; border-bottom: none; }
.notif-clear-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0 10px;
  flex-shrink: 0;
  transition: color 0.12s, background 0.12s;
}
.notif-clear-btn:hover { color: var(--red); background: var(--surface-hover); }
.notif-item-top { font-size: 0.82rem; }
.notif-item-sender { font-weight: 700; }
.notif-item-preview {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notif-item-time { color: var(--text-muted); font-size: 0.7rem; margin-top: 2px; }
.notif-empty {
  padding: 22px 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ── MENTION AUTOCOMPLETE ─────────────────────────── */
.mention-picker {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.mention-item {
  padding: 9px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  transition: background 0.1s;
}
.mention-item:hover,
.mention-item-focused { background: var(--surface-hover); }

/* ── CHAT MENTION LINK & HIGHLIGHT ───────────────────*/
.chat-mention {
  color: var(--primary-light);
  font-weight: 600;
  text-decoration: none;
}
.chat-mention:hover { text-decoration: underline; }
.chat-msg-self .chat-msg-bubble .chat-mention {
  color: var(--primary);
  text-decoration: underline;
}
@keyframes msg-highlight {
  0%   { background: transparent; }
  20%  { background: color-mix(in srgb, var(--primary-light) 22%, transparent); }
  100% { background: transparent; }
}
.chat-msg-highlight .chat-msg-bubble { border-radius: 14px; animation: msg-highlight 2.2s ease; }
.chat-msg-in { animation: chat-in 0.18s ease both; }

/* ── CHAT WIDGET (dashboard) ─────────────────────── */
.chat-widget-messages {
  height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 4px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-widget-input-row { display: flex; gap: 6px; }
.chat-widget-input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  min-width: 0;
}
.chat-widget-input:focus { outline: none; border-color: var(--primary); }
.chat-widget-input:disabled { opacity: 0.5; cursor: not-allowed; }
.chat-new-pill {
  position: sticky;
  bottom: 4px;
  align-self: center;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 4px 13px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: opacity 0.15s;
}
.chat-new-pill:hover { opacity: 0.85; }

/* ── KNOCKOUT PODIUM ──────────────────────────────────────── */
.knockout-podium {
  margin: 40px 0 8px;
  text-align: center;
}
.knockout-podium-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 0 0 20px;
}
.podium-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  max-width: 440px;
  margin: 0 auto;
}
.podium-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.podium-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 0 4px 10px;
}
.podium-two-thirds {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 4px 10px;
}
.podium-two-flags { display: flex; gap: 5px; justify-content: center; }
.podium-name {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  color: var(--text);
  word-break: break-word;
}
.podium-name--sm { font-size: 0.7rem; }
.podium-flag-img {
  border-radius: 3px;
  object-fit: cover;
  display: block;
}
.podium-flag-blank {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border-radius: 3px;
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 700;
}
.podium-block {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px 6px 0 0;
  font-size: 1.6rem;
}
.podium-block--first  { height: 100px; background: linear-gradient(170deg, var(--podium-gold-start),   var(--podium-gold-end)); }
.podium-block--second { height: 72px;  background: linear-gradient(170deg, var(--podium-silver-start), var(--podium-silver-end)); }
.podium-block--third  { height: 52px;  background: linear-gradient(170deg, var(--podium-bronze-start), var(--podium-bronze-end)); }
.podium-picks-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 12px 0 4px;
  text-align: center;
}
.podium-picks-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  max-width: 440px;
  margin: 0 auto;
}
.podium-pick-col {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}

/* ── Group Standings ──────────────────────────────────────────────────────── */
.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}
@media (max-width: 480px) { .standings-grid { grid-template-columns: 1fr; } }

.standings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: hidden;
}
.standings-group-title {
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.standings-table th {
  padding: 5px 6px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.standings-table td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.standings-table tbody tr:last-child td { border-bottom: none; }
.stn-pos  { width: 28px; color: var(--text-muted); font-size: 0.8rem; }
.stn-team { text-align: left !important; min-width: 130px; }
.stn-team span { vertical-align: middle; }
.stn-gd   { color: var(--text-muted); }
.stn-pts  { font-weight: 700; }
.standings-flag {
  width: 22px; height: 15px;
  object-fit: cover; border-radius: 2px;
  margin-right: 7px; vertical-align: middle;
}
.standings-flag-placeholder { display: inline-block; width: 22px; margin-right: 7px; }
.standings-row--advancing td.stn-pos  { border-left: 3px solid var(--green); }
.standings-row--third-adv td.stn-pos  { border-left: 3px solid var(--primary-light); }
.standings-row--self { background: rgba(217,119,6,0.08); }
.standings-row--self .stn-team span { font-weight: 700; }
.standings-third-badge {
  display: inline-block; font-size: 0.65rem; font-weight: 700;
  background: rgba(245,158,11,0.15); color: var(--primary-light);
  border-radius: 3px; padding: 1px 4px; margin-right: 5px;
  vertical-align: middle;
}

/* ── Team page ────────────────────────────────────────────────────────────── */
.team-link { cursor: pointer; }
.team-link:hover .team-name { text-decoration: underline; }
#team-standings-container, #team-matches-container { margin-top: 24px; }

/* ── Knockout Results (Standings page) ───────────────────────────────────── */
.ko-results-section { margin-top: 32px; }
.ko-results-heading {
  font-size: 1rem; font-weight: 700; margin-bottom: 16px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.standings-live-badge {
  display: inline-flex; align-items: center;
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--red);
}
.ko-round { margin-bottom: 24px; }
.ko-round-title {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px;
}
.ko-round-matches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}
.ko-match-card {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
}
.ko-team {
  display: flex; align-items: center; gap: 7px;
  flex: 1; font-size: 0.88rem; min-width: 0;
}
.ko-team span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ko-team--away { flex-direction: row-reverse; text-align: right; }
.ko-team--winner { font-weight: 700; }
.ko-team--loser  { opacity: 0.45; }
.ko-flag { width: 22px; height: 15px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.ko-score {
  flex-shrink: 0; min-width: 52px; text-align: center;
  font-size: 0.92rem; font-weight: 700;
  background: var(--surface-2); border-radius: 6px; padding: 4px 8px;
  display: flex; align-items: center; justify-content: center; gap: 4px; flex-direction: column;
}
.ko-score--tbd  { color: var(--text-muted); font-weight: 400; }
.ko-score--live { color: var(--green); }
.ko-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); animation: pulse 1.5s infinite;
}
.ko-pen-label { font-size: 0.65rem; font-weight: 400; color: var(--text-muted); margin-left: 3px; }

/* ── Admin Activity Table ────────────────────────────────────────────────── */

/* ── Pull-to-Refresh ─────────────────────────────────────────────────────── */
body { overscroll-behavior-y: contain; }
#ptr-indicator {
  position: fixed; top: 0; left: 50%;
  width: 36px; height: 36px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  z-index: 9999; pointer-events: none;
  opacity: var(--ptr-op, 0);
  transform: translateX(-50%) translateY(calc(var(--ptr-ty, 0px) - 52px));
  will-change: transform, opacity;
}
#ptr-indicator svg { transform: rotate(var(--ptr-rot, 0deg)); }
#ptr-indicator.ptr-ready { border-color: var(--primary); color: var(--primary); }
#ptr-indicator.ptr-spinning svg { animation: ptr-spin 0.65s linear infinite; }
#ptr-indicator.ptr-snap { transition: transform 0.22s ease, opacity 0.22s ease; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ── Admin Stats Bar ─────────────────────────────────────────────────────── */
.admin-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 4px;
}
@media (max-width: 639px) { .admin-stats-bar { grid-template-columns: repeat(2, 1fr); } }
.admin-stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.admin-stat-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.admin-stat-label { font-size: 0.73rem; color: var(--text-muted); margin-top: 2px; }

/* ── Admin tab description text ──────────────────────────────────────────── */
.tab-desc { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 14px; margin-top: -4px; }

/* ── Help page ───────────────────────────────────────────────────────────── */
.help-section { margin-bottom: 2rem; }
.help-section h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: .75rem; color: var(--text); }
.help-section h3 { font-size: .95rem; font-weight: 600; margin: 1rem 0 .4rem; color: var(--text); }
.help-section p, .help-section li { color: var(--text-muted); line-height: 1.65; }
.help-section ul, .help-section ol { padding-left: 1.4rem; margin: .5rem 0; }
.help-section li { margin-bottom: .35rem; }
.score-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: .5rem; }
.score-table th { text-align: left; padding: .5rem .75rem; background: var(--surface); font-weight: 600; color: var(--text); border-bottom: 2px solid var(--border); }
.score-table td { padding: .45rem .75rem; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.score-table tr:last-child td { border-bottom: none; }
.pts-badge { display: inline-block; background: var(--accent); color: #111; border-radius: 999px; padding: .1rem .55rem; font-size: .8rem; font-weight: 700; }
.pts-badge-muted { display: inline-block; background: var(--surface-2, var(--surface)); color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: .1rem .55rem; font-size: .8rem; font-weight: 600; }
.example-box { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.25rem; margin-top: .75rem; }
.example-box p { margin: 0; font-size: .9rem; color: var(--text-muted); }
.help-divider { border: none; border-top: 1px solid var(--border); margin: 1.75rem 0; }
.feature-row { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .5rem; }
.feature-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .05rem; }
.feature-text { color: var(--text-muted); line-height: 1.6; font-size: .95rem; }
.feature-text strong { color: var(--text); }

/* ── Visual polish ───────────────────────────────────────────────────────── */

/* 1. Skeleton loading */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}
.skeleton-line {
  height: 12px; border-radius: 4px; margin-bottom: 8px;
}
.skeleton-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 10px;
}
.skeleton-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

/* 2. Live score flash — already defined above, this adds the variant for match cards */
@keyframes score-flash-strong {
  0%   { background: transparent; }
  25%  { background: rgba(245,158,11,0.22); }
  100% { background: transparent; }
}
.score-flash-strong { animation: score-flash-strong 0.9s ease; }

/* 3. Prediction stat bar fill animation */
@keyframes barSlide { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.stat-bar-seg {
  transform-origin: left;
  animation: barSlide 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* 6. Card stagger entrance */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stagger-in {
  animation: fadeSlideIn 0.22s ease both;
  animation-delay: calc(var(--i, 0) * 40ms);
}

/* 7. Score input focus expansion */
.score-stepper:focus-within .score-input {
  transform: scale(1.1);
  z-index: 1;
  position: relative;
}
.score-input { transition: transform 0.15s ease, border-color 0.15s, box-shadow 0.15s; }

/* ─── Achievement Badges ────────────────────────────────────────────────── */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
}
.achievement-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
  cursor: default;
  transition: transform .15s, box-shadow .15s;
}
.achievement-badge:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.achievement-badge.unlocked {
  background: color-mix(in srgb, var(--primary-light) 8%, transparent);
  border-color: color-mix(in srgb, var(--primary-light) 35%, transparent);
}
.achievement-badge.locked {
  opacity: 0.45;
  filter: grayscale(0.6);
  background: var(--surface-2);
}
.achievement-icon { font-size: 1.5rem; line-height: 1; }
.achievement-name { font-size: 0.68rem; font-weight: 600; color: var(--text); line-height: 1.2; }

/* ─── Streak Banner ─────────────────────────────────────────────────────── */
.streak-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--primary-light) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary-light) 30%, transparent);
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 10px;
}
.streak-icon { font-size: 1.4rem; flex-shrink: 0; }

/* ─── Achievement Popover ───────────────────────────────────────────────── */
.ach-pop {
  display: none;
  position: fixed;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 10px 14px;
  min-width: 190px;
  max-width: 260px;
  font-size: 0.82rem;
  pointer-events: none;
  animation: pop-in 0.16s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.ach-pop-header { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.ach-pop-icon { font-size: 1.3rem; line-height: 1; flex-shrink: 0; }
.ach-pop-name { font-weight: 700; font-size: 0.88rem; color: var(--text); }
.ach-pop-desc { color: var(--text-muted); line-height: 1.4; padding: 2px 0; }
.ach-pop-status { margin-top: 6px; font-weight: 600; font-size: 0.78rem; }
.ach-pop-unlocked { color: var(--green); }
.ach-pop-locked { color: var(--text-muted); }

/* ─── Collapsible panels ────────────────────────────────────────────────── */
.collapsible-card { padding: 0; overflow: hidden; }
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  gap: 8px;
}
.collapsible-header:hover { background: var(--surface-hover, var(--surface-2)); }
.collapsible-header:focus-visible { outline: 2px solid var(--primary-light); outline-offset: -2px; }
.collapsible-body { padding: 0 16px 16px; }
.collapsible-chevron {
  width: 18px; height: 18px; flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

/* ─── Match Discussion messages ─────────────────────────────────────────── */
.disc-msg { padding: 5px 0; border-bottom: 1px solid var(--border); }
.disc-msg:last-child { border-bottom: none; }
.disc-msg-me { border-left: 3px solid var(--accent); padding-left: 8px; border-radius: 0 4px 4px 0; }
.disc-msg-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; flex-wrap: wrap; }
.disc-msg-name { font-weight: 600; font-size: 0.82rem; color: var(--accent); text-decoration: none; }
.disc-msg-name:hover { text-decoration: underline; }
.disc-msg-time { font-size: 0.70rem; color: var(--text-muted); }
.disc-msg-edited { font-size: 0.68rem; color: var(--text-muted); font-style: italic; }
.disc-msg-text { font-size: 0.85rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.disc-msg-footer { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; align-items: center; }
.disc-msg-actions { display: flex; gap: 4px; margin-left: auto; opacity: 0; transition: opacity 0.15s; }
.disc-msg:hover .disc-msg-actions { opacity: 1; }
.disc-action-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 0.78rem; padding: 2px 4px; border-radius: 4px; line-height: 1; }
.disc-action-btn:hover { background: var(--surface-2); color: var(--text); }
.disc-action-delete:hover { color: var(--red); }
.disc-msg-highlight { background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 4px; transition: background 2s ease; }
.disc-unread-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red, #ef4444); color: #fff;
  font-size: 0.68rem; font-weight: 700; line-height: 1;
  border-radius: 20px; padding: 2px 6px; margin-left: 4px;
  vertical-align: middle;
}

/* ─── Discussion count badge on match cards ─────────────────────────────── */
.disc-count-badge {
  display: inline-flex; align-items: center;
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 7px;
  margin-top: 4px;
}
