/* ==========================================================================
   Brawlhalla — frontend styles.
   Visual system aligned with r6data.com (Inter, #121212 surface theme,
   #17c3e6 primary, 8px radius, sticky underline navbar) and contextualised
   for Brawlhalla (warm gold→orange energy).
   ========================================================================== */
:root {
  --primary-color: #17c3e6;
  --primary-light: #5bd7f2;
  --primary-dark: #0e9fbd;
  --accent-color: #ff3d6a;
  --accent-2: #ff8a3d;

  --background-color: #0b0d10;
  --surface-color: #161619;
  --surface-2: #1c1c21;
  --surface-3: #232329;
  --card-bg: #161619;
  --input-bg: #0a0a0c;

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.70);
  --text-muted: rgba(255, 255, 255, 0.50);
  --divider-color: rgba(255, 255, 255, 0.08);
  --border-color: rgba(255, 255, 255, 0.10);
  --border-soft: rgba(255, 255, 255, 0.05);

  --success-color: #4caf50;
  --error-color: #f44336;
  --warning-color: #ff9800;
  --gold: #ffcb45;
  --silver: #c7d0dc;
  --bronze: #d0894f;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
  --radius: 8px;
  --radius-lg: 14px;
  --maxw: 1200px;
  --font-family: 'Inter', 'Roboto', 'Helvetica', Arial, sans-serif;
  --font-display: 'Archivo', 'Inter', system-ui, sans-serif;
  --primary-glow: rgba(23, 195, 230, 0.14);
  --nav-border: rgba(255, 255, 255, 0.08);
}

/* Arenyze-style display type for headings & brand */
h1, h2, .hero h1, .modern-brand, .section-head h2,
.stats-page .player-username, .stats-page .card-header h3,
.stats-page .stats-mode-banner .mode-name, .stats-page .ce-value,
.stat-card .value, .tab { letter-spacing: -0.01em; }
h1, h2, .hero h1, .section-head h2, .stats-page .player-username,
.stats-page .stats-mode-banner .mode-name { font-family: var(--font-display); font-weight: 900; }
.modern-brand { font-family: var(--font-display); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-family);
  background-color: var(--background-color);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  scrollbar-width: thin;
  /* sticky footer: header / main / footer stack, main grows to fill */
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; width: 100%; }
body > .site-header { flex-shrink: 0; }
::selection { background: rgba(23, 195, 230, 0.30); color: #fff; }
:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
body::-webkit-scrollbar { width: 8px; }
body::-webkit-scrollbar-track { background: var(--background-color); }
body::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }

a { color: var(--primary-color); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-light); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
h3 { font-size: 1.15rem; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--text-secondary); }
.small { font-size: .85rem; }
.mono { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.hidden { display: none !important; }
.material-icons, .material-symbols-outlined {
  font-family: 'Material Icons', 'Material Symbols Outlined';
  vertical-align: middle; line-height: 1; user-select: none;
}

/* ==========================================================================
   Navbar — r6data "modern-navbar" system, contextualised for Brawlhalla
   ========================================================================== */
:root {
  --nav-height: 68px;
  --nav-border: rgba(255, 255, 255, 0.08);
  --nav-item-hover: rgba(23, 195, 230, 0.10);
  --nav-item-active-bg: rgba(23, 195, 230, 0.14);
  --nav-text: #a1a1aa;
}
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: #0a0a0c;
  border-bottom: 1px solid var(--nav-border);
}
.modern-navbar { height: var(--nav-height); }
.modern-navbar-container {
  max-width: var(--maxw); margin: 0 auto; height: var(--nav-height);
  display: flex; align-items: center; gap: 18px; padding: 0 22px;
}
/* Brand */
.modern-brand {
  display: flex; align-items: center; gap: 10px; min-width: 150px;
  font-weight: 800; font-size: 1.35rem; letter-spacing: .2px; color: #fff;
}
.modern-brand-logo {
  width: 34px; height: 34px; border-radius: 9px; display: block;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.modern-brand-text {
  background: linear-gradient(135deg, #17c3e6, #5bd7f2);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
/* Desktop menu */
.modern-nav-menu { display: flex; gap: 2px; align-items: center; list-style: none; margin: 0; padding: 0; }
.modern-nav-item { position: relative; display: flex; align-items: center; }
.modern-nav-link {
  display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px 12px;
  color: var(--nav-text); font-weight: 500; font-size: .9rem; border-radius: 8px;
  border: 1px solid transparent; white-space: nowrap; cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.modern-nav-link:hover { background: var(--nav-item-hover); color: #fff; border-color: rgba(23, 195, 230, 0.2); }
.modern-nav-link.active { background: var(--nav-item-active-bg); color: #fafafa; font-weight: 600; border-color: rgba(23, 195, 230, 0.28); }
.modern-nav-link .material-icons { font-size: 18px; opacity: .86; }
/* Dropdown */
.modern-dropdown { cursor: pointer; }
.modern-dropdown::after { content: ""; position: absolute; top: 100%; left: 0; width: 100%; height: 18px; background: transparent; }
.modern-dropdown-content {
  position: absolute; top: calc(100% + 10px); left: 0; width: 260px;
  background: var(--surface-color); border: 1px solid var(--nav-border); border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42); padding: 8px;
  opacity: 0; transform: translateY(-10px); pointer-events: none; visibility: hidden;
  transition: all .2s cubic-bezier(.16, 1, .3, 1); z-index: 1001;
}
.modern-dropdown:hover .modern-dropdown-content { opacity: 1; transform: translateY(0); pointer-events: auto; visibility: visible; }
.modern-dropdown-category { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #71717a; padding: 12px 12px 4px; font-weight: 700; }
.modern-dropdown-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; color: var(--nav-text);
  border-radius: 7px; border: 1px solid transparent; font-size: .88rem;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.modern-dropdown-item:hover { background: var(--nav-item-hover); color: #fff; border-color: rgba(23, 195, 230, 0.18); }
.modern-dropdown-item .material-icons { color: var(--primary-color); opacity: .9; }
.modern-dropdown-divider { height: 1px; background: var(--nav-border); margin: 8px 0; }
/* Actions */
.modern-nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.modern-nav-cta {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px;
  border-radius: 999px; font-weight: 600; font-size: .88rem; color: #1a1205;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  box-shadow: 0 4px 14px rgba(23, 195, 230, .28);
}
.modern-nav-cta:hover { color: #1a1205; filter: brightness(1.06); }
.modern-nav-cta .material-icons { font-size: 18px; }
/* Mobile */
.modern-mobile-toggle {
  display: none; width: 38px; height: 38px; background: rgba(255, 255, 255, 0.04);
  border: 0; color: #fff; cursor: pointer; border-radius: 8px; align-items: center; justify-content: center;
}
.modern-mobile-toggle:hover { background: var(--nav-item-hover); }
.modern-mobile-menu {
  position: fixed; top: var(--nav-height); right: 0; width: min(360px, 100vw);
  height: calc(100vh - var(--nav-height)); background: var(--surface-color);
  border-left: 1px solid var(--nav-border); transform: translateX(100%);
  transition: transform .3s cubic-bezier(.16, 1, .3, 1); z-index: 999; overflow-y: auto;
  padding: 12px; padding-bottom: 80px;
}
.modern-mobile-menu.open { transform: translateX(0); box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5); }
.mobile-menu-head { display: flex; justify-content: flex-end; padding: 6px 6px 10px; }
.modern-mobile-link {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; color: var(--nav-text);
  border-radius: 8px; margin-bottom: 3px; font-weight: 500; border: 1px solid transparent;
}
.modern-mobile-link .material-icons { font-size: 20px; color: var(--primary-color); opacity: .9; }
.modern-mobile-link:hover { background: var(--nav-item-hover); color: #fff; border-color: rgba(23, 195, 230, 0.18); }
.modern-mobile-link.active { background: var(--nav-item-active-bg); color: #fafafa; }

/* brand mark reused by the footer */
.brand { display: flex; align-items: center; gap: 10px; color: var(--text-primary); font-weight: 800; letter-spacing: .2px; }
.brand:hover { color: var(--primary-color); }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px; display: block;
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius); font-weight: 600; font-size: .95rem;
  cursor: pointer; border: 1px solid var(--border-color); background: var(--surface-2);
  color: var(--text-primary); transition: all .2s; text-decoration: none;
}
.btn:hover { background: var(--surface-3); color: var(--text-primary); border-color: var(--border-color); }
.btn .material-icons { font-size: 19px; }
.btn-primary { background: var(--primary-color); color: #000; border: none; }
.btn-primary:hover { background: var(--primary-light); color: #000; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 13px; font-size: .85rem; }

/* ---- inputs ---- */
input, select {
  background: var(--input-bg); border: 1px solid var(--border-color); color: var(--text-primary);
  padding: 12px 15px; border-radius: var(--radius); font-size: 1rem; font-family: inherit; width: 100%;
}
input::placeholder { color: var(--text-muted); }
input:focus, select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--primary-glow); }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .88rem; color: var(--text-secondary); }

/* ---- search ---- */
.search-wrap { position: relative; }
.search-form { display: flex; gap: 10px; }
.search-form input { flex: 1; }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 900;
  background: var(--surface-color); border: 1px solid var(--border-color); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden; max-height: 360px; overflow-y: auto;
  text-align: left;
}
.search-results::-webkit-scrollbar { width: 8px; }
.search-results::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 4px; }
.search-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--divider-color); }
.search-item:last-child { border-bottom: none; }
.search-item:hover, .search-item.active { background: var(--surface-2); }
.search-item .s-av { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; font-weight: 800; font-size: .95rem; background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); color: #1a1205; }
.search-item .s-main { min-width: 0; flex: 1; }
.search-item .s-name { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item .s-sub { color: var(--text-muted); font-size: .76rem; display: flex; gap: 8px; align-items: center; margin-top: 1px; }
.search-item .s-pr { margin-left: auto; flex-shrink: 0; font-size: .74rem; font-weight: 700; color: var(--primary-color); background: rgba(23, 195, 230,.1); padding: 3px 9px; border-radius: 999px; }
.search-item.muted { color: var(--text-muted); justify-content: center; font-size: .88rem; padding: 16px; cursor: default; }

/* ---- layout / sections ---- */
.section { padding: 32px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ---- cards / panels ---- */
.panel, .card {
  background-color: var(--surface-color); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); border: 1px solid var(--border-soft); padding: 22px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.stat-card {
  background-color: var(--surface-color); border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft); box-shadow: var(--shadow-sm); padding: 18px;
  position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.stat-card:hover, .feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card .label { color: var(--text-secondary); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .value { font-size: 1.9rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-card .sub { color: var(--text-secondary); font-size: .82rem; margin-top: 3px; }
.stat-card.accent { border-color: rgba(23, 195, 230, 0.4); background: linear-gradient(160deg, var(--primary-glow), transparent 60%); }

.feature { padding: 22px; }
.feature .fi {
  width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(23, 195, 230, 0.12); color: var(--primary-color); font-size: 1.5rem; margin-bottom: 14px;
}
.feature h3 { font-size: 1.05rem; margin: 0 0 6px; }
.feature p { color: var(--text-secondary); font-size: .9rem; margin: 0; }

/* ---- badges / chips / pills ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border-color); color: var(--text-secondary);
}
.badge.gold { color: var(--gold); border-color: rgba(255, 203, 69, .4); background: rgba(255, 203, 69, .08); }
.badge.region { color: var(--primary-color); border-color: rgba(23, 195, 230, .35); background: rgba(23, 195, 230, .08); }
.pill { padding: 2px 9px; border-radius: 6px; font-size: .74rem; font-weight: 700; background: var(--surface-2); color: var(--text-secondary); }

/* ---- hero ---- */
.hero { padding: 64px 0 40px; text-align: center; position: relative; }
.hero::before {
  content: ""; position: absolute; top: -120px; left: 50%; transform: translateX(-50%);
  width: 720px; height: 360px; max-width: 100%;
  background: radial-gradient(circle, var(--primary-glow), transparent 70%); pointer-events: none; z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero .lead { color: var(--text-secondary); font-size: 1.12rem; max-width: 650px; margin: 0 auto 28px; }
.hero .search-wrap { max-width: 560px; margin: 0 auto; position: relative; z-index: 40; }
.hero .search-form { width: 100%; }
.tagline {
  display: inline-flex; align-items: center; gap: 7px; background: rgba(23, 195, 230, 0.12);
  color: var(--primary-color); padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .82rem; margin-bottom: 18px;
  border: 1px solid rgba(23, 195, 230, 0.25);
}

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface-color); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 520px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--divider-color); white-space: nowrap; }
th { color: var(--text-secondary); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); position: sticky; top: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank-cell { font-weight: 800; color: var(--primary-color); }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--surface-2); }

/* ---- profile header ---- */
.profile-hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.avatar {
  width: 80px; height: 80px; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); color: #1a1205;
  font-weight: 900; font-size: 2.1rem; flex-shrink: 0; box-shadow: 0 8px 20px var(--primary-glow);
}
.profile-meta h1 { margin: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---- tabs ---- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--divider-color); margin: 24px 0 22px; overflow-x: auto; }
.tab {
  padding: 12px 18px; color: var(--text-secondary); font-weight: 600; cursor: pointer;
  border: none; background: none; border-bottom: 2px solid transparent; white-space: nowrap; font-size: .95rem; transition: all .2s;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.tab-panel { display: none; animation: fadeIn .25s ease-out; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---- skeleton ---- */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 6px; color: transparent !important; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); transform: translateX(-100%); animation: shimmer 1.3s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skel-line { height: 14px; margin: 9px 0; }
.skel-card { height: 90px; }

/* ---- states ---- */
.empty-state, .error-state {
  text-align: center; padding: 46px 22px; color: var(--text-secondary);
  border: 1px dashed var(--border-color); border-radius: var(--radius-lg); background: var(--surface-color);
}
.empty-state .icon, .error-state .icon { font-size: 2.6rem; margin-bottom: 10px; display: block; }
.empty-state .icon.material-icons, .error-state .icon.material-icons { font-size: 2.8rem; color: var(--text-muted); }
.empty-state h3, .error-state h3 { color: var(--text-primary); margin: 2px 0 6px; }
.empty-state p, .error-state p { margin: 0 auto; max-width: 460px; }
.error-state { border-color: rgba(244, 67, 54, .4); }
.notice { background: rgba(23, 195, 230, 0.10); border: 1px solid rgba(23, 195, 230, .3); color: #f3d19a; padding: 13px 16px; border-radius: var(--radius); font-size: .9rem; }
.notice.info { background: rgba(66, 165, 245, .08); border-color: rgba(66, 165, 245, .3); color: #bfe0fb; }

/* ---- tooltip ---- */
.info-dot { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border-color); color: var(--text-secondary); font-size: .7rem; cursor: help; margin-left: 5px; }

/* ---- compare ---- */
.win { color: var(--success-color); font-weight: 800; }
.lose { color: var(--text-muted); }
.wcol { background: rgba(76, 175, 80, .08); }

/* ---- charts ---- */
.chart-box { position: relative; height: 280px; }
.chart-box canvas { max-width: 100%; }

/* ---- medals ---- */
.medal { font-weight: 800; }
.medal.g { color: var(--gold); } .medal.s { color: var(--silver); } .medal.b { color: var(--bronze); }

/* ---- code / embed ---- */
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: .88em; }
pre.embed-code { background: #0d0d0d; border: 1px solid var(--border-color); border-radius: var(--radius); padding: 14px; font-size: .82rem; color: #cdd6e2; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-all; }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--divider-color); margin-top: 56px; padding: 34px 0; color: var(--text-secondary); font-size: .88rem; background: var(--surface-color); }
.footer-grid { display: flex; justify-content: space-between; gap: 22px; flex-wrap: wrap; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer-links a { color: var(--text-secondary); }
.footer-links a:hover { color: var(--primary-color); }

/* ==========================================================================
   Polish / graphic details
   ========================================================================== */
/* accent bar under content-page titles */
main.container > h1:first-child { position: relative; padding-bottom: 14px; margin-bottom: 8px; }
main.container > h1:first-child::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 54px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}
/* hero title with subtle gradient */
.hero h1 {
  background: linear-gradient(180deg, #ffffff 40%, #ffd9a3 130%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
/* button press feedback */
.btn:active { transform: translateY(1px); }
/* nicer link underlines */
a { text-underline-offset: 3px; }
/* stat-card top accent line on hover */
.stat-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  opacity: 0; transition: opacity .2s;
}
.stat-card:hover::before { opacity: 1; }
.stat-card.accent::before { opacity: 1; }
/* panel subtle hover for interactive tables/cards */
.table-wrap { transition: border-color .2s; }
/* dividers between hero and content */
.section + .section { padding-top: 8px; }
/* material icon vertical fix inside buttons/nav */
.btn .material-icons, .nav-links a .material-icons { margin-top: -1px; }
/* smoother images/avatars */
.avatar, .s-av, .logo, .step-num { -webkit-font-smoothing: antialiased; }

/* ---- analysis: strength bars ---- */
.sb-row { display: flex; align-items: center; gap: 12px; margin: 11px 0; }
.sb-label { width: 46px; font-weight: 700; color: var(--text-secondary); font-size: .85rem; flex-shrink: 0; }
.sb-track { flex: 1; height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.sb-fill { height: 100%; background: linear-gradient(90deg, var(--primary-color), var(--accent-color)); border-radius: 999px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.sb-val { width: 66px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; flex-shrink: 0; }

/* ---- share tab: widget type toggle + preview ---- */
.widget-type-toggle { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.wt-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 8px;
  border: 1px solid var(--border-color); background: var(--surface-2); color: var(--text-secondary);
  cursor: pointer; font-weight: 600; font-size: .85rem; font-family: inherit; transition: all .2s;
}
.wt-btn .material-icons { font-size: 17px; }
.wt-btn:hover { color: var(--text-primary); border-color: var(--border-color); }
.wt-btn.active { background: rgba(23, 195, 230, 0.12); border-color: rgba(23, 195, 230, 0.4); color: var(--primary-color); }
.widget-preview {
  display: flex; justify-content: center; align-items: center;
  padding: 22px 18px; margin: 0 auto;
  background: var(--surface-2); border-radius: 14px; border: 1px solid var(--border-soft);
  background-image: radial-gradient(rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 14px 14px;
}
/* inline preview card (no iframe → never clipped/squeezed) */
.wcard {
  position: relative; width: 100%; max-width: 320px; overflow: hidden;
  background: linear-gradient(150deg, #1e222b, #161a21); border: 1px solid var(--border-color);
  border-radius: 16px; padding: 15px; box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}
.wcard::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--primary-color), var(--accent-color)); }
.wc-top { display: flex; align-items: center; gap: 12px; }
.wc-av { width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); color: #1a1205; font-weight: 900; font-size: 1.35rem; }
.wc-who { min-width: 0; flex: 1; }
.wc-nm { font-weight: 800; font-size: 1.05rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-rg { color: var(--text-muted); font-size: .8rem; margin-top: 2px; }
.wc-rg b { color: var(--primary-color); font-weight: 700; }
.wc-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 13px; }
.wc-st { background: var(--surface-3); border: 1px solid var(--border-color); border-radius: 11px; padding: 9px 4px; text-align: center; overflow: hidden; }
.wc-st b { display: block; font-size: .98rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-st span { color: var(--text-muted); font-size: .62rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.wc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--border-color); font-size: .72rem; color: var(--text-muted); }
.wc-logo { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text-primary); }
.wc-logo i { width: 16px; height: 16px; border-radius: 5px; background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); display: inline-grid; place-items: center; color: #1a1205; font-size: .6rem; font-weight: 900; font-style: normal; }

/* ---- home refinements ---- */
.feature .fi .material-icons { font-size: 26px; }
.tagline .material-icons { font-size: 16px; }
.hero-hint { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; }
.hero-hint .material-icons { font-size: 18px; color: var(--text-muted); }
.btn-ghost .material-icons { font-size: 18px; margin-left: -2px; }
.feature-grid { gap: 16px; }
/* consistent card hover on feature */
.feature { cursor: default; }
.feature:hover { border-color: rgba(23, 195, 230, 0.28); }

/* page enter transition (like r6data) — opacity only, no layout shift */
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
body > main { animation: pageIn .28s ease-out; }
/* tighter, more designed vertical rhythm */
.hero { padding: 60px 0 34px; }
.section:first-of-type { padding-top: 20px; }
.tagline .material-icons { margin-left: -2px; }
/* nav brand logo crisper */
.brand .logo { letter-spacing: 0; }
/* disabled buttons */
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---- leaderboard / list grid animation ----
   Opacity-only (no transform) so animating rows never overflow the container
   and never cause a transient scrollbar. */
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
#lbBody table, #topTracked table { animation: lbFade .28s ease-out; }
#lbBody tbody tr, #topTracked tbody tr { animation: lbFade .4s ease-out both; }
#lbBody tbody tr:nth-child(1),  #topTracked tbody tr:nth-child(1)  { animation-delay: .02s; }
#lbBody tbody tr:nth-child(2),  #topTracked tbody tr:nth-child(2)  { animation-delay: .05s; }
#lbBody tbody tr:nth-child(3),  #topTracked tbody tr:nth-child(3)  { animation-delay: .08s; }
#lbBody tbody tr:nth-child(4),  #topTracked tbody tr:nth-child(4)  { animation-delay: .11s; }
#lbBody tbody tr:nth-child(5),  #topTracked tbody tr:nth-child(5)  { animation-delay: .14s; }
#lbBody tbody tr:nth-child(6),  #topTracked tbody tr:nth-child(6)  { animation-delay: .17s; }
#lbBody tbody tr:nth-child(7),  #topTracked tbody tr:nth-child(7)  { animation-delay: .20s; }
#lbBody tbody tr:nth-child(8),  #topTracked tbody tr:nth-child(8)  { animation-delay: .23s; }
#lbBody tbody tr:nth-child(9),  #topTracked tbody tr:nth-child(9)  { animation-delay: .26s; }
#lbBody tbody tr:nth-child(10), #topTracked tbody tr:nth-child(10) { animation-delay: .29s; }
#lbBody tbody tr:nth-child(n+11) { animation-delay: .32s; }
/* leaderboard tab pills smoother */
#lbTabs .tab { border: 1px solid transparent; border-radius: 8px 8px 0 0; }
#lbTabs .tab.active { background: rgba(23, 195, 230, 0.08); }
@media (prefers-reduced-motion: reduce) {
  #lbBody tbody tr, #topTracked tbody tr, #lbBody table, #topTracked table { animation: none !important; }
}

/* ==========================================================================
   Final polish layer — micro-details
   ========================================================================== */
/* thin styled scrollbars for inner scroll areas */
.table-wrap::-webkit-scrollbar, .search-results::-webkit-scrollbar, .tabs::-webkit-scrollbar { height: 8px; width: 8px; }
.table-wrap::-webkit-scrollbar-thumb, .search-results::-webkit-scrollbar-thumb, .tabs::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 4px; }
.table-wrap, .search-results, .tabs { scrollbar-width: thin; scrollbar-color: #3a3a3a transparent; }

/* primary CTA glow (r6data-style) */
.btn-primary { box-shadow: 0 4px 14px rgba(23, 195, 230, .22); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(23, 195, 230, .32); }

/* clickable rows: left accent inset on hover */
tbody tr.clickable:hover { box-shadow: inset 3px 0 0 var(--primary-color); }

/* tabs with icons */
.tab { display: inline-flex; align-items: center; gap: 7px; border-radius: 8px 8px 0 0; }
.tab .material-icons { font-size: 18px; }
.tab.active { background: rgba(23, 195, 230, .08); }

/* colored medal dots (replace emoji) */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; }
.dot.g { background: var(--gold); } .dot.s { background: var(--silver); } .dot.b { background: var(--bronze); }

/* notices with leading icon */
.notice { display: flex; align-items: flex-start; gap: 10px; }
.notice .material-icons { font-size: 19px; flex-shrink: 0; margin-top: 1px; }

/* leaderboard pager */
#lbPager { display: flex; align-items: center; justify-content: center; gap: 14px; }
#lbPager .btn .material-icons { font-size: 18px; }

/* richer multi-column footer */
.site-footer { padding: 0; margin-top: 60px; }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding: 38px 16px 28px; max-width: var(--maxw); margin: 0 auto; }
.footer-brand .brand { font-size: 1.15rem; }
.footer-brand p { color: var(--text-secondary); font-size: .88rem; margin-top: 12px; max-width: 340px; line-height: 1.6; }
.footer-col h4 { font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 12px; font-weight: 700; }
.footer-col a { display: block; color: var(--text-secondary); font-size: .9rem; padding: 4px 0; }
.footer-col a:hover { color: var(--primary-color); text-decoration: none; }
.footer-bottom { border-top: 1px solid var(--divider-color); }
.footer-bottom > div { max-width: var(--maxw); margin: 0 auto; padding: 15px 16px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--text-muted); font-size: .8rem; }
@media (max-width: 760px) { .footer-top { grid-template-columns: 1fr; gap: 24px; } }

