:root {
  color-scheme: dark;
  --bg: #141713;
  --panel: #1d211c;
  --text: #f0f1ed;
  --muted: #93968e;
  --border: #2c302a;
  --accent: #4cb37e;
  --accent-2: #e0b13a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px rgba(0, 0, 0, 0.35);
  --gold: #e8b14a;
  --silver: #9ea4b0;
  --bronze: #b8794f;
  --grey-cell: #565c54;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.site-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.7rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.site-brand {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-topbar-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
}

.site-nav-link {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-nav-link:hover {
  color: var(--text);
}

.site-nav-link.active {
  color: var(--accent);
}

header {
  padding: 2rem 1.5rem 1.25rem;
  text-align: center;
}

header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.guide-event-heading {
  margin: 0 0 1rem;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.tabs {
  display: inline-flex;
  gap: 0.2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.25rem;
  box-shadow: var(--shadow);
}

.tab-button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab-button:hover {
  color: var(--text);
}

.tab-button.active {
  background: var(--accent);
  color: #fff;
}

@media (max-width: 420px) {
  .tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .tab-button {
    padding: 0.5rem 0.75rem;
    text-align: center;
  }
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
}

.tab-panel.active {
  display: flex;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* The Guide tab's two-column goal grid needs much more room than the points tab. */
main:has(#tab-guide.active) {
  max-width: 1600px;
  width: 95%;
}

#player-content {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
}

/* Search */
.search-panel {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

#search-form {
  display: flex;
  gap: 0.6rem;
}

#search-input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

#search-button {
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  width: 6.5rem;
  min-height: 2.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

#search-button:hover {
  opacity: 0.9;
}

#search-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.search-status {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--muted);
}

.search-status.success {
  color: var(--accent);
}

.search-status.error {
  color: #e0685f;
}

.search-status.success {
  color: inherit;
}

.search-result {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
}

