:root {
  --bg: #0c0b0a;
  --bg-elev: #161310;
  --bg-card: #1a1612;
  --bg-plate: #14110e;
  --border: #2f2620;
  --border-strong: #5a3a22;
  --border-copper: #a86b3c;
  --copper: #e8954a;
  --copper-deep: #c07840;
  --copper-soft: rgba(232, 149, 74, 0.14);
  --info: #6eb5ff;
  --info-soft: rgba(110, 181, 255, 0.12);
  --gold: #f0c040;
  --silver: #c0c0c0;
  --bronze: #c07830;
  --text: #f2efe9;
  --text-1: #c8c2b8;
  --text-2: #8a847a;
  /* Roboto Condensed (same as site). Mono only via .font-mono for dense numbers. */
  --font: "Roboto Condensed", "Arial Narrow", sans-serif;
  --font-display: "Roboto Condensed", "Arial Narrow", sans-serif;
  --font-mono: "IBM Plex Mono", "Cascadia Mono", "Consolas", ui-monospace, monospace;
  --radius: 10px;
  --shadow-plate: 0 10px 28px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --grid-line: rgba(192, 120, 64, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: var(--font); }
body.embed {
  font-family: var(--font) !important;
  background:
    linear-gradient(rgba(192, 120, 64, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(192, 120, 64, 0.05) 1px, transparent 1px),
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(192, 120, 64, 0.14), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(80, 50, 30, 0.22), transparent 45%),
    var(--bg);
  background-size: 24px 24px, 24px 24px, auto, auto, auto;
  color: var(--text);
  min-height: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-body-font-family: var(--font);
  --bs-font-sans-serif: var(--font);
}

body.embed button,
body.embed input,
body.embed select,
body.embed textarea,
body.embed .btn,
body.embed .form-control,
body.embed .form-select,
body.embed .nav-link,
body.embed .dropdown-menu,
body.embed .dropdown-item,
body.embed .table,
body.embed .badge,
body.embed .modal,
body.embed .card {
  font-family: inherit;
}

a { color: var(--copper); text-decoration: none; }
a:hover { text-decoration: underline; }
.font-mono { font-family: var(--font-mono); }

.tops-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1rem 1.75rem;
}

.page-header { margin-bottom: 1.25rem; }
.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
}
.page-sub { margin: 0.4rem 0 0; color: var(--text-2); font-size: 0.9rem; }

.player-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--border-copper);
  object-fit: cover;
  background: var(--bg-elev);
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Toolbar: no vertical scrollbars (overflow-x alone forces overflow-y:auto) */
.toolbar-row {
  overflow: visible;
}
.toolbar-row > [class*="col"] {
  overflow: visible;
  min-width: 0;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  border-bottom: 1px solid var(--border);
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  box-sizing: border-box;
}
.tabs-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  flex-wrap: nowrap;
  width: 100%;
}
.tabs-scroll::-webkit-scrollbar {
  height: 3px;
  width: 0;
}
.tabs-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-2);
  padding: 0 0.85rem;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  line-height: 1.2;
  cursor: pointer;
  font-size: 0.82rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}
.tab-btn:hover { color: var(--text-1); }
.tab-btn.active {
  color: var(--copper);
  border-bottom-color: var(--copper);
}

.search-wrap {
  position: relative;
  width: 100%;
  min-width: 200px;
  max-width: 320px;
  overflow: visible;
}
@media (max-width: 991.98px) {
  .search-wrap { max-width: none; }
}

body.embed .form-control.search-input {
  width: 100%;
  background: var(--bg-plate);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 8px;
  min-height: 44px;
  height: 44px;
  padding: 0.55rem 0.95rem;
  font-size: 0.88rem;
  box-shadow: var(--shadow-inset), 0 6px 16px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
body.embed .form-control.search-input:focus {
  background: var(--bg-elev);
  border-color: var(--copper);
  color: var(--text);
  box-shadow: 0 0 0 0.18rem var(--copper-soft), var(--shadow-inset);
}
body.embed .form-control.search-input::placeholder {
  color: var(--text-2);
}

.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-plate);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 30;
  max-height: 280px;
  box-shadow: var(--shadow-plate);
}
.search-dropdown.show { display: block; }
.search-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  min-height: 44px;
  cursor: pointer;
  color: var(--text);
}
.search-item:hover { background: var(--copper-soft); }
.search-item img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

