/*
  Fetzis Stats
  Palette: cool "deepslate" neutrals + one accent (experience-orb green). Dark is primary.
  Shape rule: every surface, control and pill uses --r (6px); avatars, item slots and rank
  badges use --r-sm (3px). Nothing else.
  Type: Geist for text, Geist Mono for numbers, Pixelify Sans only for the wordmark and rank numerals.
  Z-index scale: 10 sticky header, 20 popovers, 30 mobile search overlay.
*/

:root {
  --r: 6px;
  --r-sm: 3px;
  --gutter: 16px;
  --max: 1240px;
  --header: 64px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --pixel: 'Pixelify Sans', var(--mono);
}

:root,
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #111316;
  --bg-2: #15181c;
  --surface: #1a1d22;
  --surface-2: #21252b;
  --surface-3: #292e35;
  --line: #2a2f37;
  --line-2: #3a414b;
  --text: #e8eaed;
  --text-2: #aab0b9;
  --text-3: #8a919c;
  --accent: #8fd14f;
  --accent-ink: #11210a;
  --accent-text: #a5df69;
  --accent-soft: rgb(143 209 79 / 0.11);
  --accent-line: rgb(143 209 79 / 0.38);
  --shadow: 0 18px 48px rgb(4 6 9 / 0.5);
  --header-bg: rgb(17 19 22 / 0.86);
  --sk: #20242a;
  --sk-hi: #2a2f36;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f3f4f6;
  --bg-2: #eceef1;
  --surface: #fbfbfc;
  --surface-2: #eef0f3;
  --surface-3: #e3e6ea;
  --line: #dde1e6;
  --line-2: #c5cbd3;
  --text: #14171b;
  --text-2: #464d57;
  --text-3: #5d6570;
  --accent: #44791a;
  --accent-ink: #f6fbef;
  --accent-text: #3a6a15;
  --accent-soft: rgb(68 121 26 / 0.1);
  --accent-line: rgb(68 121 26 / 0.4);
  --shadow: 0 18px 40px rgb(40 50 60 / 0.14);
  --header-bg: rgb(243 244 246 / 0.88);
  --sk: #e6e9ed;
  --sk-hi: #f1f3f5;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--font);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }

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

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

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 40; padding: 8px 14px; border-radius: var(--r);
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 28px; } }

.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ header */

/* The blur lives on a pseudo-element: backdrop-filter on .topbar itself would become the
   containing block for the fixed mobile tab bar and search overlay inside it. */
.topbar { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); }
.topbar::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--header-bg);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
}
@media (prefers-reduced-transparency: reduce) { .topbar::before, .mainnav { background: var(--bg) !important; backdrop-filter: none !important; } }

.topbar__inner { height: var(--header); display: flex; align-items: center; gap: 28px; position: relative; }

.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand__mark {
  width: 18px; height: 18px; border-radius: var(--r-sm);
  background:
    linear-gradient(var(--accent), var(--accent)) 3px 10px / 3px 5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 7.5px 4px / 3px 11px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 12px 7px / 3px 8px no-repeat,
    var(--surface-3);
}
.brand__name { font: 600 19px/1 var(--pixel); letter-spacing: 0.01em; }

.mainnav { display: flex; gap: 4px; }
.mainnav a {
  position: relative; padding: 8px 12px; border-radius: var(--r); color: var(--text-2); font-weight: 500;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.mainnav a:hover { color: var(--text); background: var(--surface); }
.mainnav a[aria-current='page'] { color: var(--text); }
.mainnav a[aria-current='page']::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: -13px; height: 2px; background: var(--accent);
}

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

