:root {
  --navy: #031D3A;
  --navy-2: #08284d;
  --navy-3: #0c3765;
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #102033;
  --muted: #68788d;
  --line: #dfe6ee;
  --soft: #eef3f8;
  --accent: #2d8cff;
  --success: #1d9b68;
  --danger: #c94b57;
  --warning: #c88b22;
  --shadow: 0 10px 30px rgba(3, 29, 58, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 250px;
  background: var(--navy);
  color: #fff;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 24px 20px 28px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #0c3765, #2d8cff);
  font-weight: 900; letter-spacing: -1px;
}
.brand-title { font-weight: 800; letter-spacing: -.3px; }
.brand-sub { color: rgba(255,255,255,.56); font-size: 12px; margin-top: 3px; }
.nav { padding: 0 12px; display: grid; gap: 5px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  border-radius: 9px; color: rgba(255,255,255,.68); font-size: 14px; font-weight: 650;
}
.nav a span { width: 20px; text-align: center; opacity: .9; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: rgba(255,255,255,.13); color: #fff; }
.sidebar-footer {
  margin-top: auto; padding: 18px 20px; border-top: 1px solid rgba(255,255,255,.09);
  display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.8);
}
.sidebar-footer small { display: block; color: rgba(255,255,255,.45); margin-top: 3px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #39d98a; box-shadow: 0 0 0 4px rgba(57,217,138,.12); }

.main { margin-left: 250px; min-width: 0; width: calc(100% - 250px); }
.topbar {
  height: 68px; background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; padding: 0 30px; position: sticky; top: 0; z-index: 10;
}
.breadcrumbs { color: var(--muted); font-size: 13px; font-weight: 650; }
.season-pill { background: var(--soft); color: var(--navy); border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 800; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 22px; }
.content { max-width: 1500px; margin: 0 auto; padding: 30px; }

.page-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 24px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-size: 11px; font-weight: 850; }
h1 { margin: 5px 0 6px; font-size: clamp(28px, 4vw, 44px); letter-spacing: -1.5px; line-height: 1.05; }
h2 { margin: 0; font-size: 20px; letter-spacing: -.4px; }
h3 { margin: 0; font-size: 15px; }
.page-head p, .subtle { color: var(--muted); margin: 0; font-size: 14px; line-height: 1.55; }

.hero {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff; border-radius: 18px; padding: 30px; box-shadow: var(--shadow); overflow: hidden; position: relative;
}
.hero::after { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); right: -90px; top: -120px; box-shadow: 0 0 0 50px rgba(255,255,255,.02), 0 0 0 100px rgba(255,255,255,.015); }
.hero-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 30px; align-items: center; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); max-width: 800px; }
.hero p { color: rgba(255,255,255,.7); max-width: 700px; font-size: 15px; }
.hero-kicker { color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; }
.hero-side { border-left: 1px solid rgba(255,255,255,.12); padding-left: 26px; }
.hero-big { font-size: 56px; font-weight: 850; letter-spacing: -2px; }
.hero-label { color: rgba(255,255,255,.58); font-size: 12px; }
.hero-current { margin-top:18px; color:rgba(255,255,255,.72); font-size:13px; line-height:1.5; }
.pulse-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:18px 0; }
.rivalry-hero { display:flex; justify-content:space-between; align-items:center; gap:20px; background:linear-gradient(135deg,var(--navy),var(--navy-2)); color:#fff; border-radius:16px; padding:22px 24px; margin-bottom:18px; }
.rivalry-hero h2 { margin:4px 0; font-size:25px; }
.rivalry-hero p { margin:0; color:rgba(255,255,255,.68); font-size:13px; }
.rivalry-count { font-size:46px; font-weight:900; opacity:.9; }
.rivalry-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.rivalry-card { background:#fff; border:1px solid var(--line); border-radius:14px; padding:18px; cursor:pointer; transition:transform .15s,box-shadow .15s,border-color .15s; }
.rivalry-card:hover { transform:translateY(-2px); box-shadow:var(--shadow); border-color:#c8d9ea; }
.rivalry-rank { color:var(--accent); font-size:11px; font-weight:900; }
.rivalry-names { display:flex; align-items:center; gap:8px; margin-top:10px; font-size:15px; }
.rivalry-names span { color:var(--muted); font-size:11px; }
.rivalry-record { display:flex; justify-content:space-between; align-items:end; margin-top:18px; }
.rivalry-record b { font-size:24px; }
.rivalry-record span,.rivalry-meta { color:var(--muted); font-size:11px; }
.rivalry-meta { display:flex; justify-content:space-between; margin-top:5px; }
.pulse-card { background:linear-gradient(145deg,#fff,#f7faff); border:1px solid var(--line); border-radius:14px; padding:17px 18px; box-shadow:0 4px 15px rgba(3,29,58,.04); }
.pulse-kicker { color:var(--accent); font-size:10px; font-weight:850; letter-spacing:.1em; }
.pulse-value { margin-top:7px; font-size:18px; font-weight:850; color:var(--navy); }
.pulse-meta { color:var(--muted); font-size:11px; margin-top:4px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin: 18px 0; }
.stat-card { transition:transform .15s, box-shadow .15s; }
.stat-card:hover { transform:translateY(-1px); box-shadow:var(--shadow); }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: 0 4px 15px rgba(3,29,58,.04); }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.stat-value { font-size: 27px; font-weight: 850; letter-spacing: -.7px; margin-top: 5px; }
.stat-meta { color: var(--muted); font-size: 11px; margin-top: 3px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 4px 15px rgba(3,29,58,.04); overflow: hidden; }
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.card-body { padding: 18px; }
.card-head .link { color: var(--accent); font-size: 12px; font-weight: 800; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid #edf1f5; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.clickable:hover td { background: #f7faff; cursor: pointer; }
.rank { width: 28px; color: var(--muted); font-weight: 800; }
.owner-link { color: var(--navy); font-weight: 800; }
.team-name { color: var(--muted); font-size: 12px; }
.record { font-weight: 800; }
.positive { color: var(--success); }
.negative { color: var(--danger); }

.champ-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf1f5; }
.champ-row:last-child { border-bottom: 0; }
.trophy { width: 34px; height: 34px; border-radius: 10px; background: #f3f6f9; display: grid; place-items: center; font-size: 16px; }
.champ-name { flex: 1; font-weight: 800; }
.champ-years { color: var(--muted); font-size: 11px; }
.champ-count { font-size: 22px; font-weight: 900; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
input, select {
  background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; color: var(--ink); outline: none;
}
input:focus, select:focus { border-color: #9ec9ff; box-shadow: 0 0 0 3px rgba(45,140,255,.1); }

.owner-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.owner-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.owner-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color:#c8d9ea; }
.owner-card-top { display:flex; justify-content:space-between; gap: 10px; align-items:flex-start; }
.avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--navy); color: #fff; display:grid; place-items:center; font-weight: 900; }
.owner-card h3 { margin-top: 2px; }
.owner-card .mini { color: var(--muted); font-size: 11px; }
.owner-metrics { display:grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 16px; }
.owner-metric { background: var(--soft); border-radius: 9px; padding: 9px; }
.owner-metric b { display:block; font-size: 16px; }
.owner-metric span { color:var(--muted); font-size:10px; }

.profile-hero { display:flex; gap:18px; align-items:center; margin-bottom:18px; }
.profile-avatar { width:64px; height:64px; border-radius:18px; background:var(--navy); color:#fff; display:grid; place-items:center; font-size:22px; font-weight:900; }
.profile-hero h1 { margin:0; font-size:34px; }
.badges { display:flex; gap:7px; flex-wrap:wrap; margin-top:7px; }
.badge { background:var(--soft); color:var(--navy); border-radius:999px; padding:5px 8px; font-size:10px; font-weight:800; }

.bar-list { display:grid; gap:10px; }
.bar-row { display:grid; grid-template-columns: 120px 1fr 55px; gap:10px; align-items:center; font-size:12px; }
.bar-bg { height:8px; background:var(--soft); border-radius:999px; overflow:hidden; }
.bar-fill { height:100%; background:var(--navy); border-radius:999px; }

.empty { padding: 35px; text-align:center; color:var(--muted); }
.loading { min-height: 60vh; display:grid; place-items:center; color:var(--muted); gap:10px; }
.spinner { width:25px; height:25px; border:3px solid #dbe5ef; border-top-color:var(--navy); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .owner-grid { grid-template-columns: repeat(2,1fr); }
  .hero-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .pulse-grid { grid-template-columns:1fr; }
  .rivalry-grid { grid-template-columns:1fr; }
  .hero-side { border-left:0; border-top:1px solid rgba(255,255,255,.12); padding:18px 0 0; }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left:0; width:100%; }
  .mobile-menu { display:block; }
  .topbar { padding:0 16px; }
  .content { padding:18px; }
  .stats-grid, .owner-grid { grid-template-columns: 1fr; }
  .hero { padding:22px; }
  .page-head { align-items:flex-start; flex-direction:column; }
}

.rank-list { display:flex; flex-direction:column; }
.rank-row { display:flex; align-items:center; gap:12px; padding:15px 12px; border-bottom:1px solid var(--line); }
.rank-row:last-child { border-bottom:0; }
.rank-num { width:26px; color:var(--accent); font-size:11px; font-weight:900; }
.rank-main { flex:1; display:flex; flex-direction:column; gap:3px; }
.rank-main strong { font-size:14px; }
.rank-main small { color:var(--muted); font-size:11px; }
.rank-row > b { font-size:18px; color:var(--navy); }
.section-title { display:flex; justify-content:space-between; align-items:end; gap:16px; margin:22px 0 12px; }
.section-title h2 { margin:0; font-size:18px; }
.section-title .mini { color:var(--muted); font-size:11px; }
@media (max-width: 760px) {
  .owner-metrics { grid-template-columns:repeat(2,1fr); }
  .section-title { align-items:flex-start; flex-direction:column; gap:5px; }
}
