/* =============================================================================
 * Libra Rating — theme
 * Dark base + refined Libra gold. Tier colours come in inline per element.
 * ===========================================================================*/

/* the default Minecraft typeface, for the wordmark only */
@font-face {
  font-family: 'Minecraft';
  src: url('https://cdn.jsdelivr.net/npm/@south-paw/typeface-minecraft@1.0.0/files/minecraft.woff2') format('woff2'),
       url('https://cdn.jsdelivr.net/npm/@south-paw/typeface-minecraft@1.0.0/files/minecraft.woff') format('woff');
  font-weight: normal; font-style: normal; font-display: swap;
}

:root {
  /* base surfaces — deep dark, faint cool tint, panels lift toward the viewer */
  --bg:        #05070b;
  --bg-2:      #080b11;
  --panel:     #0d1118;
  --panel-2:   #11151f;
  --panel-hi:  #181d2b;
  --line:      #1d2433;
  --line-soft: #151a26;

  /* text */
  --text:      #eef2fb;
  --muted:     #9aa6c0;
  --faint:     #67718c;

  /* brand */
  --gold:      #ffcf4d;     /* brightened from #F5C84C for screen contrast */
  --gold-deep: #e0a92e;
  --gold-soft: rgba(255, 207, 77, 0.12);

  /* semantics */
  --win:       #38d39f;
  --loss:      #ff5d72;
  --refund:    #6eb1ff;

  /* shape */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --shadow: 0 10px 30px -12px rgba(0,0,0,.6);
  --card-shadow: 0 8px 24px -14px rgba(0,0,0,.75);
  --maxw: 1360px;

  --font: 'Lexend', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Space Grotesk', var(--font);
  --font-brand: 'Minecraft', var(--font-head);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -200px, rgba(255,207,77,.06), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(91,141,239,.06), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { display: block; }
.head { border-radius: 6px; background: #0c0f17; image-rendering: pixelated; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.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; }

/* ----------------------------------------------------------------- header */
#site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,13,19,.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.hdr-inner {
  max-width: 1640px; margin: 0 auto; padding: 0 34px;
  height: 72px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 13px; justify-self: start; }
.brand-logo { width: 42px; height: 42px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.brand-lines { display: flex; flex-direction: column; gap: 3px; }
.brand-text {
  font-family: var(--font-brand); font-weight: 400; font-size: 18px;
  letter-spacing: .5px; line-height: 1.1;
}
.brand-accent { color: var(--gold); margin-left: 7px; }
.brand-by { font-family: var(--font); font-size: 12px; color: var(--faint); letter-spacing: .2px; }
.hdr-nav { display: flex; gap: 6px; justify-self: center; }
.nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--r-sm); color: var(--muted);
  font-weight: 500; font-size: 14px; transition: .15s;
}
.nav-ico { opacity: .85; }
.nav-link:hover { color: var(--text); background: var(--panel); }
.nav-link.is-active { color: var(--gold); background: var(--gold-soft); }