.iconbtn {
  display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 9px;
  border: 1px solid transparent; border-radius: var(--r); background: transparent; color: var(--text-2);
  cursor: pointer; font: 600 12.5px/1 var(--mono); letter-spacing: 0.04em;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.iconbtn:hover { color: var(--text); background: var(--surface); border-color: var(--line); }
.iconbtn:active { transform: translateY(1px); }
.iconbtn .ic { width: 18px; height: 18px; }

/* player search */
.psearch { position: relative; }
.psearch__toggle { display: none; }
.psearch__field { position: relative; display: flex; align-items: center; }
.psearch__glyph { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.psearch__input {
  width: 230px; height: 38px; padding: 0 12px 0 34px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  transition: border-color 0.2s var(--ease), width 0.3s var(--ease);
}
.psearch__input::placeholder { color: var(--text-3); }
.psearch__input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.psearch__list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 300px; padding: 6px;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
}
.psearch__opt {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: var(--r); cursor: pointer;
}
.psearch__opt[aria-selected='true'], .psearch__opt:hover { background: var(--surface-2); }
.psearch__name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psearch__meta { color: var(--text-3); font-size: 12.5px; }
.psearch__empty { padding: 10px; color: var(--text-3); }

.mainnav a { display: inline-flex; align-items: center; gap: 8px; }
.mainnav .ic { display: none; }

/* phones: main navigation becomes a bottom tab bar */
@media (max-width: 639px) {
  .mainnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--header-bg); border-top: 1px solid var(--line);
    backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  }
  .mainnav a { flex-direction: column; gap: 3px; justify-content: center; padding: 6px; font-size: 12.5px; }
  .mainnav .ic { display: block; width: 22px; height: 22px; }
  .mainnav a[aria-current='page'] { color: var(--accent-text); background: none; }
  .mainnav a[aria-current='page']::after { display: none; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media (max-width: 767px) {
  .topbar__inner { gap: 12px; }
  .psearch__toggle { display: inline-grid; }
  .psearch__field { display: none; }
  .psearch.is-open .psearch__field {
    display: flex; position: fixed; left: 0; right: 0; top: 0; height: var(--header); z-index: 30;
    padding: 0 var(--gutter); background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .psearch.is-open .psearch__glyph { left: calc(var(--gutter) + 11px); }
  .psearch.is-open .psearch__input { width: 100%; }
  .psearch__list { position: fixed; left: var(--gutter); right: var(--gutter); top: calc(var(--header) + 6px); width: auto; z-index: 30; }
}
@media (max-width: 420px) {
  .brand__name { font-size: 17px; }
  .topbar__tools { gap: 2px; }
}

.demo-banner {
  background: var(--accent-soft); color: var(--text-2); font-size: 13px; text-align: center;
  padding: 6px var(--gutter); border-bottom: 1px solid var(--line);
}

main { flex: 1; padding-block: 36px 72px; }
main:focus { outline: none; }

.footer { padding-block: 24px 36px; color: var(--text-3); font-size: 13px; border-top: 1px solid var(--line); }
.footer p { display: flex; flex-wrap: wrap; gap: 6px 22px; }

/* ------------------------------------------------------------------ buttons, inputs */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px;
  border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font-weight: 560; white-space: nowrap; cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent); filter: brightness(1.07); }
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--ghost:hover { background: var(--surface); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 12.5px; font-weight: 550; color: var(--text-2); }

.input, .select {
  width: 100%; height: 46px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 0 12px; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input::placeholder { color: var(--text-3); }
.input:focus, .select:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-wrap, .select-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .ic { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.input-wrap .input { padding-left: 36px; }
.input-wrap--sm .input { height: 38px; }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer; }
.select-wrap > .ic { position: absolute; right: 12px; width: 14px; height: 14px; color: var(--text-3); pointer-events: none; }
.select option { background: var(--surface); color: var(--text); }

/* ------------------------------------------------------------------ shared bits */

.section-title { font-size: 20px; font-weight: 620; letter-spacing: -0.015em; }
.mini-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }

.avatar {
  width: 32px; height: 32px; border-radius: var(--r-sm); image-rendering: pixelated; flex: none;
  background: var(--surface-3); object-fit: cover;
}
.skin-fallback {
  display: inline-grid; place-items: center; font: 600 12px/1 var(--mono); color: var(--text-2);
  border-radius: var(--r-sm); background: var(--surface-3); flex: none;
}
.body-render { height: auto; width: auto; max-height: 100%; filter: drop-shadow(0 12px 14px rgb(0 0 0 / 0.35)); }
.body-fallback {
  display: grid; place-items: center; width: 120px; aspect-ratio: 1 / 2; margin-inline: auto; border-radius: var(--r);
  background: var(--surface-2); color: var(--text-3); font: 600 42px/1 var(--pixel);
}

.item {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text-3);
  box-shadow: inset 0 0 0 1px var(--line);
}
.item img { width: 24px; height: 24px; image-rendering: pixelated; }
.item .ic { width: 18px; height: 18px; }
.item--sm { width: 32px; height: 32px; }
.item--sm img { width: 22px; height: 22px; }
.item--lg { width: 56px; height: 56px; background: var(--surface); }
.item--lg img { width: 40px; height: 40px; }
.item--lg .ic { width: 26px; height: 26px; color: var(--accent-text); }

.rank {
  display: inline-grid; place-items: center; min-width: 36px; height: 28px; padding: 0 4px; border-radius: var(--r-sm);
  font: 600 14px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--text-3);
}
.rank--1 { color: var(--accent-ink); background: var(--accent); }
.rank--2, .rank--3 { color: var(--text); background: var(--surface-3); }

/* XP-bar style meter: notched segments, no background track */
.meter {
  display: block; height: 4px; width: var(--w); border-radius: 1px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 12px, transparent 12px 14px);
  opacity: 0.85;
}

.state { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 56px 16px; }
.state--page { padding-block: 96px; }
.state__icon { width: 40px; height: 40px; color: var(--text-3); }
.state__title { font-size: 22px; font-weight: 620; letter-spacing: -0.015em; }
.state__text { color: var(--text-2); max-width: 52ch; }

/* skeletons */
.sk { display: block; border-radius: var(--r); background: var(--sk); }
.sk--h1 { height: 46px; width: 90%; margin-bottom: 12px; }
.sk--short { width: 60%; }
.sk--p { height: 18px; width: 70%; margin-top: 12px; }
.sk--podium { height: 380px; }
.sk--tile { min-height: 220px; border: 0; }
.sk--render { height: 260px; margin-bottom: 16px; }
.sk--stat { min-height: 96px; border: 0; }
.sk--rank { width: 36px; height: 22px; }
.sk--avatar { width: 32px; height: 32px; border-radius: var(--r-sm); }
.sk--name { height: 14px; width: 40%; }
.sk--value { height: 14px; width: 80px; justify-self: end; }
@media (prefers-reduced-motion: no-preference) {
  .sk { background: linear-gradient(100deg, var(--sk) 30%, var(--sk-hi) 50%, var(--sk) 70%) 0 0 / 300% 100%; animation: shimmer 1.6s linear infinite; }
}
@keyframes shimmer { to { background-position: -150% 0; } }

/* entrance motion: content enters in reading order; disabled for reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .row, .total, .stat-tile, .statlist li, .tile, .podium__step { animation: rise 0.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 22ms); }
  .podium__step--2 { --i: 2; }
  .podium__step--1 { --i: 0; }
  .podium__step--3 { --i: 4; }
  .tile:nth-child(2) { --i: 1; } .tile:nth-child(3) { --i: 2; } .tile:nth-child(4) { --i: 3; }
  .tile:nth-child(5) { --i: 4; } .tile:nth-child(6) { --i: 5; } .tile:nth-child(7) { --i: 6; }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ------------------------------------------------------------------ home */

