:root {
  color-scheme: dark;

  /* ---- design tokens ---- */
  --bg-primary: #05070d;
  --bg-secondary: #0a0e18;
  --surface: #0d1320;
  --surface-2: #101828;
  --surface-hover: #151d30;

  --cyan: #18dfff;
  --purple: #8b5cf6;
  --gold: #f6c453;
  --green: #2fe08a;
  --red: #ff5577;

  --text-primary: #eef3fb;
  --text-secondary: #93a2c2;
  --text-muted: #5b6a8c;

  --border-active: rgba(24, 223, 255, 0.55);
  --border-purple: rgba(139, 92, 246, 0.35);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-cyan: 0 0 0 1px rgba(24, 223, 255, 0.16), 0 10px 28px rgba(0, 0, 0, 0.5);
  --shadow-purple: 0 0 0 1px rgba(139, 92, 246, 0.2), 0 10px 28px rgba(0, 0, 0, 0.5);

  --font-display: "Oxanium", "Rajdhani", "Arial Narrow", sans-serif;
  --font-ui: "Rajdhani", "Arial Narrow", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  /* ---- legacy aliases: every existing rule below (and every page
     template) keeps working unchanged against the new palette ---- */
  --brand: var(--cyan);
  --bg: var(--bg-primary);
  --card-bg: var(--surface);
  --border: rgba(24, 223, 255, 0.16);
  --text: var(--text-primary);
  --text-subtle: var(--text-secondary);
  --card-shadow: 0 4px 22px rgba(0, 0, 0, 0.45);

  --chrome-bg: #161d33;
  --chrome-text: #eef3fb;

  --rank-first-bg: var(--gold);
  --rank-first-text: #241a04;
  --rank-playoff-bg: rgba(139, 92, 246, 0.22);
  --rank-playoff-text: var(--text-primary);
  --rank-out-bg: var(--surface-2);

  --diff-pos: var(--green);
  --diff-neg: var(--red);

  --playoff-tint-bg: rgba(246, 196, 83, 0.07);
  --group-total-bg: rgba(24, 223, 255, 0.06);
  --group-season-bg: rgba(139, 92, 246, 0.07);
  --group-playoffs-bg: rgba(246, 196, 83, 0.08);

  --side-active-bg: rgba(24, 223, 255, 0.1);

  --chip-amber-bg: rgba(246, 196, 83, 0.15);
  --chip-amber-text: #ffd980;
  --chip-red-bg: rgba(255, 85, 119, 0.15);
  --chip-red-text: #ff96a8;
  --chip-green-bg: rgba(47, 224, 138, 0.15);
  --chip-green-text: #82f5bb;
  --chip-blue-bg: rgba(24, 223, 255, 0.15);
  --chip-blue-text: #86ecff;
  --chip-orange-bg: rgba(255, 159, 67, 0.15);
  --chip-orange-text: #ffc389;
  --chip-purple-bg: rgba(139, 92, 246, 0.18);
  --chip-purple-text: #cdb8ff;
  --chip-teal-bg: rgba(45, 212, 191, 0.15);
  --chip-teal-text: #86f0e2;
  --chip-gray-bg: rgba(147, 162, 194, 0.14);
  --chip-gray-text: #a3b0cc;

  /* ---- H2H grid tokens ---- */
  --h2h-border: rgba(0, 217, 255, 0.25);
  --h2h-green: #55f2c2;
  --h2h-green-bg: rgba(0, 130, 100, 0.28);
  --h2h-green-border: rgba(0, 255, 180, 0.45);
  --h2h-red: #ff8aae;
  --h2h-red-bg: rgba(140, 35, 75, 0.28);
  --h2h-red-border: rgba(255, 70, 130, 0.45);
  --h2h-neutral: #dce8f7;
  --h2h-neutral-bg: rgba(20, 35, 55, 0.7);
  --h2h-neutral-border: rgba(110, 150, 190, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }

::selection { background: rgba(24, 223, 255, 0.28); }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--cyan), var(--purple));
  border-radius: 999px;
  border: 2px solid var(--bg-primary);
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-primary);
  background-image:
    linear-gradient(rgba(24, 223, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 223, 255, 0.045) 1px, transparent 1px),
    radial-gradient(ellipse 900px 480px at 8% -10%, rgba(139, 92, 246, 0.14), transparent 60%),
    radial-gradient(ellipse 900px 480px at 96% -6%, rgba(24, 223, 255, 0.12), transparent 60%);
  background-size: 44px 44px, 44px 44px, auto, auto;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.015em; text-wrap: balance; }