/* search */
.search { position: relative; justify-self: end; width: 300px; max-width: 42vw; }
.search-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--faint); pointer-events: none;
}
#search-input {
  width: 100%; height: 40px; padding: 0 14px 0 38px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; color: var(--text); font-family: var(--font); font-size: 14px;
  transition: .15s;
}
#search-input::placeholder { color: var(--faint); }
#search-input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
  overflow: hidden; display: none;
}
.search.open .search-results { display: block; }
.search-item {
  display: grid; grid-template-columns: 28px 1fr auto auto; align-items: center; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid var(--line-soft); transition: .12s;
}
.search-item:last-child { border-bottom: 0; }
.search-item:hover { background: var(--panel-hi); }
.si-nick { font-family: var(--font-brand); font-weight: 400; font-size: 13px; letter-spacing: .2px; }
.si-meta { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; }
.si-rank { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.search-empty { padding: 14px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------------------------------------------------------------- tooltip */
.tip {
  position: fixed; z-index: 100; pointer-events: none;
  max-width: 280px; padding: 9px 12px;
  background: #060810; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 28px -8px rgba(0,0,0,.7);
  opacity: 0; transform: translateY(5px) scale(.98);
  transition: opacity .32s ease, transform .32s ease;
  display: flex; flex-direction: column; gap: 3px;
}
.tip.show { opacity: 1; transform: translateY(0) scale(1); }
.tip.below { transform: translateY(-5px) scale(.98); }
.tip.below.show { transform: translateY(0) scale(1); }
.tip-main { font-size: 12.5px; font-weight: 600; color: var(--text); }
.tip-sub { font-size: 12px; color: var(--muted); font-weight: 400; }

/* ------------------------------------------------------------- page header */
.page-head { padding: 38px 0 8px; }
.page-title {
  font-family: var(--font-head); font-size: 30px; font-weight: 700; margin: 0;
  letter-spacing: -.3px;
}
.page-sub { color: var(--muted); margin: 6px 0 0; font-size: 15px; }
.season-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--gold-soft); color: var(--gold);
  border: 1px solid rgba(255,207,77,.25);
  padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  margin-bottom: 12px;
}

/* pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--line); background: var(--panel);
}
.pill.tier { color: var(--tc); border-color: color-mix(in srgb, var(--tc) 40%, transparent); background: color-mix(in srgb, var(--tc) 12%, transparent); }
.tier-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 8px var(--tc); }
.pill.region { color: var(--muted); }
.region-badge {
  display: inline-grid; place-items: center; min-width: 50px;
  padding: 6px 12px; border-radius: 9px;
  font-family: var(--font-head); font-weight: 700; font-size: 14px; letter-spacing: .5px;
  color: var(--rc); background: color-mix(in srgb, var(--rc) 16%, #05070b);
  border: 1px solid color-mix(in srgb, var(--rc) 35%, transparent);
}

/* unified ELO chip — dark shade of the tier colour, text in the tier colour */
.elo-pill {
  display: inline-block; flex: none; position: relative; overflow: hidden;
  font-family: var(--font-head); font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 13.5px; letter-spacing: -.2px;
  color: var(--tc, var(--text));
  background: color-mix(in srgb, var(--tc) 15%, #0a0d13);
  border: 1px solid color-mix(in srgb, var(--tc) 30%, transparent);
  border-radius: 7px; padding: 2px 9px;
}
.elo-pill.lg { font-size: 16px; padding: 4px 12px; border-radius: 9px; }

/* near-tier promotion/demotion animation disabled in 1.0.22 */
/* ============================================================ DISTRIBUTION */
.dist {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px 22px 14px; margin: 18px 0 26px; box-shadow: var(--shadow);
}
.dist-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.dist-title { font-family: var(--font-head); font-weight: 600; font-size: 16px; margin: 0; }
.dist-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.dist-stat { text-align: right; }
.dist-stat b { font-family: var(--font-head); font-size: 20px; }
.dist-stat span { display: block; color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; }

.dist-bars {
  display: flex; align-items: flex-end; gap: 3px; height: 150px;
  margin-top: 18px; padding-bottom: 2px;
}
.dist-bar {
  position: relative;
  flex: 1; min-width: 0; height: 100%;
  display: flex; align-items: flex-end; cursor: default;
}
.dist-bar i {
  display: block; width: 100%; border-radius: 3px 3px 1px 1px;
  background: var(--bc, #444);
  min-height: 3px; transition: filter .15s, transform .15s;
}
.dist-bar:hover i { filter: brightness(1.2); }
/* vertical dashed marker that drops from the top of the chart on hover */
.dist-bar::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 50%;
  transform: translateX(-50%);
  border-left: 2px dashed rgba(150, 160, 180, .55);
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
.dist-bar:hover::before { opacity: 1; }
.dist-axis {
  display: flex; gap: 3px; margin-top: 8px;
  color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums;
}
.dist-axis span { flex: 1; min-width: 0; text-align: center; white-space: nowrap; }
.dist-top-right { display: flex; align-items: center; gap: 22px; }
.tiers-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel-hi); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 8px 14px; font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: .15s;
}
.tiers-btn::after { content: '▾'; font-size: 10px; color: var(--muted); transition: transform .2s; }
.tiers-btn:hover { border-color: var(--gold); color: var(--gold); }
.tiers-btn.open::after { transform: rotate(180deg); }
.tiers-panel {
  margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line-soft);
}
.tiers-panel[hidden] { display: none; }
.tiers-panel .ladder {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}

