/* ---- Tokens ---- */
:root {
  --accent:     #1a56db;
  --accent-h:   #1448c0;
  --accent-bg:  #eff5ff;
  --accent-lt:  #dbeafe;
  --win:        #16a34a;
  --win-bg:     #dcfce7;
  --purple:     #7c3aed;
  --purple-bg:  #f5f3ff;
  --gold:       #d97706;
  --gold-bg:    #fffbeb;
  --silver-bg:  #f8fafc;
  --bronze-bg:  #fff7ed;

  --bg:        #eef1f8;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --border-2:  #cbd5e1;
  --text:      #0f172a;
  --muted:     #64748b;
  --subtle:    #94a3b8;

  --sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', 'Inter', sans-serif;
  --radius:  14px;
  --radius-sm: 9px;

  --shadow-sm: 0 1px 2px rgba(15,23,42,0.06);
  --shadow:    0 1px 3px rgba(15,23,42,0.08), 0 6px 16px rgba(15,23,42,0.06);
  --shadow-md: 0 4px 20px rgba(15,23,42,0.10), 0 1px 4px rgba(15,23,42,0.06);
  --shadow-lg: 0 16px 40px rgba(15,23,42,0.13), 0 4px 12px rgba(15,23,42,0.08);
  --shadow-accent: 0 4px 16px rgba(26,86,219,0.35);

  --maxw: 1040px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

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

/* ---- Top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 2rem;
  height: 60px;
  background: #0f172a;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  color: #fff;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}
.brand:hover { text-decoration: none; color: #fff; }
.brand-name strong { color: rgba(255,255,255,0.55); font-weight: 600; }
.brand-team {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.02em;
  padding-left: 0.6rem;
  border-left: 1px solid rgba(255,255,255,0.15);
  margin-left: 0.5rem;
}

.nav { display: flex; align-items: center; gap: 0.1rem; position: relative; z-index: 1; }
.nav a {
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.01em;
}
.nav a:hover { background: rgba(255,255,255,0.14); color: #fff; text-decoration: none; }
.nav-user {
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  padding: 0 0.9rem;
  border-left: 1px solid rgba(255,255,255,0.18);
  margin-left: 0.25rem;
}

/* ---- Layout ---- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 2.5rem 1.75rem 5rem; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.page-header > *:last-child { flex-shrink: 0; }
.page-title {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.3rem;
}
.muted  { color: var(--muted); font-size: 0.875rem; margin-top: 0.3rem; }
.small  { font-size: 0.8rem; }
.nowrap { white-space: nowrap; }

.footer {
  text-align: center;
  color: var(--subtle);
  padding: 1.5rem;
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.7);
  letter-spacing: 0.02em;
}

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.empty { color: var(--muted); text-align: center; padding: 3.5rem; font-size: 0.9rem; }
.center-card { max-width: 420px; margin: 3rem auto; }

/* ---- Flash messages ---- */
.flashes { margin-bottom: 1.5rem; display: grid; gap: 0.5rem; }
.flash {
  padding: 0.8rem 1.1rem;
  border-radius: 10px;
  border: 1px solid;
  font-size: 0.875rem;
  font-weight: 500;
}
.flash-success { background: #f0fdf4; border-color: #86efac; color: #15803d; }
.flash-error   { background: #fef2f2; border-color: #fca5a5; color: #b91c1c; }

/* ---- Forms ---- */
label {
  display: block;
  margin: 1rem 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
input, select {
  width: 100%;
  padding: 0.72rem 0.95rem;
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  border: 1.5px solid var(--border-2);
  background: var(--surface);
  color: var(--text);
  padding: 0.62rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--bg); box-shadow: var(--shadow); text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-h);
  border-color: var(--accent-h);
  box-shadow: var(--shadow);
}
.btn-ghost { background: transparent; border-color: rgba(255,255,255,0.3); color: rgba(255,255,255,0.9); box-shadow: none; }
.btn-ghost:hover { background: rgba(255,255,255,0.14); box-shadow: none; }
.btn-block { width: 100%; margin-top: 1rem; padding: 0.8rem; font-size: 0.95rem; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.inline { display: inline; margin: 0; }

/* ---- Auth ---- */
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 2rem 1rem;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.75rem 2.5rem 2.25rem;
  box-shadow: var(--shadow-md);
}
.auth-header {
  margin-bottom: 2rem;
}
.auth-app-name {
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 1rem;
}
.auth-title {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.auth-subtitle {
  font-size: 0.875rem;
  color: var(--muted);
}
.auth-field { margin-bottom: 1rem; }
.auth-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.auth-field input {
  width: 100%;
  padding: 0.72rem 0.9rem;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--sans);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}
.auth-field input::placeholder {
  font-style: italic;
  font-size: 0.85rem;
}
.auth-field-hint {
  font-size: 0.75rem;
  color: var(--subtle);
  margin-top: 0.35rem;
}
.auth-footer-text {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 1.5rem;
}

/* ---- Filter dropdowns ---- */
.filter-dropdowns {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}
.filter-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.filter-select-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
}
.filter-select {
  width: auto;
  padding: 0.42rem 2rem 0.42rem 0.75rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
}
.hidden { display: none !important; }

/* ---- Round filter ---- */
.round-filter {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.round-btn {
  padding: 0.42rem 1rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.round-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.round-btn.active { background: var(--text); border-color: var(--text); color: #fff; box-shadow: var(--shadow-sm); }

/* ---- Rounds ---- */
.round { margin-bottom: 3rem; }
.round-title {
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.round-title::before {
  content: '';
  display: block;
  height: 2px;
  width: 24px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
  flex-shrink: 0;
}
.round-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Match grid ---- */
.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.1rem;
}

/* ---- Match card ---- */
.match {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.match:not(.locked):not(.live):hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: rgba(26,86,219,0.2);
}
.match.locked:not([data-finished="yes"]) { opacity: 0.68; }
.match.locked:not([data-finished="yes"]):hover { box-shadow: var(--shadow); transform: none; }

.match.live {
  opacity: 1;
  border-color: rgba(22, 163, 74, 0.35);
}
.match.live:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: rgba(22, 163, 74, 0.5);
}

.match-status-bar { height: 3px; width: 100%; }
.match:not(.locked) .match-status-bar { background: var(--accent); }
.match.live .match-status-bar { background: var(--win); }
.match.locked .match-status-bar { background: var(--border); }

.match-inner {
  padding: 1.15rem 1.3rem 1.3rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.match-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.15rem;
}
.kickoff { font-size: 0.74rem; color: var(--muted); font-weight: 500; }

.badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.badge-open   { background: #f0fdf4; color: #15803d; }
.badge-locked { background: #f1f5f9; color: var(--subtle); }
.badge-final  { background: var(--purple-bg); color: var(--purple); }
.badge-live   {
  background: #f0fdf4;
  color: var(--win);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.live-dot {
  width: 7px;
  height: 7px;
  background: var(--win);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* ---- Teams ---- */
.teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}
.team { display: flex; flex-direction: column; gap: 0.2rem; }
.team-away { text-align: right; align-items: flex-end; }
.team-name { font-weight: 800; font-size: 1.02rem; letter-spacing: -0.015em; line-height: 1.2; }
.team-code {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--subtle);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.team.is-winner .team-name { color: var(--win); }
.team.is-winner .team-code { color: var(--win); }

.score-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}
.score {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
  min-width: 3.5rem;
}
.score .vs {
  color: var(--subtle);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---- Pick form ---- */
.pick-form { margin-top: auto; }
.pick-buttons { display: flex; gap: 0.4rem; }
.pick {
  flex: 1;
  padding: 0.58rem 0.35rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.01em;
}
.pick:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
  transform: translateY(-1px);
}
.pick.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pick:disabled { cursor: not-allowed; opacity: 0.3; }
.your-pick { margin: 0.65rem 0 0; font-size: 0.8rem; color: var(--muted); }
.your-pick strong { color: var(--text); font-weight: 700; }

/* ---- Standing banner ---- */
.standing-banner {
  background: var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.standing-rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}
.standing-num {
  font-family: var(--display);
  font-size: 2.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.03em;
}
.standing-rank-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
}
.standing-sep {
  width: 1px;
  align-self: stretch;
  background: rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.standing-stats {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}
.standing-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.standing-stat-value {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
}
.standing-stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
}
.standing-progress {
  flex: 1;
  min-width: 140px;
}
.standing-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.standing-progress-track {
  height: 5px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  overflow: hidden;
}
.standing-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  min-width: 4px;
  transition: width 0.5s ease;
}

/* ---- Section header ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.section-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.section-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---- Dashboard layout ---- */
.dashboard-cols {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}
.dashboard-main {
  display: flex;
  flex-direction: column;
}
.dashboard-main .table-card {
  flex: 1;
}
.dashboard-side {}

.sidebar-section { margin-bottom: 0.75rem; }
.sidebar-title {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  color: var(--text);
}

/* ---- Side match cards ---- */
.side-match {
  padding: 1rem 1.1rem;
  margin-bottom: 0.6rem;
  border-radius: 10px;
}
.side-match-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}
.side-round {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.side-teams {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
}
.side-team { flex: 1; line-height: 1.2; }
.side-team em { font-style: normal; font-size: 0.65rem; font-weight: 700; color: var(--muted); letter-spacing: 0.06em; }
.side-team-away { text-align: right; }
.side-vs { color: var(--subtle); font-size: 0.72rem; font-weight: 700; flex-shrink: 0; }

.side-pick-form { display: flex; gap: 0.35rem; }
.side-pick-btn {
  flex: 1;
  padding: 0.45rem 0.3rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}
.side-pick-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

.see-all-link {
  display: block;
  text-align: center;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.4rem;
  padding: 0.4rem;
}
.see-all-link:hover { text-decoration: underline; }

/* ---- Recent results ---- */
.recent-pick {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
}
.recent-pick:last-child { border-bottom: none; }
.recent-win  { border-left-color: var(--win); }
.recent-loss { border-left-color: #f87171; }
.recent-draw { border-left-color: var(--subtle); }

.recent-match {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}
.recent-teams { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.recent-score { font-size: 0.82rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.recent-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.recent-pick-label { font-size: 0.75rem; color: var(--muted); }
.recent-pts { font-size: 0.78rem; font-weight: 700; color: var(--subtle); }
.pts-win  { color: var(--win); }
.pts-loss { color: #f87171; }

/* ---- Pagination ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.825rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); text-decoration: none; }
.page-btn-active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: var(--shadow-accent); }
.page-btn-active:hover { background: var(--accent); color: #fff; }
.page-btn-disabled { color: var(--subtle); cursor: default; opacity: 0.5; }
.page-btn-disabled:hover { border-color: var(--border); color: var(--subtle); background: var(--surface); }

/* ---- Leaderboard footer ---- */
.leaderboard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.leaderboard-footer-text { font-size: 0.8rem; color: var(--muted); }

/* ---- Leaderboard ---- */
.table-card { padding: 0; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.9rem 1.25rem; text-align: left; }
thead th {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.12s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* Podium rows */
tr.rank-1 { background: var(--gold-bg); }
tr.rank-1:hover { background: #fef9c3; }
tr.rank-1 td:first-child { border-left: 3px solid #f59e0b; padding-left: 1.1rem; }
tr.rank-2 { background: var(--silver-bg); }
tr.rank-2:hover { background: #f1f5f9; }
tr.rank-2 td:first-child { border-left: 3px solid #94a3b8; padding-left: 1.1rem; }
tr.rank-3 { background: var(--bronze-bg); }
tr.rank-3:hover { background: #ffedd5; }
tr.rank-3 td:first-child { border-left: 3px solid #f97316; padding-left: 1.1rem; }

.num { text-align: right; }
.col-rank { width: 3.5rem; text-align: center; font-size: 1.1rem; }

.player-cell { display: flex; align-items: center; gap: 0.75rem; }
.player-name { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0;
}
.avatar-0 { background: linear-gradient(135deg, #1a56db, #06b6d4); }
.avatar-1 { background: linear-gradient(135deg, #7c3aed, #db2777); }
.avatar-2 { background: linear-gradient(135deg, #059669, #0891b2); }
.avatar-3 { background: linear-gradient(135deg, #ea580c, #d97706); }
.avatar-4 { background: linear-gradient(135deg, #db2777, #9333ea); }
.avatar-5 { background: linear-gradient(135deg, #0891b2, #1a56db); }

.leaderboard .points {
  font-weight: 800;
  color: var(--accent);
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
tr.me { background: var(--accent-bg); }
tr.me:hover { background: var(--accent-lt); }
tr.me td { font-weight: 600; }
tr.rank-1.me, tr.rank-2.me, tr.rank-3.me { background: var(--accent-bg); }

.tag {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  margin-left: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tag-me { background: var(--accent-bg); color: var(--accent); }

/* ---- Admin ---- */
.btn-danger { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }
.btn-danger:hover { background: #fee2e2; border-color: #f87171; }
.admin-actions { margin-bottom: 1.25rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.admin-cols .card { margin-bottom: 0; }
.result-form { display: flex; align-items: center; gap: 0.4rem; }
.result-form input { width: 3.5rem; margin: 0; text-align: center; padding: 0.35rem 0.4rem; }
.admin-matches td { vertical-align: middle; }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-cols { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .admin-cols { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .topbar { padding: 0 1rem; height: 56px; }
  .container { padding: 1.75rem 1rem 3rem; }
  .match-grid { grid-template-columns: 1fr; }
  .page-header { gap: 0.75rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .stat-value { font-size: 1.6rem; }
}

/* ---- Dark mode ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --accent:    #4f8ef7;
    --accent-h:  #3b82f6;
    --accent-bg: #1a2d52;
    --accent-lt: #1e3560;
    --win:       #34d399;
    --win-bg:    #052e1a;
    --purple:    #a78bfa;
    --purple-bg: #1e1040;
    --gold:      #fbbf24;
    --gold-bg:   #1a1200;
    --silver-bg: #141820;
    --bronze-bg: #1a0e06;

    --bg:       #0d1117;
    --surface:  #161c2a;
    --border:   #242d40;
    --border-2: #2e3850;
    --text:     #e8edf8;
    --muted:    #8896b3;
    --subtle:   #4e5f7d;
  }

  body::before {
    background:
      radial-gradient(ellipse 80% 50% at 50% -10%, rgba(79,142,247,0.1) 0%, transparent 70%),
      radial-gradient(ellipse 60% 40% at 90% 90%, rgba(124,58,237,0.07) 0%, transparent 60%);
  }

  .topbar {
    background: #070c14;
    border-bottom-color: rgba(255,255,255,0.06);
  }

  .card { background: var(--surface); border-color: var(--border); }
  .match { background: var(--surface); border-color: var(--border); }

  input, select { background: #0d1117; border-color: var(--border-2); }
  input:focus, select:focus { background: #111827; }

  .btn { background: var(--surface); border-color: var(--border-2); }
  .btn:hover { background: #1e2638; }

  .filter-btn { background: var(--surface); border-color: var(--border); }
  .filter-btn:hover { background: #1e2638; }
  .round-btn { background: var(--surface); border-color: var(--border); }
  .round-btn:hover { background: #1e2638; }
  .round-btn.active { background: var(--text); border-color: var(--text); color: var(--bg); }

  .pick { background: #0d1117; border-color: var(--border); }
  .pick:hover:not(:disabled) { background: var(--accent-bg); }

  thead th { background: #10151f; }
  tbody tr:hover { background: #1c2235; }

  tr.rank-1       { background: #1a1200; }
  tr.rank-1:hover { background: #201600; }
  tr.rank-2       { background: var(--silver-bg); }
  tr.rank-2:hover { background: #1a2030; }
  tr.rank-3       { background: var(--bronze-bg); }
  tr.rank-3:hover { background: #1f1008; }
  tr.me           { background: var(--accent-bg); }
  tr.me:hover     { background: var(--accent-lt); }

  .badge-locked { background: #1c2235; }
  .tag { background: #1e2638; }

  .flash-success { background: #052e1a; border-color: #065f46; color: #6ee7b7; }
  .flash-error   { background: #3b0a0a; border-color: #7f1d1d; color: #fca5a5; }

  .footer { background: rgba(22,28,42,0.8); border-color: var(--border); }

  .standing-banner { background: #1e3a8a; }
  .standing-progress-track { background: rgba(255,255,255,0.12); }
  .side-match { background: var(--surface); }
  .side-pick-btn { background: #0d1117; border-color: var(--border); }
  .side-pick-btn:hover { background: var(--accent-bg); }

  .match:not(.locked):hover { box-shadow: 0 16px 40px rgba(0,0,0,0.5); }
}