.hero {
  display: grid; gap: 40px; align-items: end; padding-bottom: 48px;
}
@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; padding-top: 8px; }
}
.hero__copy { padding-bottom: 8px; align-self: center; }
.hero__title {
  font-size: clamp(2.15rem, 1.4rem + 3vw, 3.5rem); line-height: 1.04; font-weight: 680; letter-spacing: -0.035em;
  max-width: 14ch; text-wrap: balance;
}
.hero__lead { margin-top: 18px; color: var(--text-2); font-size: 17px; max-width: 44ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.podium { min-width: 0; }
.podium__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px; }
.podium__link { display: flex; flex-direction: column; align-items: center; }
.podium__figure { display: flex; align-items: flex-end; justify-content: center; height: 230px; margin-bottom: -4px; transition: transform 0.35s var(--ease); }
.podium__step--1 .podium__figure { height: 270px; }
.podium__figure .body-render { max-height: 100%; }
.podium__link:hover .podium__figure { transform: translateY(-4px); }
.podium__block {
  width: 100%; display: grid; justify-items: center; align-content: start; gap: 6px; padding: 14px 8px 16px;
  border-radius: var(--r); background: var(--surface-2);
  box-shadow: inset 0 2px 0 var(--surface-3), inset 0 -3px 0 rgb(0 0 0 / 0.18);
  text-align: center; min-width: 0;
}
.podium__step--1 .podium__block { min-height: 150px; background: linear-gradient(180deg, var(--accent-soft), transparent 75%), var(--surface-2); box-shadow: inset 0 2px 0 var(--accent-line), inset 0 -3px 0 rgb(0 0 0 / 0.18); }
.podium__step--2 .podium__block { min-height: 122px; }
.podium__step--3 .podium__block { min-height: 104px; }
.podium__name { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium__value { font: 500 13.5px/1.2 var(--mono); color: var(--text-2); }
.podium__step--1 .podium__value { color: var(--accent-text); }
.podium__cap { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; color: var(--text-3); font-size: 13.5px; }
.podium__cap a { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); font-weight: 550; }
.podium__cap a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 520px) {
  .podium__figure { height: 160px; }
  .podium__step--1 .podium__figure { height: 190px; }
  .podium__block { padding: 10px 4px 12px; }
  .podium__name { font-size: 13.5px; }
  .podium__value { font-size: 12px; }
}

.totals { padding-block: 40px 48px; border-top: 1px solid var(--line); }
.totals__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; margin-top: 22px; }
@media (min-width: 768px) { .totals__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .totals__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.total dt { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 13.5px; }
.total dt .ic { color: var(--text-3); }
.total dd { margin-top: 6px; font: 500 clamp(1.4rem, 1.1rem + 1vw, 1.9rem)/1.1 var(--mono); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.bento { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile--tall { grid-row: span 2; }
}
@media (min-width: 1024px) {
  .bento { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile--wide { grid-column: span 2; }
}
.tile {
  position: relative; overflow: hidden; isolation: isolate; padding: 18px 16px 12px;
  border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
}
.tile--tall { background: linear-gradient(160deg, var(--accent-soft), transparent 55%), var(--surface); }
@media (min-width: 1024px) { .tile--wide .tile__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, auto); grid-auto-flow: column; column-gap: 28px; } }
.tile__art { position: absolute; right: -14px; bottom: -18px; z-index: -1; width: 150px; height: 150px; opacity: 0.09; transform: rotate(-14deg); pointer-events: none; }
.tile__art img { width: 100%; height: 100%; image-rendering: pixelated; }
:root[data-theme='light'] .tile__art { opacity: 0.12; }
.tile__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tile__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--accent-text); flex: none; }
.tile__title { font-size: 15.5px; font-weight: 620; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tile__sub { font-size: 12.5px; font-weight: 450; color: var(--text-3); }
.tile__more { margin-left: auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r); color: var(--text-3); transition: color 0.2s, background-color 0.2s; }
.tile__more:hover { color: var(--text); background: var(--surface-2); }
.tile__row { display: grid; grid-template-columns: 24px 24px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 6px; margin-inline: -6px; border-radius: var(--r); transition: background-color 0.2s var(--ease); }
.tile__row:hover { background: var(--surface-2); }
.tile__rank { font: 500 13px/1 var(--mono); color: var(--text-3); text-align: center; }
.tile__list > li:first-child .tile__rank { color: var(--accent-text); }
.tile--tall .tile__list > li:first-child .tile__rank { color: var(--text-3); }
.tile__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tile__value { font: 500 13.5px/1 var(--mono); color: var(--text-2); }
.tile .avatar { width: 24px; height: 24px; }
.tile .skin-fallback { width: 24px; height: 24px; font-size: 10px; }

