/* ================================================================
   CSS Variables — Insight Gaming Design System
   ================================================================ */
:root {
  --purple:        #7B2FBE;
  --purple-light:  #9B51E0;
  --purple-bright: #A855F7;
  --purple-glow:   rgba(123, 47, 190, 0.4);
  --purple-dim:    rgba(123, 47, 190, 0.15);
  --bg:            #050507;
  --surface-1:     #0D0D14;
  --surface-2:     #12121E;
  --surface-3:     #1A1A2A;
  --border:        rgba(123, 47, 190, 0.25);
  --text:          #E8E8F0;
  --text-dim:      #7070A0;
  --gold:          #FFD700;
  --silver:        #C0C0C0;
  --bronze:        #CD7F32;
  --amber:         #F59E0B;
  --green:         #22C55E;
  --red:           #ef4444;
}

/* ================================================================
   Reset
   ================================================================ */
html {
  font-size: 16px;
}

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

/* ================================================================
   Body & Background
   ================================================================ */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Ambient blobs — bottom-right large + top-centre small */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 85% 90%, var(--purple-dim)   0%, transparent 70%),
    radial-gradient(ellipse 30% 25% at 50%  5%, rgba(123,47,190,0.07) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* Ambient blob — top-left */
body::after {
  content: '';
  position: fixed;
  top: -40%;
  left: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, var(--purple-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: blob-drift 55s ease-in-out infinite;
}

@keyframes blob-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(3%, 2%) scale(1.04); }
  66%       { transform: translate(-2%, 3.5%) scale(0.97); }
}

/* ================================================================
   Layout Wrapper
   ================================================================ */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* ================================================================
   Header — Zone 1
   ================================================================ */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--purple-light);
  box-shadow: 0 0 24px var(--purple-glow);
  object-fit: cover;
  flex-shrink: 0;
}

.logo-text h1 {
  font-family: 'Orbitron', monospace;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 0 30px var(--purple-glow);
  line-height: 1;
}

.logo-text p {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--purple-bright);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-top: 5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Status pill */
.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 8px 16px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.is-live {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: blink 1.6s ease-in-out infinite;
}

.status-dot.is-loading {
  background: var(--purple-bright);
  box-shadow: 0 0 8px var(--purple-bright);
  animation: blink 0.6s ease-in-out infinite;
}

.status-dot.is-error {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: error-pulse 2.5s ease-in-out infinite;
}

@keyframes error-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.timestamp {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ================================================================
   Tab Bar — double-mode A/B tournament selector
   ================================================================ */
.tab-bar {
  display: none;
  gap: 4px;
}

.tab-bar.is-visible {
  display: flex;
}

.tab-btn {
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 7px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.tab-btn:hover {
  background: var(--purple-dim);
  border-color: var(--purple);
  color: var(--text);
}

.tab-btn.is-active {
  background: var(--purple);
  border-color: var(--purple-light);
  color: #fff;
  box-shadow: 0 0 14px var(--purple-glow);
}

.refresh-btn {
  background: var(--purple-dim);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--purple-bright);
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: background 0.2s, border-color 0.2s;
}

.refresh-btn:hover {
  background: rgba(123, 47, 190, 0.3);
  border-color: var(--purple);
}

/* ================================================================
   Stats Strip
   ================================================================ */
.stats-strip {
  display: flex;
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  border-color: rgba(123, 47, 190, 0.45);
  box-shadow: 0 0 16px rgba(123, 47, 190, 0.1);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--purple-bright), transparent);
}

.stat-value {
  font-family: 'Orbitron', monospace;
  font-size: 2.1rem;
  font-weight: 900;
  color: var(--purple-bright);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 7px;
}

.prize-lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.prize-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
}

.prize-rank {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  flex-shrink: 0;
}

.prize-amount {
  font-family: 'Orbitron', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--purple-bright);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ── Best X Games — 2-card stat strip layout ──────────────────── */
/* Larger typography when the middle card is removed and each card fills 50% */
.stats-strip--bestx .stat-value {
  font-size: 3.2rem;
}