/* accent stat card: gradient value */
.stat-card.accent .value { background: linear-gradient(90deg, var(--primary-light), var(--accent-color)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* input hover affordance */
input:hover, select:hover { border-color: rgba(255, 255, 255, .18); }

/* profile hero panel flair */
#profileHero.panel { background: linear-gradient(160deg, rgba(23, 195, 230, .06), transparent 45%), var(--surface-color); }

/* ==========================================================================
   Player page — r6data "stats" layout, contextualised for Brawlhalla.
   Scoped to .stats-page so it never clashes with home/leaderboard cards.
   ========================================================================== */
.stats-page { padding-top: 24px; padding-bottom: 24px; }
.stats-shell { display: flex; flex-direction: column; }

/* cards reset (r6data uses .card + .card-content) */
.stats-page .card {
  padding: 0; background: var(--surface-color); border: 1px solid var(--nav-border);
  border-radius: 14px; overflow: hidden; box-shadow: none;
  transition: border-color .2s ease;
}
.stats-page .card:hover { border-color: rgba(255, 255, 255, 0.14); transform: none; box-shadow: none; }
.stats-page .card-content { padding: 20px 22px; }
.stats-page .card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.stats-page .card-header .material-icons { font-size: 20px; color: var(--primary-color); }
.stats-page .card-header h3 { font-size: 1.02rem; font-weight: 700; letter-spacing: .01em; margin: 0; }
.stats-page .card-header-hint { margin-left: auto; font-size: .78rem; color: var(--text-secondary); }
.stats-page .card-header-hint strong { color: var(--primary-color); }
.stats-page .card-divider { height: 1px; background: var(--nav-border); margin: 16px 0; }

/* ---- hero card ---- */
.stats-page .player-hero-card {
  margin-bottom: 22px;
  background: linear-gradient(135deg, rgba(23, 195, 230, 0.10), rgba(0, 0, 0, 0) 55%), var(--surface-color);
}
.stats-page .player-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 26px; flex-wrap: wrap; }
.stats-page .player-profile { display: flex; align-items: center; gap: 18px; min-width: 0; }
.stats-page .player-avatar-wrap { position: relative; flex-shrink: 0; }
.stats-page .player-avatar {
  width: 84px; height: 84px; border-radius: 18px; display: grid; place-items: center;
  border: 2px solid var(--primary-color); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  font-weight: 900; font-size: 2.2rem; color: #1a1205;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}
.stats-page .player-level-badge {
  position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%);
  background: var(--primary-color); color: #000; font-weight: 800; font-size: .72rem; line-height: 1;
  padding: 4px 10px; border-radius: 999px; border: 2px solid var(--surface-color); white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.stats-page .player-identity { min-width: 0; }
.stats-page .player-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stats-page .player-username { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0; font-weight: 800; letter-spacing: -0.01em; }
.stats-page .player-region-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: var(--text-secondary);
  font-size: .8rem; font-weight: 600;
}
.stats-page .player-region-chip .material-icons { font-size: 16px; color: var(--primary-color); }
.stats-page .player-identity-bottom { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin-top: 14px; }
.stats-page .player-headline-stats { display: flex; gap: 26px; flex-wrap: wrap; }
.stats-page .hstat { display: flex; flex-direction: column; gap: 2px; }
.stats-page .hstat-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .6px; color: var(--text-secondary); }
.stats-page .hstat-value { font-size: 1.3rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.stats-page .player-rank { display: flex; align-items: center; gap: 12px; padding-left: 28px; border-left: 1px solid rgba(255, 255, 255, 0.12); }
.stats-page .rank-emblem {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(23, 195, 230, 0.22), rgba(255, 107, 53, 0.12));
  border: 1px solid rgba(23, 195, 230, 0.35);
}
.stats-page .rank-emblem .material-icons { font-size: 30px; color: var(--primary-color); }
.stats-page .player-rank-name { font-weight: 600; font-size: .95rem; color: #fff; }
.stats-page .player-mmr { color: var(--text-secondary); font-size: .85rem; }
.stats-page .player-mmr strong { color: var(--primary-color); font-size: 1.15rem; }
.stats-page .player-hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.stats-page .refresh-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--nav-border); color: var(--text-primary);
}
.stats-page .refresh-btn:hover { background: var(--nav-item-hover); border-color: rgba(23, 195, 230, 0.28); color: var(--primary-color); }
.stats-page .hero-updated { font-size: .74rem; color: var(--text-muted); }