.recent { padding-top: 56px; }
.recent__row {
  display: flex; gap: 10px; margin-top: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; overscroll-behavior-x: contain;
  mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
}
.recent__row > li { scroll-snap-align: start; flex: none; }
.chip-player {
  display: grid; grid-template-columns: 40px auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 8px 14px 8px 8px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.chip-player:hover { border-color: var(--line-2); transform: translateY(-1px); }
.chip-player .avatar, .chip-player .skin-fallback { grid-row: span 2; width: 40px; height: 40px; }
.chip-player__name { font-weight: 560; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-player__meta { font-size: 12.5px; color: var(--text-3); }

.servers { padding-top: 48px; }
.servers__list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.server-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-size: 14px;
  transition: color 0.2s, border-color 0.2s;
}
.server-pill:hover { color: var(--text); border-color: var(--line-2); }
.server-pill .ic { color: var(--text-3); }
.server-pill__n { font: 500 12.5px/1 var(--mono); color: var(--text-3); }

.home-skeleton .hero { align-items: center; }

/* ------------------------------------------------------------------ board */

.board__head { display: flex; align-items: center; gap: 16px; }
.board__title { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.35rem); font-weight: 670; letter-spacing: -0.03em; line-height: 1.1; overflow-wrap: anywhere; }
.board__sub { display: flex; flex-wrap: wrap; gap: 0 10px; margin-top: 4px; color: var(--text-2); }
.board__sub span + span::before { content: '/'; margin-right: 10px; color: var(--line-2); }

.cats {
  display: flex; gap: 2px; margin-top: 26px; overflow-x: auto; border-bottom: 1px solid var(--line);
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.cats::-webkit-scrollbar { display: none; }
.cat, .tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 12px 12px 13px;
  color: var(--text-2); font-weight: 520; white-space: nowrap; border: 0; background: none; cursor: pointer;
  transition: color 0.2s var(--ease);
}
.cat:hover, .tab:hover { color: var(--text); }
.cat .ic, .tab .ic { color: var(--text-3); transition: color 0.2s; }
.cat[aria-current='page'], .tab[aria-selected='true'] { color: var(--text); }
.cat[aria-current='page'] .ic, .tab[aria-selected='true'] .ic { color: var(--accent-text); }
.cat[aria-current='page']::after, .tab[aria-selected='true']::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--accent);
}

.controls {
  display: grid; gap: 12px; margin-top: 20px; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'picker picker' 'server order' 'filter filter';
}
.controls__picker { grid-area: picker; }
.controls > .field--server { grid-area: server; }
.controls > .field--grow { grid-area: filter; }
.controls > .field--order { grid-area: order; }
@media (min-width: 900px) {
  .controls { grid-template-columns: minmax(280px, 1.3fr) minmax(180px, 1fr) minmax(180px, 1fr) auto; grid-template-areas: 'picker server filter order'; align-items: end; }
}
.btn--order { height: 46px; }

