/* ULTRAbullet Team Battles — Competitive Arena design layer
   Arena energy + editorial typography + analytical clarity.
   This file is presentation-only: keep all data, ranking and interaction logic intact. */

:root {
  --arena-bg: #080f1a;
  --arena-bg-raised: #0e1a2b;
  --arena-panel: rgba(15, 28, 45, .92);
  --arena-panel-strong: rgba(20, 37, 58, .96);
  --arena-line: rgba(133, 164, 194, .2);
  --arena-line-strong: rgba(133, 164, 194, .34);
  --arena-text: #f4f7fb;
  --arena-muted: #9baec1;
  --arena-dim: #71869b;
  --arena-cyan: #70dce5;
  --arena-blue: #83a1ff;
  --arena-violet: #a99af4;
  --arena-gold: #dfbb7b;
  --arena-serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --arena-display: "Space Grotesk", "Manrope", system-ui, sans-serif;
  --arena-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --arena-mono: "DM Mono", "SFMono-Regular", Consolas, monospace;
}

html {
  scroll-padding-top: 118px;
  scrollbar-color: #314b62 #080f1a;
}

body {
  color: var(--arena-text);
  background:
    radial-gradient(ellipse at 7% 0%, rgba(63, 190, 203, .12), transparent 36rem),
    radial-gradient(ellipse at 94% 5%, rgba(103, 112, 210, .13), transparent 40rem),
    linear-gradient(145deg, #080f1a 0%, #0a1422 54%, #080e18 100%);
  font-family: var(--arena-sans);
}

body:before {
  opacity: .11;
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, rgba(0,0,0,.5) 42%, transparent 86%);
}
body:after {
  opacity: .16;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(113, 152, 194, .08), transparent 52rem),
    linear-gradient(122deg, transparent 0 72%, rgba(112, 220, 229, .025) 72.1%, transparent 72.4% 100%);
}
::selection { color: #07121b; background: rgba(112, 220, 229, .84); }
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--arena-cyan);
  outline-offset: 3px;
}
.shell {
  width: min(1380px, calc(100% - 56px));
  padding-top: 22px;
}

/* Shared navigation */
.masthead {
  position: sticky;
  top: 12px;
  z-index: 40;
  min-height: 78px;
  margin-bottom: 42px;
  padding: 8px 14px;
  border: 1px solid var(--arena-line);
  border-radius: 17px;
  background: rgba(7, 15, 26, .9);
  box-shadow: 0 16px 42px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.045);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.brand { min-width: 198px; gap: 12px; }