.hero-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-title svg {
  flex: none;
  color: var(--cyan);
}

.app-shell {
  max-width: 1650px;
  margin: 0 auto;
  padding: 28px 32px 0;
  display: flex;
  align-items: flex-start;
  gap: 28px;
  box-sizing: border-box;
}

.app-main {
  flex: 1;
  min-width: 0;
}

.page {
  width: 100%;
  min-width: 0;
  padding: 0 0 64px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

/* Flex items default to min-width:auto, which lets unshrinkable content
   (a wide table, a long-content form) force the whole card -- and every
   ancestor up the chain -- to grow instead of scrolling internally. */
.page > * {
  min-width: 0;
}

.table-scroll {
  overflow-x: auto;
}

fluent-card {
  display: block;
  position: relative;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

/* Plain div with the same look as fluent-card -- used instead of the
   <fluent-card> custom element for very long prose content, where the
   element's internal shadow-DOM sizing can clip tall content on narrow
   viewports. */
.plain-card {
  display: block;
  position: relative;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--card-shadow);
}

.header-card {
  position: relative;
  overflow: hidden;
  border-color: var(--border-active);
  box-shadow: var(--shadow-cyan);
  background:
    radial-gradient(1100px 280px at 100% -30%, rgba(139, 92, 246, 0.18), transparent 60%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
}

.header-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(24, 223, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 223, 255, 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
  mask-image: linear-gradient(180deg, #000, transparent 85%);
  pointer-events: none;
}

.header-card > * {
  position: relative;
}

.header-card {
  padding-right: 190px;
}

.header-card > .hero-logo-panel {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  width: 175px;
  height: 175px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
}

.hero-logo-panel img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 55%, transparent 82%);
  mask-image: radial-gradient(circle at 50% 50%, #000 55%, transparent 82%);
  filter: drop-shadow(0 0 26px rgba(139, 92, 246, 0.3));
}

@media (max-width: 900px) {
  .header-card {
    padding-right: 24px;
  }

  .header-card > .hero-logo-panel {
    display: none;
  }
}

.header-card h1 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  font-size: clamp(1.75rem, 1.35rem + 1.6vw, 3rem);
}

.meta {
  margin: 0 0 16px;
  color: var(--text-subtle);
  font-size: 14px;
}

.season-tabs {
  display: flex;
  gap: 8px;
}

.season-tab {
  text-decoration: none;
  color: var(--text-subtle);
  background: var(--surface-2);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.season-tab:hover {
  color: var(--text);
  border-color: var(--border-active);
}

.season-tab.active {
  background: linear-gradient(90deg, var(--gold), #ffe1a0);
  border-color: var(--gold);
  color: #241a04;
  box-shadow: 0 0 16px rgba(246, 196, 83, 0.35);
}

.view-tabs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.view-tab {
  text-decoration: none;
  color: var(--text-subtle);
  background: var(--surface-2);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.view-tab:hover {
  color: var(--text);
  border-color: var(--border-active);
}

.view-tab.active {
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-color: transparent;
  color: #04141a;
  box-shadow: var(--shadow-cyan);
}

.standings-card h2 {
  margin: 0 0 2px;
  font-size: 18px;
}

.subtle {
  margin: 0 0 16px;
  color: var(--text-subtle);
  font-size: 13px;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.standings-table th {
  text-align: left;
  color: var(--text-subtle);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
}

.standings-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.standings-table tr:first-child td {
  font-weight: 600;
}

.standings-table tbody tr {
  transition: background-color 0.15s ease;
}

.standings-table tbody tr:hover {
  background-color: var(--surface-hover);
}

.team-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.team-name {
  font-weight: 600;
}

.owner-name {
  color: var(--text-subtle);
  font-size: 12px;
}

/* Standings v2: rank badges, manager column, diff, playoff shading */
.standings-table-v2 th:nth-child(n+4),
.standings-table-v2 td:nth-child(n+4) {
  text-align: right;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 12.5px;
}

.rank-first { background: var(--rank-first-bg); color: var(--rank-first-text); }
.rank-playoff { background: var(--rank-playoff-bg); color: var(--rank-playoff-text); }
.rank-out { background: var(--rank-out-bg); color: var(--text-subtle); }

.manager-name {
  color: var(--brand);
  font-weight: 600;
  font-size: 13px;
}

.diff-pos { color: var(--diff-pos); font-weight: 700; }
.diff-neg { color: var(--diff-neg); font-weight: 700; }

tr.playoff-row { background: var(--playoff-tint-bg); }
tr.playoff-cutoff td { border-bottom: 2px solid var(--chrome-bg); }

/* Career stats table */
.careers-table th,
.careers-table td {
  text-align: right;
  white-space: nowrap;
}

.careers-table th:first-child,
.careers-table td:first-child,
.careers-table th:nth-child(2),
.careers-table td:nth-child(2) {
  text-align: left;
  white-space: normal;
}

.group-head {
  text-align: center !important;
  font-family: var(--font-ui);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid var(--border);
}

.group-total { background: var(--group-total-bg); }
.group-season { background: var(--group-season-bg); }
.group-playoffs { background: var(--group-playoffs-bg); }

.group-start {
  border-left: 2px solid var(--border);
}

.manager-cell-name {
  font-weight: 700;
}

.season-range {
  color: var(--text-subtle);
  font-size: 12px;
}

.title-badge {
  display: inline-block;
  background: var(--chip-amber-bg);
  color: var(--chip-amber-text);
  font-weight: 700;
  font-size: 12.5px;
  padding: 3px 10px;
  border-radius: 999px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
}

.live-badge.is-live {
  border-color: rgba(47, 224, 138, 0.4);
  background: rgba(47, 224, 138, 0.08);
  color: var(--green);
}

.live-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.titles-none {
  color: var(--border);
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable-th:hover {
  color: var(--text);
}

.sort-arrow {
  display: inline-block;
  font-size: 10px;
  color: var(--brand);
}

/* League records */
.section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 4px 0 0;
}

.records-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: stretch;
}

/* If the last card ends up alone on its row, let it stretch full-width
   instead of sitting small and lopsided on the left. */
.records-grid > .record-card:last-child:nth-child(3n+1) {
  grid-column: 1 / -1;
}

.record-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.record-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  opacity: 0.6;
}

.record-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
  box-shadow: var(--shadow-cyan);
}

.record-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  margin-bottom: 6px;
}

.record-top3 {
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}

.record-top3-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.record-top3-row:last-child {
  border-bottom: none;
}

.record-top3-rank {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  background: var(--group-total-bg);
  color: var(--text-subtle);
}

.record-top3-row:first-child .record-top3-rank {
  background: var(--rank-first-bg);
  color: var(--rank-first-text);
}

.record-top3-main {
  flex: 1;
  min-width: 0;
}

.record-top3-name {
  display: block;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.record-top3-detail {
  display: block;
  color: var(--text-subtle);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.record-top3-value {
  flex: none;
  font-weight: 800;
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
}

.streaks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.streak-list {
  display: flex;
  flex-direction: column;
}

.streak-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.streak-row:last-child {
  border-bottom: none;
}

.streak-rank {
  color: var(--text-subtle);
  font-size: 13px;
  width: 14px;
  flex: none;
}

.streak-badge {
  flex: none;
  min-width: 30px;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  padding: 4px 0;
  border-radius: 8px;
}

.streak-win { background: var(--chip-green-bg); color: var(--chip-green-text); }
.streak-loss { background: var(--chip-red-bg); color: var(--chip-red-text); }

.streak-name {
  font-weight: 700;
  font-size: 14px;
  flex: 1;
}

.streak-range {
  color: var(--text-subtle);
  font-size: 12.5px;
  flex: none;
}

.streak-tag {
  flex: none;
  background: var(--chip-amber-bg);
  color: var(--chip-amber-text);
  font-weight: 600;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 6px;
}

/* Matchups v2 */
.matchups-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.matchups-toolbar h2 {
  margin: 0;
}

.show-all-link {
  background: none;
  border: none;
  color: var(--brand);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.week-pill {
  position: relative;
}

.week-pill.playoff-week::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -1px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rank-first-bg);
}

.matchup-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 16px;
  align-items: start;
}

.matchup-card-v2 {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.matchup-card-v2:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
  box-shadow: var(--shadow-cyan);
}

.matchup-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.matchup-team-info {
  flex: 1;
  min-width: 0;
}

.matchup-team-info.right {
  text-align: right;
}

.matchup-team-name-v2 {
  font-weight: 700;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matchup-team-info .owner-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matchup-score-box {
  background: linear-gradient(135deg, rgba(24, 223, 255, 0.18), rgba(139, 92, 246, 0.18));
  border: 1px solid var(--border-active);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 15.5px;
  font-variant-numeric: tabular-nums;
  min-width: 60px;
  text-align: center;
  flex: none;
  box-shadow: 0 0 14px rgba(24, 223, 255, 0.12);
}

.matchup-score-box.plain {
  background: var(--surface-2);
  border-color: var(--border);
  font-weight: 600;
  color: var(--text-subtle);
  box-shadow: none;
}

.matchup-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.lineups-toggle {
  background: none;
  border: none;
  color: var(--brand);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
}

.chevron {
  display: inline-block;
  transition: transform 0.15s ease;
}

.matchup-card-v2.open .chevron {
  transform: rotate(180deg);
}

.matchup-lineups {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}

.matchup-card-v2.open .matchup-lineups {
  display: grid;
}

.lineup-col {
  min-width: 0;
}

.lineup-note {
  background: var(--chip-amber-bg);
  color: var(--chip-amber-text);
  font-size: 11px;
  line-height: 1.4;
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.lineup-col-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  font-size: 12.5px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.lineup-col-head span:first-child {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lineup-col-head span:last-child {
  flex: none;
}

.lineup-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12.5px;
}

.lineup-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lineup-team {
  flex: none;
  width: 30px;
  color: var(--text-subtle);
  font-size: 11px;
}

.lineup-points {
  flex: none;
  width: 44px;
  text-align: right;
  font-weight: 700;
}

/* Top nav */
.topbar {
  position: relative;
  background: linear-gradient(180deg, var(--bg-secondary), var(--bg-primary));
  border-bottom: 1px solid var(--border);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--gold));
  opacity: 0.6;
}

.topbar-inner {
  max-width: 1650px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  box-sizing: border-box;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.brand-logo {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--border-active), 0 0 18px rgba(24, 223, 255, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.03em;
  color: var(--text);
}

.brand-tag {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.top-nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.top-link {
  text-decoration: none;
  color: var(--text-subtle);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.top-link:hover {
  color: var(--text);
  border-color: var(--border);
}

.top-link.active {
  color: #04141a;
  font-weight: 700;
  background: linear-gradient(90deg, var(--cyan), #7cf0ff);
  box-shadow: var(--shadow-cyan);
}

/* League sidebar (NFL / NBA Redraft / NBA Dynasty) */
.side-nav {
  flex: none;
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 24px;
}

.side-nav-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 14px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.side-nav-title svg {
  flex: none;
  color: var(--purple);
}

.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 11px 14px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--text-subtle);
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.side-link svg {
  flex: none;
  opacity: 0.75;
}

.side-link:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.side-link.active {
  color: var(--text);
  font-weight: 700;
  background: var(--side-active-bg);
  border-left-color: var(--cyan);
  box-shadow: inset 0 0 24px rgba(24, 223, 255, 0.06);
}

.side-link.active svg {
  opacity: 1;
  color: var(--cyan);
}

@media (max-width: 1150px) {
  .app-shell {
    flex-direction: column;
    align-items: stretch;
    padding: 18px 20px 0;
    gap: 14px;
  }

  .side-nav {
    position: static;
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .side-nav-title {
    display: none;
  }

  .side-link {
    flex: none;
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: var(--radius-sm);
  }

  .side-link.active {
    border-bottom-color: var(--cyan);
    box-shadow: none;
  }
}

/* Matchups */
.week-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.week-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  text-decoration: none;
  color: var(--text-subtle);
  background: var(--surface-2);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 50%;
  border: 1px solid var(--border);
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.week-pill:hover {
  border-color: var(--border-active);
  color: var(--text);
  transform: translateY(-1px);
}

.week-pill.active {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  border-color: transparent;
  color: #04141a;
  box-shadow: var(--shadow-cyan);
}

/* H2H form */
.coming-soon p {
  font-size: 14px;
  line-height: 1.6;
}

/* H2H compare form */
.h2h-form-v2 {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.h2h-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 180px;
}

.h2h-field label {
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.h2h-field select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.h2h-field select:hover {
  border-color: var(--border-active);
}

.h2h-field select:focus-visible {
  outline: none;
  border-color: var(--border-active);
  box-shadow: var(--shadow-cyan);
}

.h2h-vs {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 2px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-purple);
  color: var(--purple);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.h2h-submit {
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  color: #04141a;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  height: 42px;
  box-shadow: var(--shadow-cyan);
  transition: filter 0.18s ease, transform 0.18s ease;
}

.h2h-submit:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.h2h-submit:active {
  transform: translateY(0);
}

/* ---- shared button system (available for future pages) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  color: #04141a;
  box-shadow: var(--shadow-cyan);
}

.btn-primary:hover { filter: brightness(1.08); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover { border-color: var(--border-active); }

.btn-gold {
  background: linear-gradient(90deg, var(--gold), #ffe1a0);
  color: #241a04;
  box-shadow: 0 0 16px rgba(246, 196, 83, 0.35);
}

.btn-gold:hover { filter: brightness(1.05); }

/* H2H grid panel */
.h2h-panel {
  position: relative;
  border-color: var(--h2h-border);
  box-shadow: var(--shadow-cyan), var(--shadow-purple);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

.h2h-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(420px 220px at 0% 0%, rgba(139, 92, 246, 0.12), transparent 60%),
    radial-gradient(420px 220px at 100% 0%, rgba(24, 223, 255, 0.1), transparent 60%);
  pointer-events: none;
}

.h2h-panel > * {
  position: relative;
}

.h2h-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.h2h-panel-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.h2h-icon-box {
  flex: none;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-cyan);
  color: var(--cyan);
}

.h2h-title {
  margin: 0 0 4px;
  font-size: 26px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.h2h-subtitle {
  margin: 0 0 4px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.h2h-instruction {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.h2h-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.h2h-legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 64px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.h2h-legend-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.h2h-legend-value {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.h2h-legend-win { background: var(--h2h-green-bg); border-color: var(--h2h-green-border); }
.h2h-legend-win .h2h-legend-label,
.h2h-legend-win .h2h-legend-value { color: var(--h2h-green); }

.h2h-legend-loss { background: var(--h2h-red-bg); border-color: var(--h2h-red-border); }
.h2h-legend-loss .h2h-legend-label,
.h2h-legend-loss .h2h-legend-value { color: var(--h2h-red); }

.h2h-legend-tie { background: var(--h2h-neutral-bg); border-color: var(--h2h-neutral-border); }
.h2h-legend-tie .h2h-legend-label,
.h2h-legend-tie .h2h-legend-value { color: var(--h2h-neutral); }

.h2h-legend-self { flex-direction: row; gap: 8px; }

.h2h-legend-swatch {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid var(--h2h-border);
  background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 3px, rgba(0, 217, 255, 0.3) 3px, rgba(0, 217, 255, 0.3) 4px);
}

/* H2H grid */
.h2h-grid-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
}

.h2h-grid {
  border-collapse: separate;
  border-spacing: 6px;
}

.h2h-grid thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg-primary);
}

.h2h-grid-corner {
  width: 170px;
  vertical-align: bottom;
  padding-bottom: 8px;
  left: 0;
  z-index: 4 !important;
}

.h2h-corner-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.h2h-col-head {
  width: 112px;
  height: 84px;
  padding: 0 3px;
}

.h2h-col-head span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-align: center;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: #eaf4ff;
  background: var(--surface-2);
  border: 1px solid var(--h2h-border);
  box-shadow: 0 0 12px rgba(0, 217, 255, 0.07);
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
  word-break: break-word;
  padding: 4px 10px;
}

.h2h-row-head {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-primary);
  box-shadow: 2px 0 0 var(--h2h-border);
  text-align: left;
  padding: 6px 16px 6px 4px;
  white-space: nowrap;
}

.h2h-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-right: 10px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 13px;
  vertical-align: middle;
}

.h2h-badge-0 { background: rgba(24, 223, 255, 0.16); color: var(--cyan); border: 1px solid rgba(24, 223, 255, 0.4); }
.h2h-badge-1 { background: rgba(139, 92, 246, 0.18); color: var(--purple); border: 1px solid rgba(139, 92, 246, 0.4); }
.h2h-badge-2 { background: rgba(246, 196, 83, 0.18); color: var(--gold); border: 1px solid rgba(246, 196, 83, 0.4); }
.h2h-badge-3 { background: rgba(47, 224, 138, 0.16); color: var(--green); border: 1px solid rgba(47, 224, 138, 0.4); }
.h2h-badge-4 { background: rgba(255, 85, 119, 0.16); color: var(--red); border: 1px solid rgba(255, 85, 119, 0.4); }

.h2h-row-name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
  vertical-align: middle;
}

.h2h-cell {
  min-width: 112px;
  height: 46px;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.h2h-cell a {
  display: block;
  width: 100%;
  height: 100%;
  line-height: 46px;
  color: inherit;
  text-decoration: none;
}

.h2h-cell a:hover,
.h2h-cell a:focus-visible {
  cursor: pointer;
}

.h2h-win {
  background: var(--h2h-green-bg);
  color: var(--h2h-green);
  border-color: var(--h2h-green-border);
}

.h2h-loss {
  background: var(--h2h-red-bg);
  color: var(--h2h-red);
  border-color: var(--h2h-red-border);
}

.h2h-even {
  background: var(--h2h-neutral-bg);
  color: var(--h2h-neutral);
  border-color: var(--h2h-neutral-border);
}

.h2h-win:has(a):hover,
.h2h-loss:has(a):hover,
.h2h-even:has(a):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  filter: brightness(1.15);
}

.h2h-empty { background: transparent; }
.h2h-empty .h2h-dot { color: var(--text-muted); font-weight: 600; }

.h2h-diagonal {
  border-radius: var(--radius-sm);
  background-color: #06111d;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 4px,
    rgba(0, 210, 255, 0.22) 4px,
    rgba(0, 210, 255, 0.22) 5px
  );
}