body.embed .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  background: var(--bg-plate);
  color: var(--text-1);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  min-height: 44px;
  height: 44px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: var(--shadow-inset), 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
body.embed .btn:hover {
  text-decoration: none;
  border-color: var(--border-strong);
  color: var(--text);
  background: rgba(232, 149, 74, 0.08);
}
body.embed .btn:disabled { opacity: 0.4; cursor: not-allowed; }
body.embed .btn-sm {
  padding: 0.4rem 0.65rem;
  font-size: 0.78rem;
  min-height: 40px;
  height: 40px;
}
body.embed .btn-glass { background: rgba(255,255,255,0.03); }
body.embed .btn-primary,
body.embed .btn.btn-primary {
  background: var(--copper-soft);
  border-color: var(--copper);
  color: var(--copper);
}
body.embed .btn.muted { color: var(--text-2); }

#btn-breakdown {
  overflow: hidden;
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  background: var(--bg-plate);
  box-shadow: var(--shadow-plate);
  width: 100%;
}
body.embed .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
  --bs-table-striped-bg: transparent;
  color: var(--text);
  font-size: 0.92rem;
  width: 100%;
}
body.embed #lb-table {
  width: 100%;
  table-layout: fixed;
}
body.embed #lb-table th:nth-child(1),
body.embed #lb-table td:nth-child(1) {
  width: 4.5rem;
}
body.embed #lb-table th:nth-child(2),
body.embed #lb-table td.lb-player {
  width: 32%;
}
body.embed #lb-table th[data-col],
body.embed #lb-table td[data-col] {
  width: auto;
}
body.embed .table-wrap .table > :not(caption) > * > * {
  padding: 0.95rem 1rem;
  border-bottom-color: var(--border);
  background: transparent;
  vertical-align: middle;
}
body.embed #lb-table thead th {
  background: #181410;
  position: sticky;
  top: 0;
  z-index: 1;
}
th {
  color: var(--text-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
th.sorted { color: var(--copper); }
th[data-col],
td.col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#lb-table th:nth-child(1),
#lb-table th:nth-child(2),
#lb-table td:nth-child(1),
#lb-table td:nth-child(2) {
  text-align: left;
}
.player-main-row:hover { background: rgba(255, 255, 255, 0.025); }
.player-main-row--top1 {
  background: linear-gradient(90deg, rgba(240, 192, 64, 0.16), transparent 58%);
  box-shadow: inset 3px 0 0 0 var(--gold);
}
.player-main-row--top2 {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.12), transparent 58%);
  box-shadow: inset 3px 0 0 0 var(--silver);
}
.player-main-row--top3 {
  background: linear-gradient(90deg, rgba(192, 120, 48, 0.14), transparent 58%);
  box-shadow: inset 3px 0 0 0 var(--bronze);
}
.player-main-row--top1:hover,
.player-main-row--top2:hover,
.player-main-row--top3:hover {
  filter: brightness(1.05);
}
.lb-rank { font-family: var(--font-display); font-size: 0.85rem; font-weight: 700; }
.lb-metric {
  font-family: var(--font-display);
  color: var(--copper);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.lb-kd {
  font-family: var(--font-display);
  color: var(--info);
  font-variant-numeric: tabular-nums;
}
.lb-num {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}
.lb-time {
  font-family: var(--font-display);
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.player-cell img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #222;
  flex-shrink: 0;
  border: 2px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.player-main-row--top1 .player-cell img { border-color: var(--gold); }
.player-main-row--top2 .player-cell img { border-color: var(--silver); }
.player-main-row--top3 .player-cell img { border-color: var(--bronze); }
.player-cell a {
  color: var(--text);
  font-weight: 600;
  display: block;
}
.score-sub { display: none !important; }

.bd-row td {
  padding: 0.4rem 0.85rem 0.85rem;
  background: rgba(0,0,0,0.25);
}
.bd-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
/* Author display:flex wins over UA [hidden] — must force hide extras */
.bd-chips[hidden],
.bd-chips-extra[hidden] {
  display: none !important;
}
.bd-expand-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}
.bd-more-btn {
  margin: 0;
  font-size: 0.75rem;
  flex: 0 0 auto;
  white-space: nowrap;
  align-self: center;
}

/* Category tabs + Score Breakdown on one line */
.cat-toolbar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.cat-toolbar #category-tabs {
  flex: 1 1 auto;
  min-width: 0;
}
.cat-toolbar .btn-breakdown-inline {
  flex: 0 0 auto;
  width: auto;
  white-space: nowrap;
  min-height: 42px;
}
.bd-chip {
  --chip-color: var(--copper);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid color-mix(in srgb, var(--chip-color) 45%, transparent);
  background: color-mix(in srgb, var(--chip-color) 12%, transparent);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.75rem;
}
.bd-chip-label { color: var(--chip-color); font-weight: 600; }
.bd-chip-amount { color: var(--text-1); font-family: var(--font-display); }
.bd-chip-pts { color: var(--text-2); font-family: var(--font-display); }