/* ---- inline main tabs ---- */
.stats-page .player-tabs-inline { padding: 8px 16px; border-top: 1px solid rgba(255, 255, 255, 0.07); background: rgba(0, 0, 0, 0.2); }
.stats-page .main-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.stats-page .main-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid transparent; background: none; color: var(--text-secondary); font-weight: 600;
  font-size: .92rem; font-family: inherit; cursor: pointer; transition: all .18s ease;
}
.stats-page .main-tab .material-icons { font-size: 19px; }
.stats-page .main-tab:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.stats-page .main-tab.active { color: var(--primary-color); background: var(--nav-item-active-bg); border-color: rgba(23, 195, 230, 0.28); }

/* ---- 2-col layout ---- */
.stats-page .stats-layout { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }
.stats-page .stats-sidebar { display: flex; flex-direction: column; gap: 18px; }
.stats-page .stats-sidebar .card:hover { border-color: var(--nav-border); }
.stats-page .stats-main { min-width: 0; animation: fadeIn .25s ease-out; }

/* ---- stats grid + cards ---- */
.stats-page .stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.stats-page .stats-grid.three { grid-template-columns: repeat(3, 1fr); }
.stats-page .stats-grid.stack { grid-template-columns: 1fr; }
.stats-page .stats-grid.charts { grid-template-columns: repeat(2, 1fr); }
.stats-page .stat-row { display: flex; gap: 22px; }
.stats-page .stat-row .stat-item { flex: 1; }
.stats-page .stat-item .stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-secondary); margin-bottom: 6px; }
.stats-page .stat-item .stat-value, .stats-page .stat-value.big { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stats-page .stat-value.big { font-size: 1.9rem; }
.stats-page .stat-value.wins { color: var(--gold); }
.stats-page .stat-value.losses { color: var(--text-secondary); }
.stats-page .stat-value.accent { color: var(--primary-color); }

/* ---- mode banner ---- */
.stats-page .stats-mode-banner { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; }
.stats-page .stats-mode-banner .mode-name { font-weight: 800; font-size: 1.05rem; }
.stats-page .stats-mode-banner .mode-season { font-size: .8rem; color: var(--text-secondary); background: var(--surface-2); padding: 3px 10px; border-radius: 999px; }

/* ---- rank info grid ---- */
.stats-page .rank-info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 22px; }
.stats-page .rank-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-secondary); margin-bottom: 5px; }
.stats-page .rank-value { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stats-page .rank-value.accent { color: var(--primary-color); }

/* ---- charts ---- */
.stats-page .chart-card .chart-container {
  position: relative; height: 320px; margin-top: 6px; padding: 16px;
  background: rgba(0, 0, 0, 0.2); border: 1px solid var(--nav-border); border-radius: 10px;
}
.stats-page .chart-container.sm { height: 250px; }
.stats-page .chart-container canvas { max-width: 100%; }

/* ---- sidebar bits ---- */
.stats-page .career-earn { text-align: left; }
.stats-page .career-earn .ce-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-secondary); }
.stats-page .career-earn .ce-value {
  font-size: 1.9rem; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, var(--primary-light), var(--accent-color));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stats-page .medal-breakdown { display: flex; justify-content: space-between; gap: 8px; }
