/* ==========================================================================
   Adiance x VMukti - Claude Arena
   Design system: CSS variables, theme-aware (prefers-color-scheme + manual
   toggle via [data-theme] on <html>), mobile-first responsive layout.
   ========================================================================== */

:root {
  --bg: #f4f6fb;
  --bg-elevated: #ffffff;
  --bg-inset: #eceff6;
  --text: #12141c;
  --text-dim: #565c6d;
  --text-faint: #8a90a3;
  --border: #dfe3ee;
  --border-strong: #c7ccdc;
  --accent: #6d5ef8;
  --accent-2: #ff5fa2;
  --accent-3: #21d4b4;
  /* Raw hue/sat/light components of --accent/--accent-2, for the handful of
     spots that need a translucent tint (hsl(var(--accent-hue) / alpha))
     rather than a solid fill - kept separate so dark mode can swap to a
     neutral gray tint without touching every alpha value individually. */
  --accent-hue: 258deg 90% 60%;
  --accent-2-hue: 330deg 90% 60%;
  /* Text/icon color for content sitting ON TOP of a solid --accent/--accent-2
     gradient fill (buttons, active tabs, avatars) - white on the light mode
     purple, but needs to flip to dark text once dark mode's accent becomes
     a light gray/white monochrome fill. */
  --accent-contrast: #ffffff;
  --shadow-color: 220deg 30% 60%;
  --shadow-sm: 0 1px 2px hsl(var(--shadow-color) / 0.12);
  --shadow-md: 0 8px 24px hsl(var(--shadow-color) / 0.14);
  --shadow-lg: 0 20px 60px hsl(var(--shadow-color) / 0.22);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --up: #1caa6f;
  --down: #e5484d;
  --neutral: #8a90a3;

  --tier-bronze: #b26a3a;
  --tier-silver: #8f97a8;
  --tier-gold: #d6a527;
  --tier-platinum: #59c2c8;
  --tier-diamond: #6da8ff;
  --tier-legendary: #c86dff;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #000000;
    --bg-elevated: #121212;
    --bg-inset: #1c1c1c;
    --text: #f1f2f8;
    --text-dim: #a8adc2;
    --text-faint: #6b7086;
    --border: #2a2a2a;
    --border-strong: #3a3a3a;
    --accent: #f2f2f5;
    --accent-2: #c9c9d1;
    --accent-hue: 0deg 0% 90%;
    --accent-2-hue: 0deg 0% 78%;
    --accent-contrast: #0a0a0a;
    --shadow-color: 0deg 0% 2%;
    --shadow-sm: 0 1px 2px hsl(var(--shadow-color) / 0.4);
    --shadow-md: 0 8px 24px hsl(var(--shadow-color) / 0.5);
    --shadow-lg: 0 24px 70px hsl(var(--shadow-color) / 0.65);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #000000;
  --bg-elevated: #121212;
  --bg-inset: #1c1c1c;
  --text: #f1f2f8;
  --text-dim: #a8adc2;
  --text-faint: #6b7086;
  --border: #2a2a2a;
  --border-strong: #3a3a3a;
  --accent: #f2f2f5;
  --accent-2: #c9c9d1;
  --accent-hue: 0deg 0% 90%;
  --accent-2-hue: 0deg 0% 78%;
  --accent-contrast: #0a0a0a;
  --shadow-color: 0deg 0% 2%;
  --shadow-sm: 0 1px 2px hsl(var(--shadow-color) / 0.4);
  --shadow-md: 0 8px 24px hsl(var(--shadow-color) / 0.5);
  --shadow-lg: 0 24px 70px hsl(var(--shadow-color) / 0.65);
  color-scheme: dark;
}