.brand-emblem {
  flex-basis: 58px;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(112,220,229,.3);
  border-radius: 14px;
  background:
    radial-gradient(circle at 42% 36%, rgba(112,220,229,.19), transparent 68%),
    linear-gradient(145deg, #183149, #0b1727);
  box-shadow: 0 0 26px rgba(72,190,207,.09), inset 0 1px 0 rgba(255,255,255,.06);
}
.brand-logo { width: 52px; height: 52px; filter: drop-shadow(0 0 11px rgba(112,220,229,.16)); }
.brand-copy strong {
  font-family: var(--arena-display);
  font-size: 1rem;
  letter-spacing: .105em;
}
.brand-copy small {
  color: #91a9bd;
  font-size: .57rem;
  letter-spacing: .23em;
}
.mast-actions.primary-nav {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
}
.primary-nav .nav-link {
  min-height: 37px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #a6b8c9;
  font-size: .71rem;
  font-weight: 750;
  letter-spacing: .01em;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.primary-nav .nav-link:hover {
  color: #f5f9fc;
  border-color: rgba(128,165,196,.16);
  background: rgba(255,255,255,.045);
}
.primary-nav .nav-link.active {
  color: #f5fbfc;
  border-color: rgba(112,220,229,.22);
  background: linear-gradient(135deg, rgba(54,142,157,.2), rgba(95,100,177,.15));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.primary-nav .nav-link.active:after { display: none; }
.primary-nav .status-pill {
  margin-left: 5px;
  border-color: rgba(112,220,229,.22);
  background: rgba(112,220,229,.07);
  color: #a8dce0;
  font-size: .59rem;
}

.eyebrow, .pathway-kicker, .hub-card-meta, .info-kicker, .note-label,
.dashboard-card-head .info-kicker {
  letter-spacing: .16em;
}
.eyebrow:before { width: 25px; opacity: .8; }
.section-heading h2, .profile-section-heading h2, .hub-section-heading h2 {
  font-family: var(--arena-display);
  letter-spacing: -.04em;
}

/* Arena hero + editorial accent */
.hero {
  align-items: center;
  gap: clamp(30px, 5vw, 76px);
  margin: 10px 0 30px;
}
.hero-copy { min-width: 0; }
.hero h1 {
  max-width: 830px;
  margin: 19px 0 17px;
  font-family: var(--arena-display);
  font-size: clamp(3.25rem, 6.7vw, 6.3rem);
  font-weight: 800;
  line-height: .94;
  letter-spacing: -.075em;
}
.hero h1 em, .hub-hero h1 em, .compare-hero h1 em,
.profile-hero h1 em, .hof-hero h1 em, .info-hero h1 em {
  color: var(--arena-gold);
  font-family: var(--arena-serif);
  font-size: 1.08em;
  font-style: italic;
  font-weight: 600;
  letter-spacing: -.045em;
  background: none;
}
.lede { max-width: 660px; color: #a9bbcc; font-size: .94rem; line-height: 1.85; }
.hero-actions { gap: 10px; margin-top: 24px; }
.primary-action, .secondary-action {
  min-height: 43px;
  border-radius: 9px;
  letter-spacing: .01em;
}
.primary-action {
  border-color: rgba(112,220,229,.48);
  background: linear-gradient(112deg, #226f7d, #385c97);
  box-shadow: 0 10px 25px rgba(25,102,124,.18);
}
.primary-action:hover { background: linear-gradient(112deg, #2a8391, #456ba8); }
.secondary-action {
  border-color: rgba(143,171,198,.25);
  background: rgba(255,255,255,.025);
}
.hero-note, .arena-panel {
  border-color: rgba(143,174,201,.24);
  border-radius: 19px;
  background:
    linear-gradient(145deg, rgba(25,46,68,.82), rgba(12,23,38,.92)),
    radial-gradient(circle at 90% 10%, rgba(223,187,123,.09), transparent 45%);
  box-shadow: 0 22px 54px rgba(0,0,0,.2);
}
.hero-note .note-label { color: var(--arena-gold); }
.arena-panel-content strong { font-family: var(--arena-display); font-size: 1.42rem; letter-spacing: -.045em; }
.arena-panel-content p { color: #a2b5c7; }
.arena-panel-foot { border-top-color: rgba(143,171,198,.17); }
.arena-panel-foot span { color: #93aabd; }

/* KPI ribbon and dashboard modules */
.stats { gap: 12px; margin: 24px 0 25px; }
.stat, .global-analytics-stat {
  border-color: var(--arena-line);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(19,36,56,.88), rgba(11,21,35,.82));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.stat { padding: 17px 19px; }
.stat:after { width: 88px; background: linear-gradient(90deg,var(--arena-cyan),rgba(131,161,255,.3),transparent); }
.stat-label { color: #a7b9ca; font-size: .68rem; letter-spacing: .035em; }
.stat-value {
  margin-top: 8px;
  color: #f4f8fb;
  font-family: var(--arena-mono);
  font-size: clamp(1.5rem,2.5vw,1.9rem);
}
.home-pathways { margin: 25px 0 34px; }
.home-pathways-heading { align-items: end; margin-bottom: 14px; }
.home-pathways-heading h2 {
  color: var(--arena-text);
  font-family: var(--arena-display);
  font-size: 1.4rem;
  letter-spacing: -.045em;
}
.home-pathways-heading p { color: #98adbf; font-size: .75rem; }
.home-pathway-card, .hub-card {
  position: relative;
  min-height: 172px;
  padding: 19px 20px;
  overflow: hidden;
  border-color: var(--arena-line);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(19,37,57,.88), rgba(11,22,36,.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.home-pathway-card:after, .hub-card:after {
  position: absolute;
  right: -33px;
  bottom: -55px;
  width: 125px;
  height: 125px;
  border: 1px solid rgba(112,220,229,.08);
  border-radius: 50%;
  box-shadow: 0 0 0 17px rgba(112,220,229,.018), 0 0 0 34px rgba(112,220,229,.012);
  content: "";
  pointer-events: none;
}
.home-pathway-card:hover, .hub-card:hover {
  transform: translateY(-3px);
  border-color: rgba(112,220,229,.42);
  background: linear-gradient(145deg, rgba(25,48,72,.95), rgba(12,25,41,.96));
}
.pathway-kicker, .hub-card-meta { color: var(--arena-cyan); font-size: .57rem; }
.home-pathway-card strong, .hub-card h2 {
  font-family: var(--arena-display);
  font-size: 1.06rem;
  letter-spacing: -.035em;
}
.home-pathway-card > span:not(.pathway-kicker):not(.pathway-cta),
.hub-card p { color: #9bafc2; font-size: .73rem; line-height: 1.7; }
.pathway-cta, .hub-card-link { color: var(--arena-cyan); font-size: .68rem; }
.dashboard-grid { gap: 12px; }
.dashboard-card, .global-analytics-panel, .compare-panel,
.profile-panel, .profile-record, .profile-stat, .pi-profile-card,
.compare-form-panel, .info-card, .record-group, .season-card {
  border-color: var(--arena-line);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(17,33,52,.9), rgba(10,20,34,.88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 12px 34px rgba(0,0,0,.1);
}
.dashboard-card { padding: 19px 20px; }
.dashboard-card h2 {
  color: #f2f7fa;
  font-family: var(--arena-display);
  font-size: 1.16rem;
  letter-spacing: -.045em;
}
.dashboard-sub { color: #97adbf; }
.dashboard-status { color: #9eb6c7; }
.dashboard-link { color: var(--arena-cyan); }
.leader-entry { border-color: rgba(142,170,196,.14); }
.leader-entry > span { color: #9cb0c2; }
.leader-entry a { color: #edf6fa; }
.leader-entry strong { color: var(--arena-cyan); }

/* Analytics: precise grids, quieter chrome, stronger labels */
.global-analytics { margin: 42px 0 40px; }
.global-analytics-stat { padding: 16px 18px; }
.global-analytics-stat > span { color: #a3b5c6; }
.global-analytics-stat strong { color: #f4f8fb; font-family: var(--arena-mono); }
.global-analytics-panel { padding: 19px 19px 15px; }
.global-analytics-panel-head h3 { font-family: var(--arena-display); letter-spacing: -.035em; }
.global-chart-axis { fill: #91a6b9; }
.global-analytics-legend, .global-analytics-caption { color: #8fa5b8; }
.section-heading { margin-top: 37px; }
.section-heading h2 { font-size: 1.4rem; }
.history-panel {
  border-color: var(--arena-line);
  border-radius: 14px;
  background: rgba(12,23,38,.82);
}
.history-row { border-color: rgba(142,170,196,.12); }
.history-row:hover { background: rgba(112,220,229,.035); }
.history-name { color: #eef5f9; }
.history-date, .history-meta { color: #92a8bb; }
.history-link { color: var(--arena-cyan); }

/* Tables: stronger hierarchy and restrained podium colour */
.board {
  border-color: var(--arena-line-strong);
  border-radius: 17px;
  background: rgba(10,20,34,.94);
  box-shadow: 0 22px 56px rgba(0,0,0,.21);
}
.board-head { padding: 22px 23px 17px; border-color: var(--arena-line); }
.board-title { font-family: var(--arena-display); font-size: 1.36rem; letter-spacing: -.045em; }
.board-sub { color: #93a9bc; }
.controls { padding: 13px 19px; border-color: var(--arena-line); background: rgba(255,255,255,.018); }
.segmented, .segmented button, .search input, .select-input, .filter-button {
  border-color: rgba(135,165,193,.22);
}
.segmented { background: rgba(5,13,23,.6); }
.segmented button.active {
  background: linear-gradient(110deg,#287f8b,#465f9d);
  box-shadow: 0 5px 14px rgba(34,119,138,.2);
}
.search input, .select-input {
  background: #081522;
  color: #f0f6fa;
}
thead { background: #14243a; }
th {
  padding-top: 12px;
  padding-bottom: 12px;
  color: #91a7bc;
  font-size: .61rem;
  letter-spacing: .11em;
}
td { border-color: rgba(137,166,193,.12); }
tbody tr:nth-child(-n+3) { background: rgba(223,187,123,.025); }
tbody tr:nth-child(-n+3):hover { background: rgba(223,187,123,.065); }
tbody tr:hover { background: rgba(112,220,229,.045); }
.rank.top { color: var(--arena-gold); }
.mini-mark {
  border-color: rgba(112,220,229,.24);
  background: linear-gradient(145deg, rgba(112,220,229,.1), rgba(131,161,255,.1));
  color: var(--arena-cyan);
}
.points { color: #e9f0f6; }
.board-foot { border-color: var(--arena-line); color: #8fa5b8; }

/* Profiles */
.profile-hero { gap: 22px; margin-top: 8px; }
.profile-hero h1 {
  font-family: var(--arena-display);
  font-size: clamp(2.7rem,5.8vw,5.35rem);
  letter-spacing: -.075em;
}
.profile-title-row { gap: 15px; }
.profile-initial-mark {
  border-color: rgba(112,220,229,.29);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(112,220,229,.13), rgba(131,161,255,.1));
  color: #a1e5e9;
}
.profile-identity-card {
  border-color: rgba(223,187,123,.26);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0%, rgba(223,187,123,.08), transparent 60%),
    linear-gradient(145deg, rgba(24,42,61,.94), rgba(11,21,35,.96));
}
.profile-identity-card .note-label { color: var(--arena-gold); }
.profile-stat { padding: 17px 18px; }
.profile-stat span, .profile-stat small { color: #9eb1c2; }
.profile-stat strong { color: #f4f8fb; font-family: var(--arena-mono); }
.profile-section { margin: 34px 0; }
.profile-section-heading { align-items: end; }
.profile-section-heading h2 { color: #f1f6fa; font-size: 1.38rem; }
.profile-section-note { color: #a0b4c5; }
.profile-record { padding: 15px 16px; }
.profile-record strong { color: #eff7fa; font-family: var(--arena-mono); }
.profile-panel { background: rgba(11,22,36,.9); }
.profile-history-table th { background: #14243a; color: #94a9bc; }
.profile-history-table td { border-color: rgba(137,166,193,.12); }
.profile-history-table tbody tr:hover { background: rgba(112,220,229,.04); }
.profile-history-table a, .member-profile-link { color: var(--arena-cyan); }
.chart-bar { background: linear-gradient(180deg,#70dce5,#6e83d9); box-shadow: 0 0 15px rgba(112,220,229,.1); }
.achievement-badge-card {
  border-color: var(--arena-line);
  background: linear-gradient(145deg, rgba(18,37,56,.84), rgba(11,22,36,.9));
}
.achievement-badge-icon {
  border-color: rgba(223,187,123,.24);
  background: rgba(223,187,123,.07);
  color: #e4c88f;
}

/* Landing pages, PI and comparison tools */
.hub-hero { gap: 25px; margin: 27px 0 35px; }
.hub-hero h1 {
  font-family: var(--arena-display);
  font-size: clamp(2.8rem,5.9vw,5.25rem);
  letter-spacing: -.075em;
}
.hub-hero-note {
  border-color: var(--arena-line);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(23,43,64,.9), rgba(11,22,37,.92));
}
.hub-card { min-height: 205px; }
.hub-note-panel {
  border-color: var(--arena-line);
  background: rgba(15,29,46,.66);
}
.hub-note-mark { color: var(--arena-gold); border-color: rgba(223,187,123,.25); }
.hub-footer, .profile-footer, .compare-footer, .hof-footer, .info-footer {
  border-color: var(--arena-line);
  color: #8ea5b8;
}
.compare-hero { padding-top: 28px; }
.compare-hero h1, .compare-hero h1 em { font-family: var(--arena-display); }
.compare-hero h1 em { font-family: var(--arena-serif); }
.compare-form-panel { background: linear-gradient(145deg, rgba(18,36,55,.92), rgba(10,21,35,.94)); }
.compare-panel-heading h2 { font-family: var(--arena-display); }
.compare-identity {
  border-color: var(--arena-line);
  background: linear-gradient(145deg, rgba(20,39,59,.92), rgba(10,20,34,.96));
}
.compare-identity strong { font-family: var(--arena-display); }
.compare-pi-card {
  border-color: var(--arena-line);
  background: rgba(255,255,255,.025);
}
.compare-pi-card strong { color: var(--arena-cyan); }
.compare-table th { color: #91a7bc; }
.compare-table td { border-color: rgba(137,166,193,.12); }
.pi-profile-card, .pi-table-wrap, .performance-index-panel {
  border-color: var(--arena-line);
}
.pi-profile-card { background: linear-gradient(145deg, rgba(18,36,55,.9), rgba(10,21,35,.9)); }

/* Editorial touches */
.hof-hero h1, .info-hero h1 { font-family: var(--arena-display); }
.hof-hero h1 em, .info-hero h1 em { font-family: var(--arena-serif); }
.hof-stat, .period-item {
  border-color: var(--arena-line);
  background: linear-gradient(145deg, rgba(20,39,59,.86), rgba(10,21,35,.9));
}
.hof-stat strong { font-family: var(--arena-mono); color: #f1f6f9; }
.info-card { background: linear-gradient(145deg, rgba(18,36,55,.88), rgba(10,21,35,.9)); }
.info-card h2 { font-family: var(--arena-display); }
.info-callout { border-left-color: var(--arena-gold); background: rgba(223,187,123,.055); }
.info-card a, .info-footer a { color: var(--arena-cyan); }

/* Shared hover, footer and motion treatment */
a, button { -webkit-tap-highlight-color: transparent; }
button, .home-pathway-card, .hub-card, .nav-link {
  transition-duration: .16s;
}
button:disabled { cursor: not-allowed; }
.empty, .global-analytics-empty, .profile-empty, .loading-state, .empty-state {
  color: #9bb0c2;
}
@media (max-width: 1120px) {
  .masthead {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 34px;
    padding: 10px 12px;
  }
  .brand { min-width: 0; }
  .mast-actions.primary-nav {
    justify-content: flex-start;
    width: 100%;
    margin-left: 0;
    padding-top: 7px;
    border-top: 1px solid rgba(133,164,194,.15);
  }
}
@media (max-width: 700px) {
  .shell { width: min(100% - 28px, 1380px); padding-top: 14px; }
  .masthead { top: 6px; border-radius: 14px; margin-bottom: 27px; }
  .brand-emblem { flex-basis: 48px; width: 48px; height: 48px; border-radius: 12px; }
  .brand-logo { width: 43px; height: 43px; }
  .brand-copy strong { font-size: .9rem; }
  .brand-copy small { font-size: .52rem; }
  .mast-actions.primary-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 4px;
  }
  .primary-nav .nav-link {
    justify-content: center;
    min-height: 34px;
    padding: 7px 4px;
    font-size: .64rem;
    text-align: center;
    white-space: normal;
  }
  .primary-nav .status-pill { grid-column: 1/-1; justify-self: start; margin: 3px 0 0; }
  .hero { grid-template-columns: 1fr; gap: 22px; }
  .hero h1 { font-size: clamp(2.8rem, 12vw, 4.25rem); }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:last-child { grid-column: 1/-1; }
  .home-pathways-grid { grid-template-columns: 1fr; }
  .home-pathway-card { min-height: 145px; }
  .global-analytics-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .global-analytics-grid { grid-template-columns: 1fr; }
  .global-analytics-panel--wide { grid-column: auto; }
  .home-pathways-heading { align-items: flex-start; flex-direction: column; }
  .profile-hero h1, .hub-hero h1 { font-size: clamp(2.7rem, 11vw, 4.1rem); }
}
@media (max-width: 440px) {
  .mast-actions.primary-nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .primary-nav .nav-link { font-size: .62rem; }
  .stats, .profile-stats { grid-template-columns: 1fr 1fr; }
  .profile-title-row { align-items: flex-start; gap: 11px; }
  .profile-initial-mark { flex-basis: 54px; width: 54px; height: 54px; font-size: 1.5rem; }
  .profile-record-grid { grid-template-columns: 1fr 1fr; }
  .compare-identities, .compare-pi-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Four primary routes keep the expanded V2 dashboard balanced. */
.home-pathways-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1120px) {
  .home-pathways-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .home-pathways-grid { grid-template-columns: 1fr; }
}


/* Operational data freshness states */
.primary-nav .status-pill.is-stale,
.primary-nav .status-pill.has-issues {
  border-color: rgba(223, 187, 123, .48);
  background: rgba(223, 187, 123, .10);
  color: #f2d7a8;
}


/* -------------------------------------------------------------------------
   SITE-WIDE VISUAL UNIFICATION
   Shared presentation layer for every public page. This block deliberately
   changes appearance only: it does not change selectors, IDs, data hooks,
   table structure, URLs, or interaction states used by application scripts.
   ------------------------------------------------------------------------- */

:root {
  --bg: var(--arena-bg);
  --surface: var(--arena-panel);
  --surface-raised: var(--arena-panel-strong);
  --line: var(--arena-line);
  --text: var(--arena-text);
  --muted: var(--arena-muted);
  --accent: var(--arena-cyan);
  --cyan: var(--arena-cyan);
  --gold: var(--arena-gold);
  --panel: var(--arena-panel);
  --font-sans: var(--arena-sans);
  --font-mono: var(--arena-mono);
  --site-radius-sm: 9px;
  --site-radius-md: 13px;
  --site-radius-lg: 16px;
  --site-border: 1px solid var(--arena-line);
  --site-panel-bg: linear-gradient(145deg, rgba(18,36,55,.92), rgba(10,21,35,.94));
  --site-panel-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 14px 36px rgba(0,0,0,.13);
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: 116px;
}

body {
  color: var(--arena-text);
  font-family: var(--arena-sans);
  font-size: 15px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body .shell :is(h1,h2,h3,h4) {
  text-wrap: balance;
}

body .shell :is(p,li) {
  text-wrap: pretty;
}

body .shell :is(a) {
  text-underline-offset: 3px;
}

body .shell :is(button,input,select,textarea) {
  font-family: var(--arena-sans);
}

.shell {
  width: min(1380px, calc(100% - 56px));
}

/* One consistent content rhythm across overview, hubs, reports and profiles. */
.shell :is(
  .hero,
  .hub-hero,
  .rank-hero,
  .contributors-hero,
  .profile-hero,
  .compare-hero,
  .pi-hero,
  .battle-hero,
  .achievements-hero,
  .hof-hero,
  .info-hero
) {
  scroll-margin-top: 124px;
}

.shell :is(
  .hero h1,
  .hub-hero h1,
  .rank-hero h1,
  .contributors-hero h1,
  .profile-hero h1,
  .compare-hero h1,
  .pi-hero h1,
  .battle-hero h1,
  .achievements-hero h1,
  .hof-hero h1,
  .info-hero h1
) {
  color: #f3f7fb;
  font-family: var(--arena-display);
  font-weight: 750;
  line-height: .99;
  letter-spacing: -.065em;
  overflow-wrap: anywhere;
}

.shell :is(
  .hero .lede,
  .hub-hero p,
  .rank-hero-copy p,
  .contributors-lede,
  .profile-hero .lede,
  .compare-hero p,
  .pi-hero > p,
  .battle-hero p,
  .achievements-hero p,
  .hof-hero p,
  .info-hero p
) {
  color: #a2b5c6;
  font-size: .86rem;
  line-height: 1.82;
}

.shell :is(
  .section-heading,
  .contributors-section-heading,
  .achievement-section,
  .profile-section,
  .global-analytics,
  .home-pathways,
  .rank-method
) {
  scroll-margin-top: 126px;
}

.shell :is(
  .section-heading h2,
  .contributors-section-heading h2,
  .achievement-section h2,
  .profile-section-heading h2,
  .global-analytics-heading h2,
  .global-analytics-panel-head h3,
  .compare-panel-heading h2,
  .pi-panel-heading h2,
  .rank-method-heading h2
) {
  color: #edf5fa;
  font-family: var(--arena-display);
  font-weight: 700;
  letter-spacing: -.04em;
}

/* Shared surfaces: the same material language across every section.
   Gold Hall of Fame cards and Guide period cards retain their page-specific accents. */
.shell :is(
  .dashboard-card,
  .global-analytics-panel,
  .compare-form-panel,
  .compare-panel,
  .compare-identity,
  .compare-metric,
  .compare-pi-card,
  .profile-identity-card,
  .profile-stat,
  .profile-record,
  .profile-panel,
  .pi-panel,
  .pi-method,
  .pi-profile-card,
  .performance-index-panel,
  .pi-table-wrap,
  .contributors-hero-note,
  .contributors-summary-card,
  .contributors-board,
  .contributor-podium-card,
  .achievement-summary-card,
  .achievement-card,
  .hof-panel,
  .info-card,
  .battle-summary-card,
  .battle-results-panel,
  .hub-hero-note
) {
  border-color: var(--arena-line);
  border-radius: var(--site-radius-lg);
  box-shadow: var(--site-panel-shadow);
}

.shell :is(
  .dashboard-card,
  .global-analytics-panel,
  .compare-form-panel,
  .compare-panel,
  .compare-identity,
  .compare-metric,
  .compare-pi-card,
  .profile-stat,
  .profile-record,
  .profile-panel,
  .pi-panel,
  .pi-method,
  .performance-index-panel,
  .contributors-hero-note,
  .contributors-summary-card,
  .contributors-board,
  .contributor-podium-card,
  .achievement-summary-card,
  .achievement-card,
  .hof-panel,
  .info-card,
  .battle-summary-card,
  .battle-results-panel
) {
  background: var(--site-panel-bg);
}

.shell :is(
  .dashboard-card,
  .global-analytics-panel,
  .compare-form-panel,
  .compare-panel,
  .profile-panel,
  .pi-panel,
  .pi-method,
  .performance-index-panel,
  .contributors-board,
  .battle-results-panel
) {
  overflow: hidden;
}

.shell :is(
  .dashboard-card,
  .global-analytics-panel,
  .compare-form-panel,
  .compare-panel,
  .profile-panel,
  .pi-panel,
  .pi-method,
  .contributors-board,
  .battle-results-panel
) {
  padding: clamp(16px, 2.2vw, 23px);
}

.shell :is(
  .stat,
  .global-analytics-stat,
  .profile-stat,
  .contributors-summary-card,
  .achievement-summary-card,
  .battle-summary-card,
  .pi-hero-stats > div,
  .compare-metric
) {
  border: var(--site-border);
  border-radius: var(--site-radius-md);
  background: linear-gradient(145deg, rgba(20,39,59,.88), rgba(10,21,35,.91));
}

.shell :is(
  .stat-label,
  .global-analytics-stat > span,
  .profile-stat span,
  .profile-stat small,
  .contributors-summary-card span,
  .achievement-summary-card span,
  .battle-summary-card span,
  .pi-hero-stats span,
  .compare-metric span
) {
  color: #9db1c2;
  font-size: .66rem;
  letter-spacing: .025em;
}

.shell :is(
  .stat-value,
  .global-analytics-stat strong,
  .profile-stat strong,
  .contributors-summary-card strong,
  .achievement-summary-card strong,
  .battle-summary-card strong,
  .pi-hero-stats strong,
  .compare-metric strong
) {
  color: #f1f6fa;
  font-family: var(--arena-mono);
  font-variant-numeric: tabular-nums;
}

/* Data controls share one height, border, surface and focus treatment. */
.shell :is(
  input[type="text"],
  input[type="search"],
  input[type="number"],
  input[type="email"],
  select,
  textarea,
  .select-input,
  .search input,
  .contributors-search input,
  .compare-form input,
  #pi-search,
  #result-search
) {
  min-height: 40px;
  border: 1px solid rgba(135,165,193,.24);
  border-radius: 9px;
  background: #091625;
  color: #edf5f9;
  font: 500 .73rem var(--arena-sans);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.018);
}

.shell :is(
  input[type="text"],
  input[type="search"],
  input[type="number"],
  input[type="email"],
  textarea,
  .search input,
  .contributors-search input,
  .compare-form input,
  #pi-search,
  #result-search
)::placeholder {
  color: #7890a5;
  opacity: 1;
}

.shell :is(
  input[type="text"],
  input[type="search"],
  input[type="number"],
  input[type="email"],
  select,
  textarea,
  .select-input,
  .search input,
  .contributors-search input,
  .compare-form input,
  #pi-search,
  #result-search
):focus {
  border-color: rgba(112,220,229,.6);
  outline: none;
  box-shadow: 0 0 0 3px rgba(112,220,229,.09);
}

.shell :is(button, .primary-action, .secondary-action, .filter-button, .compare-submit, .battle-more-button, .page-button, .pi-pagination button, .contributors-pagination button, .profile-actions button, .profile-actions a) {
  border-radius: 9px;
  font-family: var(--arena-sans);
  font-weight: 750;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.shell :is(
  .secondary-action,
  .filter-button,
  .battle-more-button,
  .page-button,
  .pi-pagination button,
  .contributors-pagination button,
  .profile-actions .secondary-action,
  .chart-mode-button,
  .battle-view-button,
  .pi-switch button,
  .compare-kind button,
  .segmented button
) {
  border: 1px solid rgba(135,165,193,.24);
  border-radius: 8px;
  background: rgba(255,255,255,.025);
  color: #c4d2de;
}

.shell :is(
  .secondary-action,
  .filter-button,
  .battle-more-button,
  .page-button,
  .pi-pagination button,
  .contributors-pagination button,
  .profile-actions .secondary-action,
  .chart-mode-button,
  .battle-view-button,
  .pi-switch button,
  .compare-kind button,
  .segmented button
):hover:not(:disabled) {
  border-color: rgba(112,220,229,.34);
  background: rgba(112,220,229,.065);
  color: #f2fbfd;
}

.shell :is(
  .primary-action,
  .compare-submit
) {
  border: 1px solid rgba(112,220,229,.36);
  border-radius: 9px;
  background: linear-gradient(110deg, #246f7d, #405f9b);
  color: #f4fbfc;
  box-shadow: 0 8px 22px rgba(26,105,126,.16);
}

.shell :is(.primary-action, .compare-submit):hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(112,220,229,.58);
  background: linear-gradient(110deg, #2b8490, #4b6ca8);
  box-shadow: 0 11px 26px rgba(26,105,126,.22);
}

.shell :is(button, input, select, textarea, a) {
  -webkit-tap-highlight-color: transparent;
}

.shell :is(button, input, select, textarea, a, [tabindex]):focus-visible {
  outline: 2px solid var(--arena-cyan);
  outline-offset: 3px;
}

.shell :is(button:disabled, .contributors-pagination button:disabled, .pi-pagination button:disabled, .page-button:disabled) {
  cursor: not-allowed;
  opacity: .42;
}

/* Segmented controls always communicate the selected view consistently. */
.shell :is(
  .segmented,
  .pi-switch,
  .chart-mode-switch,
  .battle-view-switch,
  .compare-kind
) {
  border: 1px solid rgba(135,165,193,.2);
  border-radius: 10px;
  background: rgba(6,15,26,.74);
}

.shell :is(
  .segmented button.active,
  .pi-switch button.active,
  .chart-mode-button.active,
  .battle-view-button.active,
  .compare-kind button.active
) {
  border-color: rgba(112,220,229,.28);
  border-radius: 7px;
  background: linear-gradient(110deg, rgba(39,126,139,.82), rgba(68,91,151,.84));
  color: #f5fbfd;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 4px 12px rgba(31,103,127,.13);
}

/* Unified table grammar, without changing row or column behaviour. */
.shell :is(
  .contributors-table,
  .pi-table,
  .battle-table,
  .compare-table,
  .profile-history-table,
  .analytics-season-table,
  .pi-history-table
) {
  border-collapse: collapse;
  color: #dce7ef;
  font-variant-numeric: tabular-nums;
}

.shell :is(
  .contributors-table th,
  .pi-table th,
  .battle-table th,
  .compare-table th,
  .profile-history-table th,
  .analytics-season-table th,
  .pi-history-table th
) {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(142,170,196,.18);
  background: #14253a;
  color: #9bb0c2;
  font-family: var(--arena-mono);
  font-size: .57rem;
  font-weight: 500;
  letter-spacing: .095em;
  line-height: 1.45;
  text-transform: uppercase;
}

.shell :is(
  .contributors-table td,
  .pi-table td,
  .battle-table td,
  .compare-table td,
  .profile-history-table td,
  .analytics-season-table td,
  .pi-history-table td
) {
  padding: 12px 14px;
  border-top: 1px solid rgba(142,170,196,.105);
  color: #d2dfe8;
  font-size: .71rem;
  line-height: 1.55;
}

.shell :is(
  .contributors-table tbody tr,
  .pi-table tbody tr,
  .battle-table tbody tr,
  .compare-table tbody tr,
  .profile-history-table tbody tr,
  .analytics-season-table tbody tr,
  .pi-history-table tbody tr
) {
  transition: background .14s ease;
}

.shell :is(
  .contributors-table tbody tr:hover,
  .pi-table tbody tr:hover,
  .battle-table tbody tr:hover,
  .compare-table tbody tr:hover,
  .profile-history-table tbody tr:hover,
  .analytics-season-table tbody tr:hover,
  .pi-history-table tbody tr:hover
) {
  background: rgba(112,220,229,.045);
}

.shell :is(
  .contributors-table-wrap,
  .pi-table-wrap,
  .battle-table-wrap,
  .compare-table-wrap,
  .profile-history-table-wrap,
  .analytics-table-wrap,
  .pi-history-table-wrap
) {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-color: #34516a #0b1726;
  scrollbar-width: thin;
}

.shell :is(.contributors-table, .pi-table, .battle-table, .compare-table, .profile-history-table, .analytics-season-table, .pi-history-table) a {
  color: var(--arena-cyan);
  text-decoration: none;
}

.shell :is(.contributors-table, .pi-table, .battle-table, .compare-table, .profile-history-table, .analytics-season-table, .pi-history-table) a:hover {
  color: #b4f1f1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Section headers and helper text use shared spacing and contrast. */
.shell :is(
  .contributors-board-head,
  .contributors-section-heading,
  .achievement-section-heading,
  .profile-section-heading,
  .global-analytics-heading,
  .compare-panel-heading,
  .pi-panel-heading,
  .battle-results-heading,
  .section-heading,
  .hub-section-heading
) {
  gap: 14px;
}

.shell :is(
  .contributors-board-head p,
  .contributors-section-note,
  .section-description,
  .profile-section-note,
  .dashboard-sub,
  .global-analytics-caption,
  .global-analytics-legend,
  .pi-footnote,
  .pi-method-note,
  .compare-hint,
  .compare-message,
  .battle-panel-footer,
  .battle-footer,
  .contributors-footer
) {
  color: #91a7ba;
  font-size: .68rem;
  line-height: 1.72;
}

.shell :is(
  .contributors-board-count,
  .contributors-hero-meta,
  .pi-count,
  .compare-count,
  .battle-result-count,
  .dashboard-status,
  .pill
) {
  font-family: var(--arena-mono);
  font-variant-numeric: tabular-nums;
}

/* State messages: loading, empty, warning and errors remain distinguishable. */
.shell :is(
  .empty,
  .global-analytics-empty,
  .profile-empty,
  .loading-state,
  .empty-state,
  .achievement-loading,
  .contributors-loading,
  .battle-empty,
  .pi-message
) {
  color: #9aafc1;
  line-height: 1.7;
}

.shell :is(.battle-status, .profile-feedback, .compare-message, .pi-message) {
  border-radius: 10px;
  line-height: 1.7;
}

.shell :is(.battle-status, .profile-feedback) {
  border-color: rgba(135,165,193,.2);
  background: rgba(255,255,255,.025);
}

.shell :is(.battle-status.error, .profile-feedback.error, .compare-message.error, .pi-message.error) {
  border-color: rgba(242,132,149,.35);
  background: rgba(170,57,77,.09);
  color: #ffc0c9;
}

/* Badges, notes and small metadata keep the same restrained treatment. */
.shell :is(
  .pill,
  .contributors-board-count,
  .contributors-live-mark,
  .dashboard-status,
  .battle-result-count,
  .pi-count,
  .compare-count,
  .profile-section-note
) {
  letter-spacing: .045em;
}

.shell :is(
  .hub-note-panel,
  .info-callout,
  .battle-status,
  .context-note,
  .rank-profile-callout
) {
  border-radius: 12px;
}

.shell :is(
  .hub-footer,
  .profile-footer,
  .compare-footer,
  .hof-footer,
  .info-footer,
  .pi-footer,
  .battle-footer,
  .achievement-footer,
  .contributors-footer,
  .rank-footer
) {
  border-top-color: var(--arena-line);
  color: #849bad;
  font-size: .67rem;
  line-height: 1.7;
}

.shell :is(
  .hub-footer a,
  .profile-footer a,
  .compare-footer a,
  .hof-footer a,
  .info-footer a,
  .pi-footer a,
  .battle-footer a,
  .achievement-footer a,
  .contributors-footer a,
  .rank-footer a
) {
  color: #b4c8d8;
  text-decoration: none;
}

.shell :is(
  .hub-footer a:hover,
  .profile-footer a:hover,
  .compare-footer a:hover,
  .hof-footer a:hover,
  .info-footer a:hover,
  .pi-footer a:hover,
  .battle-footer a:hover,
  .achievement-footer a:hover,
  .contributors-footer a:hover,
  .rank-footer a:hover
) {
  color: var(--arena-cyan);
  text-decoration: underline;
}

/* Page-specific corrections that bring specialist pages into the same system. */
.page-contributors .shell :is(.contributors-hero-note, .contributors-board, .contributor-podium-card) {
  border-radius: var(--site-radius-lg);
}
.page-contributors .contributors-table-wrap,
.page-profile .profile-history-table-wrap {
  border-radius: 0 0 var(--site-radius-md) var(--site-radius-md);
}
.page-achievements .shell :is(.achievement-card, .achievement-summary-card) {
  border-radius: var(--site-radius-md);
}
.page-battle .battle-results-panel {
  border-radius: var(--site-radius-lg);
}
.page-profile .shell :is(.profile-stat, .profile-record, .profile-panel, .profile-identity-card) {
  border-radius: var(--site-radius-md);
}
.page-hall-of-fame .shell :is(.hof-stat, .period-item) {
  border-radius: var(--site-radius-md);
}
.page-information .info-card {
  border-radius: var(--site-radius-md);
}
.page-dashboard .shell :is(.dashboard-card, .global-analytics-panel, .history-panel, .board) {
  border-radius: var(--site-radius-md);
}
.page-ranking-hub .shell :is(.rank-card, .rank-method, .rank-profile-callout) {
  border-radius: var(--site-radius-lg);
}

/* Responsive consistency: keep dense controls usable and cards aligned. */
@media (max-width: 1120px) {
  .shell {
    width: min(100% - 40px, 1380px);
  }
  .shell :is(.contributors-hero, .profile-hero, .rank-hero, .hub-hero) {
    gap: 22px;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 28px, 1380px);
  }
  .shell :is(
    .contributors-summary,
    .achievement-summary,
    .profile-stats,
    .battle-summary,
    .compare-summary-grid,
    .pi-hero-stats
  ) {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
  .shell :is(
    .contributors-hero,
    .profile-hero,
    .compare-identities,
    .compare-pi-grid,
    .battle-summary
  ) {
    grid-template-columns: 1fr;
  }
  .shell :is(
    .contributors-board-head,
    .contributors-section-heading,
    .profile-section-heading,
    .global-analytics-heading,
    .compare-panel-heading,
    .pi-panel-heading,
    .battle-results-heading
  ) {
    align-items: flex-start;
    flex-direction: column;
  }
  .shell :is(
    .contributors-controls,
    .pi-controls,
    .battle-table-controls,
    .history-controls
  ) {
    flex-wrap: wrap;
  }
  .shell :is(
    .contributors-search,
    .contributors-sort,
    .contributors-page-size,
    .pi-search-label,
    .analytics-range-control
  ) {
    min-width: 0;
    max-width: 100%;
  }
  .shell :is(.contributors-search input, #pi-search, #result-search) {
    width: 100%;
    max-width: none;
  }
  .shell :is(.compare-form) {
    grid-template-columns: 1fr;
  }
  .shell :is(.compare-versus) {
    display: none;
  }
  .shell :is(.compare-submit) {
    width: 100%;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 14px;
  }
  .shell :is(.contributors-summary, .achievement-summary, .profile-stats, .compare-summary-grid, .pi-hero-stats) {
    gap: 8px;
  }
  .shell :is(.stat, .profile-stat, .contributors-summary-card, .achievement-summary-card, .battle-summary-card) {
    padding: 13px;
  }
  .shell :is(.contributors-table th, .contributors-table td, .pi-table th, .pi-table td, .battle-table th, .battle-table td, .compare-table th, .compare-table td, .profile-history-table th, .profile-history-table td) {
    padding: 10px 11px;
  }
  .shell :is(.battle-footer, .profile-footer, .compare-footer, .pi-footer, .contributors-footer, .achievement-footer, .hof-footer, .info-footer, .hub-footer) {
    gap: 8px;
  }
}

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