.stats-page .mb-item { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; }
.stats-page .mb-item .dot { width: 11px; height: 11px; }
.stats-page .mb-item .mb-n { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 3px; }
.stats-page .mb-item .mb-l { font-size: .68rem; text-transform: uppercase; letter-spacing: .4px; color: var(--text-secondary); }
.stats-page .mini-grid { display: flex; justify-content: space-between; gap: 10px; }
.stats-page .mini-grid .stat-item { text-align: left; }
.stats-page .mini-grid .stat-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .4px; color: var(--text-secondary); }
.stats-page .mini-grid .stat-value { font-size: 1.15rem; font-weight: 800; margin-top: 2px; }
.stats-page .meta-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: .9rem; }
.stats-page .meta-table td { padding: 8px 0; border-bottom: 1px solid var(--nav-border); white-space: nowrap; }
.stats-page .meta-table tr:last-child td { border-bottom: none; }
.stats-page .meta-table td.num { text-align: right; font-weight: 700; }
.stats-page .social-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.stats-page .social-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border-color); color: var(--text-secondary);
  font-size: .82rem; font-weight: 600;
}
.stats-page .social-link:hover { color: #fff; border-color: rgba(23, 195, 230, 0.3); }
.stats-page .social-link .material-icons { font-size: 16px; }
.stats-page .social-link.twitch:hover { color: #a970ff; }

/* ---- strength bars (sidebar + analysis) ---- */
.stats-page .sb-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.stats-page .sb-label { width: 40px; font-weight: 700; color: var(--text-secondary); font-size: .85rem; flex-shrink: 0; }
.stats-page .sb-track { flex: 1; height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.stats-page .sb-fill { height: 100%; background: linear-gradient(90deg, var(--primary-color), var(--accent-color)); border-radius: 999px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.stats-page .sb-val { width: 58px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; flex-shrink: 0; }

/* ---- empty states inside cards ---- */
.stats-page .empty-state { border: none; background: none; padding: 30px 18px; }
.stats-page .card .empty-state h3 { color: var(--text-primary); }

/* ---- pill ---- */
.stats-page .pill { padding: 2px 9px; border-radius: 6px; font-size: .74rem; font-weight: 700; background: var(--surface-2); color: var(--text-secondary); }

/* ==========================================================================
   Arenyze component alignment — brings home / leaderboards / compare / widgets
   components up to the arenyze design language (flat surfaces, thin borders,
   Archivo display, orange-soft icon tiles, pill CTAs, crisp chips & tables).
   Scoped to NOT touch .stats-page (player page already matches).
   ========================================================================== */
:root { --accent-soft: rgba(23, 195, 230, 0.12); --line: rgba(255, 255, 255, 0.08); --bg-2: #0a0a0c; }

/* ---- section heads: eyebrow + display heading ---- */
.section-head h2, .hero h1 { font-family: var(--font-display); font-weight: 900; letter-spacing: -0.02em; }
.section-head { align-items: flex-end; }
.section-eyebrow, .tagline {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .12em; font-weight: 800;
}

/* ---- hero polish (search-first, arenyze type) ---- */
.hero h1 { -webkit-text-fill-color: currentColor; background: none; color: var(--text-primary); }
.hero h1 mark { background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); color: #1a1205; padding: 0 .14em; border-radius: 6px; -webkit-text-fill-color: #1a1205; }
.hero::before { background: radial-gradient(circle, rgba(23, 195, 230,.20), transparent 70%); }
.tagline { border-color: rgba(23, 195, 230,.28); }

/* ---- panels / cards: flat, thin border, orange hover ---- */
.panel:not(.stats-page .panel), .card:not(.stats-page .card) {
  background: var(--surface-color); border: 1px solid var(--line); border-radius: 16px; box-shadow: none;
  transition: transform .2s ease, border-color .2s ease;
}
.panel:hover, .card:hover { border-color: rgba(23, 195, 230, 0.3); box-shadow: none; }

/* ---- feature cards -> arenyze .tn-feature ---- */
.feature { background: var(--surface-color); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: none; }
.feature:hover { transform: translateY(-4px); border-color: rgba(23, 195, 230, 0.3); box-shadow: none; }
.feature .fi { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--primary-color); box-shadow: none; }
.feature h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.08rem; }

/* ---- buttons -> simple, high-contrast, readable in every state ---- */
.btn { border-radius: 10px; font-weight: 700; border: 1px solid var(--border-color);
  background: var(--surface-2); color: var(--text-primary); }
.btn:hover { background: var(--surface-3); color: var(--text-primary); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
/* Solid primary: white text on cyan — readable at rest, hover, active and focus. */
.btn-primary,
.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus { background: var(--primary-color); color: #04222b; border: none;
  box-shadow: 0 4px 14px rgba(23, 195, 230, .22); filter: none; }
.btn-primary:hover { background: var(--primary-light); }
.btn-ghost,
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }
/* Kill the mobile tap-flash that washed out button labels. */
.btn, .plat-btn, .lb-chip, .modern-nav-link, .modern-mobile-toggle { -webkit-tap-highlight-color: transparent; }

/* ---- inputs ---- */
input, select, textarea { background: var(--bg-2); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(23, 195, 230,.16); }
.search-results { border-radius: 12px; border-color: var(--line); }

/* ---- stat cards (home/compare) ---- */
.stat-card:not(.stats-page .stat-card) { border-radius: 16px; border: 1px solid var(--line); box-shadow: none; }
.stat-card:not(.stats-page .stat-card):hover { transform: translateY(-3px); border-color: rgba(23, 195, 230,.3); box-shadow: none; }
.stat-card .value { font-family: var(--font-family); }

/* ---- badges / pills / chips ---- */
.badge { border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 600; }
.badge.region { background: var(--accent-soft); border-color: rgba(23, 195, 230,.35); color: var(--primary-color); }
.pill:not(.stats-page .pill) { border-radius: 7px; background: var(--surface-2); }

/* ---- tables -> arenyze card ---- */
.table-wrap { border-radius: 16px; border: 1px solid var(--line); background: var(--surface-color); }
table { font-size: .92rem; }
th { background: var(--bg-2); color: var(--text-muted); font-size: .72rem; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
td, th { border-bottom: 1px solid var(--line); }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.rank-cell, td.num.rank-cell { color: var(--primary-color); font-weight: 800; }

/* ---- leaderboard tabs -> arenyze subnav (underline) ---- */
#lbTabs.tabs, .tabs { border-bottom: 1px solid var(--line); gap: 4px; }
#lbTabs .tab { border-radius: 8px 8px 0 0; border: 1px solid transparent; border-bottom: 2px solid transparent; color: var(--text-secondary); font-weight: 600; background: none; }
#lbTabs .tab:hover { color: #fff; background: rgba(255,255,255,.04); }
#lbTabs .tab.active { color: var(--primary-color); background: none; border-bottom-color: var(--primary-color); }

/* ---- notices ---- */
.notice { border-radius: 12px; }

/* ---- footer chrome match ---- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); }

/* ========================================================================== 
   Player page visual refresh — denser R6Data-style dashboard cards
   ========================================================================== */
.stats-page.container {
  max-width: 1500px;
  padding-top: 26px;
  padding-bottom: 42px;
}
.stats-page .stats-shell { gap: 0; }
.stats-page .player-hero-card {
  margin-bottom: 18px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(23, 195, 230, 0.14), rgba(255, 107, 53, 0.05) 42%, rgba(255, 255, 255, 0.015) 100%),
    var(--surface-color);
}
.stats-page .player-hero-top { min-height: 150px; padding: 24px; align-items: stretch; }
.stats-page .player-profile { flex: 1 1 620px; align-items: center; }
.stats-page .player-avatar {
  width: 82px;
  height: 82px;
  border-radius: 16px;
  border: 1px solid rgba(23, 195, 230, .62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 12px 30px rgba(0,0,0,.32);
}
.stats-page .player-identity { flex: 1; }
.stats-page .player-name-row { min-height: 32px; }
.stats-page .player-username { max-width: 100%; overflow-wrap: anywhere; }
.stats-page .player-region-chip {
  height: 28px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.24);
}
.stats-page .player-identity-bottom { align-items: stretch; gap: 18px; }
.stats-page .player-headline-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(108px, 1fr));
  gap: 10px;
  flex: 1 1 520px;
}
.stats-page .hstat {
  min-height: 72px;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 8px;
  background: rgba(0,0,0,.22);
}
.stats-page .hstat-value { font-size: 1.22rem; }
.stats-page .player-rank {
  min-width: 238px;
  padding: 10px 0 10px 18px;
  align-self: stretch;
}
.stats-page .rank-emblem { width: 48px; height: 48px; border-radius: 10px; }
.stats-page .player-hero-right { justify-content: space-between; padding: 2px 0; }
.stats-page .refresh-btn { border-radius: 8px; }
.stats-page .player-tabs-inline { padding: 0 12px 10px; border-top: 0; background: transparent; }
.stats-page .main-tabs {
  padding: 6px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 10px;
  background: rgba(0,0,0,.22);
}
.stats-page .main-tab { min-height: 38px; border-radius: 8px; padding: 8px 13px; }
.stats-page .main-tab.active { background: rgba(23, 195, 230,.13); }

.stats-page .stats-layout {
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 18px;
}
.stats-page .stats-sidebar { gap: 14px; }
.stats-page .stats-main { display: grid; gap: 16px; }
.stats-page .card {
  border-radius: 10px;
  border-color: rgba(255,255,255,.075);
  background: linear-gradient(180deg, rgba(255,255,255,.018), rgba(0,0,0,.06)), var(--surface-color);
}
.stats-page .card-content { padding: 18px; }
.stats-page .card-header { min-height: 28px; margin-bottom: 14px; }
.stats-page .card-header h3 { font-size: .96rem; }
.stats-page .card-header .material-icons { font-size: 19px; }
.stats-page .card-divider { margin: 14px 0; }

.stats-page .stats-grid { gap: 16px; align-items: stretch; }
.stats-page .stats-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-page .stats-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-page .stats-grid > .card,
.stats-page .stats-grid > .stats-card { height: 100%; min-width: 0; }
.stats-page .stats-card .card-content,
.stats-page .stats-grid > .card > .card-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.stats-page .stats-card { min-height: 226px; }
.stats-page .stats-grid.three .stats-card { min-height: 156px; }
.stats-page .stat-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.stats-page .stat-row .stat-item,
.stats-page .rank-info-item {
  min-height: 74px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 8px;
  background: rgba(0,0,0,.18);
}
.stats-page .stat-item .stat-label,
.stats-page .rank-label { font-size: .68rem; letter-spacing: .06em; }
.stats-page .stat-item .stat-value,
.stats-page .rank-value { overflow-wrap: anywhere; }
.stats-page .stat-item .stat-value,
.stats-page .stat-value.big { font-size: 1.48rem; }
.stats-page .stat-value.big { line-height: 1.08; }
.stats-page .rank-info-grid { gap: 10px; }
.stats-page .rank-value { font-size: 1.26rem; }
.stats-page .medal-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.stats-page .mb-item {
  min-height: 70px;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
  background: rgba(0,0,0,.16);
}
.stats-page .mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.stats-page .mini-grid .stat-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
  background: rgba(0,0,0,.16);
}
.stats-page .career-earn {
  padding: 12px;
  border: 1px solid rgba(23, 195, 230,.16);
  border-radius: 8px;
  background: rgba(23, 195, 230,.07);
}
.stats-page .career-earn .ce-value { font-size: 1.68rem; }
.stats-page .sb-row { min-height: 34px; }
.stats-page .sb-track { height: 10px; }
.stats-page .meta-table td { padding: 9px 0; }
.stats-page .chart-card .chart-container { height: 300px; border-radius: 8px; }
.stats-page .chart-container.sm { height: 238px; }
.stats-page .stats-mode-banner { margin: 4px 0 0; }
.stats-page .stats-mode-banner + .stats-grid { margin-top: 0; }
.stats-page .player-section-card { margin-top: 16px; }
.stats-page .notice.info { border-radius: 10px; }