:root[data-theme='light'] {
  --bg: #f4f6fb;
  --bg-elevated: #ffffff;
  --bg-inset: #eceff6;
  --text: #12141c;
  --text-dim: #565c6d;
  --text-faint: #8a90a3;
  --border: #dfe3ee;
  --border-strong: #c7ccdc;
  --shadow-color: 220deg 30% 60%;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Login page
   -------------------------------------------------------------------------- */

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  background:
    radial-gradient(1100px 700px at 12% -10%, hsl(var(--accent-hue) / 0.35), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, hsl(var(--accent-2-hue) / 0.28), transparent 55%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: hsl(var(--accent-hue) / 0.12);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 20px;
}

.login-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-subtitle {
  color: var(--text-dim);
  margin: 0 0 32px;
  font-size: 15px;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}

.google-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.google-btn:active {
  transform: translateY(0);
}

.login-note {
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.dev-login-option {
  margin-top: 12px;
}

.dev-login-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dev-login-tag {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: hsl(var(--accent-hue) / 0.2);
}

.dev-login-tag-regular {
  background: hsl(220deg 15% 60% / 0.2);
}

.login-error {
  margin: 0 0 20px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: hsl(357deg 80% 55% / 0.12);
  color: var(--down);
  font-size: 13px;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   403 page
   -------------------------------------------------------------------------- */

.error-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.error-card {
  max-width: 440px;
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 44px 36px;
}

.error-emoji {
  font-size: 44px;
  margin-bottom: 12px;
}

.error-card h1 {
  font-size: 20px;
  margin: 0 0 10px;
}

.error-card p {
  color: var(--text-dim);
  margin: 0 0 24px;
}

.error-card a.google-btn {
  display: inline-flex;
  width: auto;
  padding: 10px 22px;
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

.app-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px 20px;
  flex-wrap: wrap;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.topbar-title .logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 4px hsl(var(--accent-hue) / 0.15);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-contrast);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.avatar.lg {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

.avatar.podium-1 {
  width: 72px;
  height: 72px;
  font-size: 26px;
}

.avatar.podium-23 {
  width: 58px;
  height: 58px;
  font-size: 20px;
}

.avatar.md {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

/* --------------------------------------------------------------------------
   Controls row
   -------------------------------------------------------------------------- */

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Left sidebar (Players/Teams navigation) + content area, wrapping the
   existing main-content/warmup/skeleton states - purely a layout change,
   the sections themselves are untouched. */
.board-shell {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.board-sidebar {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 160px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  box-shadow: var(--shadow-sm);
}

.board-sidebar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.board-sidebar-btn:hover {
  background: var(--bg-inset);
  color: var(--text);
}

.board-sidebar-btn.active {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast);
}

.board-content {
  flex: 1;
  min-width: 0;
}

@media (max-width: 640px) {
  .board-shell {
    flex-direction: column;
  }

  .board-sidebar {
    position: static;
    flex-direction: row;
    width: 100%;
  }

  .board-sidebar-btn {
    flex: 1;
    justify-content: center;
  }
}

.window-select {
  appearance: none;
  padding: 10px 34px 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%238a90a3'/></svg>") no-repeat right 12px center;
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.freshness-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.freshness-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 9px 16px;
  flex-wrap: wrap;
}

.freshness-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.freshness-icon {
  font-size: 15px;
  line-height: 1;
}

.freshness-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px transparent;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.freshness-dot-ok {
  background: var(--up);
  box-shadow: 0 0 0 3px hsl(160deg 70% 45% / 0.18);
}

.freshness-dot-warn {
  background: #d9a441;
  box-shadow: 0 0 0 3px hsl(42deg 90% 55% / 0.2);
}

.freshness-dot-stale {
  background: var(--down);
  box-shadow: 0 0 0 3px hsl(355deg 70% 55% / 0.2);
}

.freshness-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
}

.freshness-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.freshness-value {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.freshness-value-muted {
  font-weight: 500;
  color: var(--text-dim);
  white-space: normal;
}

.freshness-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border);
}

@media (max-width: 640px) {
  .freshness-wrap {
    align-items: stretch;
    width: 100%;
  }

  .freshness-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .freshness-divider {
    display: none;
  }
}

.live-clock {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
  padding: 0 4px;
}

.data-freshness {
  margin-bottom: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-inset);
  color: var(--text-dim);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.pill.building {
  color: #a3720b;
  background: hsl(42deg 95% 55% / 0.15);
  border-color: hsl(42deg 90% 50% / 0.35);
}

/* --------------------------------------------------------------------------
   Champion banner / Rising star spotlight
   -------------------------------------------------------------------------- */

.spotlight-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.champion-banner,
.rising-star-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.champion-banner {
  border-color: hsl(45deg 90% 55% / 0.6);
  box-shadow: 0 0 0 1px hsl(45deg 90% 55% / 0.3), var(--shadow-sm);
  background: linear-gradient(180deg, hsl(45deg 95% 60% / 0.08), var(--bg-elevated) 70%);
}

.champion-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.champion-title {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.champion-name {
  font-size: 16px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.champion-points {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
}

.rising-star-card {
  border-color: hsl(160deg 80% 45% / 0.4);
}

.rising-star-text {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .spotlight-row {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Hall of Fame
   -------------------------------------------------------------------------- */

.hall-of-fame {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  overflow: hidden;
}

.hof-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}

.hof-count {
  color: var(--text-faint);
  font-weight: 700;
  font-size: 12.5px;
}

.hof-caret {
  margin-left: auto;
  color: var(--text-faint);
}

.hof-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.hof-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.hof-row:last-child {
  border-bottom: none;
}

.hof-season {
  font-weight: 700;
  color: var(--text-dim);
}

.hof-champ {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hof-points {
  font-weight: 800;
  text-align: right;
}

/* --------------------------------------------------------------------------
   Podium
   -------------------------------------------------------------------------- */

.podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  gap: 10px;
  margin-bottom: 22px;
}

.podium-slot {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 12px 16px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease;
}

.podium-slot.rank-1 {
  order: 2;
  padding-top: 30px;
  padding-bottom: 22px;
  border-color: hsl(45deg 90% 55% / 0.6);
  box-shadow: 0 0 0 1px hsl(45deg 90% 55% / 0.35), 0 20px 50px hsl(45deg 90% 50% / 0.25), var(--shadow-md);
  background: linear-gradient(180deg, hsl(45deg 95% 60% / 0.08), var(--bg-elevated) 60%);
}

.podium-slot.rank-2 {
  order: 1;
}

.podium-slot.rank-3 {
  order: 3;
}

.podium-medal {
  font-size: 26px;
  line-height: 1;
  margin-bottom: 6px;
}

.podium-slot.rank-1 .podium-medal {
  font-size: 32px;
}

.podium-crown {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  filter: drop-shadow(0 4px 8px hsl(45deg 90% 50% / 0.5));
}

.podium-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.podium-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium-points {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.podium-slot.rank-1 .podium-points {
  font-size: 25px;
  background: linear-gradient(120deg, #d6a527, #ffcf4d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --------------------------------------------------------------------------
   Tier chips
   -------------------------------------------------------------------------- */

.tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  color: #fff;
}

/* --------------------------------------------------------------------------
   Your card
   -------------------------------------------------------------------------- */

.your-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
}

.your-card-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.your-card-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.your-card-row1 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.your-card-rank {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 700;
}

.your-card-points {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-inset);
  overflow: hidden;
  width: 100%;
  max-width: 320px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-label {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 2px;
}

.streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 13px;
  color: #cc6a17;
}

.your-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 220px;
}

/* --------------------------------------------------------------------------
   Next-milestone (personal card + profile modal)
   -------------------------------------------------------------------------- */

.milestone-wrap {
  grid-column: 1 / -1;
  margin-top: 10px;
}

/* --------------------------------------------------------------------------
   Ranked list
   -------------------------------------------------------------------------- */

.list-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.list-row {
  display: grid;
  grid-template-columns: 34px 30px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.4s ease;
}

.list-row:last-child {
  border-bottom: none;
}

.list-row:hover {
  background-color: var(--bg-inset);
}

.list-row.is-me:hover {
  background-color: hsl(var(--accent-hue) / 0.12);
}

.list-row.is-me {
  background: hsl(var(--accent-hue) / 0.08);
  box-shadow: inset 3px 0 0 var(--accent);
}

.list-row.flash {
  animation: flash-row 1.6s ease;
}

@keyframes flash-row {
  0% {
    background-color: hsl(160deg 80% 45% / 0.22);
  }
  100% {
    background-color: transparent;
  }
}

.rank-num {
  font-weight: 800;
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
}

.move-indicator {
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.move-up {
  color: var(--up);
}

.move-down {
  color: var(--down);
}

.move-flat {
  color: var(--neutral);
}

.row-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.row-name-wrap {
  min-width: 0;
}

.row-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.you-tag {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  background: hsl(var(--accent-hue) / 0.14);
  border-radius: 5px;
  padding: 1px 6px;
  letter-spacing: 0.03em;
}

.row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.row-secondary {
  font-size: 11.5px;
  color: var(--text-faint);
  white-space: nowrap;
}

.row-badges {
  display: flex;
  gap: 3px;
}

.row-points {
  font-weight: 800;
  font-size: 15px;
  text-align: right;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Teams (Team-vs-Team standings)
   -------------------------------------------------------------------------- */

.teams-view {
  margin-bottom: 22px;
}

.teams-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.teams-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
}

.teams-window-note {
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 600;
}

.teams-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-stats-row {
  margin-top: 4px;
}

.champion-emoji-avatar,
.rising-emoji-avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.champion-emoji-avatar {
  width: 56px;
  height: 56px;
  font-size: 26px;
  background: linear-gradient(135deg, hsl(45deg 90% 55% / 0.25), hsl(45deg 90% 55% / 0.08));
}

.rising-emoji-avatar {
  width: 44px;
  height: 44px;
  font-size: 20px;
  background: linear-gradient(135deg, hsl(160deg 80% 45% / 0.25), hsl(160deg 80% 45% / 0.08));
}

.team-podium-avatar {
  background: linear-gradient(135deg, hsl(var(--accent-hue) / 0.35), hsl(var(--accent-hue) / 0.12));
}

.team-podium-slot {
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.team-podium-slot .org-tag {
  margin-top: 4px;
}

.podium-team-tl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  margin-top: 4px;
}

.team-podium-slot.expanded {
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-md);
}

/* Several team names repeat across the two orgs (e.g. "Full Stack" exists
   under both Adiance and VMukti) - this tag disambiguates them wherever a
   team name is shown. */
.org-tag {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  color: var(--text-faint);
}

.team-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.team-name-line .team-name {
  flex-shrink: 1;
  min-width: 0;
}

.team-row {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.team-row-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  flex-wrap: wrap;
}

.team-row-header:hover {
  background: var(--bg-inset);
}

.team-rank {
  font-size: 18px;
  font-weight: 800;
  width: 34px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-dim);
}

.team-identity {
  flex: 1;
  min-width: 140px;
}

.team-name {
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-meta {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-row-stats {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}

.team-stat-cell {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  min-width: 46px;
}

.team-stat-cell span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  margin-top: 1px;
}

.team-score {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-align: right;
  min-width: 80px;
  flex-shrink: 0;
}

.team-score span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
}

.team-caret {
  font-size: 12px;
  color: var(--text-faint);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.team-row-header.expanded .team-caret {
  transform: rotate(180deg);
}

.team-members {
  border-top: 1px solid var(--border);
  padding: 4px 16px;
  background: var(--bg-inset);
}

.team-member-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.team-member-row:last-child {
  border-bottom: none;
}

.team-member-row:hover {
  opacity: 0.75;
}

.team-member-name-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-member-name {
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-member-tier {
  flex-shrink: 0;
}

.team-member-points {
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   TMS Hygiene - chips, dots, personal-card nudge, footnote
   -------------------------------------------------------------------------- */

.hygiene-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.hygiene-chip.good {
  color: var(--up);
  background: hsl(160deg 70% 45% / 0.14);
  border-color: hsl(160deg 70% 45% / 0.35);
}

.hygiene-chip.watch {
  color: #a3720b;
  background: hsl(42deg 95% 55% / 0.16);
  border-color: hsl(42deg 90% 50% / 0.4);
}

.hygiene-chip.poor {
  color: var(--down);
  background: hsl(355deg 70% 55% / 0.14);
  border-color: hsl(355deg 70% 55% / 0.4);
}

.hygiene-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hygiene-dot.good {
  background: var(--up);
  box-shadow: 0 0 0 3px hsl(160deg 70% 45% / 0.18);
}

.hygiene-dot.watch {
  background: #d69412;
  box-shadow: 0 0 0 3px hsl(42deg 90% 50% / 0.2);
}

.hygiene-dot.poor {
  background: var(--down);
  box-shadow: 0 0 0 3px hsl(355deg 70% 55% / 0.18);
}

.ontopofit-badge {
  font-size: 12px;
  cursor: default;
}

.hygiene-note {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hygiene-note.good {
  color: var(--up);
  background: hsl(160deg 70% 45% / 0.1);
}

.hygiene-note.watch {
  color: #a3720b;
  background: hsl(42deg 95% 55% / 0.14);
}

.hygiene-note.poor {
  color: var(--down);
  background: hsl(355deg 70% 55% / 0.1);
}

.hygiene-note.unavailable {
  color: var(--text-faint);
  background: var(--bg-inset);
  font-weight: 600;
}

.tms-completed-stat {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 700;
  margin-top: 2px;
}

.tms-footnote {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

/* --------------------------------------------------------------------------
   TMS task status tab (admin-only) - team-wise cards of real TMS task data
   -------------------------------------------------------------------------- */

.tms-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tms-team-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.tms-team-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-inset);
}

.tms-member-rows {
  display: flex;
  flex-direction: column;
}

.tms-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.tms-member-row:last-child {
  border-bottom: none;
}

.tms-member-name {
  font-weight: 700;
  font-size: 13px;
  min-width: 110px;
  flex-shrink: 0;
}

.tms-member-stats {
  display: flex;
  gap: 16px;
  flex: 1;
}

.tms-stat-cell {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  min-width: 46px;
}

.tms-stat-cell span,
.tms-stat-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  margin-top: 1px;
}

.tms-no-record {
  font-size: 12px;
  color: var(--text-faint);
  font-style: italic;
}

/* --------------------------------------------------------------------------
   TMS Performance Tracking (admin-only) - sub-nav, legend, status chips,
   trend arrows, individual/team performance lists. Reuses the .tms-*
   card/row/stat-cell structure above and .achv-guide-* for the legend rows.
   -------------------------------------------------------------------------- */

.tms-subnav {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tms-subnav-btn {
  font: inherit;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-weight: 700;
  font-size: 13px;
}

.tms-subnav-btn.active {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.perf-legend-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 4px 16px;
  margin-bottom: 16px;
}

.perf-legend-card[open] {
  padding-bottom: 12px;
}

.perf-legend-summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 800;
  font-size: 13px;
  color: var(--text-dim);
  list-style: none;
}

.perf-legend-summary::-webkit-details-marker {
  display: none;
}

.perf-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.perf-status.excellent {
  color: var(--up);
  background: hsl(160deg 70% 45% / 0.14);
  border-color: hsl(160deg 70% 45% / 0.35);
}

.perf-status.needs_attention {
  color: #a3620b;
  background: hsl(32deg 95% 55% / 0.16);
  border-color: hsl(32deg 90% 50% / 0.4);
}

.perf-status.efficient_contributor {
  color: #2f6fce;
  background: hsl(214deg 90% 55% / 0.14);
  border-color: hsl(214deg 85% 55% / 0.35);
}

.perf-status.needs_support {
  color: var(--down);
  background: hsl(355deg 70% 55% / 0.14);
  border-color: hsl(355deg 70% 55% / 0.4);
}

.perf-status.not_enough_data {
  color: var(--text-faint);
  background: var(--bg-inset);
  border-color: var(--border);
}

.perf-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  margin-left: 8px;
}

.perf-trend.improving {
  color: var(--up);
}

.perf-trend.declining {
  color: var(--down);
}

.perf-team-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.perf-team-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.perf-team-stats {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

/* Employees nested directly under their team's card (Individual Employees
   was merged into Teams - each team now shows its own people underneath). */
.perf-team-members {
  display: flex;
  flex-direction: column;
}

.perf-individual-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.perf-individual-row:last-child {
  border-bottom: none;
}

.perf-name-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   States: skeleton, empty, warmup
   -------------------------------------------------------------------------- */

.skeleton {
  background: linear-gradient(100deg, var(--bg-inset) 30%, var(--border) 50%, var(--bg-inset) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.state-screen {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-dim);
}

.state-screen .state-emoji {
  font-size: 42px;
  margin-bottom: 14px;
}

.state-screen h2 {
  font-size: 18px;
  margin: 0 0 8px;
  color: var(--text);
}

.state-screen p {
  margin: 0;
  font-size: 14px;
  max-width: 360px;
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Jump-to-me FAB
   -------------------------------------------------------------------------- */

.jump-fab {
  position: fixed;
  bottom: 22px;
  right: 22px;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast);
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 20;
  transition: transform 0.15s ease;
}

.jump-fab:hover {
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Confetti canvas
   -------------------------------------------------------------------------- */

.confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .your-card {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .your-card-badges {
    justify-content: flex-start;
    max-width: 100%;
  }

  .list-row {
    grid-template-columns: 26px 22px auto 1fr;
    gap: 8px;
    padding: 10px 12px;
  }

  .row-points {
    grid-column: 1 / -1;
    text-align: left;
    margin-top: 4px;
    font-size: 14px;
  }

  .podium-name {
    font-size: 12.5px;
  }

  .podium-points {
    font-size: 16px;
  }

  .podium-slot.rank-1 .podium-points {
    font-size: 19px;
  }
}

@media (min-width: 641px) {
  .row-points-group {
    display: flex;
    align-items: baseline;
    gap: 10px;
  }
}

/* --------------------------------------------------------------------------
   Clickable player identities (rows / podium / your-card -> profile modal)
   -------------------------------------------------------------------------- */

button.profile-clickable {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  border-radius: var(--radius-sm);
}

button.profile-clickable:hover {
  opacity: 0.75;
}

button.profile-clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.podium-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* --------------------------------------------------------------------------
   Player profile modal
   -------------------------------------------------------------------------- */

.profile-modal-overlay {
  position: fixed;
  inset: 0;
  background: hsl(0deg 0% 0% / 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.profile-modal-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: min(88vh, 780px);
  overflow-y: auto;
  position: relative;
  padding: 28px 22px 22px;
}

.profile-modal-close {
  position: sticky;
  float: right;
  top: 0;
  margin: -8px -6px 0 0;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-modal-close:hover {
  background: var(--border);
}

.profile-modal-status {
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

.profile-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  clear: both;
  margin-bottom: 18px;
}

.profile-modal-headinfo {
  min-width: 0;
}

.profile-modal-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-modal-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.profile-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.profile-stat-block {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.profile-stat-value {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.profile-stat-label {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

.profile-section {
  margin-bottom: 20px;
}

.profile-section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.profile-badges-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px 5px 8px;
  font-size: 12px;
  font-weight: 700;
}

.profile-badge-emoji {
  font-size: 14px;
}

.profile-product-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.profile-product-row:last-child {
  border-bottom: none;
}

.profile-product-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
}

.profile-product-label {
  font-weight: 700;
  font-size: 13px;
  flex: 1;
}

.profile-product-stats {
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
}

.profile-trend {
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 8px;
}

.profile-trend.up {
  color: var(--up);
}

.profile-trend.down {
  color: var(--down);
}

.profile-trend.flat {
  color: var(--neutral);
}

.profile-chart {
  position: relative;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 12px 10px;
}

.chart-legend {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
}

.chart-legend-item::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.chart-legend-current::before {
  background: var(--accent);
}

.chart-svg {
  display: block;
  width: 100%;
  height: 84px;
  overflow: visible;
}

.chart-bar {
  transition: opacity 0.15s ease;
  cursor: pointer;
}

.chart-bar:hover,
.chart-bar:focus-visible {
  opacity: 0.7;
  outline: none;
}

.chart-bar-muted {
  fill: hsl(var(--accent-hue) / 0.22);
}

.chart-bar-current {
  fill: var(--accent);
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--text-faint);
}

.chart-tooltip {
  position: absolute;
  transform: translate(-50%, calc(-100% - 10px));
  background: var(--text);
  color: var(--bg);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-md);
  z-index: 5;
}

.chart-tooltip-value {
  font-weight: 800;
}

.chart-tooltip-date {
  opacity: 0.8;
}

/* --------------------------------------------------------------------------
   Achievement tags guide (public modal + admin section - shared markup/CSS)
   -------------------------------------------------------------------------- */

.achv-guide-list {
  display: flex;
  flex-direction: column;
}

.achv-guide-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.achv-guide-row:last-child {
  border-bottom: none;
}

.achv-guide-emoji {
  font-size: 22px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.achv-guide-name {
  font-weight: 800;
  font-size: 13.5px;
}

.achv-guide-desc {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 1px;
}

.scoring-formula-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.scoring-formula-term {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scoring-formula-emoji {
  font-size: 20px;
}

.scoring-formula-label {
  font-size: 10.5px;
  color: var(--text-faint);
  white-space: nowrap;
}

.scoring-formula-value {
  font-size: 14px;
  font-weight: 800;
}

.scoring-formula-op {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-faint);
}

.scoring-example-card {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.scoring-example-line {
  font-size: 12.5px;
  color: var(--text-dim);
}

.scoring-example-line strong {
  color: var(--text);
  font-weight: 800;
}

.tier-ladder {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.tier-ladder-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tier-ladder-row .tier-chip {
  min-width: 82px;
  justify-content: center;
}

.tier-ladder-desc {
  font-size: 12px;
  color: var(--text-faint);
}

.guide-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.guide-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 4px 10px;
  margin-bottom: -1px;
  font: inherit;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text-faint);
  cursor: pointer;
}

.guide-tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Admin panel
   -------------------------------------------------------------------------- */

.admin-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 20px;
}

.admin-card h2 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.admin-card h3 {
  margin: 18px 0 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-dim);
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
}

.admin-input {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-inset);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
}

.admin-input:focus {
  outline: none;
  border-color: var(--accent);
}

.admin-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.admin-hint {
  font-size: 12.5px;
  color: var(--text-faint);
  margin: 0 0 12px;
}

.admin-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.admin-grid.tiers {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.admin-btn {
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.admin-btn:hover {
  transform: translateY(-1px);
}

.admin-btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: var(--accent-contrast);
}

.admin-btn.danger {
  border-color: var(--down);
  color: var(--down);
}

.admin-save-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0 40px;
}

.admin-status {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--border);
}

.admin-status-ok {
  background: hsl(160deg 70% 45% / 0.12);
  border-color: var(--up);
  color: var(--up);
}

.admin-status-error {
  background: hsl(355deg 70% 55% / 0.12);
  border-color: var(--down);
  color: var(--down);
}

/* ---------------------------------------------------------------------
   Admin sidebar - wraps the existing admin-card sections into named,
   toggleable groups. Purely a navigation layer; card internals unchanged.
--------------------------------------------------------------------- */

.admin-shell {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.admin-sidebar {
  position: sticky;
  top: 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  box-shadow: var(--shadow-sm);
}

.admin-sidebar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.admin-sidebar-btn:hover {
  background: var(--bg-inset);
  color: var(--text);
}

.admin-sidebar-btn.active {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast);
}

.admin-content {
  flex: 1;
  min-width: 0;
}

/* ---------------------------------------------------------------------
   Players & Teams (admin) - Unassigned Users member-detail table, tag chips.
   The Team Hierarchy tree that used to live here was removed; the real org
   hierarchy is served entirely by the public Teams tab.
--------------------------------------------------------------------- */

.team-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.team-detail-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-faint);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.team-detail-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  white-space: nowrap;
  margin: 0 4px 4px 0;
}

.members-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-inset);
}

.member-hide {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
}

.member-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.member-identity strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-identity .admin-hint {
  margin: 0;
}

.member-row-hidden {
  opacity: 0.55;
}

.member-hidden-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--down);
  background: hsl(355deg 70% 55% / 0.12);
  border: 1px solid var(--down);
  vertical-align: middle;
}

