:root {
  color-scheme: light;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f1f1f3;
  --border: #e6e6ea;
  --border-strong: #d4d4da;
  --text: #111114;
  --muted: #6b6b76;
  --faint: #9a9aa4;
  --accent: #4f6bff;
  --accent-weak: rgba(79, 107, 255, 0.10);
  --up: #12a150;
  --up-weak: rgba(18, 161, 80, 0.10);
  --down: #e5484d;
  --down-weak: rgba(229, 72, 77, 0.10);
  --warn: #d18b00;

  /* Darker text steps: the mark colors above (and --faint) sit under 4.5:1 as small text on white. */
  --accent-text: #3d58f0;
  --up-text: #0e8543;
  --down-text: #d1363b;
  --on-accent: #ffffff;
  --accent-hover: #3d58f0;
  --faint-text: #74747e;
  --header-bg: rgba(247, 247, 248, 0.78);
  --shadow-sm: 0 1px 2px rgba(17, 17, 20, 0.04), 0 6px 20px rgba(17, 17, 20, 0.08);
  --shadow: 0 2px 6px rgba(17, 17, 20, 0.05), 0 16px 40px rgba(17, 17, 20, 0.10);

  --radius: 14px;
  --radius-sm: 9px;
  --gap: 16px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --header-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0b0d;
    --surface: #131316;
    --surface-2: #1a1a1f;
    --border: #24242a;
    --border-strong: #32323a;
    --text: #ededf0;
    --muted: #9696a0;
    --faint: #6a6a74;
    --accent: #7b8cff;
    --accent-weak: rgba(123, 140, 255, 0.14);
    --up: #3ecf7a;
    --up-weak: rgba(62, 207, 122, 0.12);
    --down: #ff6b6f;
    --down-weak: rgba(255, 107, 111, 0.12);
    --warn: #f5b83d;
    --accent-text: #8d9bff;
    --up-text: #3ecf7a;
    --down-text: #ff6b6f;
    --on-accent: #0b0b0d;
    --accent-hover: #909eff;
    --faint-text: #81818b;
    --header-bg: rgba(11, 11, 13, 0.72);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 18px 48px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0d;
  --surface: #131316;
  --surface-2: #1a1a1f;
  --border: #24242a;
  --border-strong: #32323a;
  --text: #ededf0;
  --muted: #9696a0;
  --faint: #6a6a74;
  --accent: #7b8cff;
  --accent-weak: rgba(123, 140, 255, 0.14);
  --up: #3ecf7a;
  --up-weak: rgba(62, 207, 122, 0.12);
  --down: #ff6b6f;
  --down-weak: rgba(255, 107, 111, 0.12);
  --warn: #f5b83d;
  --accent-text: #8d9bff;
  --up-text: #3ecf7a;
  --down-text: #ff6b6f;
  --on-accent: #0b0b0d;
  --accent-hover: #909eff;
  --faint-text: #81818b;
  --header-bg: rgba(11, 11, 13, 0.72);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 18px 48px rgba(0, 0, 0, 0.55);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, p {
  margin: 0;
}

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.01em;
}

img, svg {
  display: block;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: var(--accent-weak);
}

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

main:focus {
  outline: none;
}

kbd {
  font-family: var(--font);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.nowrap { white-space: nowrap; }

.truncate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 16px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transform: translateY(calc(-100% - 40px));
  transition: transform .2s var(--ease);
}

.skip-link:focus {
  transform: none;
}

/* Shell */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  position: relative;
  max-width: 1180px;
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-family: 'Montserrat', var(--font);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.035em;
  flex-shrink: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand-word {
  white-space: nowrap;
}

/* The tilted square is the "O" from the 2022 Roblox wordmark, sized to its cap height ratio (147.6 / 127.7). */
.brand-o {
  display: inline-block;
  width: 0.81em;
  height: 0.81em;
  margin: 0 0.07em 0 0.01em;
  vertical-align: -0.055em;
  fill: currentColor;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: color .15s, background-color .15s;
}

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

.nav-link.active {
  color: var(--text);
  background: var(--surface-2);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 11px;
  fill: none;
  stroke: var(--faint);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}

.search-input {
  width: 260px;
  height: 36px;
  padding: 0 56px 0 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, width .25s var(--ease);
}

.search-input::placeholder {
  color: var(--faint);
}