.page-info { color: var(--text-2); font-family: var(--font-display); font-size: 0.85rem; }

/* Metric cards: Bootstrap row when #metric-grid has .row */
.metric-grid:not(.row) {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}
#metric-grid.row,
#metric-grid-secondary.row {
  display: flex;
  flex-wrap: wrap;
}
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  height: 100%;
  box-shadow: var(--shadow-inset);
}
.metric-value {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-display);
  margin-bottom: 0.2rem;
  font-variant-numeric: tabular-nums;
}
.metric-value.is-info { color: var(--info); }
.metric-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  font-weight: 600;
}
.metric-icon { color: var(--copper); margin-bottom: 0.3rem; font-size: 0.85rem; }

.section-label {
  color: var(--copper);
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
  font-weight: 700;
}
.breakdown-section { margin-top: 1.1rem; }
.activity-sections .breakdown-section { margin-top: 0.85rem; }
.history-section { margin-top: 1.25rem; }
#category-tabs { border-bottom-color: var(--border-copper); }

.past-wipes-panel { margin-bottom: 1rem; }
.past-wipes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.wipe-chip {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-1);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  min-height: 44px;
  cursor: pointer;
  font-size: 0.82rem;
}
.wipe-chip:hover, .wipe-chip.active {
  border-color: var(--copper);
  color: var(--copper);
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-2);
}
.skeleton {
  background: linear-gradient(90deg, #1a1a1a, #242424, #1a1a1a);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.lang-bar {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  min-height: 40px;
  min-width: 44px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.lang-btn img {
  width: 18px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.lang-btn.active {
  border-color: var(--copper);
  color: var(--copper);
}

.lb-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.lb-card {
  background: var(--bg-plate);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow-inset), 0 8px 20px rgba(0, 0, 0, 0.28);
}
.lb-card--top1 {
  background: linear-gradient(135deg, rgba(240, 192, 64, 0.16), var(--bg-plate));
  border-color: rgba(240, 192, 64, 0.4);
  box-shadow: inset 3px 0 0 0 var(--gold), 0 8px 20px rgba(0, 0, 0, 0.28);
}
.lb-card--top2 {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.12), var(--bg-plate));
  border-color: rgba(192, 192, 192, 0.35);
  box-shadow: inset 3px 0 0 0 var(--silver), 0 8px 20px rgba(0, 0, 0, 0.28);
}
.lb-card--top3 {
  background: linear-gradient(135deg, rgba(192, 120, 48, 0.14), var(--bg-plate));
  border-color: rgba(192, 120, 48, 0.4);
  box-shadow: inset 3px 0 0 0 var(--bronze), 0 8px 20px rgba(0, 0, 0, 0.28);
}
.lb-card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.lb-card-rank {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 2.25rem;
}
.lb-card-score {
  margin-left: auto;
  font-family: var(--font-display);
  color: var(--copper);
  font-weight: 800;
  font-size: 1.15rem;
}
.lb-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-1);
}
.lb-card-stats > div {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
}
.lb-card-stats span {
  font-family: var(--font-display);
  color: var(--text);
  display: block;
  margin-top: 0.15rem;
}
.lb-card-bd { margin-top: 0.7rem; }