.h2h-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  /* Let long team/owner names wrap instead of being ellipsis-truncated
     down to a couple of characters in the cramped mobile matchup row. */
  .matchup-team-name-v2,
  .matchup-team-info .owner-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .h2h-panel-head {
    flex-direction: column;
  }

  .h2h-panel-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* Draft grid */
.draft-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.draft-grid {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
}

.draft-corner {
  position: sticky;
  left: 0;
  background: var(--chrome-bg);
  z-index: 2;
  width: 40px;
}

.draft-slot-head {
  background: linear-gradient(135deg, rgba(24, 223, 255, 0.22), rgba(139, 92, 246, 0.28));
  color: var(--chrome-text);
  padding: 10px 14px;
  text-align: left;
  min-width: 150px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.slot-label {
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
}

.slot-team {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}

.draft-round-head {
  position: sticky;
  left: 0;
  background: var(--card-bg);
  color: var(--text-subtle);
  font-weight: 700;
  text-align: center;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  z-index: 1;
}

.draft-cell {
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px;
  vertical-align: top;
  min-width: 150px;
}

.pick-card {
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.pick-card:hover {
  border-color: var(--border-active);
  box-shadow: 0 0 12px rgba(24, 223, 255, 0.15);
  transform: translateY(-1px);
}

.pick-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.pick-label {
  color: var(--text-subtle);
  font-size: 12px;
  font-weight: 600;
}

.pick-player {
  font-weight: 700;
  font-size: 13.5px;
}

.pick-team {
  color: var(--text-subtle);
  font-size: 12px;
}

.pos-badge {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 5px;
  text-align: center;
}

.lineup-row .pos-badge {
  min-width: 30px;
}

.pos-QB { background: var(--chip-red-bg); color: var(--chip-red-text); }
.pos-RB { background: var(--chip-green-bg); color: var(--chip-green-text); }
.pos-WR { background: var(--chip-blue-bg); color: var(--chip-blue-text); }
.pos-TE { background: var(--chip-orange-bg); color: var(--chip-orange-text); }
.pos-K  { background: var(--chip-purple-bg); color: var(--chip-purple-text); }
.pos-DEF { background: var(--chip-gray-bg); color: var(--chip-gray-text); }
.pos-NA { background: var(--chip-gray-bg); color: var(--chip-gray-text); }

/* NBA positions */
.pos-PG { background: var(--chip-blue-bg); color: var(--chip-blue-text); }
.pos-SG { background: var(--chip-teal-bg); color: var(--chip-teal-text); }
.pos-SF { background: var(--chip-green-bg); color: var(--chip-green-text); }
.pos-PF { background: var(--chip-orange-bg); color: var(--chip-orange-text); }
.pos-C  { background: var(--chip-purple-bg); color: var(--chip-purple-text); }

.draft-list {
  display: none;
}

/* Tablet */
@media (max-width: 980px) {
  .records-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .records-grid > .record-card:last-child:nth-child(3n+1) {
    grid-column: auto;
  }

  .records-grid > .record-card:last-child:nth-child(2n+1) {
    grid-column: 1 / -1;
  }
}

/* Mobile */
@media (max-width: 720px) {
  .app-shell {
    padding: 14px 12px 0;
  }

  .page {
    padding: 0 0 40px;
    gap: 14px;
  }

  .topbar-inner {
    padding: 10px 12px;
    justify-content: flex-start;
    gap: 6px 10px;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .brand-name {
    font-size: 14.5px;
  }

  .brand-tag {
    font-size: 8.5px;
  }

  .brand {
    width: 100%;
  }

  .top-nav {
    flex-wrap: wrap;
    margin-left: 0;
  }

  .top-link {
    font-size: 12.5px;
    padding: 6px 10px;
  }

  fluent-card,
  .plain-card {
    padding: 16px;
    border-radius: 10px;
  }

  .header-card h1 {
    font-size: 20px;
  }

  .meta {
    font-size: 12.5px;
  }

  .standings-table,
  .draft-grid {
    font-size: 12.5px;
  }

  .standings-table th,
  .standings-table td {
    padding: 8px 6px;
  }

  .team-name {
    font-size: 13px;
  }

  .h2h-form-v2 {
    flex-direction: column;
    align-items: stretch;
  }

  .h2h-field {
    min-width: 0;
  }

  .h2h-vs {
    align-self: center;
  }

  .h2h-submit {
    width: 100%;
  }

  .matchup-grid-v2,
  .matchup-lineups,
  .records-grid,
  .streaks-grid {
    grid-template-columns: 1fr;
  }

  .streak-row {
    flex-wrap: wrap;
  }

  .streak-range {
    width: 100%;
    padding-left: 42px;
  }

  /* Turn data tables into stacked cards so nothing needs horizontal scroll */
  .table-scroll {
    overflow-x: visible;
  }

  .standings-table thead {
    display: none;
  }

  .standings-table,
  .standings-table tbody,
  .standings-table tr {
    display: block;
    width: 100%;
  }

  .standings-table tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
  }

  .standings-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    border-bottom: none;
  }

  .standings-table td[data-label]::before {
    content: attr(data-label);
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-subtle);
  }

  .standings-table td.rank-td {
    justify-content: flex-start;
    gap: 8px;
    font-weight: 700;
  }

  .standings-table td.rank-td::before {
    content: "#";
  }

  .standings-table td.team-td {
    display: block;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
    font-size: 15px;
  }

  .standings-table td.team-td::before {
    display: block;
    margin-bottom: 2px;
  }

  /* Draft: swap the wide grid for a simple chronological list */
  .draft-scroll {
    display: none;
  }

  .draft-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .draft-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
  }

  .draft-list-item .pick-label {
    width: 42px;
    flex: none;
  }

  .draft-list-item .pick-main {
    flex: 1;
    min-width: 0;
  }

  .draft-list-item .pick-player {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .draft-list-item .pick-owner {
    color: var(--text-subtle);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

}

/* Manager profiles */
.tier-section + .tier-section {
  margin-top: 4px;
}

.tier-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.tier-heading h2 {
  margin: 0;
}

.tier-count {
  color: var(--text-subtle);
  font-size: 13px;
}

.tier-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
}