/* title + server info share one row, sitting just above the distribution */
.head-row {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; flex-wrap: wrap; padding: 22px 0 0;
}
.head-row .page-head { padding: 0; }

/* server card — simple hover highlight (no tilt) */
.server-card { width: 300px; max-width: 100%; }
.sc-tilt {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px;
  transition: box-shadow .2s ease, border-color .2s ease;
  box-shadow: var(--card-shadow);
}
.server-card:hover .sc-tilt {
  border-color: color-mix(in srgb, var(--gold) 35%, var(--line));
  box-shadow: 0 16px 34px -16px rgba(0,0,0,.8);
}
.sc-grid {
  position: absolute; inset: 0; opacity: .04; pointer-events: none; transition: opacity .3s;
  background-image: linear-gradient(var(--gold) 1px, transparent 1px), linear-gradient(90deg, var(--gold) 1px, transparent 1px);
  background-size: 22px 22px;
}
.server-card:hover .sc-grid { opacity: .08; }
.sc-glow {
  position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; pointer-events: none;
  background: radial-gradient(circle, rgba(255,207,77,.18), transparent 70%);
  opacity: 0; transition: opacity .3s;
}
.server-card:hover .sc-glow { opacity: 1; }

.sc-content { position: relative; z-index: 1; }
.sc-brand { display: flex; align-items: center; gap: 10px; }
.sc-brand img { filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.sc-name { font-family: var(--font-head); font-weight: 700; font-size: 17px; }
.sc-iprow { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.sc-ip { display: flex; align-items: baseline; gap: 6px; }
.sc-iprow .discord-icon { margin-left: auto; }
.sc-ip .ip-prefix { color: var(--faint); font-size: 13px; font-weight: 600; }
.sc-ip code { font-family: var(--font-head); font-weight: 700; color: var(--gold); font-size: 15px; }
.copy-icon-btn {
  display: inline-flex; align-items: center; gap: 0;
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; padding: 6px; border-radius: 8px; transition: color .15s, background .15s;
}
.copy-icon-btn:hover { color: var(--gold); background: var(--panel-hi); }
.copy-icon-btn .ci-text {
  max-width: 0; overflow: hidden; white-space: nowrap;
  font-size: 12.5px; font-weight: 600; opacity: 0;
  transition: max-width .25s ease, opacity .2s ease, margin-left .25s ease;
}
.copy-icon-btn:hover .ci-text { max-width: 70px; opacity: 1; margin-left: 6px; }
.discord-icon { display: inline-grid; place-items: center; opacity: .9; transition: opacity .15s, transform .15s; }
.discord-icon:hover { opacity: 1; transform: translateY(-1px); }

/* ============================================================ LEADERBOARD */
.board { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.board-head, .row {
  display: grid;
  grid-template-columns: 64px 1fr 130px 130px 92px 120px;
  align-items: center;
}
.board-head {
  padding: 13px 20px; border-bottom: 1px solid var(--line);
  color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600;
  background: var(--bg-2);
}
.board-head .col-r { text-align: right; }
.board-head .col-c { text-align: center; }

.row {
  padding: 13px 20px; border-bottom: 1px solid var(--line-soft);
  cursor: pointer; transition: background .14s, transform .16s ease, border-radius .16s; position: relative;
}
.row:last-child { border-bottom: 0; }
/* the whole highlighted plate slides left on hover (mctiers-style) */
.row:hover,
.row.top1:hover, .row.top2:hover, .row.top3:hover {
  background: var(--panel-hi); transform: translateX(-8px); border-radius: 10px;
}
.row:hover .rank-num { color: var(--text); }

.rank { display: flex; align-items: center; }
.rank-num { font-family: var(--font-head); font-weight: 700; font-size: 17px; color: var(--muted); font-variant-numeric: tabular-nums; }
.medal {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 15px; color: #1a1205;
  position: relative; overflow: hidden;
}
.medal > span { position: relative; z-index: 1; }
.medal.g { background: linear-gradient(145deg,#ffe27a,#e0a92e); box-shadow: 0 4px 14px -4px #e0a92e; }
.medal.s { background: linear-gradient(145deg,#eef2fb,#b3bccd); box-shadow: 0 4px 14px -4px #b3bccd; color:#1a1d24; }
.medal.b { background: linear-gradient(145deg,#f0a86a,#c0703a); box-shadow: 0 4px 14px -4px #c0703a; }
/* quick shine that sweeps across every few seconds */
.medal::after {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.9) 50%, transparent 65%);
  transform: translateX(-130%);
}
.medal.g::after { animation: medal-shine 3.2s ease-in-out infinite; }
.medal.s::after { animation: medal-shine 3.2s ease-in-out .35s infinite; }
.medal.b::after { animation: medal-shine 3.2s ease-in-out .7s infinite; }
@keyframes medal-shine {
  0% { transform: translateX(-130%); }
  12% { transform: translateX(130%); }
  100% { transform: translateX(130%); }
}

.player-cell { display: flex; align-items: center; gap: 14px; min-width: 0; }
.player-cell .head { width: 46px; height: 46px; }
.p-name { font-family: var(--font-brand); font-weight: 400; font-size: 16px; letter-spacing: .3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-sub { display: flex; align-items: center; gap: 8px; margin-top: 5px; }

.elo-cell { text-align: right; font-variant-numeric: tabular-nums; }
.elo-cell .elo-pill { font-size: 16px; padding: 4px 12px; }
.elo-val { font-family: var(--font-head); font-weight: 800; font-size: 17px; color: var(--ec, var(--text)); letter-spacing: -.2px; }
.elo-best { color: var(--muted); font-weight: 500; font-size: 15px; }
.wins-cell { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; color: var(--muted); }
.tier-cell { text-align: right; }

/* top-3 row tint */
.row.top1 { background: linear-gradient(90deg, rgba(255,207,77,.10), transparent 60%); }
.row.top2 { background: linear-gradient(90deg, rgba(200,210,225,.08), transparent 60%); }
.row.top3 { background: linear-gradient(90deg, rgba(200,120,60,.08), transparent 60%); }

/* loading / skeleton */
.skeleton { color: var(--faint); padding: 40px; text-align: center; }
.spin { width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================ PROFILE */
.back-btn {
  display: inline-flex; align-items: center; gap: 8px; margin: 26px 0 16px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--muted); font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: .15s;
}
.back-btn:hover { color: var(--text); border-color: var(--gold); background: var(--panel-hi); }

.prof-hero {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 28px; box-shadow: var(--card-shadow); position: relative;
}
.prof-head-wrap { position: relative; flex: none; }
.prof-head {
  width: 96px; height: 96px; border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 22px -10px rgba(0,0,0,.8);
}
.prof-id { min-width: 0; }
.prof-name { font-family: var(--font-brand); font-size: 26px; font-weight: 400; margin: 0; letter-spacing: .5px; }
.banned-name-triangle { color: var(--loss); font-size: .58em; vertical-align: .22em; cursor: help; filter: drop-shadow(0 0 5px rgba(255,93,114,.35)); }
.anti-cheat-badge {
  position: absolute; right: 22px; top: 22px; padding: 8px 11px; border-radius: 9px;
  color: var(--loss); background: rgba(255,92,122,.09); border: 1px solid rgba(255,92,122,.32);
  font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: .45px;
  white-space: nowrap; cursor: help;
}
.banned-position { font-size: 20px !important; letter-spacing: .25px; }
.si-rank.banned { color: var(--loss); font-size: 10px; font-weight: 800; }
.prof-elo { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.prof-elo b { font-family: var(--font-head); font-size: 30px; color: var(--hc, var(--gold)); letter-spacing: -.5px; }
.prof-elo .lbl { color: var(--faint); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.prof-tier-row { margin-top: 12px; }

/* tier progress bar in hero */
.tier-progress { margin-top: 14px; max-width: 360px; }
.tp-track { height: 7px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line-soft); }
.tp-fill { height: 100%; border-radius: 999px; background: var(--hc, var(--gold)); }
.tp-label { display: flex; justify-content: space-between; margin-top: 5px; font-size: 11.5px; color: var(--faint); }

/* stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; position: relative;
}
.stat-card .sc-label { color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat-card .sc-value { font-family: var(--font-head); font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat-card .sc-extra { color: var(--muted); font-size: 13px; margin-top: 2px; }
.sc-help { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--faint); color: var(--faint); font-size: 10px; display: inline-grid; place-items: center; cursor: help; }

.wl-ring { display:flex; align-items:center; gap:14px; margin-top:8px; }
.wl-w { color: var(--win); font-weight: 600; }
.wl-l { color: var(--loss); font-weight: 600; }
.ring { --p: 0; width: 56px; height: 56px; border-radius: 50%; display:grid; place-items:center; flex:none;
  background: conic-gradient(var(--win) calc(var(--p)*1%), var(--loss) 0); }
.ring i { width: 44px; height: 44px; border-radius: 50%; background: var(--panel); display:grid; place-items:center; font-style: normal; font-family: var(--font-head); font-weight: 700; font-size: 14px; }

/* matches */
.sec-title { font-family: var(--font-head); font-size: 18px; font-weight: 600; margin: 26px 0 12px; display:flex; align-items:center; gap:10px; }
.sec-title .count { color: var(--faint); font-size: 13px; font-weight: 500; }
.match {
  display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 16px;
  background: var(--panel); border: 1px solid var(--line); border-left-width: 3px;
  border-radius: var(--r); padding: 12px 16px; margin-bottom: 10px;
}
.match.win  { border-left-color: var(--win); }
.match.loss { border-left-color: var(--loss); }
.match.cancelled { border-left-color: var(--refund); }
.m-result { display: flex; flex-direction: column; gap: 3px; }
.m-badge { font-family: var(--font-head); font-weight: 700; font-size: 14px; }
.m-badge.win { color: var(--win); }
.m-badge.loss { color: var(--loss); }
.m-badge.cancelled { color: var(--refund); cursor: help; }
.m-kit { font-size: 12px; color: var(--muted); }
.m-id { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }

.m-teams { display: flex; align-items: center; gap: 14px; min-width: 0; }
.m-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; align-items: flex-start; }
.m-side.right { align-items: flex-end; }
.m-vs { color: var(--faint); font-family: var(--font-head); font-weight: 700; font-size: 12px; flex: none; }
.m-player { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; }
a.m-player { cursor: pointer; transition: color .12s; }
a.m-player:hover .m-pn { filter: brightness(1.18); }
.m-player.me .m-pn { color: var(--gold); }
.m-player.ally .m-pn { color: var(--win); }
.m-player.opp .m-pn { color: var(--loss); }
.m-player .head { width: 28px; height: 28px; flex: none; }
.m-pn { font-family: var(--font-brand); font-weight: 400; font-size: 13px; letter-spacing: .2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-delta { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 17px; font-family: var(--font-head); }
.m-delta.up { color: var(--win); }
.m-delta.down { color: var(--loss); }
.m-delta.refunded { color: var(--refund); font-style: italic; cursor: help; }
.m-when { margin-top: 3px; color: var(--faint); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }


.match-pages {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  margin: 14px 0 4px;
}
.match-page-btn {
  min-width: 34px; height: 32px; padding: 0 10px;
  border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted);
  font-family: var(--font-head); font-weight: 700; font-size: 12px;
  cursor: pointer; transition: .14s;
}
.match-page-btn:hover { color: var(--text); border-color: rgba(245,200,76,.42); }
.match-page-btn.active {
  color: var(--gold); border-color: rgba(245,200,76,.45);
  background: rgba(245,200,76,.08);
  cursor: default;
}
.match-page-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ==================================================================== INFO */
.info-hero { padding: 40px 0 10px; }
.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0 40px; }
.faq-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px 24px;
}
.faq-card h3 { font-family: var(--font-head); font-size: 17px; margin: 0 0 8px; display:flex; align-items:center; gap:10px; }
.faq-card p { color: var(--muted); margin: 0 0 10px; font-size: 14.5px; }
.faq-card .ico { width: 34px; height: 34px; border-radius: 9px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; flex: none; }
.faq-card.span2 { grid-column: 1 / -1; }
.ip-box { display:inline-flex; align-items:center; gap:10px; background: var(--bg); border:1px dashed var(--line); border-radius:10px; padding:10px 14px; margin-top:6px; }
.ip-box code { font-family: var(--font-head); font-weight:700; color: var(--gold); font-size:15px; }
.copy-btn { border:1px solid var(--line); background:var(--panel-hi); color:var(--muted); border-radius:7px; padding:5px 10px; font-size:12px; cursor:pointer; transition:.15s; }
.copy-btn:hover { color:var(--text); border-color: var(--gold); }

/* tier ladder table on info page */
.ladder { display: grid; gap: 8px; margin-top: 10px; }
.ladder-row { display:grid; grid-template-columns: 18px 130px 1fr; align-items:center; gap:14px; padding:9px 12px; background:var(--bg); border:1px solid var(--line-soft); border-radius:10px; }
.ladder-dot { width: 12px; height:12px; border-radius:50%; box-shadow:0 0 10px currentColor; }
.ladder-name { font-weight:700; font-family: var(--font-head); }
.ladder-range { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13.5px; }

/* ---------------------------------------------------------------- footer */
.site-foot { border-top: 1px solid var(--line-soft); margin-top: 56px; background: var(--bg-2); }
.foot-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 30px 20px 26px;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 28px; flex-wrap: wrap;
}
.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot-brand img { filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.foot-name { font-family: var(--font-brand); font-size: 15px; letter-spacing: .5px; }
.foot-tag { color: var(--faint); font-size: 12.5px; margin-top: 4px; }
.foot-center { display: flex; flex-direction: column; align-items: center; gap: 12px; flex: 1 1 280px; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; }
.foot-links a { color: var(--muted); font-size: 13.5px; font-weight: 500; transition: color .15s; }
.foot-links a:hover { color: var(--gold); }
.foot-meta { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.foot-made { font-size: 13.5px; color: var(--faint); font-weight: 500; }
.foot-made:hover .foot-author { text-decoration: underline; }
.foot-author { color: var(--gold); font-weight: 700; }
.foot-started { color: var(--faint); font-size: 12px; margin-top: 6px; }
.foot-started-center { text-align: center; width: 100%; margin-top: 2px; }
.foot-copy { color: var(--faint); font-size: 12px; margin-top: 6px; }
.foot-ip {
  background: var(--panel); border: 1px solid var(--line);
  color: var(--gold); font-family: var(--font-head); font-weight: 700; font-size: 13px;
  padding: 6px 12px; border-radius: 8px; cursor: pointer; transition: .15s;
}
.foot-ip:hover { border-color: var(--gold); background: var(--panel-hi); }
@media (max-width: 720px) {
  .foot-inner { flex-direction: column; gap: 18px; }
  .foot-meta { text-align: left; }
}

/* toast notification */
.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%) translateY(14px);
  background: #060810; border: 1px solid var(--line); color: var(--text);
  padding: 11px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 14px 32px -10px rgba(0,0,0,.8); z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Apex stretches across the full width of the open tiers panel */
.tiers-panel .ladder-row.apex { grid-column: 1 / -1; }

/* notice / not-found */
.notice { text-align:center; padding: 70px 20px; }
.notice h2 { font-family: var(--font-head); font-size: 22px; margin: 0 0 8px; }
.notice p { color: var(--muted); }

/* ============================================================== RESPONSIVE */
@media (max-width: 1040px) {
  .hdr-inner { padding: 0 20px; }
}
@media (max-width: 880px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .faq-grid { grid-template-columns: 1fr; }
  .board-head, .row { grid-template-columns: 54px 1fr 116px 78px; }
  .board-head .col-best, .col-best, .board-head .col-tier, .tier-cell { display: none; }
  .tiers-panel .ladder { grid-template-columns: repeat(2, 1fr); }
}
/* header wraps to two rows: brand + nav, then full-width search */
@media (max-width: 760px) {
  #site-header { position: static; }
  .hdr-inner {
    height: auto; padding: 10px 16px; gap: 10px 14px;
    grid-template-columns: auto 1fr; align-items: center;
  }
  .brand { grid-row: 1; grid-column: 1; }
  .hdr-nav { grid-row: 1; grid-column: 2; justify-self: end; }
  .search { grid-row: 2; grid-column: 1 / -1; width: 100%; max-width: none; }
  .head-row { padding-top: 18px; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 14px; }
  .server-card { width: 100%; }
  .page-title { font-size: 24px; }
  .page-sub { font-size: 14px; }
  .dist { padding: 16px 14px 12px; }
  .dist-bars { height: 120px; }
  .dist-axis { font-size: 10px; }
  .board { border-radius: 14px; }
  .board-head, .row { grid-template-columns: 44px 1fr 96px; padding-left: 14px; padding-right: 14px; }
  .board-head .col-wins, .wins-cell { display: none; }
  .player-cell { gap: 11px; }
  .player-cell .head { width: 40px; height: 40px; }
  .p-name { font-size: 15.5px; }
  /* no horizontal shift on touch devices (feels broken on tap) */
  .row:hover, .row.top1:hover, .row.top2:hover, .row.top3:hover { transform: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .match { grid-template-columns: 58px 1fr auto; gap: 10px; padding: 10px 12px; }
  /* stack the two teams vertically so ELO pills hug the nick and never
     collide with the VS divider or the rating-change column */
  .m-teams { flex-direction: column; align-items: stretch; gap: 7px; }
  .m-side, .m-side.right { align-items: flex-start; }
  .m-vs { align-self: flex-start; }
  .m-player { gap: 6px; }
  .prof-hero { padding: 18px; gap: 16px; }
  .prof-head { width: 76px; height: 76px; }
  .anti-cheat-badge { position: static; margin-left: auto; align-self: flex-start; }
  .prof-name { font-size: 22px; }
  .tiers-panel .ladder { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .brand-lines { display: none; }           /* logo only, frees room for nav */
  .nav-link { padding: 8px 11px; }
  .stat-grid { grid-template-columns: 1fr; }
  .m-elo-pill, .elo-pill { font-size: 12.5px; }
  .prof-elo b { font-size: 26px; }
  .prof-hero.banned { flex-wrap: wrap; }
  .anti-cheat-badge { width: 100%; text-align: center; margin: 0; }
}

/* calibration state */
.elo-pill.calibrating {
  color: var(--tc, #B8BCC6);
  background: color-mix(in srgb, var(--tc, #B8BCC6) 15%, #0a0d13);
  border-color: color-mix(in srgb, var(--tc, #B8BCC6) 30%, transparent);
}
.pill.calibrating {
  color: var(--faint);
  background: rgba(103,113,140,.10);
  border-color: rgba(103,113,140,.28);
  font-style: italic;
}
.pill.calibrating .tier-dot {
  background: var(--faint);
  box-shadow: 0 0 10px rgba(103,113,140,.55);
}
.tp-label.single {
  justify-content: flex-start;
  color: var(--faint);
  font-style: italic;
}
.m-delta.calib {
  color: var(--faint);
  font-style: italic;
}