@media (max-width: 720px) {
  .tops-wrap { padding: 0.9rem 0.75rem 1.25rem; }
  .page-title { font-size: 1.4rem; }
  #lb-desktop { display: none; }
  #lb-cards { display: flex; }
  .metric-grid:not(.row) { grid-template-columns: repeat(2, 1fr); }
  .metric-value { font-size: 1.1rem; }
  .lb-card-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 721px) {
  #lb-cards { display: none !important; }
  #lb-desktop { display: block; }
}

@media (min-width: 992px) {
  body.embed .w-lg-auto { width: auto !important; }
}

/* SVG UI icons (categories / primary metrics) */
.svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--copper);
}
.svg-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.svg-icon.tab-icon {
  width: 18px;
  height: 18px;
  margin-right: 0.3rem;
}
.svg-icon.metric-tile-icon {
  width: 28px;
  height: 28px;
}
.svg-icon.cat-panel-icon {
  width: 36px;
  height: 36px;
}
.svg-icon.rust-icon-sm {
  width: 18px;
  height: 18px;
}

/* Rust item icons (detail / resources) */
.rust-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  image-rendering: -webkit-optimize-contrast;
  padding: 3px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-inset);
}
.rust-icon-sm {
  width: 22px;
  height: 22px;
  padding: 2px;
}
.tab-icon.rust-icon {
  width: 20px;
  height: 20px;
  margin-right: 0.35rem;
  vertical-align: middle;
  padding: 1px;
  background: transparent;
  border: none;
  box-shadow: none;
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 500;
}
.tab-btn.active {
  font-weight: 600;
}

.player-header {
  padding: 1.1rem 1.15rem;
  background: var(--bg-plate);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-plate);
  margin-bottom: 0.35rem;
}

.slims-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(135deg, rgba(232, 149, 74, 0.16), rgba(20, 17, 14, 0.95));
  box-shadow: var(--shadow-inset), 0 4px 12px rgba(0, 0, 0, 0.25);
  font-size: 0.82rem;
  line-height: 1.2;
}
.slims-chip-label {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-1);
  font-size: 0.72rem;
}
.slims-chip-val {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--copper);
  font-variant-numeric: tabular-nums;
}

/* LB Overview Slims — earned breakdown popover */
.slims-earned-btn {
  appearance: none;
  margin: 0;
  padding: 0.15rem 0.35rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  text-decoration: underline dotted rgba(232, 149, 74, 0.55);
  text-underline-offset: 0.2em;
}
.slims-earned-btn:hover,
.slims-earned-btn[aria-expanded="true"] {
  border-color: var(--border-strong);
  background: rgba(232, 149, 74, 0.12);
  color: var(--copper);
}
.slims-earned-popover {
  position: fixed;
  z-index: 1200;
  min-width: 12.5rem;
  max-width: min(18rem, calc(100vw - 1rem));
  padding: 0.65rem 0.75rem;
  background: var(--bg-plate);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-plate), 0 10px 28px rgba(0, 0, 0, 0.45);
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-1);
}
.slims-earned-popover-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--text-2);
  margin-bottom: 0.45rem;
}
.slims-earned-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0;
  font-variant-numeric: tabular-nums;
}
.slims-earned-row span:last-child {
  color: var(--copper);
  font-weight: 600;
}
.slims-earned-row--total {
  margin-top: 0.35rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
  font-weight: 700;
}
.slims-earned-row--total span:last-child {
  color: var(--text-1);
}