.tier-hall_of_fame { background: var(--chip-amber-bg); color: var(--chip-amber-text); }
.tier-all_star { background: var(--chip-blue-bg); color: var(--chip-blue-text); }
.tier-rookie { background: var(--chip-green-bg); color: var(--chip-green-text); }
.tier-retired { background: var(--chip-gray-bg); color: var(--chip-gray-text); }

.manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.manager-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card-bg);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.manager-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.manager-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 15%;
  display: block;
  background: var(--group-total-bg);
}

.manager-photo-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  color: var(--text-subtle);
  background: var(--group-total-bg);
}

.manager-card-name {
  padding: 10px 12px 12px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}

.trophy-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 0 10px 14px;
  margin-top: -4px;
}

.trophy-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 2px solid var(--brand);
  background: #000;
  flex: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.tier-empty {
  color: var(--text-subtle);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

/* Manager profile detail page */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-photo {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  border: 3px solid var(--card-bg);
  box-shadow: 0 0 0 2px var(--border);
  flex: none;
}

.profile-photo-placeholder {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 800;
  color: var(--text-subtle);
  background: var(--group-total-bg);
  box-shadow: 0 0 0 2px var(--border);
}

.profile-header h1 {
  margin: 0;
  font-family: var(--font-ui);
  text-transform: none;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.profile-trophy-row {
  display: flex;
  gap: 10px;
}

.profile-trophy-row .trophy-icon {
  width: 80px;
  height: 80px;
  border-width: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.league-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.league-stat-card h2 {
  margin: 0 0 2px;
}

.stat-split-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.stat-split-col {
  border-left: 2px solid var(--border);
  padding-left: 10px;
}

.stat-split-title {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  margin-bottom: 8px;
}

.pace-heading {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  padding: 3px 0;
}

.stat-row-label {
  color: var(--text-subtle);
}

.profile-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-subtle);
}

.no-leagues {
  color: var(--text-subtle);
}

.tier-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.tier-legend-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  color: var(--text-subtle);
}