.stats-strip--bestx .stat-label {
  font-size: 1.05rem;
  margin-top: 10px;
}

.stats-strip--bestx .prize-amount {
  font-size: 1.55rem;
}

.stats-strip--bestx .prize-rank {
  font-size: 0.9rem;
}

/* ================================================================
   Match Point Banner — Zone 2 (hidden by default)
   ================================================================ */
.mp-banner {
  display: none;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 10px;
  padding: 12px 20px;
  margin-bottom: 28px;
  overflow: hidden;
  box-shadow: inset 3px 0 0 rgba(245, 158, 11, 0.75);
}

.mp-banner.is-visible {
  display: flex;
}

.mp-banner:hover .mp-scroll-track {
  animation-play-state: paused;
}

.mp-banner__label {
  font-family: 'Orbitron', monospace;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.20em;
  color: var(--amber);
  white-space: nowrap;
  flex-shrink: 0;
}

.mp-banner__teams {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.mp-scroll-track {
  display: flex;
  animation: mp-scroll 20s linear infinite;
  width: max-content;
  gap: 10px;
}

@keyframes mp-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .mp-scroll-track {
    animation: none;
  }
}

.mp-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 6px;
  padding: 5px 14px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.74rem;
  color: var(--amber);
  white-space: nowrap;
  flex-shrink: 0;
  animation: chip-pulse 2s ease-in-out infinite;
}

.mp-chip-logo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  vertical-align: middle;
}

@keyframes chip-pulse {
  0%, 100% { box-shadow: 0 0 0px rgba(245, 158, 11, 0); }
  50%       { box-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
}

@media (prefers-reduced-motion: reduce) {
  .mp-chip {
    animation: none;
  }
}

/* ================================================================
   Main Grid — Zone 3 (two columns)
   ================================================================ */
.main-grid {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 26px;
  align-items: stretch;
}

.fraggers-col {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  position: relative;
}

.fraggers-body {
  position: relative;
  flex: 1;
  min-height: 0;
}

/* ================================================================
   Section Headers
   ================================================================ */
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.section-title {
  font-family: 'Orbitron', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}

.section-tag {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  background: var(--purple-dim);
  color: var(--purple-bright);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  animation: tag-pulse 2.5s ease-in-out infinite;
}

@keyframes tag-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

.column-hint {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

/* ================================================================
   Leaderboard Chrome Tabs — double-mode only
   ================================================================ */
.lb-tabs {
  display: none;
  align-items: flex-end;
  border-bottom: 1px solid var(--border);
}

.lb-tabs.is-visible {
  display: flex;
}

.lb-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: var(--surface-1);
  color: var(--text-dim);
  cursor: pointer;
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  user-select: none;
  transition: color 0.15s;
  white-space: nowrap;
}

.lb-tab + .lb-tab {
  margin-left: 4px;
}

.lb-tab.is-active {
  background: var(--surface-2);
  color: var(--text);
  border-bottom: 1px solid var(--surface-2); /* erases the shelf line under active tab */
  margin-bottom: -1px;                        /* extends 1px down to meet the panel */
  position: relative;
  z-index: 1;
}

.lb-tab:not(.is-active):hover {
  color: var(--text);
}

.lb-wrap.has-tabs {
  border-top: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* ================================================================
   Leaderboard Table
   ================================================================ */
.lb-wrap {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: 0 4px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(123,47,190,0.12);
}

.lb-wrap table {
  min-width: 480px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

thead th {
  background: var(--surface-3);
  padding: 11px 14px;
  text-align: left;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

thead th.align-center { text-align: center; width: 50px; }
thead th.align-right  { text-align: right; }

/* --- Data rows --- */
.data-row {
  border-bottom: 1px solid rgba(123, 47, 190, 0.1);
  cursor: pointer;
  animation: row-in 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: background 0.15s, box-shadow 0.15s;
}

.data-row:hover {
  background: rgba(123, 47, 190, 0.07);
  box-shadow: inset 3px 0 0 var(--purple);
}

@keyframes row-in {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: none; }
}

.data-row td {
  padding: 13px 14px;
  vertical-align: middle;
}

/* Winner — slightly taller row */
.data-row.is-winner > td {
  padding-top: 17px;
  padding-bottom: 17px;
  background: rgba(255, 215, 0, 0.025);
}

/* Match point — amber pulsing border on each td */
.data-row.is-match-point > td {
  border-top: 1px solid rgba(245, 158, 11, 0.4);
  border-bottom: 1px solid rgba(245, 158, 11, 0.4);
  animation: mp-row-pulse 2s ease-in-out infinite;
}

@keyframes mp-row-pulse {
  0%, 100% { background: transparent; }
  50%       { background: rgba(245, 158, 11, 0.07); }
}

/* Winner — gold pulsing border; overrides amber match-point glow via later cascade position */
.data-row.is-winner > td {
  border-top: 1px solid rgba(255, 215, 0, 0.5);
  border-bottom: 1px solid rgba(255, 215, 0, 0.5);
  animation: winner-row-pulse 2s ease-in-out infinite;
}

@keyframes winner-row-pulse {
  0%, 100% { background: rgba(255, 215, 0, 0.025); }
  50%       { background: rgba(255, 215, 0, 0.08); }
}

@media (prefers-reduced-motion: reduce) {
  .data-row.is-winner > td {
    animation: none;
  }
}

/* --- Rank cell --- */
.rank {
  text-align: center;
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  width: 50px;
}

.rank--1 { color: var(--gold);   text-shadow: 0 0 18px rgba(255, 215, 0, 0.7), 0 0 32px rgba(255, 215, 0, 0.2); }
.rank--2 { color: var(--silver); text-shadow: 0 0 8px  rgba(192, 192, 192, 0.45); }
.rank--3 { color: var(--bronze); text-shadow: 0 0 8px  rgba(205, 127, 50, 0.45); }
.rank--n { color: var(--text-dim); }

/* --- Team cell --- */
.team-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.org-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--purple-light);
  flex-shrink: 0;
  background: var(--surface-3);
  box-shadow: 0 0 10px rgba(123,47,190,0.35);
  transition: filter 0.2s;
}

.org-logo-fallback {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--purple);
  border: 1px solid var(--purple-light);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  user-select: none;
}