.player-cat-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cat-score-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-plate);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  box-shadow: var(--shadow-inset);
}
.cat-score-label { color: var(--text-1); }
.cat-score-val {
  font-family: var(--font-display);
  color: var(--copper);
  font-weight: 700;
}

.cat-panel {
  background: var(--bg-plate);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem 1.2rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-plate);
}
.cat-panel-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}
/* Detail metrics: side-by-side grid (Bootstrap cols alone left full-width stacks) */
.cat-panel .metric-tile-grid.row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0;
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
}
.cat-panel .metric-tile-grid.row > [class*="col-"] {
  width: auto;
  max-width: none;
  flex: none;
  padding: 0;
}
.cat-panel .metric-tile {
  min-height: 56px;
  padding: 0.65rem 0.75rem;
}
@media (max-width: 900px) {
  .cat-panel .metric-tile-grid.row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .cat-panel .metric-tile-grid.row {
    grid-template-columns: 1fr;
  }
}
.cat-panel-icon {
  width: 40px;
  height: 40px;
}
.cat-panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper);
}
.cat-panel-score {
  font-size: 0.8rem;
  color: var(--text-2);
  margin-top: 0.2rem;
}
.cat-panel-score strong {
  color: var(--copper);
  font-family: var(--font-display);
}

.metric-tile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 0.9rem;
  height: 100%;
  min-height: 72px;
  box-shadow: var(--shadow-inset);
}
.metric-tile--primary {
  background: var(--bg-card);
  border-color: var(--border-strong);
  padding: 1.05rem 1.1rem;
  min-height: 88px;
  box-shadow: var(--shadow-plate);
}
.metric-tile--primary .metric-value {
  font-size: 1.55rem;
}
.metric-tile--secondary {
  opacity: 0.95;
  min-height: 64px;
}
.metric-tile-icon {
  width: 36px;
  height: 36px;
}
.metric-tile-body { min-width: 0; }
.metric-tile .metric-value {
  font-size: 1.1rem;
  margin-bottom: 0.1rem;
  line-height: 1.2;
}
.metric-tile .metric-pts {
  font-size: 0.72rem;
  font-family: var(--font-display);
  color: var(--copper);
  line-height: 1.2;
  margin-bottom: 0.15rem;
}
.metric-tile .metric-label {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}

.bd-chip {
  gap: 0.35rem;
}
.bd-chip .rust-icon {
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
}

#category-tabs .tab-btn span,
#sort-tabs .tab-btn span {
  white-space: nowrap;
}

/* ─── Teams (auth-gated) ─── */
.tab-btn.is-disabled,
.tab-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.teams-panel {
  margin-top: 0.25rem;
}
.teams-locked {
  text-align: center;
  padding: 2.5rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.2));
}
.teams-locked-stack {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.avatar-ghost {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(0,0,0,0.35);
  margin-left: -10px;
  filter: blur(1.5px);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06);
}
.avatar-ghost:first-child { margin-left: 0; }
.teams-locked-title {
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}
.teams-locked-body {
  color: var(--text-2);
  max-width: 28rem;
  margin: 0 auto 0.75rem;
}
.teams-locked-count {
  font-family: var(--font-display);
  color: var(--copper);
  margin-bottom: 1rem;
}
.team-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.team-avatar-stack {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.team-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0,0,0,0.4);
  margin-left: -8px;
  background: rgba(255,255,255,0.06);
}
.team-avatar:first-child { margin-left: 0; }
.team-avatar-more {
  margin-left: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-2);
  font-family: var(--font-display);
}