.picker { position: relative; }
.picker__btn {
  width: 100%; height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 14px 0 10px; text-align: left;
  border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); cursor: pointer;
  transition: border-color 0.2s var(--ease);
}
.picker__btn:hover, .picker.is-open .picker__btn { border-color: var(--accent-line); }
.picker__text { display: flex; min-width: 0; flex: 1; }
.picker__current { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker__caret { color: var(--text-3); transition: transform 0.25s var(--ease); }
.picker.is-open .picker__caret { transform: rotate(180deg); }
.picker__pop {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 20; width: min(440px, calc(100vw - 2 * var(--gutter)));
  border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow); overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .picker__pop:not([hidden]) { animation: pop 0.22s var(--ease); }
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.99); } }
.picker__head { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px; border-bottom: 1px solid var(--line); }
.picker__glyph { position: absolute; left: 22px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.picker__search { flex: 1; min-width: 0; height: 40px; padding: 0 10px 0 36px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-2); }
.picker__search::placeholder { color: var(--text-3); }
.picker__search:focus { outline: none; border-color: var(--accent-line); }
.picker__count { flex: none; font: 500 12px/1 var(--mono); color: var(--text-3); }
.picker__list { max-height: min(56vh, 440px); overflow-y: auto; padding: 6px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.picker__group { padding: 10px 8px 4px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.picker__opt { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: var(--r); cursor: pointer; }
.picker__opt:hover, .picker__opt.is-active { background: var(--surface-2); }
.picker__opt[aria-selected='true'] .picker__optlabel { color: var(--accent-text); font-weight: 600; }
.picker__optkey { font: 400 12px/1.2 var(--mono); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.picker__optlabel { flex: none; max-width: 70%; }
.picker__none { padding: 18px; text-align: center; color: var(--text-3); }

.board__body { margin-top: 26px; transition: opacity 0.2s var(--ease); }
.board__body.is-loading { opacity: 0.55; }
.board__count { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--text-3); font-size: 13.5px; margin-bottom: 18px; }
.board__body .podium { max-width: 680px; margin: 0 auto 28px; }

.rows { display: grid; gap: 4px; }
.row__link {
  display: grid; grid-template-columns: 44px 32px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 9px 16px 9px 10px; border-radius: var(--r); background: var(--surface);
  transition: background-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.row__link:hover { background: var(--surface-2); }
.row__link:active { transform: scale(0.995); }
.row__main { display: grid; gap: 6px; min-width: 0; }
.row__name { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__value { font: 500 15px/1 var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.rows--skeleton .row { display: grid; grid-template-columns: 44px 32px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 13px 16px 13px 10px; border-radius: var(--r); background: var(--surface); }
@media (max-width: 520px) {
  .row__link, .rows--skeleton .row { grid-template-columns: 34px 28px minmax(0, 1fr) auto; gap: 10px; padding: 8px 10px 8px 6px; }
  .row__link .avatar, .row__link .skin-fallback { width: 28px; height: 28px; }
  .rank { min-width: 30px; font-size: 13px; }
  .row__value { font-size: 13.5px; }
}

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 26px; }
.pager__info { font: 500 13.5px/1 var(--mono); color: var(--text-2); }
@media (max-width: 420px) { .pager .btn span { display: none; } .pager .btn { padding: 0 14px; } }

/* ------------------------------------------------------------------ profile */

.profile { display: grid; gap: 32px; }
@media (min-width: 1024px) {
  .profile { grid-template-columns: 300px minmax(0, 1fr); gap: 48px; align-items: start; }
  .profile__card { position: sticky; top: calc(var(--header) + 24px); }
}
.profile__card { min-width: 0; }
.profile__render {
  display: flex; justify-content: center; align-items: flex-end; height: 320px; padding-top: 12px; border-radius: var(--r);
  background: radial-gradient(70% 55% at 50% 100%, var(--accent-soft), transparent 70%), var(--surface);
  border: 1px solid var(--line); overflow: hidden;
}
.profile__render .body-render { max-height: 300px; margin-bottom: -6px; }
.profile__name { margin-top: 20px; font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.2rem); font-weight: 680; letter-spacing: -0.03em; line-height: 1.1; overflow-wrap: anywhere; }
.profile__uuid { margin-top: 6px; font: 400 12px/1.4 var(--mono); color: var(--text-3); overflow-wrap: anywhere; }
.facts { display: grid; gap: 12px; margin-top: 22px; }
.fact { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.fact dt { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.fact dt .ic { color: var(--text-3); }
.fact dd { text-align: right; font-weight: 550; }
.profile__servers { margin-top: 26px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: var(--r); background: var(--surface-2); color: var(--text-2); font-size: 13px; transition: color 0.2s, background-color 0.2s; }
.tag:hover { color: var(--text); background: var(--surface-3); }
@media (min-width: 640px) and (max-width: 1023px) {
  .profile__card { display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 28px; align-items: start; }
  .profile__render { grid-row: span 5; height: 260px; }
  .profile__render .body-render { max-height: 240px; }
  .profile__name { margin-top: 0; }
}
@media (max-width: 639px) {
  .profile__render { height: 250px; }
  .profile__render .body-render { max-height: 230px; }
}

.profile__main { display: grid; gap: 44px; min-width: 0; }
.profile__main > * { min-width: 0; }
.headline { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .headline { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-tile {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 12px; min-width: 0;
  border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
a.stat-tile:hover { border-color: var(--line-2); transform: translateY(-1px); }
.stat-tile--lead { grid-column: span 2; background: linear-gradient(140deg, var(--accent-soft), transparent 65%), var(--surface); }
.stat-tile__label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); }
.stat-tile__label .ic { color: var(--text-3); }
.stat-tile__value { font: 500 22px/1.15 var(--mono); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-tile--lead .stat-tile__value { font-size: clamp(26px, 20px + 1.4vw, 34px); }
.stat-tile__rank { font-size: 12.5px; color: var(--text-3); }
.stat-tile__rank.is-top { color: var(--accent-text); font-weight: 560; }

.profile__stats-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.profile__stats-head .input-wrap { width: min(280px, 100%); }
.tabs { display: flex; gap: 2px; margin-top: 14px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; overscroll-behavior-x: contain; }
.tabs::-webkit-scrollbar { display: none; }
.tab__n { font: 500 11.5px/1 var(--mono); color: var(--text-3); }
.tabpanel { margin-top: 16px; }
.statlist { display: grid; gap: 4px; }
@media (min-width: 768px) { .statlist { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; } }
.statlist__row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 6px 14px 6px 6px; border-radius: var(--r); background: var(--surface);
  transition: background-color 0.18s var(--ease);
}
.statlist__row:hover { background: var(--surface-2); }
.statlist__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statlist__value { font: 500 14px/1 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.btn--more { margin-top: 14px; }

.table-wrap { margin-top: 14px; overflow-x: auto; overscroll-behavior-x: contain; }
.table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 14px; }
.table th, .table td { padding: 11px 12px; text-align: left; white-space: nowrap; }
.table td.when { font-family: var(--font); font-size: 13px; }
.table thead th { font-size: 12.5px; font-weight: 550; color: var(--text-3); padding-block: 4px 6px; }
.table tbody th, .table tbody td { background: var(--surface); }
.table tbody th { font-weight: 560; border-radius: var(--r) 0 0 var(--r); }
.table tbody td:last-child { border-radius: 0 var(--r) var(--r) 0; color: var(--text-3); }
.table tbody th a:hover { color: var(--accent-text); }
.table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table thead .num { font-family: var(--font); }
@media (max-width: 899px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr { display: block; }
  .table tr { margin-bottom: 8px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); }
  .table tbody th, .table tbody td { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; background: none; border-radius: 0; white-space: normal; }
  .table tbody th { font-size: 15px; padding-bottom: 8px; }
  .table tbody td::before { content: attr(data-label); font-family: var(--font); color: var(--text-2); }
  .table tbody td:last-child { border-radius: 0; }
}

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