.tier-legend-tier {
  font-weight: 700;
  color: var(--text);
  min-width: 44px;
}

.tier-legend-name {
  font-weight: 600;
  color: var(--brand);
  min-width: 90px;
}

@media (max-width: 980px) {
  .manager-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .league-stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .manager-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-header {
    flex-wrap: wrap;
  }

  .stat-split-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-split-col {
    border-left: none;
    border-top: 2px solid var(--border);
    padding-left: 0;
    padding-top: 8px;
  }
}

/* League rules / constitution */
.rules-card h2 {
  position: relative;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 30px 0 10px;
  padding-top: 20px;
  border-top: none;
}

.rules-card h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 64px;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
}

.rules-card h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
}

.rules-card h2:first-of-type::before {
  display: none;
}

.rules-card h3 {
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 18px 0 6px;
  color: var(--cyan);
}

.rules-card p {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.7;
  margin: 0 0 10px;
  max-width: 70ch;
}

.rules-card ul {
  margin: 0 0 12px;
  padding-left: 22px;
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.7;
  max-width: 70ch;
}

.rules-card li {
  margin-bottom: 4px;
}

.rules-bismillah {
  text-align: center;
  font-size: 17px;
  line-height: 1.9;
  max-width: none;
  margin: 4px 0 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.rules-bismillah-en {
  display: block;
  font-size: 12.5px;
  font-style: italic;
  color: var(--text-subtle);
  margin-top: 4px;
}

.rules-callout {
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  margin: 18px 0 4px;
  color: var(--brand);
  max-width: none;
}

.rules-summary-grid {
  display: flex;
  flex-direction: column;
}

.rules-summary-grid .stat-row {
  border-bottom: 1px solid var(--border);
  padding: 9px 0;
  font-size: 13.5px;
  gap: 20px;
}

.rules-summary-grid .stat-row:last-child {
  border-bottom: none;
}

.rules-summary-grid .stat-row span:first-child {
  flex: none;
  min-width: 150px;
}

.rules-summary-grid .stat-row span:last-child {
  text-align: right;
  font-weight: 600;
}

@media (max-width: 720px) {
  .rules-summary-grid .stat-row {
    flex-direction: column;
    gap: 2px;
  }

  .rules-summary-grid .stat-row span:last-child {
    text-align: left;
  }
}

/* Steal / Bust */
.steal-bust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 14px;
}