/* Unified Teams list (all breakpoints) */
.teams-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.team-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  position: relative;
}
.team-row--top1 {
  box-shadow: inset 3px 0 0 0 #f0c040;
  border-color: rgba(240, 192, 64, 0.4);
}
.team-row--top2 {
  box-shadow: inset 3px 0 0 0 #c0c0c0;
  border-color: rgba(192, 192, 192, 0.35);
}
.team-row--top3 {
  box-shadow: inset 3px 0 0 0 #c07830;
  border-color: rgba(192, 120, 48, 0.4);
}
.team-row__toggle {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 44px;
  font: inherit;
}
.team-row__toggle:hover {
  background: rgba(255, 255, 255, 0.02);
}
.team-row__toggle:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: -2px;
}
.team-row__main {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.7rem 0.85rem;
}
.team-row__rank {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 2.25rem;
}
.team-row__identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.team-row__name-block { min-width: 0; }
.team-row__name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-row__sub {
  font-size: 0.75rem;
  color: var(--text-2);
  margin-top: 0.1rem;
}
.team-row__stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  font-family: var(--font-display);
}
.team-row__score {
  color: var(--copper);
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.team-row--top1 .team-row__score,
.team-row--top2 .team-row__score,
.team-row--top3 .team-row__score {
  font-size: 1.2rem;
}
.team-row__meta {
  font-size: 0.72rem;
  color: var(--text-2);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  justify-content: flex-end;
}
.team-row__chevron {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: var(--text-2);
  transition: transform 0.18s ease;
}
.team-row.is-open .team-row__chevron {
  transform: rotate(180deg);
}
.team-row__panel {
  display: block;
  padding: 0 0.85rem 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.team-row__panel[hidden] {
  display: none !important;
}
.team-row--hidden .team-row__name {
  color: var(--text-2);
  font-style: italic;
}
.team-avatar-stack--hidden {
  width: 2.1rem;
  height: 2.1rem;
}
.team-avatar-ph {
  display: block;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(232,149,74,0.18));
  border: 1px solid rgba(232, 149, 74, 0.25);
}
.team-row__hidden-msg {
  margin: 0;
  padding: 0.35rem 0.15rem 0.15rem;
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.4;
}
.player-team-card--hidden .team-row__hidden-msg {
  margin-top: 0.55rem;
}
.team-row__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.65rem;
}

@media (max-width: 899px) {
  .team-row__main {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "rank identity chevron"
      "score score score"
      "meta meta meta";
  }
  .team-row__rank { grid-area: rank; }
  .team-row__identity { grid-area: identity; }
  .team-row__stats { display: contents; }
  .team-row__score {
    grid-area: score;
    justify-self: start;
    margin-top: 0.15rem;
    font-size: 1.15rem;
  }
  .team-row--top1 .team-row__score,
  .team-row--top2 .team-row__score,
  .team-row--top3 .team-row__score {
    font-size: 1.3rem;
  }
  .team-row__meta {
    grid-area: meta;
    justify-content: flex-start;
  }
  .team-row__chevron { grid-area: chevron; }
}

@media (prefers-reduced-motion: reduce) {
  .team-row__chevron { transition: none; }
}

.player-team-block {
  max-width: 36rem;
}
.player-team-locked,
.player-team-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  background: rgba(255,255,255,0.03);
}
.player-team-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.82rem;
  color: var(--text-2);
  margin-bottom: 0.65rem;
}
.player-team-members {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.team-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem 0.2rem 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: 0.78rem;
}
.team-member-chip img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}
.team-member-chip:hover { border-color: var(--copper); color: var(--copper); }

.flag-img {
  height: 14px;
  width: auto;
  vertical-align: middle;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12);
  object-fit: cover;
}
.flag-primary {
  height: 16px;
  margin-right: 0.4rem;
}
.flag-inline {
  height: 12px;
  margin-right: 0.25rem;
}
.flag-chip {
  height: 12px;
  margin-right: 0.15rem;
}
.flag-stack {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.flag-stack-item { height: 12px; }
.team-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
  font-weight: 600;
  line-height: 1.2;
}