.team-info {
  min-width: 0;
}

.team-name {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

/* Winner — gold shimmer on the name only */
.team-name.is-winner {
  color: var(--gold);
  animation: gold-shimmer 3s ease-in-out infinite;
}

@keyframes gold-shimmer {
  0%, 60%, 100% { text-shadow: 0 0 8px  rgba(255, 215, 0, 0.35); }
  70%            { text-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 38px rgba(255, 215, 0, 0.2); }
}

.org-name {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--purple-bright);
  letter-spacing: 0.09em;
  margin-top: 2px;
}

/* --- Score cell --- */
.score-cell {
  text-align: right;
  font-family: 'Orbitron', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--purple-bright);
  font-variant-numeric: tabular-nums;
}

.score-cell.at-threshold {
  color: #CC7722;
}

.data-row.is-winner .score-cell.at-threshold {
  color: #FFD700;
}

.data-row.is-winner .score-cell {
  color: var(--gold);
  font-size: 0.72rem;
  white-space: nowrap;
  letter-spacing: 0.06em;
}

/* --- Maps cell (pip chips) --- */
.maps-cell {
  text-align: right;
}

.pips {
  display: flex;
  gap: 3px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.pip {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 5px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.62rem;
  color: var(--text-dim);
}

.pip.is-best {
  background: rgba(123, 47, 190, 0.3);
  border-color: var(--purple);
  color: var(--purple-bright);
}

/* --- Chevron cell --- */
.chevron-cell {
  text-align: center;
  width: 36px;
}

.chevron {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s;
  user-select: none;
}

.data-row.is-expanded .chevron {
  transform: rotate(90deg);
}

.data-row:hover .chevron {
  color: var(--purple-bright);
}

.data-row:hover .org-logo {
  filter: brightness(1.1);
}

/* --- Expandable sub-row --- */
.expand-row td {
  padding: 0 14px;
  background: rgba(123, 47, 190, 0.03);
  min-width: 0;
  max-width: 0;
  width: 100%;
}

/* Inner container drives the open/close transition */
.map-breakdown {
  display: flex;
  gap: 7px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  scrollbar-width: thin;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding-top 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding-bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-breakdown::-webkit-scrollbar {
  height: 2px;
}

.map-breakdown::-webkit-scrollbar-track {
  background: transparent;
}

.map-breakdown::-webkit-scrollbar-thumb {
  background: var(--purple);
  border-radius: 1px;
}

.expand-row.is-open .map-breakdown {
  max-height: 400px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.map-card {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  text-align: center;
  min-width: 52px;
}

.map-card__label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.map-card__score {
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--purple-bright);
  margin-top: 2px;
}

/* --- Map detail table (expanded leaderboard rows) --- */
.map-breakdown--table {
  flex-direction: column;
}

.map-detail-scroll {
  overflow-x: auto;
  width: 100%;
}

.map-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  white-space: nowrap;
}

.map-detail-table thead th {
  background: var(--surface-3);
  padding: 5px 10px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  border: 1px solid var(--border);
  text-align: right;
  font-weight: 400;
}

.map-detail-table thead th:first-child {
  text-align: left;
}

.map-detail-table tbody td {
  padding: 4px 10px;
  border: 1px solid rgba(123, 47, 190, 0.1);
  text-align: right;
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
}

.map-detail-table .detail-label {
  text-align: left;
  color: var(--text-dim);
  font-size: 0.72rem;
  white-space: nowrap;
}

.map-detail-table .detail-player .detail-label {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text);
}