.steal-heading,
.bust-heading {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
}

.steal-heading { color: var(--chip-green-text); }
.bust-heading { color: var(--chip-red-text); }

.steal-side {
  background: rgba(24, 223, 255, 0.04);
  border: 1px solid rgba(24, 223, 255, 0.16);
  border-radius: var(--radius-md);
  padding: 16px;
}

.bust-side {
  background: rgba(255, 85, 119, 0.04);
  border: 1px solid rgba(255, 85, 119, 0.16);
  border-radius: var(--radius-md);
  padding: 16px;
}

.steal-bust-table th,
.steal-bust-table td {
  font-size: 12.5px;
  white-space: nowrap;
}

.steal-bust-table .diff-pos,
.steal-bust-table .diff-neg {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
}

.steal-bust-table .diff-pos {
  background: var(--chip-green-bg);
  color: var(--chip-green-text);
}

.steal-bust-table .diff-pos::before {
  content: "\25B2";
  font-size: 8px;
}

.steal-bust-table .diff-neg {
  background: var(--chip-red-bg);
  color: var(--chip-red-text);
}

.steal-bust-table .diff-neg::before {
  content: "\25BC";
  font-size: 8px;
}

@media (max-width: 900px) {
  .steal-bust-grid {
    grid-template-columns: 1fr;
  }
}