/* Board mode: Players/Teams + country chips on ONE row (tabs must not be width:100%) */
.board-mode-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  width: 100%;
  border-bottom: 1px solid var(--border);
  height: 44px;
  box-sizing: border-box;
}
.board-mode-bar #board-mode-tabs.tabs,
.board-mode-bar #board-mode-tabs.tabs-scroll {
  width: auto;
  max-width: none;
  flex: 0 0 auto;
  margin: 0;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  border-bottom: none; /* bar already has the rule */
}
.board-mode-bar #board-mode-tabs .tab-btn {
  height: 42px;
}
.country-dominance {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.country-dominance::-webkit-scrollbar { height: 3px; }
.country-dominance::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}
.country-dom-label {
  display: none; /* chips speak for themselves; keep aria on row */
}
.country-dom-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  width: max-content;
  min-width: max-content;
  margin-left: auto;
}
.country-dom-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.15rem 0.45rem 0.15rem 0.3rem;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.7rem;
  font-family: var(--font-display);
  background: rgba(255,255,255,0.035);
  color: inherit;
  line-height: 1.15;
  flex: 0 0 auto;
  white-space: nowrap;
  cursor: pointer;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}
.country-dom-chip:hover {
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
}
.country-dom-chip:focus-visible {
  outline: 2px solid rgba(205, 133, 63, 0.7);
  outline-offset: 1px;
}
.country-dom-chip.is-top {
  border-color: rgba(240,192,64,0.5);
  background: linear-gradient(135deg, rgba(240,192,64,0.12), rgba(255,255,255,0.03));
}
.country-dom-chip.is-active {
  border-color: rgba(205, 133, 63, 0.75);
  background: linear-gradient(135deg, rgba(205, 133, 63, 0.22), rgba(255,255,255,0.04));
  box-shadow: 0 0 0 1px rgba(205, 133, 63, 0.25);
}
.country-dom-clear {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.14);
  font-size: 0.68rem;
  font-family: var(--font-display);
  font-weight: 600;
  background: rgba(255,255,255,0.05);
  color: var(--text-2);
  line-height: 1.15;
  flex: 0 0 auto;
  white-space: nowrap;
  cursor: pointer;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}
.country-dom-clear:hover {
  color: var(--text);
  border-color: rgba(205, 133, 63, 0.45);
  background: rgba(205, 133, 63, 0.12);
}
.country-dom-clear:focus-visible {
  outline: 2px solid rgba(205, 133, 63, 0.7);
  outline-offset: 1px;
}
.flag-dom {
  height: 12px;
  width: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35);
}
.country-dom-code { font-weight: 700; letter-spacing: 0.02em; }
.country-dom-score { color: var(--copper); }
.country-dom-pct { color: var(--text-2); font-variant-numeric: tabular-nums; }
.country-dom-players {
  color: var(--text-2);
  opacity: 0.8;
  padding-left: 0.18rem;
  border-left: 1px solid rgba(255,255,255,0.12);
  margin-left: 0.02rem;
}


/* PvP tier kill share (player profile, activity v3) */
.tier-bar {
  margin: 0 0 12px;
}
.tier-bar__track {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-plate);
  border: 1px solid var(--border);
}
.tier-bar__seg { display: block; height: 100%; min-width: 2px; }
.tier-bar__seg--t3 { background: #e04848; }
.tier-bar__seg--t2 { background: #e08a3c; }
.tier-bar__seg--t1 { background: #c8b45a; }
.tier-bar__seg--t0 { background: #6c7078; }
.tier-bar__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-2);
}
.tier-bar__key::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 2px;
  vertical-align: middle;
}
.tier-bar__key strong { color: var(--text); font-family: var(--font-mono); font-weight: 600; }
.tier-bar__key--t3::before { background: #e04848; }
.tier-bar__key--t2::before { background: #e08a3c; }
.tier-bar__key--t1::before { background: #c8b45a; }
.tier-bar__key--t0::before { background: #6c7078; }