/* Player page final polish — compact stats, medals, charts */
.stats-page .player-headline-stats {
  grid-template-columns: repeat(4, minmax(92px, 124px));
  justify-content: start;
  flex: 0 1 auto;
}
.stats-page .hstat {
  min-height: 66px;
  padding: 9px 10px;
}
.stats-page .hstat-label { font-size: .66rem; }
.stats-page .hstat-value { font-size: 1.12rem; line-height: 1.05; }
.stats-page .stats-card { min-height: 206px; }
.stats-page .stat-row .stat-item,
.stats-page .rank-info-item {
  min-height: 66px;
  padding: 10px 11px;
}
.stats-page .stat-item .stat-value,
.stats-page .stat-value.big { font-size: 1.36rem; }
.stats-page .rank-value { font-size: 1.16rem; }
.stats-page .medal-breakdown {
  gap: 10px;
  align-items: stretch;
}
.stats-page .mb-item {
  min-width: 0;
  min-height: 76px;
  padding: 11px 8px 10px;
  justify-content: center;
  overflow: hidden;
}
.stats-page .mb-item .dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  margin: 0 0 5px;
  box-shadow: 0 0 0 3px rgba(255,255,255,.035), 0 0 14px currentColor;
}
.stats-page .mb-item .mb-n { margin-top: 0; line-height: 1.05; }
.stats-page .mb-item .mb-l { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.stats-page .mini-grid .stat-item { padding: 9px 10px; }
.stats-page .career-earn .ce-value { font-size: 1.56rem; }
.stats-page .chart-card .chart-container {
  height: 318px;
  padding: 14px 12px 10px;
  border-color: rgba(23, 195, 230,.10);
  background:
    linear-gradient(180deg, rgba(23, 195, 230,.055), rgba(0,0,0,.08)),
    radial-gradient(circle at 20% 0%, rgba(255,186,82,.08), transparent 34%),
    rgba(0,0,0,.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), inset 0 -22px 52px rgba(0,0,0,.12);
  overflow: hidden;
}
.stats-page .chart-container.sm { height: 260px; }
.stats-page .chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}
.stats-page .stats-mode-banner {
  padding: 0 2px;
}