.map-detail-table .detail-weighted td {
  color: var(--purple-bright);
  font-weight: 700;
}

.map-detail-table .detail-total-col {
  color: var(--amber) !important;
  font-weight: 700;
}

/* --- Per-map breakdown cards (leaderboard expand row) --- */
.mc {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  width: 80px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.mc__label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.mc__placement {
  font-family: 'Orbitron', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.mc__players {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0;
}

.mc__player {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
}

.mc__pname {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.mc__kills {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--text);
  flex-shrink: 0;
}

.mc__weighted {
  font-family: 'Orbitron', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--amber);
  border-top: 1px solid var(--border);
  padding-top: 3px;
  margin-top: 1px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* --- Map card layout: scrollable cards + pinned AVG --- */
.mc-layout {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.mc-scroll {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--purple-dim) transparent;
}

.mc-scroll .mc {
  width: calc(12.5% - 7px);
  min-width: unset;
  flex-shrink: 0;
  flex-grow: 0;
  box-sizing: border-box;
}

.mc-scroll::-webkit-scrollbar {
  height: 4px;
}

.mc-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.mc-scroll::-webkit-scrollbar-thumb {
  background: var(--purple-dim);
  border-radius: 2px;
}

.mc-avg-pin {
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: stretch;
}

/* --- Averages summary card --- */
.mc--avg {
  border-color: var(--purple-bright);
  min-width: 110px;
  max-width: 130px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  padding: 8px;
}

.mc__avg-row {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 2px;
}

.mc__avg-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.6rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.mc__avg-val {
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  color: var(--purple-bright);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ================================================================
   Top Fraggers Panel
   ================================================================ */
.fraggers-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--purple) var(--surface-1);
  box-shadow: 0 4px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(123,47,190,0.12);
}

.fragger-row {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(123, 47, 190, 0.08);
  min-width: 0;
}

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

.fragger-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 6px;
}

.fragger-summary:hover {
  background: rgba(123, 47, 190, 0.06);
}

.fragger-chevron {
  font-size: 0.75rem;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s;
  user-select: none;
}

.fragger-row.is-expanded .fragger-chevron {
  transform: rotate(90deg);
}

.fragger-summary:hover .fragger-chevron {
  color: var(--purple-bright);
}