.search-result-card {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.search-result-points {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.search-result-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 6.5rem;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  background: color-mix(in srgb, var(--muted) 18%, var(--bg));
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.search-result-link:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.leaderboard-note {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Leaderboard */
.leaderboard-columns {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.6rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.leaderboard-columns .col-rank {
  width: 1.75rem;
  flex-shrink: 0;
  text-align: center;
}

.leaderboard-columns .col-player {
  flex: 1;
}

.leaderboard-columns .col-blackouts {
  width: 4.5rem;
  flex-shrink: 0;
  text-align: right;
}

.leaderboard-columns .col-points {
  width: 4.5rem;
  flex-shrink: 0;
  text-align: right;
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.leaderboard-list::-webkit-scrollbar {
  width: 6px;
}

.leaderboard-list::-webkit-scrollbar-track {
  background: transparent;
}

.leaderboard-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.leaderboard-list::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.leaderboard-row {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  padding: 0.5rem 0.6rem;
  border-radius: 9px;
  transition: background 0.15s ease;
}

.leaderboard-row.flash {
  animation: leaderboard-flash 1.4s linear 2;
}

@keyframes leaderboard-flash {
  0% { background: transparent; }
  50% { background: color-mix(in srgb, var(--accent) 55%, transparent); }
  100% { background: transparent; }
}

.leaderboard-row-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 3rem;
}

.leaderboard-row-link {
  color: inherit;
  text-decoration: none;
}

.leaderboard-row:hover {
  background: var(--bg);
}

.rank-badge {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg);
}

.leaderboard-row.rank-gold .rank-badge {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  background: linear-gradient(135deg, #ffe28c 0%, #d99a1f 55%, #a86e0f 100%);
}

.leaderboard-row.rank-silver .rank-badge {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  background: linear-gradient(135deg, #eef1f6 0%, #a7adb8 55%, #767c88 100%);
}

.leaderboard-row.rank-bronze .rank-badge {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  background: linear-gradient(135deg, #e8ab77 0%, #b06a35 55%, #7d431e 100%);
}

.leaderboard-row.rank-gold,
.leaderboard-row.rank-silver,
.leaderboard-row.rank-bronze {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.hob-count {
  width: 4.5rem;
  flex-shrink: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--bg);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.85rem;
  text-align: center;
}

.blackout-count {
  width: 4.5rem;
  flex-shrink: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
  padding-right: 0.6rem;
}

.record-meta {
  margin: 0.15rem 0 0 3rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
}

.player-cell .player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hob-badge {
  flex-shrink: 0;
  color: #0c2a4d;
  background: #7dc4fb;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.hob-badge-meta {
  display: none;
  vertical-align: middle;
  margin-right: 0.35rem;
}

.avatar {
  border-radius: 6px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.empty {
  color: var(--muted);
  font-style: italic;
  padding: 0.5rem 0;
  text-align: center;
}

/* Player page */
.player-summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
  padding-right: 200px;
}

.player-avatar {
  border-radius: 10px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.player-summary-info {
  flex: 1;
  min-width: 0;
}

.player-summary .record-meta {
  margin: 0.25rem 0 0;
}

.stale-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.5rem;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 15%, transparent);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.player-total {
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.player-total span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.player-rank-badge {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 2rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--muted);
  background: var(--bg);
  white-space: nowrap;
  clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%);
}

.player-rank-badge.rank-gold,
.player-rank-badge.rank-silver,
.player-rank-badge.rank-bronze {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.player-rank-badge.rank-gold {
  background: linear-gradient(135deg, #ffe28c 0%, #d99a1f 55%, #a86e0f 100%);
}

.player-rank-badge.rank-silver {
  background: linear-gradient(135deg, #eef1f6 0%, #a7adb8 55%, #767c88 100%);
}

.player-rank-badge.rank-bronze {
  background: linear-gradient(135deg, #e8ab77 0%, #b06a35 55%, #7d431e 100%);
}

.stats-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.stat-box {
  flex: 1;
  min-width: 150px;
  text-align: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.completion-columns {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.completion-left {
  flex: 1;
  min-width: 260px;
}

.event-panel {
  width: 220px;
  min-height: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.hob-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.hob-columns {
  display: grid;
  grid-template-columns: 1fr 240px;
  grid-template-areas:
    "stats history"
    "list pie"
    "radar radar";
  gap: 1.25rem;
  min-height: 200px;
}

.hob-columns > .empty {
  grid-column: 1 / -1;
}

@media (max-width: 700px) {
  .hob-columns {
    grid-template-columns: 1fr;
    grid-template-areas:
      "stats"
      "history"
      "list"
      "pie"
      "radar";
  }
}

.hob-list-panel h3,
.hob-radar-panel h3,
.hob-pie-panel h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.hob-history-panel h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.hob-stats-column h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.hob-pie-subtitle {
  margin: 0 0 0.75rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.78rem;
}

.hob-pie-back[hidden] {
  display: none;
}

.hob-pie-back {
  display: block;
  width: calc(100% + 3rem);
  margin: 1rem -1.5rem -1.4rem;
  border: none;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 13px 13px;
  padding: 0.65rem 1.5rem;
  text-align: center;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.hob-pie-back:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--bg));
}

.hob-radar-subtitle {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.hob-list-panel {
  grid-area: list;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.hob-radar-panel {
  grid-area: radar;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.hob-pie-panel {
  grid-area: pie;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.hob-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 180px;
  max-height: 460px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hob-list::-webkit-scrollbar {
  width: 6px;
}

.hob-list::-webkit-scrollbar-track {
  background: transparent;
}

.hob-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.hob-list::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.hob-list-season-header {
  padding: 0.6rem 0.5rem 0.2rem;
  margin: 0 -0.5rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hob-list-season-header:first-child {
  padding-top: 0;
}

.hob-list-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  margin: 0 -0.5rem;
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.hob-list-item:hover {
  background: var(--bg);
}

.hob-list-item.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.hob-list-icon {
  flex-shrink: 0;
  border-radius: 4px;
  image-rendering: pixelated;
}

.hob-list-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.hob-list-meta {
  font-size: 0.85rem;
  font-weight: 600;
}

.hob-list-detail {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
}

.hob-history-panel {
  grid-area: history;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.hob-history-boxes {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.1rem;
}

.hob-history-boxes::-webkit-scrollbar {
  width: 6px;
}

.hob-history-boxes::-webkit-scrollbar-track {
  background: transparent;
}

.hob-history-boxes::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.hob-history-boxes::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.hob-history-boxes .hob-stat-box {
  flex-shrink: 0;
}

.radar-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.radar-chart {
  width: 100%;
  max-width: 340px;
}

.radar-ring {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
}

.radar-axis {
  stroke: var(--border);
  stroke-width: 1;
}

.radar-shape {
  fill: color-mix(in srgb, var(--accent) 30%, transparent);
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
}

.radar-point {
  fill: var(--accent);
}

.radar-label {
  fill: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pie-container {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 0;
}

.pie-chart-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.pie-chart {
  width: 100%;
  max-width: 180px;
}

.pie-chart path {
  stroke: var(--panel);
  stroke-width: 2;
}

.pie-center-bg {
  fill: var(--bg);
}

.pie-center-image {
  image-rendering: pixelated;
}

.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  max-width: 220px;
}

.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.pie-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.pie-legend-label {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-weight: 600;
}

.pie-legend-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pie-legend-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.35rem;
  margin-bottom: 0.15rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pie-legend-header .pie-legend-label,
.pie-legend-header .pie-legend-value {
  color: var(--muted);
  font-weight: 700;
}

.hob-stats-column {
  grid-area: stats;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hob-stat-box {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  overflow: hidden;
  padding: 0.85rem 1rem;
  padding-right: 78px;
}

.hob-stat-box-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.hob-stat-box-link:hover {
  border-color: var(--accent);
}

.hob-stat-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hob-stat-badge {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 1rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  background: var(--bg);
  white-space: nowrap;
  clip-path: polygon(28% 0, 100% 0, 100% 100%, 0 100%);
}

.hob-stat-badge.empty {
  color: var(--muted);
  font-size: 1rem;
}

.hob-stat-badge.rank-gold {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  background: linear-gradient(135deg, #ffe28c 0%, #d99a1f 55%, #a86e0f 100%);
}

.hob-stat-badge.rank-silver {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  background: linear-gradient(135deg, #eef1f6 0%, #a7adb8 55%, #767c88 100%);
}

.hob-stat-badge.rank-bronze {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  background: linear-gradient(135deg, #e8ab77 0%, #b06a35 55%, #7d431e 100%);
}

.hob-stat-value-plain {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.event-table-header {
  display: flex;
  justify-content: space-between;
  padding: 0 0.6rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.event-table-header span:last-child {
  text-align: right;
}

.event-table-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.event-table-body::-webkit-scrollbar {
  width: 6px;
}

.event-table-body::-webkit-scrollbar-track {
  background: transparent;
}

.event-table-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.event-table-body::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.event-table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.event-table-row:nth-child(even) {
  background: var(--bg);
}

.goal-number {
  font-weight: 600;
}

.goal-number.none {
  color: var(--muted);
}

.goal-number.partial {
  color: color-mix(in srgb, var(--accent-2) 85%, var(--text) 15%);
}

.goal-number.blackout {
  color: color-mix(in srgb, var(--accent) 85%, var(--text) 15%);
}

.bingo-year {
  color: var(--muted);
  font-weight: 500;
}

.bingo-month {
  color: var(--text);
  font-weight: 600;
}

.contribution-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contribution-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.contribution-row-label {
  flex-shrink: 0;
  width: 3.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.contribution-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.contribution-cell {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--grey-cell);
}

.contribution-cell.blank {
  background: transparent;
}

.contribution-cell.partial {
  background: var(--accent-2);
}

.contribution-cell.blackout {
  background: var(--accent);
}

.contribution-legend {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

@media (max-width: 480px) {
  .col-blackouts,
  .blackout-count {
    display: none;
  }

  .hob-count {
    width: 3rem;
    font-size: 0.8rem;
    padding: 0.15rem 0.3rem;
  }

  .leaderboard-row-main {
    gap: 0.5rem;
  }

  .rank-badge {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
  }

  .player-cell .avatar {
    display: none;
  }

  .hob-badge {
    font-size: 0.6rem;
    padding: 0.08rem 0.35rem;
  }

  .hob-badge-inline {
    display: none;
  }

  .hob-badge-meta {
    display: inline-block;
  }

  .player-summary {
    padding-right: 90px;
    gap: 0.75rem;
  }

  .player-avatar {
    width: 48px;
    height: 48px;
  }

  .player-rank-badge {
    width: 90px;
    padding-left: 0.75rem;
    font-size: 1.1rem;
  }

  .player-total {
    font-size: 1.3rem;
  }

  .contribution-row-label {
    width: 2.75rem;
    font-size: 0.7rem;
  }

  .contribution-cell {
    width: 11px;
    height: 11px;
  }
}