/* Widgets page + player share polish */
@media (min-width: 901px) {
  .modern-navbar-container { position: relative; }
  .modern-nav-menu {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    justify-content: center;
  }
  .modern-brand,
  .modern-nav-actions { position: relative; z-index: 2; }
}
.widgets-page { padding-top: 28px; padding-bottom: 46px; max-width: 1320px; }
.widgets-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 22px 0 8px;
}
.widgets-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--primary-color);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.widgets-eyebrow .material-icons { font-size: 18px; }
.widgets-hero h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 3rem); }
.widgets-hero p { max-width: 620px; margin: 8px 0 0; color: var(--text-secondary); font-size: .98rem; }
.widget-builder-shell {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.widget-builder-panel,
.widget-preview-card,
.widget-code-card,
.widget-empty-state {
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.018), rgba(0,0,0,.06)), var(--surface-color);
  overflow: hidden;
}
.widget-builder-panel { padding: 18px; }
.wb-head,
.widget-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.wb-head { justify-content: flex-start; }
.wb-head > .material-icons,
.widget-card-head .material-icons {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--primary-color);
  background: rgba(23, 195, 230,.11);
}
.wb-head b,
.widget-card-head b { display: block; color: #fff; font-weight: 800; }
.wb-head span:not(.material-icons) { display: block; color: var(--text-muted); font-size: .8rem; }
.widget-card-head > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.widget-card-head > a,
.widget-card-head > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: .8rem;
  font-weight: 700;
}
.widget-card-head > a .material-icons { width: auto; height: auto; background: none; font-size: 17px; }
.widget-form { display: grid; gap: 13px; }
.widget-field { display: grid; gap: 7px; color: var(--text-secondary); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.widget-field input,
.widget-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-primary);
  padding: 10px 11px;
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
}
.widget-field input:focus,
.widget-field select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(23, 195, 230,.13); }
.widget-generate { width: 100%; justify-content: center; margin-top: 2px; }
.widget-type-list { display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.075); }
.widget-type-list div {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
  background: rgba(0,0,0,.14);
}
.widget-type-list .material-icons { color: var(--primary-color); font-size: 21px; }
.widget-type-list b,
.widget-type-list small { display: block; }
.widget-type-list small { margin-top: 2px; color: var(--text-muted); line-height: 1.35; }
.widget-output { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, .86fr); gap: 18px; }
.widget-empty-state {
  min-height: 362px;
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 34px;
  text-align: center;
  color: var(--text-secondary);
}
.widget-empty-state > .material-icons {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(23, 195, 230,.11);
  color: var(--primary-color);
  font-size: 32px;
}
.widget-empty-state h2 { margin: 8px 0 0; }
.widget-empty-state p { max-width: 420px; margin: 0; }
.widget-empty-state.error > .material-icons { color: var(--error-color); background: rgba(244,67,54,.12); }
.widget-preview-card,
.widget-code-card { padding: 18px; }
.widget-live-frame,
.widget-preview {
  min-height: 248px;
  border: 1px solid rgba(23, 195, 230,.10);
  border-radius: 10px;
  background:
    radial-gradient(circle at 20% 0%, rgba(23, 195, 230,.12), transparent 32%),
    radial-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    rgba(0,0,0,.22);
  background-size: auto, 15px 15px, auto;
}
.widget-live-frame {
  display: grid;
  place-items: center;
  padding: 18px;
}
.widget-live-frame iframe {
  width: min(100%, 420px);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background: #111;
  box-shadow: 0 18px 42px rgba(0,0,0,.28);
}
.widget-preview-card > p { margin: 12px 2px 0; color: var(--text-muted); font-size: .84rem; }
.widget-code-card .embed-code { max-height: 210px; overflow: auto; }
.widget-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.widget-actions .btn { display: inline-flex; align-items: center; gap: 7px; }
.widget-embed-tips { display: grid; gap: 8px; margin-top: 16px; }
.widget-embed-tips div {
  display: grid;
  grid-template-columns: 28px minmax(0,1fr);
  gap: 8px;
  align-items: start;
  color: var(--text-secondary);
  font-size: .82rem;
}
.widget-embed-tips .material-icons { color: var(--primary-color); font-size: 20px; }
.widget-share-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr); gap: 16px; align-items: stretch; }
.widget-share-layout .card { min-width: 0; }
.widget-share-layout .card-content { height: 100%; }
.widget-share-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.widget-share-head .card-header { margin-bottom: 0; }
.widget-share-head .widget-type-toggle { margin-bottom: 0; justify-content: flex-end; }
.widget-share-layout .widget-preview { min-height: 276px; }
.widget-share-layout .wcard { max-width: 360px; }

/* Widget spacing refinements */
.widget-output,
.widget-share-layout {
  grid-template-columns: 1fr;
  max-width: 900px;
}
.widget-output { align-content: start; }
.widget-share-layout { align-items: start; }
.widget-preview-card,
.widget-code-card,
.widget-share-layout .card { width: 100%; }
.widget-code-card,
.widget-share-code { margin-top: 0; }
.widget-type-list { gap: 10px; }
.widget-type-list div {
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 3px 10px;
  padding: 12px;
  min-height: 72px;
  align-items: center;
}
.widget-type-list .material-icons {
  grid-row: 1 / 3;
  grid-column: 1;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(23, 195, 230,.10);
}
.widget-type-list b {
  grid-column: 2;
  align-self: end;
  line-height: 1.12;
}
.widget-type-list small {
  grid-column: 2;
  align-self: start;
  margin-top: 0;
  font-size: .78rem;
}
.widget-share-code .card-content,
.widget-code-card { display: grid; gap: 0; }
.widget-share-code .card-header,
.widget-code-card .widget-card-head { margin-bottom: 10px; }
.widget-share-code p.muted,
.widget-code-card p.muted { margin: 0 0 12px; }
.widget-share-code .embed-code,
.widget-code-card .embed-code {
  margin: 0;
  padding: 15px;
  border-radius: 9px;
  line-height: 1.5;
  background: #0a0a0c;
  border-color: rgba(255,255,255,.10);
}
.widget-share-code .widget-actions,
.widget-code-card .widget-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.075);
  gap: 10px;
}
.widget-share-code .widget-embed-tips,
.widget-code-card .widget-embed-tips {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.widget-share-head {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.065);
}
.widget-share-head .widget-type-toggle { gap: 8px; }

/* ===========================================================================
   THE FINALS — tracker-specific components
   =========================================================================== */
.page-head { margin-bottom: 22px; }
.page-head h1 { font-family: var(--font-display); font-weight: 900; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; color: var(--text-secondary); margin-bottom: 10px; }
.back-link .material-icons { font-size: 18px; }
.badge-live { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: .62rem; font-weight: 800; letter-spacing: .06em; vertical-align: middle;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); color: #04222b; }

/* Catalog (leaderboards.html) */
.lb-group { margin-bottom: 18px; }
.lb-group-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.lb-group-head h2 { font-family: var(--font-display); font-size: 1.25rem; }
.lb-chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.lb-chip { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2);
  border: 1px solid var(--border-color); color: var(--text-primary); font-weight: 600; font-size: .9rem; transition: .16s; }
.lb-chip:hover { border-color: var(--primary-color); background: var(--surface-3); transform: translateY(-1px); }
.lb-chip .material-icons { font-size: 20px; color: var(--primary-color); }
.lb-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Leaderboard controls + table */
.lb-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.lb-search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.lb-search .material-icons { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 20px; }
.lb-search input { width: 100%; padding: 11px 14px 11px 40px; border-radius: var(--radius); background: var(--input-bg); border: 1px solid var(--border-color); color: var(--text-primary); font-size: .92rem; }
.lb-search input:focus { border-color: var(--primary-color); outline: none; }
.lb-platforms { display: flex; gap: 6px; }
.plat-btn { padding: 8px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border-color); color: var(--text-secondary); font-weight: 600; font-size: .84rem; cursor: pointer; }
.plat-btn.active, .plat-btn:hover { border-color: var(--primary-color); color: var(--text-primary); }
.lb-table td, .lb-table th { vertical-align: middle; }
.lb-table .p-name { font-weight: 600; }
.lb-table .chg { width: 54px; }
.chg .up, .chg .down, .chg .flat { display: inline-flex; align-items: center; gap: 1px; font-size: .78rem; font-weight: 700; }
.chg .up { color: var(--success-color); } .chg .down { color: var(--error-color); } .chg .flat { color: var(--text-muted); }
.chg .material-icons { font-size: 14px; }
td.strong, .num.strong { font-weight: 800; color: var(--primary-light); }