.member-name-input {
  width: 100%;
  max-width: 220px;
}

@media (max-width: 640px) {
  .member-row {
    grid-template-columns: 1fr;
  }

  .member-name-input {
    max-width: none;
  }
}

/* --------------------------------------------------------------------------
   Admin panel - Quests
   -------------------------------------------------------------------------- */

.quests-admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.quest-admin-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-inset);
}

.quest-admin-row-inactive {
  opacity: 0.55;
}

.quest-admin-identity {
  min-width: 0;
  font-size: 13.5px;
}

.quest-admin-identity strong {
  font-size: 14px;
}

.quest-admin-meta {
  margin-top: 4px;
}

.quest-admin-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.quest-delete-btn {
  padding: 7px 14px;
  font-size: 12.5px;
}

#add-quest-btn {
  margin-top: 4px;
}

@media (max-width: 640px) {
  .quest-admin-row {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Company Goal meter
   -------------------------------------------------------------------------- */

.goal-meter {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  margin-bottom: 18px;
}

.goal-meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.goal-meter-label {
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.goal-meter-window {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.goal-meter-track {
  height: 14px;
}

.goal-meter-fill {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.goal-meter-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  font-size: 12.5px;
}

.goal-meter-numbers {
  color: var(--text-dim);
  font-weight: 700;
}

.goal-meter-pct {
  font-weight: 800;
  color: var(--text);
}

.goal-meter-complete {
  border-color: hsl(160deg 70% 45% / 0.5);
  box-shadow: 0 0 0 1px hsl(160deg 70% 45% / 0.3), var(--shadow-sm);
  background: linear-gradient(180deg, hsl(160deg 70% 45% / 0.1), var(--bg-elevated) 70%);
}

.goal-meter-complete .goal-meter-fill {
  background: linear-gradient(90deg, var(--up), var(--accent-3));
}

.goal-meter-complete .goal-meter-pct {
  color: var(--up);
}

/* --------------------------------------------------------------------------
   Active Quests
   -------------------------------------------------------------------------- */

.quests-section {
  margin-bottom: 18px;
}

.quests-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

.quests-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.quest-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
}

.quest-card-inactive {
  opacity: 0.6;
}

.quest-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quest-card-title {
  font-weight: 800;
  font-size: 14.5px;
}

.quest-bonus-chip {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--accent);
  background: hsl(252deg 90% 65% / 0.14);
  white-space: nowrap;
}

.quest-card-desc {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 4px;
}

.quest-card-caption {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 6px;
}

.quest-card-completed {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  margin-top: 8px;
}

.quest-progress-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quest-progress-mine {
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.quest-progress-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.quest-progress-row-me {
  font-weight: 800;
}

.quest-progress-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quest-progress-track {
  height: 6px;
}

.quest-progress-value {
  text-align: right;
  color: var(--text-faint);
  font-weight: 700;
  white-space: nowrap;
}

.quest-top-list {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.quest-top-title {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 5px;
}

.quest-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  padding: 2px 0;
}

.quest-chip {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  cursor: default;
  position: relative;
}

.quest-chip[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  z-index: 5;
  box-shadow: var(--shadow-md);
}

.podium-quests {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .quests-list {
    grid-template-columns: 1fr;
  }
  .quest-progress-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      'name value'
      'track track';
    row-gap: 3px;
  }
  .quest-progress-name {
    grid-area: name;
  }
  .quest-progress-value {
    grid-area: value;
  }
  .quest-progress-track {
    grid-area: track;
  }
}

/* ==========================================================================
   Admin Overview (#overview-view)
   Uses only existing design tokens, so light/dark follow automatically - in
   dark mode --accent/--accent-hue become the neutral monochrome fill the rest
   of the app uses, rather than a naive colour flip.
   ========================================================================== */

/* --- KPI stat tiles ------------------------------------------------------ */
.ov-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.ov-stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

/* Proportional figures on purpose - tabular-nums makes a large standalone
   number look loosely spaced. Tabular is reserved for table columns below. */
.ov-stat-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.02em;
}

.ov-stat-label {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.ov-stat-sub {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.4;
}

/* --- Season spotlights --------------------------------------------------- */
.ov-spotlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.ov-spot {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.ov-spot-emoji { font-size: 20px; line-height: 1.2; }
.ov-spot-body { min-width: 0; }

.ov-spot-kicker {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.ov-spot-headline {
  margin-top: 3px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
}

.ov-spot-sub { margin-top: 2px; font-size: 12px; color: var(--text-dim); }

/* --- Cards + layout ------------------------------------------------------ */
.ov-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  min-width: 0;
}

.ov-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ov-card-title { font-size: 14px; font-weight: 800; color: var(--text); margin: 0; }
.ov-card-note { font-size: 11.5px; font-weight: 600; color: var(--text-faint); }

.ov-grid-2,
.ov-grid-3 { display: grid; gap: 14px; }
.ov-grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.ov-grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.ov-grid-2 > .ov-card,
.ov-grid-3 > .ov-card { margin-bottom: 0; }

/* --- Ranked magnitude lists --------------------------------------------- */
.ov-rank-list { display: flex; flex-direction: column; gap: 2px; }

.ov-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--border);
}

.ov-rank-row:last-child { border-bottom: none; }

.ov-rank-row.is-clickable { cursor: pointer; }
.ov-rank-row.is-clickable:hover,
.ov-rank-row.is-clickable:focus-visible {
  background: var(--bg-inset);
  outline: none;
}

.ov-rank-num {
  flex: 0 0 auto;
  min-width: 26px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.ov-rank-mid { flex: 1 1 auto; min-width: 0; }

.ov-rank-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ov-rank-sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Thin mark, rounded end, recessive track. One fill colour for every row -
   length is the encoding, so tinting by value would double-encode it. */
.ov-bar-track {
  margin-top: 5px;
  height: 4px;
  border-radius: 999px;
  background: var(--bg-inset);
  overflow: hidden;
}

.ov-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.ov-rank-value {
  flex: 0 0 auto;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.ov-up { color: var(--up); }
.ov-down { color: var(--down); }

/* --- Tables (the chart's table twin, and the full team table) ----------- */
.ov-table-wrap { overflow-x: auto; }

.ov-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.ov-table th,
.ov-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.ov-table th {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.ov-table tbody tr:last-child td { border-bottom: none; }
.ov-table tbody tr:hover { background: var(--bg-inset); }

/* Tabular figures belong here - these columns align vertically. */
.ov-table th.num,
.ov-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.ov-details { margin-top: 12px; }

.ov-details-summary {
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-dim);
  padding: 6px 0;
}

.ov-details[open] .ov-details-summary { margin-bottom: 8px; }

/* Taller plot than the profile modal's, matching the 120-unit viewBox. The
   axis labels sit in a sibling div so the card grows to include them. */
.ov-trend-chart .chart-svg { height: 120px; }

@media (max-width: 720px) {
  .ov-stat { padding: 13px 14px; }
  .ov-stat-value { font-size: 22px; }
  .ov-card { padding: 14px; }
}