.fragger-detail {
  min-width: 0;
  overflow: hidden;
  width: 100%;
  padding: 8px 0 4px 0;
  max-height: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding-bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fragger-detail .mc {
  width: calc(12.5% - 7px);
  min-width: unset;
  max-width: unset;
  flex-shrink: 0;
  flex-grow: 0;
  padding: 6px 2px;
  align-items: center;
  text-align: center;
}

.fragger-detail .mc__label {
  font-size: 0.55rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
}

.fragger-detail .mc__fkills {
  font-size: 0.85rem;
  font-family: 'Orbitron', monospace;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fragger-detail .mc-scroll {
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  align-items: stretch;
  padding-bottom: 4px;
}

.fragger-row.is-expanded .fragger-detail {
  max-height: 120px;
  padding-bottom: 8px;
}

@media (max-width: 425px) {
  .fragger-detail {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--purple) transparent;
  }

  .fragger-detail .mc {
    flex: 0 0 auto;
    min-width: 52px;
    max-width: none;
  }

  .fragger-detail::-webkit-scrollbar {
    height: 2px;
  }

  .fragger-detail::-webkit-scrollbar-track {
    background: transparent;
  }

  .fragger-detail::-webkit-scrollbar-thumb {
    background: var(--purple);
    border-radius: 1px;
  }
}

.mc__fkills {
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--amber);
  text-align: center;
  margin-top: 4px;
}

.fragger-row.is-expanded .fragger-bar-track {
  display: none;
}

/* Rank number */
.fragger-rank {
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  width: 22px;
  text-align: right;
  flex-shrink: 0;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.fragger-rank.rank--1 { color: var(--gold);   text-shadow: 0 0 8px rgba(255, 215, 0, 0.5); }
.fragger-rank.rank--2 { color: var(--silver); text-shadow: 0 0 8px rgba(192, 192, 192, 0.4); }
.fragger-rank.rank--3 { color: var(--bronze); text-shadow: 0 0 8px rgba(205, 127, 50, 0.4); }

/* Org logo — 20px */
.fragger-org {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface-3);
}

.fragger-org-placeholder {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* Name + kill bar */
.fragger-info {
  flex: 1;
  min-width: 0;
}

.fragger-name-text {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fragger-bar-track {
  height: 4px;
  background: var(--surface-3);
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}

.fragger-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--purple-bright) 55%, var(--amber));
  border-radius: 3px;
  width: 0;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: width;
}

/* Kill count */
.fragger-kills {
  font-family: 'Orbitron', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--purple-bright);
  flex-shrink: 0;
  min-width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ================================================================
   Loading, Error & Empty States
   ================================================================ */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  gap: 14px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--purple-bright);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.76rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.error-state {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.73rem;
  color: var(--red);
  padding: 30px 20px;
  text-align: center;
  line-height: 1.8;
}

.empty-state {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.73rem;
  color: var(--text-dim);
  padding: 30px 20px;
  text-align: center;
}

/* ================================================================
   Focus-visible — keyboard navigation rings
   ================================================================ */
.tab-btn:focus-visible,
.refresh-btn:focus-visible,
.lb-tab:focus-visible {
  outline: 2px solid var(--purple-bright);
  outline-offset: 3px;
}

.data-row:focus-visible {
  outline: 2px solid var(--purple-bright);
  outline-offset: -2px;
}

.fragger-summary:focus-visible {
  outline: 2px solid var(--purple-bright);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ================================================================
   Scrollbar — Webkit
   ================================================================ */
::-webkit-scrollbar         { width: 6px; height: 6px; }
::-webkit-scrollbar-track   { background: var(--surface-1); }
::-webkit-scrollbar-thumb   { background: var(--purple); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-light); }

/* ================================================================
   Responsive — 1000px breakpoint
   ================================================================ */
@media (max-width: 1000px) {
  .logo-text h1 {
    font-size: 1.1rem;
  }

  .stats-strip {
    flex-wrap: wrap;
  }

  .stat-card {
    flex: 1 1 calc(50% - 7px);
  }
}

@media (max-width: 374px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .fraggers-body {
    height: 400px;
  }
}

/* ================================================================
   Reduced Motion — disable all animations
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .mp-scroll-track {
    animation-duration: var(--mp-duration, 0s) !important;
    animation-iteration-count: infinite !important;
  }
}