/* Pager */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.pager-info { color: var(--text-secondary); font-size: .88rem; }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ph-avatar { width: 68px; height: 68px; border-radius: 16px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 900; font-size: 1.8rem;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); color: #04222b; flex-shrink: 0; }
.ph-main { flex: 1; min-width: 200px; }
.ph-main h1 { font-family: var(--font-display); font-size: 1.6rem; }
.club-tag { color: var(--accent-color); font-size: 1rem; }
.ph-sub { font-size: .85rem; margin: 2px 0 8px; }
.ph-handles { display: flex; flex-wrap: wrap; gap: 8px; }
.handle { font-size: .78rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-color); color: var(--text-secondary); }
.handle b { color: var(--primary-color); margin-right: 3px; }
.ph-actions { display: flex; gap: 8px; }
.stat-row { margin: 20px 0 8px; }
.stat-tile { text-align: center; padding: 18px 12px; }
.st-ic { display: grid; place-items: center; min-height: 34px; }
.st-ic .material-icons { font-size: 24px; color: var(--primary-color); }
.st-ic .rank-ic { width: 34px; height: 34px; display: block; margin: 0 auto; }
.st-v { font-family: var(--font-display); font-weight: 900; font-size: 1.5rem; margin: 6px 0 2px; }
.st-l { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }

/* Sparkline */
.spark-wrap { position: relative; }
.spark { width: 100%; height: 160px; display: block; }
.spark-labels { display: flex; justify-content: space-between; font-size: .72rem; color: var(--text-muted); margin-top: 4px; }

/* Compare */
.compare-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 20px; }
.cf-field { position: relative; flex: 1; min-width: 200px; }
.cf-field input { width: 100%; padding: 12px 14px; border-radius: var(--radius); background: var(--input-bg); border: 1px solid var(--border-color); color: var(--text-primary); }
.cf-field input:focus { border-color: var(--primary-color); outline: none; }
.cf-field .search-results { top: calc(100% + 4px); }
.cf-vs { font-family: var(--font-display); font-weight: 900; color: var(--text-muted); }
.compare-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; margin-bottom: 16px; }
.compare-player { display: flex; align-items: center; gap: 12px; }
.compare-player .ph-avatar { width: 48px; height: 48px; font-size: 1.2rem; border-radius: 12px; }
.compare-mid { width: 2px; background: var(--border-color); }
.compare-table { width: 100%; }
.compare-table th { text-align: center; color: var(--text-secondary); font-weight: 600; width: 40%; }
.compare-table td { text-align: center; font-weight: 700; font-size: 1.05rem; }
.compare-table td.win { color: var(--primary-light); }
.compare-table td.win::after { content: ' ★'; color: var(--accent-color); font-size: .7em; }

/* Widget builder */
.widget-builder { max-width: 720px; }
.wb-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.wb-controls label { font-weight: 600; color: var(--text-secondary); }
.wb-controls .cf-field { max-width: 360px; }
.wb-preview { min-height: 60px; margin-bottom: 16px; }
.wb-code textarea { width: 100%; padding: 12px; border-radius: var(--radius); background: var(--input-bg); border: 1px solid var(--border-color); color: var(--text-primary); font-family: monospace; font-size: .82rem; resize: vertical; }
.wb-code label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--text-secondary); }

/* Prose (about/privacy) */
.prose { max-width: 780px; }
.prose h1 { font-family: var(--font-display); font-weight: 900; margin-bottom: 14px; }
.prose h2 { font-family: var(--font-display); margin: 26px 0 10px; font-size: 1.2rem; }
.prose p, .prose li { color: var(--text-secondary); line-height: 1.7; }
.prose ul { padding-left: 20px; margin: 10px 0; }
.prose li { margin: 6px 0; }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; font-size: .88em; color: var(--primary-light); }

/* Rank icons */
.rank-ic { vertical-align: middle; object-fit: contain; }
/* rank emblem used as the search-result avatar */
.search-item .s-av-rank { background: none !important; border: none; display: grid; place-items: center; }
.search-item .s-av-rank .rank-ic { width: 28px; height: 28px; }
.league-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.league-cell .rank-ic { flex-shrink: 0; }
.ph-rank { flex-shrink: 0; display: grid; place-items: center; width: 84px; height: 84px; }
.ph-rank .rank-ic { width: 76px; height: 76px; }

/* Season summary cards */
.season-cards { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; }
.season-card { flex: 0 0 auto; width: 132px; text-align: center; padding: 14px 10px; border-radius: var(--radius-lg);
  background: var(--surface-2); border: 1px solid var(--border-color); }
.season-card .sc-season { font-family: var(--font-display); font-weight: 800; font-size: .82rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .03em; }
.season-card .sc-ic { height: 46px; display: grid; place-items: center; margin: 6px 0; }
.season-card .sc-ic .rank-ic { width: 44px; height: 44px; }
.season-card .sc-rank { font-family: var(--font-display); font-weight: 900; font-size: 1.25rem; color: var(--primary-light); }
.season-card .sc-league { margin-top: 2px; }
.season-card .sc-score { font-size: .74rem; color: var(--text-muted); margin-top: 4px; }
.spark text { font-family: var(--font-family); }

/* Clubs */
.club-badge { font-family: var(--font-display); font-weight: 800; color: var(--primary-light); }
.member-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.member-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px 7px 7px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border-color); color: var(--text-primary); font-weight: 600; font-size: .86rem; }
.member-chip:hover { border-color: var(--primary-color); background: var(--surface-3); }
.member-chip .s-av { width: 26px; height: 26px; font-size: .8rem; }
a.club-tag { color: var(--accent-color); }
a.club-tag:hover { color: var(--primary-light); }

/* Interactive chart */
.chartv { position: relative; }
.chartv-svg { width: 100%; height: auto; display: block; cursor: crosshair; touch-action: pan-y; }
.chartv-cursor { pointer-events: none; }
.chartv-tip { position: absolute; pointer-events: none; background: var(--surface-3);
  border: 1px solid var(--border-color); border-radius: 8px; padding: 6px 10px; font-size: .82rem;
  color: var(--text-primary); white-space: nowrap; box-shadow: var(--shadow-md); z-index: 6; font-weight: 700; }
.chartv-tip b { display: block; font-size: .7rem; color: var(--text-secondary); font-weight: 700; margin-bottom: 1px; }
.chartv-tip[hidden] { display: none; }

/* Platform handle icons under the player name */
.ph-handles { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ph-handles .handle { display: inline-flex; align-items: center; gap: 7px; line-height: 1; padding: 6px 12px; }
.ph-handles .handle svg { flex: 0 0 auto; display: block; width: 16px; height: 16px; }
.ph-handles .handle-psn svg { width: 20px; }      /* PSN glyph is wider than tall */
.ph-handles .handle .handle-name { line-height: 1; font-weight: 600; display: inline-block; }
.handle-steam svg { color: #c7d5e0; }
.handle-psn svg { color: #0d9bec; }
.handle-xbox svg { color: #57ac41; }

/* Extra breathing room between player/club section titles */
#playerRoot .section-head, #clubRoot .section-head { margin-top: 34px; }
#playerRoot .section-head:first-of-type { margin-top: 26px; }