.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-input:hover {
  border-color: var(--border-strong);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

.search-kbd {
  position: absolute;
  right: 8px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  pointer-events: none;
}

.search-input:focus ~ .search-kbd,
.search-input:not(:placeholder-shown) ~ .search-kbd {
  display: none;
}

.site-header .search-cancel,
.site-header .search-toggle {
  display: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-height: min(440px, calc(100vh - 100px));
  overflow-y: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 50;
}

.sr-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
}

.sr-item:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.sr-item.active {
  background: var(--accent-weak);
  box-shadow: inset 2px 0 0 var(--accent);
  text-decoration: none;
}

.sr-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sr-name,
.sr-creator {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-name {
  font-size: 13.5px;
  font-weight: 500;
}

.sr-creator {
  font-size: 12px;
  color: var(--muted);
}

.sr-ccu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.sr-ccu small {
  font-size: 11px;
  font-weight: 400;
  color: var(--faint);
}

.sr-status {
  padding: 14px 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.sr-status a {
  display: inline-block;
  margin-top: 4px;
}

.sr-group + .sr-group {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.sr-group-label {
  padding: 6px 10px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.sr-item.is-player {
  grid-template-columns: auto minmax(0, 1fr);
}

.sr-player-name {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.sr-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-toggle .theme-icon {
  display: none;
}

.theme-toggle[data-mode="system"] .theme-system,
.theme-toggle[data-mode="light"] .theme-light,
.theme-toggle[data-mode="dark"] .theme-dark {
  display: block;
}

.user-avatar {
  --avatar-size: 28px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: var(--avatar-size);
  height: var(--avatar-size);
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text);
}

.user-avatar .gicon {
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.user-avatar.is-local {
  background: var(--accent-weak);
  box-shadow: none;
  color: var(--accent-text);
  font-size: calc(var(--avatar-size) * 0.36);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.account {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 36px;
  min-height: 36px;
}

.account-skeleton {
  width: 28px;
  height: 28px;
  margin: 0 4px;
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
}

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 7px 0 3px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  transition: background-color .15s, border-color .15s;
}

.account-btn:hover,
.account-btn[aria-expanded="true"] {
  background: var(--surface-2);
}

.account-btn.is-current {
  border-color: var(--border);
  background: var(--surface-2);
}

.account-name {
  display: none;
  min-width: 0;
  max-width: 150px;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chevron {
  flex-shrink: 0;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s var(--ease);
}

.account-btn[aria-expanded="true"] .account-chevron {
  transform: rotate(180deg);
}

.login-btn.is-current {
  border-color: var(--border-strong);
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: 264px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.account-menu[hidden] {
  display: none;
}

.am-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
}

a.am-head:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.am-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.am-name {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.am-name-text,
.am-sub {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.am-sub {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.am-head.is-static .am-sub {
  white-space: normal;
}

.am-badges {
  display: flex;
  margin-top: 5px;
}

.am-badges[hidden] {
  display: none;
}

.am-sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--border);
}

.am-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  text-align: left;
}

.am-item:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.am-item:focus-visible,
a.am-head:focus-visible {
  outline: none;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 2px var(--accent);
  text-decoration: none;
}

main {
  flex: 1;
  width: 100%;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
}

.footer-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--faint);
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--text);
}

.collector-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.status-dot.ok { background: var(--up); }
.status-dot.warn { background: var(--warn); }
.status-dot.bad { background: var(--down); }

/* Layout */

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 16px 64px;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.page-head > :not(.page-actions) {
  grid-column: 1;
  min-width: 0;
}

.page-head h1 {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.page-sub {
  margin-top: 6px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--muted);
  font-size: 14px;
}

.page-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section {
  margin-top: 28px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.section-head > .section-title {
  margin: 0;
}

.section-actions,
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.grid-2 {
  display: grid;
  gap: var(--gap);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.stack.sm {
  gap: 8px;
}

/* Cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
}

.card.flush {
  padding: 0;
  overflow: clip;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  margin-bottom: 14px;
}

.card.flush > .card-head {
  margin: 0;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-sub {
  color: var(--muted);
  font-size: 12.5px;
}

.card-foot {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
}

/* KPIs */

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

.kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
}

.kpi-label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.kpi-value {
  font-size: 26px;
  font-weight: 600;
  line-height: 36px;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-value.is-text {
  font-size: 17px;
  letter-spacing: -0.015em;
}

.kpi-value a {
  color: inherit;
}

.kpi-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 6px;
  min-height: 20px;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.kpi-sub .spark {
  margin-left: auto;
}

/* Marks a number that comes from imported history. */
.kpi-tag {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-weak);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  cursor: help;
}

.kpi.is-skeleton .kpi-label,
.kpi.is-skeleton .kpi-value {
  display: flex;
  align-items: center;
  min-height: 1lh;
}

/* Deltas */

.delta {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
}

.delta-glyph {
  font-size: 0.72em;
  position: relative;
  top: -0.08em;
}

.delta.up { color: var(--up-text); }
.delta.down { color: var(--down-text); }
.delta.flat { color: var(--muted); }

/* Game list */

.game-list {
  --gr-cols: 36px minmax(0, 1fr) 88px 84px 96px 64px;
  --gr-cols-sm: 24px minmax(0, 1fr) auto;
  display: flex;
  flex-direction: column;
}

.game-row,
.game-list-head {
  display: grid;
  grid-template-columns: var(--gr-cols);
  align-items: center;
  column-gap: 14px;
  padding: 0 18px;
}

.game-list-head {
  min-height: 36px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.glh {
  white-space: nowrap;
}

.glh.right { text-align: right; justify-self: end; }
.glh.center { text-align: center; justify-self: center; }

.glh-sort {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  margin: 0 -6px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.glh-sort:hover {
  color: var(--text);
  background: var(--surface-2);
}

.glh-sort.active {
  color: var(--text);
}

.glh-arrow {
  width: 10px;
  font-size: 11px;
  opacity: 0;
}

.glh-sort.active .glh-arrow {
  opacity: 1;
}

.game-row {
  position: relative;
  min-height: 60px;
  padding-top: 9px;
  padding-bottom: 9px;
  color: var(--text);
  transition: background-color .12s;
}

a.game-row:hover,
.game-row.has-action:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.game-row + .game-row {
  border-top: 1px solid var(--border);
}

.game-row:focus-visible {
  outline-offset: -2px;
  border-radius: 4px;
}

.gr-rank {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.gr-rank.top {
  color: var(--text);
  font-weight: 700;
}

.gr-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
}

a.gr-main:hover {
  text-decoration: none;
}

.gr-link::after {
  content: '';
  position: absolute;
  inset: 0;
}

.gr-link:focus-visible {
  outline: none;
}

.gr-link:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 4px;
}

.gr-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gr-name,
.gr-creator {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gr-name {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.gr-creator {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.verified {
  display: inline-block;
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  vertical-align: -0.14em;
}

.gr-ccu,
.gr-delta,
.gr-rating,
.gr-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gr-ccu {
  font-size: 14px;
  font-weight: 600;
}

.gr-delta {
  font-size: 13px;
}

.gr-spark {
  display: flex;
  justify-content: center;
}

.gr-rating,
.gr-num {
  color: var(--muted);
  font-size: 13px;
}

.gr-action {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.gicon {
  --icon-size: 40px;
  width: var(--icon-size);
  height: var(--icon-size);
  flex-shrink: 0;
  border-radius: calc(var(--icon-size) * 0.25);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
  object-fit: cover;
}

.gicon.placeholder {
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  font-size: calc(var(--icon-size) * 0.4);
  font-weight: 600;
  line-height: 1;
  user-select: none;
}

.game-row.is-skeleton .gr-text {
  gap: 6px;
}

/* Compact side lists */

.mini-list {
  display: flex;
  flex-direction: column;
}

.mini-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 16px;
  color: var(--text);
  transition: background-color .12s;
}

.mini-row + .mini-row {
  border-top: 1px solid var(--border);
}

a.mini-row:hover {
  background: var(--surface-2);
  text-decoration: none;
}

a.mini-row:focus-visible {
  outline-offset: -2px;
  border-radius: 4px;
}

.mr-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mr-name,
.mr-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mr-name {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
}

.mr-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.mr-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mr-value small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

/* Tabs */

.tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 3px;
  overflow-x: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: color .15s, background-color .15s, box-shadow .15s;
}

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

.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.tab:focus-visible {
  outline-offset: -1px;
}

.tab-count {
  color: var(--faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

/* Set by watchScrollFade() on rows that scroll sideways: the edge with more content fades out. */
.scroll-fade-end {
  mask-image: linear-gradient(to right, #000 calc(100% - 40px), rgba(0, 0, 0, 0.1));
}

.scroll-fade-start {
  mask-image: linear-gradient(to left, #000 calc(100% - 40px), rgba(0, 0, 0, 0.1));
}

.scroll-fade-start.scroll-fade-end {
  mask-image: linear-gradient(to right, rgba(0, 0, 0, 0.1), #000 40px, #000 calc(100% - 40px), rgba(0, 0, 0, 0.1));
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s, opacity .15s;
}

.btn:hover {
  border-color: var(--border-strong);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0.5px);
}

/* White on --accent is only 4.3:1, so light buttons use the darker accent text color (5.45:1, hover 6.2:1). */
.btn.primary {
  --btn-primary-bg: var(--accent-text);
  --btn-primary-hover: #3450e0;
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--on-accent);
}

.btn.primary:hover {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn.primary {
    --btn-primary-bg: var(--accent);
    --btn-primary-hover: var(--accent-hover);
  }
}

:root[data-theme="dark"] .btn.primary {
  --btn-primary-bg: var(--accent);
  --btn-primary-hover: var(--accent-hover);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn.ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn.danger {
  background: transparent;
  border-color: var(--border);
  color: var(--down-text);
}

.btn.danger:hover {
  background: var(--down-weak);
  border-color: transparent;
}

.btn.sm {
  height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
}

.btn[disabled],
.btn.disabled {
  pointer-events: none;
}

.btn[disabled]:not(.is-busy):not(.is-state),
.btn.disabled {
  opacity: 0.5;
}

/* In flight: stays readable (usually with a spinner) instead of looking unavailable. */
.btn.is-busy {
  opacity: 0.85;
}

/* A finished action shown in place of its button, such as "Tracking ✓" or "Added ✓". */
.btn.is-state {
  border-color: transparent;
  background: var(--up-weak);
  color: var(--up-text);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  transition: background-color .15s, color .15s;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Forms */

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

.field-label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.input,
.select,
.textarea {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--faint);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--border-strong);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--down);
}

.select {
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.textarea {
  height: auto;
  min-height: 88px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}

.input.lg {
  height: 46px;
  padding: 0 14px;
  font-size: 15px;
}

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

.hint {
  color: var(--muted);
  font-size: 12px;
}

.error-text {
  color: var(--down-text);
  font-size: 13px;
}

/* Badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.badge.accent {
  background: var(--accent-weak);
  border-color: transparent;
  color: var(--accent-text);
}

.badge.up {
  background: var(--up-weak);
  border-color: transparent;
  color: var(--up-text);
}

.badge.down {
  background: var(--down-weak);
  border-color: transparent;
  color: var(--down-text);
}

.badge.warn {
  background: transparent;
  color: var(--warn);
}

.live-dot {
  position: relative;
  display: inline-block;
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
}

.live-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: live-pulse 2.4s var(--ease) infinite;
}

@keyframes live-pulse {
  0% { transform: scale(1); opacity: 0.5; }
  70%, 100% { transform: scale(3.2); opacity: 0; }
}

/* Stat lists */

.stat-list {
  display: flex;
  flex-direction: column;
}

.stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
}

.stat + .stat {
  border-top: 1px solid var(--border);
}

.stat:first-child {
  padding-top: 0;
}

.stat:last-child {
  padding-bottom: 0;
}

.stat-text {
  min-width: 0;
}

.stat-label {
  color: var(--muted);
  font-size: 13.5px;
}

.stat-hint {
  margin-top: 1px;
  color: var(--faint-text);
  font-size: 12px;
  line-height: 1.4;
}

.stat-value {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* States */

.skeleton {
  display: block;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

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

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 44px 20px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.empty-text {
  max-width: 44ch;
}

.card .empty {
  padding: 32px 16px;
}

.error-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--down);
  border-radius: var(--radius);
}

.error-card-title {
  font-size: 15px;
  font-weight: 600;
}

.error-card-text {
  color: var(--muted);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.error-card .btn {
  margin-top: 8px;
}

.missing-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 580px;
  margin: 32px auto 0;
  padding: 28px;
}

.missing-title {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.missing-text {
  color: var(--muted);
  font-size: 14px;
}

.missing-actions {
  margin-top: 6px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: var(--accent);
  color: var(--on-accent);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 440px;
  margin: 32px auto 0;
  padding: 32px 28px 26px;
  text-align: center;
}

.login-card .login-mark {
  margin-bottom: 6px;
}

.login-card-title {
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.login-card-text {
  max-width: 38ch;
  color: var(--muted);
  font-size: 14px;
}

.login-card-btn {
  height: 40px;
  margin-top: 10px;
  padding: 0 18px;
}

.login-card-note {
  color: var(--faint-text);
  font-size: 12px;
}

/* A one-line explanation above a list, e.g. why a column is still empty. */
.list-note {
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
}

/* Charts */

.chart {
  position: relative;
  min-width: 0;
  transition: opacity .2s;
}

.chart.is-loading {
  opacity: 0.5;
}

.chart svg {
  width: 100%;
  display: block;
  overflow: visible;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.chart svg:focus {
  outline: none;
}

.chart svg:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.chart-tip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  min-width: 96px;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  line-height: 1.45;
  white-space: nowrap;
  pointer-events: none;
}

.chart-tip[hidden] {
  display: none;
}

.tip-value {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tip-label {
  color: var(--muted);
}

.tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tip-key {
  width: 10px;
  height: 2px;
  flex-shrink: 0;
  border-radius: 1px;
  background: var(--faint);
}

.tip-key.band {
  height: 8px;
  background: var(--accent-weak);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--muted);
  font-size: 12.5px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-key {
  width: 12px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
}

.chart .grid line {
  stroke: var(--border);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.chart .axis text {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}

.lc-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.lc-band {
  fill: var(--accent);
  opacity: 0.12;
}

.lc-cross {
  stroke: var(--border-strong);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.lc-dot {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2;
}

.lc-hover {
  opacity: 0;
  transition: opacity .1s;
}

.lc-hover.on {
  opacity: 1;
}

.lc-marker line {
  stroke: var(--faint);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.lc-marker circle {
  fill: var(--faint);
  stroke: var(--surface);
  stroke-width: 2;
}

.lc-marker text {
  fill: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .12s;
}

.lc-marker.near line {
  stroke: var(--muted);
}

.lc-marker.near text {
  opacity: 1;
}

.bc-bar {
  fill: var(--accent);
  transition: opacity .12s;
}

.bc-bar.active {
  opacity: 0.72;
}

.bc-hit {
  fill: transparent;
}

.spark {
  display: block;
  flex-shrink: 0;
  overflow: visible;
}

.spark path {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spark.up path { stroke: var(--up); }
.spark.down path { stroke: var(--down); }

.spark.flat path {
  stroke: var(--faint);
  stroke-dasharray: 2 3;
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bl-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.bl-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
}

.bl-sub {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.bl-value {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.bl-track {
  height: 6px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--accent-weak);
}

.bl-fill {
  height: 100%;
  min-width: 2px;
  border-radius: 3px;
  background: var(--accent);
  transition: width .4s var(--ease);
}

.heatmap {
  position: relative;
  min-width: 0;
}

.hm-grid {
  display: grid;
  grid-template-columns: 34px repeat(24, minmax(0, 1fr));
  gap: 2px;
}

.hm-col {
  height: 18px;
  overflow: visible;
  color: var(--muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hm-row {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 11.5px;
}

.hm-cell {
  height: 22px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) calc(var(--a, 0) * 100%), var(--surface-2));
}

.hm-cell.null {
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 3px, transparent 3px 6px);
}

.hm-cell:hover,
.hm-cell.active {
  box-shadow: inset 0 0 0 1.5px var(--text);
}

.hm-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11.5px;
}

.hm-legend i {
  width: 14px;
  height: 10px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) calc(var(--a, 0) * 100%), var(--surface-2));
}

/* Toasts */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity .2s var(--ease), transform .25s var(--ease);
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
}

.toast.success .toast-dot { background: var(--up); }
.toast.error .toast-dot { background: var(--down); }

.toast-text {
  overflow-wrap: anywhere;
}

/* Home */

.home-kpis .spark {
  margin-left: auto;
}

.home-grid {
  display: grid;
  gap: var(--gap);
  margin-top: var(--gap);
}

.home-side {
  min-width: 0;
}

.home-top .card-foot .btn {
  min-width: 140px;
}

/* Slots hold optional side cards without adding a gap of their own when empty. */
.home-slot {
  display: contents;
}

.home-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  padding: 12px 16px;
}

.home-updated {
  font-variant-numeric: tabular-nums;
}

/* Responsive */

@media (min-width: 960px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: start;
  }
}

@media (min-width: 720px) and (max-width: 959.98px) {
  .game-row,
  .game-list-head {
    grid-template-columns: var(--gr-cols-md, var(--gr-cols));
  }

  .game-row > .gr-hide-md,
  .game-list-head > .gr-hide-md {
    display: none;
  }
}

@media (min-width: 960px) {
  .account-name {
    display: block;
  }

  .account-btn {
    padding-right: 9px;
  }
}

@media (min-width: 720px) and (max-width: 1099.98px) {
  .header-inner {
    gap: 20px;
  }

  .nav-link {
    padding: 0 10px;
  }

  .search-input {
    width: 206px;
    padding-right: 12px;
  }

  .search-kbd {
    display: none;
  }
}

@media (min-width: 960px) and (max-width: 1099.98px) {
  .account-name {
    max-width: 96px;
  }
}

/* Below 880px the search box no longer fits beside the nav, so it opens over the header from a button. */
@media (max-width: 879.98px) {
  .search {
    display: none;
  }

  .site-header .search-toggle {
    display: inline-grid;
  }

  .site-header.search-open .search {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    gap: 8px;
    height: var(--header-h);
    padding: 0 12px 0 16px;
    background: var(--bg);
  }

  .site-header.search-open .search-icon {
    left: 27px;
  }

  .site-header.search-open .search-input {
    flex: 1;
    width: auto;
    padding-right: 12px;
    font-size: 16px;
  }

  .site-header.search-open .search-cancel {
    display: inline-flex;
  }

  .search-kbd {
    display: none;
  }

  .search-results {
    left: 12px;
    right: 12px;
    top: calc(100% + 4px);
    width: auto;
  }
}

@media (min-width: 720px) and (max-width: 879.98px) {
  .search-results {
    left: auto;
    width: 440px;
  }
}

@media (max-width: 719.98px) {
  :root {
    --header-h: 52px;
  }

  .header-inner {
    height: auto;
    flex-wrap: wrap;
    column-gap: 12px;
    row-gap: 0;
  }

  .brand {
    height: var(--header-h);
  }

  .main-nav {
    order: 3;
    width: calc(100% + 32px);
    margin: 0 -16px;
    padding: 0 12px 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    height: 36px;
  }

  .tab {
    height: 34px;
  }

  .btn.sm {
    height: 36px;
  }

  .page {
    padding-top: 20px;
    padding-bottom: 48px;
  }

  .page-head {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 12px;
    margin-bottom: 18px;
  }

  .page-head h1 {
    font-size: 23px;
  }

  .page-actions {
    grid-column: 1;
    grid-row: auto;
    flex-wrap: wrap;
  }

  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .kpi {
    padding: 13px 14px;
  }

  .kpi-value {
    font-size: 21px;
    line-height: 30px;
  }

  .kpi-value.is-text {
    font-size: 15px;
  }

  .kpi-sub .spark {
    display: none;
  }

  .card {
    padding: 16px 14px;
  }

  .card.flush {
    padding: 0;
  }

  .card.flush > .card-head {
    padding: 10px 14px;
  }

  .game-list-head {
    display: none;
  }

  .game-row {
    grid-template-columns: var(--gr-cols-sm);
    column-gap: 10px;
    row-gap: 1px;
    min-height: 58px;
    padding: 8px 14px;
  }

  .game-row > .gr-rank,
  .game-row > .gr-main,
  .game-row > .gr-action {
    grid-row: 1 / span 2;
  }

  .game-row > .gr-ccu {
    align-self: end;
  }

  .game-row > .gr-delta {
    grid-row: 2;
    align-self: start;
    font-size: 12.5px;
  }

  .game-row > .gr-delta.is-empty {
    display: none;
  }

  .game-row:has(> .gr-delta.is-empty) > .gr-ccu {
    grid-row: 1 / span 2;
    align-self: center;
  }

  .game-row > .gr-spark,
  .game-row > .gr-rating,
  .game-row > .gr-hide-sm {
    display: none;
  }

  .gr-rank {
    font-size: 12px;
  }

  .gr-main {
    gap: 10px;
  }

  .gr-main .gicon {
    --icon-size: 36px !important;
  }

  .mini-row {
    padding: 8px 14px;
  }

  .list-note {
    padding: 8px 14px;
  }

  .missing-card {
    margin-top: 12px;
    padding: 20px 16px;
  }

  .input,
  .select,
  .textarea {
    font-size: 16px;
  }

  .hm-grid {
    grid-template-columns: 28px repeat(24, minmax(0, 1fr));
    gap: 1px;
  }

  .hm-cell {
    height: 16px;
    border-radius: 2px;
  }

  .hm-col:not(.major) {
    visibility: hidden;
  }

  .footer-inner {
    flex-direction: column;
  }

  .footer-links {
    gap: 2px;
  }

  .footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding-inline: 6px;
  }

  .footer-links a:first-child {
    margin-left: -6px;
  }

  .login-card {
    margin-top: 12px;
    padding: 26px 18px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .live-dot::after {
    display: none;
  }

  .skeleton {
    animation: none;
  }
}

/* Badges: the art is in /img/badges and badge-art.js. These tones color milestone progress bars, and a locked
   milestone is dimmed more gently on light backgrounds, where a faded white glyph would disappear. */

:root {
  --badge-blue: #0066ff;
  --badge-accent: #4a5ef0;
  --badge-gold: #df9300;
  --badge-silver: #6f7a8c;
  --badge-bronze: #b0582e;
  --badge-green: #14a05a;
  --badge-pink: #dc3a85;
  --badge-orange: #ea5a1a;
  --badge-purple: #7c4ddb;
  --badge-teal: #0f978c;
  --badge-red: #d9304f;
  --badge-locked-filter: grayscale(1) brightness(0.85);
  --badge-locked-opacity: 0.65;

  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #4a3aa7;
  --series-8: #e34948;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --badge-blue: #4d94ff;
    --badge-accent: #8d9bff;
    --badge-gold: #f0b73a;
    --badge-silver: #b6bfcc;
    --badge-bronze: #dc9a6c;
    --badge-green: #45d184;
    --badge-pink: #f472b6;
    --badge-orange: #fb923c;
    --badge-purple: #ab8cfb;
    --badge-teal: #34d3bd;
    --badge-red: #ff6b7d;
    --badge-locked-filter: grayscale(1);
    --badge-locked-opacity: 0.45;

    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-8: #e66767;
  }
}

:root[data-theme="dark"] {
  --badge-blue: #4d94ff;
  --badge-accent: #8d9bff;
  --badge-gold: #f0b73a;
  --badge-silver: #b6bfcc;
  --badge-bronze: #dc9a6c;
  --badge-green: #45d184;
  --badge-pink: #f472b6;
  --badge-orange: #fb923c;
  --badge-purple: #ab8cfb;
  --badge-teal: #34d3bd;
  --badge-red: #ff6b7d;
  --badge-locked-filter: grayscale(1);
  --badge-locked-opacity: 0.45;

  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
}

.badge-tile {
  --badge-size: 22px;
  display: inline-block;
  flex-shrink: 0;
  width: var(--badge-size);
  height: var(--badge-size);
  border-radius: calc(var(--badge-size) * 0.3);
  vertical-align: middle;
  user-select: none;
}

.badge-tile > img {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-user-drag: none;
}

.badge-tile.is-locked > img {
  filter: var(--badge-locked-filter);
  opacity: var(--badge-locked-opacity);
}

[data-badge-tip] {
  cursor: default;
}

[data-badge-tip]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.badge-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
  vertical-align: middle;
}

.badge-more {
  --badge-size: 22px;
  display: inline-grid;
  place-items: center;
  min-width: var(--badge-size);
  height: var(--badge-size);
  padding: 0 5px;
  border-radius: calc(var(--badge-size) * 0.3);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--muted);
  font-size: max(10.5px, calc(var(--badge-size) * 0.46));
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.badge-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.badge-card-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.badge-card-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
}

.badge-card-kind {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.badge-card-desc {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.badge-card-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin-top: 3px;
  color: var(--faint-text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.badge-card-pct {
  flex-shrink: 0;
  color: var(--muted);
  font-weight: 500;
}

.badge-progress {
  display: block;
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
}

.badge-progress-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--bc);
  transition: width .5s var(--ease);
}

.badge-tip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 95;
  max-width: min(280px, calc(100vw - 16px));
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
  line-height: 1.4;
  pointer-events: none;
}

.badge-tip[hidden] {
  display: none;
}

.chart-tip .tip-series {
  gap: 7px;
}

.tip-num {
  min-width: 3ch;
  color: var(--text);
  font-weight: 600;
}

.tip-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
