:root {
  --bg: #0f131a;
  --bg-elevated: #161c26;
  --panel: #161c26;
  --panel-2: #1d2530;
  --panel-3: #242d3a;
  --panel-glow: #1d2530;
  --ink: #e8ecf2;
  --muted: #98a3b3;
  --muted-2: #6c7787;
  --line: rgba(152, 163, 179, 0.17);
  --line-strong: rgba(27, 158, 140, 0.34);
  --accent: #1b9e8c;
  --accent-2: #22b8a3;
  --accent-dark: #12776a;
  --accent-ink: #03201c;
  --highlight: #3d8be0;
  --highlight-soft: rgba(61, 139, 224, 0.14);
  --danger: #e84d66;
  --warning: #c4831a;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 6px 16px rgba(0, 0, 0, 0.22);
  --radius: 16px;
  --radius-sm: 10px;
  --font: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body[data-theme="light"] {
  --bg: #f5f7fa;
  --bg-elevated: #ffffff;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --panel-3: #eff3f8;
  --panel-glow: #ffffff;
  --ink: #121821;
  --muted: #4c5768;
  --muted-2: #78849a;
  --line: rgba(18, 24, 33, 0.13);
  --line-strong: rgba(18, 133, 117, 0.3);
  --accent: #128575;
  --accent-2: #17a08f;
  --accent-dark: #0c6357;
  --accent-ink: #ffffff;
  --highlight: #2f7de1;
  --highlight-soft: rgba(47, 125, 225, 0.12);
  --danger: #ce3b54;
  --warning: #8a600a;
  --shadow: 0 18px 38px rgba(18, 24, 33, 0.1);
  --shadow-soft: 0 6px 16px rgba(18, 24, 33, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body[data-theme="light"] {
  color-scheme: light;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

body[data-theme="light"] {
  background: var(--bg);
}

body.portal-page {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(15, 19, 26, 0.88);
  border-bottom: 1px solid rgba(152, 163, 179, 0.08);
}

body[data-theme="light"] .topbar {
  background: rgba(245, 247, 250, 0.92);
  border-bottom-color: rgba(23, 35, 28, 0.08);
}

.topbar-inner {
  width: min(1800px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0;
  display: grid;
  grid-template-columns: auto auto;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(61, 139, 224, 0.25), 0 10px 24px rgba(27, 158, 140, 0.28);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-overline {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-copy strong {
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.main-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: 120ms ease;
}

.main-nav a:hover {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  transition: 120ms ease;
}

.logout-link:hover {
  border-color: rgba(27, 158, 140, 0.4);
  color: var(--highlight);
  transform: translateY(-1px);
}

body[data-theme="light"] .logout-link {
  background: var(--panel);
  color: var(--ink);
}

body[data-theme="light"] .logout-link:hover {
  color: var(--accent-dark);
}

.portal-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: calc(100vh - 84px);
  margin: 0 auto;
  padding: clamp(46px, 7vw, 92px) 0;
  display: grid;
  align-content: center;
  gap: 28px;
}

.portal-hero {
  max-width: 780px;
}

.portal-hero h1 {
  margin: 10px 0 12px;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.portal-hero p:last-child {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.portal-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.portal-choice-grid-tight {
  max-width: 860px;
}

.portal-choice-grid-three {
  max-width: 1320px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.h2h-scoring-shell {
  width: min(1320px, calc(100% - 32px));
}

.h2h-scoring-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-choice-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    var(--panel);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

button.portal-choice-card {
  width: 100%;
}

body[data-theme="light"] .portal-choice-card {
  background:
    var(--panel);
}

.portal-choice-card:hover {
  transform: translateY(-3px);
  border-color: rgba(61, 139, 224, 0.42);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

body[data-theme="light"] .portal-choice-card:hover {
  box-shadow: 0 18px 34px rgba(21, 34, 24, 0.13);
}

.portal-choice-card-primary {
  border-color: rgba(61, 139, 224, 0.42);
  background:
    var(--panel);
}

body[data-theme="light"] .portal-choice-card-primary {
  background:
    var(--panel);
}

.portal-choice-card strong {
  display: block;
  max-width: 12ch;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.portal-choice-card small {
  max-width: 420px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.league-modal[hidden],
.league-step[hidden] {
  display: none !important;
}

.league-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    rgba(8, 10, 14, 0.78);
  backdrop-filter: blur(14px);
}

body[data-theme="light"] .league-modal {
  background:
    rgba(239, 243, 248, 0.76);
}

.league-dialog {
  width: min(680px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background:
    var(--panel);
  box-shadow: var(--shadow);
  padding: 24px;
}

body[data-theme="light"] .league-dialog {
  background:
    var(--panel);
}

.league-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.league-modal-head h2 {
  margin: 4px 0 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 0.98;
}

.league-modal-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.league-modal-close:hover {
  border-color: rgba(61, 139, 224, 0.42);
  color: var(--highlight);
}

.league-step {
  display: grid;
  gap: 18px;
  padding-top: 22px;
}

.league-field {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.league-field input,
.league-field select {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  padding: 0 16px;
  font-size: 1rem;
  font-weight: 750;
  outline: none;
}

body[data-theme="light"] .league-field input,
body[data-theme="light"] .league-field select {
  background: rgba(23, 35, 28, 0.04);
}

.league-field input:focus,
.league-field select:focus {
  border-color: rgba(61, 139, 224, 0.52);
  box-shadow: 0 0 0 3px rgba(61, 139, 224, 0.12);
}

.league-field input::placeholder {
  color: var(--muted-2);
}

.league-error {
  margin: -4px 0 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 750;
}

.league-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.league-action-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 900;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.league-action-button.secondary {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

body[data-theme="light"] .league-action-button.secondary {
  background: rgba(23, 35, 28, 0.04);
}

.league-action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.league-context {
  margin: 0;
  color: var(--muted);
}

.league-context strong {
  color: var(--ink);
}

.league-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.league-type-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

body[data-theme="light"] .league-type-card {
  background: rgba(23, 35, 28, 0.03);
}

.league-type-card span {
  color: var(--highlight);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.league-type-card strong {
  font-size: 1.45rem;
  line-height: 1;
}

.league-type-card small {
  color: var(--muted);
  line-height: 1.45;
}

.league-type-card:hover,
.league-type-card.is-selected {
  transform: translateY(-2px);
  border-color: rgba(61, 139, 224, 0.5);
  background:
    var(--panel),
    rgba(255, 255, 255, 0.04);
}

.league-setup-shell {
  width: min(760px, calc(100% - 32px));
  min-height: calc(100vh - 84px);
  margin: 0 auto;
  padding: clamp(44px, 6vw, 76px) 0 120px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.league-setup-hero {
  text-align: center;
  margin-bottom: 8px;
}

.league-setup-hero h1 {
  margin: 8px 0 8px;
  color: var(--ink);
  font-size: clamp(2.2rem, 5vw, 3.7rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.league-setup-hero p:last-child,
.league-setup-note,
.league-setup-footnote {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.league-summary-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  background:
    var(--panel);
  box-shadow: var(--shadow-soft);
}

body[data-theme="light"] .league-summary-card {
  background:
    var(--panel);
}

.league-summary-card h2 {
  margin: 6px 0 18px;
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: 0;
}

.league-summary-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.league-summary-list div {
  display: grid;
  grid-template-columns: minmax(160px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.league-summary-list dt {
  color: var(--ink);
  font-weight: 900;
}

.league-summary-list dd {
  margin: 0;
  color: var(--muted);
  font-weight: 900;
  text-align: right;
}

.league-schedule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.league-schedule-grid .league-field input,
.league-schedule-grid .league-field select {
  min-height: 48px;
}

.league-setup-footnote {
  margin-top: 14px;
  text-align: center;
  font-size: 0.88rem;
}

.league-setup-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: rgba(15, 19, 26, 0.9);
  backdrop-filter: blur(16px);
}

body[data-theme="light"] .league-setup-actions {
  background: rgba(245, 247, 250, 0.92);
}

.league-save-message {
  border: 1px solid rgba(61, 139, 224, 0.35);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(61, 139, 224, 0.12);
  color: var(--highlight);
  font-weight: 950;
}

/* The invite page's main carries league-settings-shell too, whose 1040px
   width used to win by file order and squeezed the three-column fixtures
   workspace into a third of the screen. The compound selector wins, and the
   workspace gets the width its columns need. */
.league-settings-shell.league-invite-shell {
  width: min(1500px, calc(100% - 32px));
}

.league-invite-card {
  display: grid;
  gap: 18px;
}

.league-workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.league-workspace-tabs button,
.league-position-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-weight: 950;
  cursor: pointer;
}

.league-reset-fixtures-button {
  min-height: 42px;
  border: 1px solid rgba(233, 64, 64, 0.5);
  border-radius: 8px;
  padding: 0 16px;
  background: rgba(233, 64, 64, 0.12);
  color: #ff6b6b;
  font-weight: 950;
  cursor: pointer;
}

.league-reset-fixtures-button:hover {
  background: rgba(233, 64, 64, 0.2);
}

.league-workspace-tabs button.is-active,
.league-position-tabs button.is-active {
  border-color: var(--accent-ink);
  background: var(--accent);
  color: var(--accent-ink);
}

.league-workspace-panel {
  display: grid;
  gap: 16px;
}

.league-workspace-panel[hidden] {
  display: none;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.admin-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-weight: 950;
  cursor: pointer;
}

.admin-tabs button.is-active {
  border-color: var(--accent-ink);
  background: var(--accent);
  color: var(--accent-ink);
}

.admin-tab-panel {
  display: grid;
  gap: 16px;
}

.admin-tab-panel[hidden] {
  display: none;
}

.admin-template-builder {
  gap: 16px;
}

.admin-template-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-template-note {
  margin: -6px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.admin-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-template-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel-soft);
}

.admin-template-card.is-enabled {
  border-color: rgba(27, 158, 140, 0.28);
  background: rgba(27, 158, 140, 0.08);
}

.admin-template-card span {
  color: var(--highlight);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-template-card h3 {
  margin: 5px 0 6px;
  color: var(--ink);
  font-size: 1.1rem;
  letter-spacing: 0;
}

.admin-template-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 760;
  line-height: 1.4;
}

.admin-template-switch {
  display: grid;
  gap: 8px;
  justify-items: end;
  align-content: start;
  color: var(--muted);
  font-weight: 900;
}

.admin-template-switch input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.admin-ladder-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.admin-ladder-editor,
.admin-ladder-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel-soft);
}

.admin-ladder-editor textarea,
.admin-ladder-card textarea {
  min-height: 170px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  line-height: 1.35;
}

.admin-ladder-market-map {
  display: grid;
  gap: 8px;
}

.admin-ladder-map-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-ladder-map-row span {
  min-width: 0;
}

.admin-ladder-map-row strong,
.admin-ladder-map-row em {
  display: block;
}

.admin-ladder-map-row strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.admin-ladder-map-row em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 850;
}

.admin-ladder-map-row select {
  min-width: 0;
  width: 100%;
}

.admin-ladder-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-ladder-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.admin-ladder-card-head h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 1.2rem;
  letter-spacing: 0;
}

.admin-ladder-card-head > span {
  color: var(--highlight);
  font-size: 0.82rem;
  font-weight: 950;
  white-space: nowrap;
}

.admin-backend-page .topbar {
  position: sticky;
  top: 0;
  z-index: 30;
}

.admin-backend-shell {
  width: min(1840px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(34px, 4vw, 64px) 0 80px;
  display: grid;
  gap: 22px;
}

.admin-backend-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: 18px;
  align-items: stretch;
}

.admin-backend-hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(3rem, 6vw, 6.1rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.admin-backend-hero p {
  max-width: 820px;
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 760;
  line-height: 1.5;
}

.admin-backend-health {
  display: grid;
  gap: 6px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background:
    var(--panel),
    var(--panel);
  box-shadow: var(--shadow);
}

.admin-backend-health span,
.admin-backend-health small,
.admin-home-card span,
.admin-setup-card span,
.admin-wallet-card span,
.admin-status {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.admin-backend-health strong {
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 950;
}

.admin-backend-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-backend-nav {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-backend-nav button,
.admin-backend-nav a,
.admin-subtabs button,
.admin-chip {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-weight: 950;
  text-align: left;
  cursor: pointer;
}

.admin-subtabs button,
.admin-chip {
  text-align: center;
}

.admin-subtabs.small button {
  min-height: 36px;
  font-size: 0.86rem;
}

.admin-backend-nav a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.admin-backend-nav button.is-active,
.admin-backend-nav a.is-active,
.admin-subtabs button.is-active,
.admin-chip.is-active {
  border-color: var(--accent-ink);
  background: var(--accent);
  color: var(--accent-ink);
}

.admin-chip.danger {
  border-color: rgba(233, 64, 64, 0.44);
  background: rgba(233, 64, 64, 0.12);
  color: #ff6b6b;
}

.admin-save-chip:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.admin-save-chip.is-dirty:not(:disabled) {
  border-color: var(--accent-ink);
  background: var(--accent);
  color: var(--accent-ink);
}

.admin-backend-workspace,
.admin-backend-panel,
.admin-config-panel {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.admin-backend-panel[hidden],
.admin-config-panel[hidden] {
  display: none;
}

.admin-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.admin-section-head.compact {
  align-items: center;
}

.admin-section-head h2,
.admin-section-head h3 {
  margin: 3px 0 0;
  color: var(--ink);
  letter-spacing: 0;
}

.admin-section-head h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.admin-section-head h3 {
  font-size: 1.45rem;
}

.admin-chip-row,
.admin-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-competitor-tools {
  display: grid;
  grid-template-columns: 104px 104px minmax(180px, 1fr) 116px;
  gap: 10px;
  align-items: end;
  min-width: min(620px, 100%);
}

.admin-per-page-control {
  display: grid;
  gap: 5px;
}

.admin-per-page-control span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-card,
.admin-home-card,
.admin-setup-card,
.admin-wallet-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  min-width: 0;
}

.admin-home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-home-card {
  display: grid;
  gap: 8px;
  min-height: 154px;
  padding: 18px;
  text-align: left;
  cursor: pointer;
}

.admin-home-card strong,
.admin-wallet-card strong,
.admin-setup-card strong {
  color: var(--ink);
  font-size: 1.32rem;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.admin-home-card small,
.admin-setup-card p,
.admin-wallet-card small {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 760;
  line-height: 1.42;
}

.admin-two-column,
.admin-customer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.admin-filter-grid,
.admin-form-grid,
.admin-profile-grid,
.admin-setup-grid,
.admin-wallet-grid {
  display: grid;
  gap: 12px;
}

.admin-filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-filter-grid.wide {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-form-grid,
.admin-profile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-setup-grid,
.admin-wallet-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-form-grid label,
.admin-profile-grid article,
.admin-setup-card,
.admin-wallet-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: var(--panel-soft);
  min-width: 0;
}

.admin-form-grid label span,
.admin-profile-grid article span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-form-grid input,
.admin-form-grid select,
.admin-inline-input,
.admin-per-page-control select,
.admin-filter-grid select {
  min-width: 0;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 850;
}

/* Every competitor field spans the full panel width and stacks vertically,
   including the feed provider rows, so the inputs stay wide and readable. */
.admin-form-grid .admin-competitor-field {
  grid-column: 1 / -1;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-color: transparent;
  padding: 4px 0;
  background: transparent;
}

.admin-form-grid .admin-competitor-field > span {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: none;
}

.admin-field-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.admin-field-help {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 950;
  cursor: help;
}

.admin-competitor-toggle-row .admin-field-control {
  grid-template-columns: 48px auto 30px;
  justify-content: start;
}

.admin-switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
}

.admin-switch {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.admin-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.18s ease, background 0.18s ease;
}

.admin-switch-input:checked + .admin-switch {
  border-color: rgba(27, 158, 140, 0.55);
  background: rgba(27, 158, 140, 0.28);
}

.admin-switch-input:checked + .admin-switch::after {
  transform: translateX(20px);
  background: var(--highlight);
}

.admin-competitor-toggle-row strong {
  color: var(--ink);
  font-weight: 950;
}

.admin-pagination-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.admin-pagination-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-pagination-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 950;
  cursor: pointer;
}

.admin-pagination-actions button:not(:disabled):hover {
  border-color: rgba(27, 158, 140, 0.58);
}

.admin-pagination-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.admin-table-wrap {
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 0.92rem;
}

.admin-data-table.compact {
  font-size: 0.86rem;
}

.admin-data-table th,
.admin-data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-data-table th {
  background: rgba(27, 158, 140, 0.14);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-data-table th[data-market-sort] {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.admin-data-table th[data-market-sort]:hover {
  background: rgba(27, 158, 140, 0.22);
}

.admin-data-table th[data-market-sort][aria-sort="ascending"]::after {
  content: " \25B2";
  font-size: 0.7em;
}

.admin-data-table th[data-market-sort][aria-sort="descending"]::after {
  content: " \25BC";
  font-size: 0.7em;
}

.admin-empty-row {
  text-align: center;
  color: var(--muted);
  padding: 18px 12px;
  cursor: default;
}

/* Bet templates (admin > Structure/Configuration > Templates) */
.admin-bet-template-list,
.admin-bet-template-markets {
  display: grid;
  gap: 8px;
}

.admin-bet-template-markets {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-bet-template-check {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--panel-soft);
  cursor: pointer;
  min-width: 0;
}

.admin-bet-template-check.is-checked {
  border-color: rgba(61, 139, 224, 0.56);
  background: rgba(61, 139, 224, 0.12);
}

.admin-bet-template-check input {
  flex: none;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.admin-bet-template-check span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-bet-template-check strong {
  font-weight: 950;
}

.admin-bet-template-check em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 850;
}

.admin-bet-template-row,
.admin-bet-template-market-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
}

.admin-bet-template-row {
  cursor: pointer;
}

.admin-bet-template-row.is-selected {
  border-color: rgba(61, 139, 224, 0.56);
  background: rgba(61, 139, 224, 0.12);
}

.admin-bet-template-row > span:first-child,
.admin-bet-template-market-row > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-bet-template-row strong,
.admin-bet-template-market-row strong {
  font-weight: 950;
}

.admin-bet-template-row em,
.admin-bet-template-market-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 850;
}

.admin-data-table tbody tr {
  cursor: pointer;
}

.admin-data-table tbody tr:hover,
.admin-data-table tbody tr.is-selected {
  background: rgba(61, 139, 224, 0.12);
}

.admin-status {
  display: inline-grid;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.06);
}

.admin-status.ok {
  background: rgba(27, 158, 140, 0.14);
  color: var(--good, var(--accent-2));
}

.admin-status.muted {
  color: var(--muted);
}

.admin-mini-feed {
  display: grid;
  gap: 8px;
}

.admin-mini-feed article,
.admin-link-report article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.admin-mini-feed strong,
.admin-link-report strong {
  color: var(--ink);
  font-weight: 950;
}

.admin-mini-feed span,
.admin-link-report span {
  color: var(--muted);
  font-weight: 760;
}

.admin-match-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-match-card {
  display: grid;
  gap: 6px;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.admin-match-card.is-selected {
  border-color: rgba(61, 139, 224, 0.6);
  background: rgba(61, 139, 224, 0.12);
}

.admin-match-card span,
.admin-match-card small {
  color: var(--muted);
  font-weight: 850;
}

.admin-match-card strong {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.admin-report-nav {
  display: grid;
  gap: 8px;
}

.admin-report-nav button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 950;
  text-align: left;
  cursor: pointer;
}

.admin-report-nav button.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

.admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(9, 12, 16, 0.68);
  backdrop-filter: blur(4px);
}

.admin-modal-overlay[hidden] {
  display: none;
}

.admin-modal-panel {
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.admin-modal-head h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: 0;
}

.admin-modal-close {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  font-weight: 950;
  cursor: pointer;
}

.admin-log-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.admin-log-entry,
.admin-log-empty {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.admin-log-entry > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.admin-log-entry strong,
.admin-log-empty strong {
  color: var(--ink);
}

.admin-log-entry span,
.admin-log-empty span {
  color: var(--muted);
  font-weight: 800;
}

.admin-log-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.admin-log-table th,
.admin-log-table td {
  border-top: 1px solid var(--line);
  padding: 9px;
  color: var(--ink);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.admin-log-table th {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.h2h-action-button.is-danger {
  border-color: rgba(233, 64, 64, 0.5);
  background: rgba(233, 64, 64, 0.12);
  color: #ff6b6b;
}

.league-balance-strip {
  display: flex;
  justify-content: flex-end;
}

.league-balance-strip div {
  min-width: 210px;
  border: 1px solid rgba(27, 158, 140, 0.22);
  border-radius: 10px;
  padding: 12px 16px;
  background:
    var(--panel),
    rgba(255, 255, 255, 0.035);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.08);
}

.league-balance-strip span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.league-balance-strip strong {
  color: var(--ink);
  font-size: 1.35rem;
}

.league-public-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  border: 1px solid rgba(27, 158, 140, 0.24);
  border-radius: 10px;
  padding: 18px;
  background:
    var(--panel),
    rgba(255, 255, 255, 0.03);
}

.league-public-banner h2 {
  margin: 5px 0 4px;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.1;
}

.league-public-banner span {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.league-invite-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.league-invite-head h2 {
  margin-bottom: 0;
}

.league-invite-head span {
  color: var(--muted);
  font-weight: 900;
}

.league-invite-status-copy {
  display: grid;
  gap: 5px;
  text-align: right;
}

.league-invite-status-copy strong {
  color: var(--danger);
  font-weight: 950;
  text-transform: uppercase;
}

.league-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.league-slot {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.league-slot.is-filled {
  border-style: solid;
  border-color: rgba(27, 158, 140, 0.35);
  background: rgba(27, 158, 140, 0.08);
}

.league-slot.is-virtual {
  border-color: rgba(61, 139, 224, 0.34);
  background: rgba(61, 139, 224, 0.08);
}

.league-slot span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(61, 139, 224, 0.12);
  color: var(--highlight);
  font-size: 0.8rem;
  font-weight: 950;
}

.league-slot strong {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.league-slot small {
  color: var(--muted);
  font-weight: 850;
}

.league-invite-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.league-invite-link-row input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

body[data-theme="light"] .league-invite-link-row input {
  background: rgba(23, 35, 28, 0.04);
}

.league-email-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.league-invite-actions {
  position: static;
  min-height: auto;
  justify-content: flex-start;
  border-top: 0;
  padding-top: 4px;
  background: transparent;
  backdrop-filter: none;
}

body[data-theme="light"] .league-invite-actions {
  background: transparent;
}

.league-team-card,
.league-players-card {
  display: grid;
  gap: 18px;
}

.league-team-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 16px;
  align-items: stretch;
}

.league-logo-upload {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 14px;
  align-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
}

.league-logo-upload span {
  grid-row: span 2;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 950;
}

.league-logo-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.league-logo-upload strong {
  color: var(--ink);
}

.league-logo-upload small {
  color: var(--muted);
  font-weight: 800;
}

.league-logo-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.league-team-roster-grid {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.league-team-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  gap: 16px;
  align-items: start;
}

.league-trade-sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
}

.league-trade-ticket-card {
  gap: 14px;
}

.league-roster-slot {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) minmax(120px, 0.3fr);
  gap: 14px;
  align-items: center;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
}

.league-roster-slot:last-child {
  border-bottom: 0;
}

.league-roster-slot.is-filled {
  border-color: var(--line);
  background: rgba(27, 158, 140, 0.08);
}

.league-roster-slot.is-clickable {
  cursor: pointer;
}

.league-roster-slot.is-clickable:hover,
.league-roster-slot.is-selected {
  border-color: rgba(61, 139, 224, 0.55);
  background: rgba(61, 139, 224, 0.1);
}

.league-roster-slot.is-selected {
  box-shadow: inset 4px 0 0 var(--highlight);
}

.league-roster-slot.is-injured-reserve {
  background: rgba(61, 139, 224, 0.055);
}

.league-roster-slot.is-injured-reserve span {
  background: color-mix(in srgb, var(--warning) 16%, transparent);
  color: var(--warning);
}

.league-roster-slot.has-warning {
  border-left: 4px solid rgba(232, 52, 52, 0.92);
  background: rgba(232, 52, 52, 0.11);
}

.league-roster-slot.has-warning span {
  background: rgba(232, 52, 52, 0.18);
  color: #ff5d5d;
}

.league-roster-slot.has-warning strong,
.league-roster-slot.has-warning small {
  color: #ff5d5d;
}

.league-roster-slot.is-drop-target {
  cursor: grab;
}

.league-roster-slot.is-dragging {
  opacity: 0.45;
}

.league-roster-slot.is-drag-over {
  outline: 2px solid rgba(61, 139, 224, 0.72);
  outline-offset: -2px;
}

.league-roster-slot.is-drop-allowed {
  outline: 1px solid rgba(27, 158, 140, 0.34);
  outline-offset: -1px;
}

.league-roster-slot.is-drop-blocked {
  opacity: 0.36;
  filter: grayscale(0.85);
  background: var(--panel-2);
  cursor: not-allowed;
}

.league-roster-slot.is-drop-blocked strong,
.league-roster-slot.is-drop-blocked small {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.league-roster-slot span {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(61, 139, 224, 0.14);
  color: var(--highlight);
  font-size: 0.74rem;
  font-weight: 950;
}

.league-roster-slot strong {
  color: var(--ink);
}

.league-roster-slot small {
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.league-team-player-stats {
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px;
  background: rgba(61, 139, 224, 0.055);
}

.league-team-player-stats-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.league-team-player-stats-head h3 {
  margin: 4px 0 3px;
  color: var(--ink);
  font-size: 1.4rem;
  letter-spacing: 0;
}

.league-team-player-stats-head span {
  color: var(--muted);
  font-weight: 800;
}

.league-team-player-stats-head > strong {
  color: var(--highlight);
  font-size: 1.25rem;
  white-space: nowrap;
}

.league-trade-inline-action {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(27, 158, 140, 0.22);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.league-trade-inline-action span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.league-trade-ticket {
  display: grid;
  gap: 12px;
}

.league-trade-ticket-block {
  position: relative;
  border: 1px solid rgba(27, 158, 140, 0.22);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.league-trade-ticket-block > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.league-trade-ticket-block > strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.league-trade-ticket-block > em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 800;
}

.league-trade-selected-list {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.league-trade-selected-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(232, 52, 52, 0.25);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-soft);
}

.league-trade-selected-player div {
  min-width: 0;
}

.league-trade-selected-player strong {
  display: block;
  min-width: 0;
  color: var(--ink);
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.league-trade-selected-player em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.league-trade-selected-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.league-trade-offer-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
}

.league-trade-offer-row {
  display: grid;
  grid-template-columns: 22px 50px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-soft);
  cursor: pointer;
}

.league-trade-offer-row.is-selected {
  border-color: rgba(232, 52, 52, 0.36);
}

.league-trade-offer-row span {
  color: var(--highlight);
  font-size: 0.75rem;
  font-weight: 950;
}

.league-trade-offer-row div {
  min-width: 0;
}

.league-trade-offer-row strong {
  display: block;
  min-width: 0;
  color: var(--ink);
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.league-trade-offer-row em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
  text-align: left;
}

.league-trade-remove-offer {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(232, 52, 52, 0.5);
  border-radius: 999px;
  color: #ff4d4d;
  background: rgba(232, 52, 52, 0.1);
  font-size: 0.9rem;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
}

.league-trade-remove-offer:hover {
  color: #ffffff;
  background: #e83434;
}

.league-trade-remove-target {
  position: absolute;
  top: 10px;
  right: 10px;
}

.league-trade-summary {
  border: 1px solid rgba(27, 158, 140, 0.22);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  font-weight: 850;
  background: rgba(27, 158, 140, 0.08);
}

.league-trade-summary.has-warning {
  border-color: rgba(232, 52, 52, 0.34);
  background: rgba(232, 52, 52, 0.08);
  color: #ff5d5d;
}

.league-trade-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
}

.league-team-player-stat-table {
  table-layout: fixed;
}

.league-team-player-stat-table th,
.league-team-player-stat-table td {
  min-width: 0;
  padding: 9px 8px;
  white-space: normal;
}

.league-team-player-stat-table tr.is-muted td {
  color: color-mix(in srgb, var(--muted) 82%, transparent);
}

.league-team-player-stat-table tr.is-average td {
  border-top: 2px solid rgba(61, 139, 224, 0.42);
  background: rgba(27, 158, 140, 0.08);
  color: var(--ink);
  font-weight: 950;
}

.league-player-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px);
  gap: 14px;
}

.league-position-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.league-player-table-wrap {
  max-height: 560px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.league-player-table {
  width: 100%;
  border-collapse: collapse;
}

.league-player-table th,
.league-player-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.league-player-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.league-player-table td {
  color: var(--muted);
  font-weight: 850;
}

.league-player-table td strong {
  display: block;
  color: var(--ink);
}

.league-player-table td span {
  display: block;
  margin-top: 3px;
  font-size: 0.78rem;
}

.league-player-table tr.is-drafted {
  opacity: 0.58;
}

.league-player-table tr.is-admin-inactive {
  opacity: 0.45;
  background: rgba(232, 52, 52, 0.08);
}

.league-player-table tr.is-admin-inactive td,
.league-player-table tr.is-admin-inactive td strong {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.league-player-table tr.is-selected {
  background: rgba(61, 139, 224, 0.1);
  box-shadow: inset 4px 0 0 var(--highlight);
}

.league-player-table tr[data-pool-player-key] {
  cursor: pointer;
}

.league-player-detail-row,
.league-player-detail-row:hover {
  cursor: default;
  background: transparent;
}

.league-player-inline-stats {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.league-claim-option-list {
  display: grid;
  gap: 8px;
}

.league-claim-option {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: var(--panel-soft);
  text-align: left;
  cursor: pointer;
}

.league-claim-option:hover,
.league-claim-option.is-selected {
  border-color: rgba(61, 139, 224, 0.55);
  background: rgba(61, 139, 224, 0.1);
}

.league-claim-option.is-drop-target.is-selected {
  border-color: rgba(232, 52, 52, 0.82);
  background: rgba(232, 52, 52, 0.16);
  box-shadow: inset 4px 0 0 #e83434;
}

.league-claim-option.is-drop-target.is-selected span,
.league-claim-option.is-drop-target.is-selected em {
  color: #ff5d5d;
}

.league-claim-option.is-drop-target.is-selected strong {
  color: var(--ink);
}

.league-claim-option span {
  grid-row: span 2;
  color: var(--highlight);
  font-size: 0.75rem;
  font-weight: 950;
}

.league-claim-option strong {
  min-width: 0;
  line-height: 1.2;
  white-space: normal;
}

.league-claim-option em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.league-draft-card {
  display: grid;
  gap: 18px;
}

.league-draft-status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.league-draft-status-grid div {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.league-draft-status-grid span,
.league-draft-log-row span {
  color: var(--muted);
  font-weight: 850;
}

.league-draft-status-grid strong {
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.2;
}

.league-draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.league-draft-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.league-draft-player-table-wrap {
  max-height: 680px;
}

.league-draft-board-wrap {
  max-height: 680px;
}

.league-mini-button {
  min-height: 34px;
  border: 1px solid rgba(61, 139, 224, 0.5);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(61, 139, 224, 0.16);
  color: var(--highlight);
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.league-mini-button:disabled {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: not-allowed;
}

.league-draft-rosters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.league-draft-roster-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.league-draft-roster-card h3 {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px;
  color: var(--ink);
  font-size: 1rem;
}

.league-draft-roster-card h3 span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.league-draft-roster-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.league-draft-roster-row:last-child {
  border-bottom: 0;
}

.league-draft-roster-row.is-filled {
  background: rgba(27, 158, 140, 0.08);
}

.league-draft-roster-row span {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(61, 139, 224, 0.14);
  color: var(--highlight);
  font-size: 0.72rem;
  font-weight: 950;
}

.league-draft-roster-row strong {
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.league-draft-roster-row small {
  grid-column: 2;
  color: var(--muted);
  font-weight: 800;
}

.league-draft-log {
  display: grid;
  gap: 8px;
  max-height: 720px;
  overflow-y: auto;
  overflow-x: hidden;
}

.league-draft-log-row {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
}

.league-draft-log-row strong {
  color: var(--ink);
  text-transform: capitalize;
}

.league-season-panel,
.league-season-card {
  display: grid;
  gap: 16px;
}

.league-fixtures-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px) minmax(300px, 340px);
  gap: 16px;
  align-items: start;
}

/* Standalone floating ticket column to the right of the markets sidebar.
   Sticky so the player always sees their ticket while scrolling. */
.league-ticket-column {
  position: sticky;
  top: 96px;
  align-self: start;
  display: grid;
  gap: 16px;
  min-width: 0;
  max-height: calc(100vh - 116px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

.league-fixtures-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

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

.league-season-tabs button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-weight: 950;
  cursor: pointer;
}

.league-season-tabs button.is-active {
  border-color: var(--accent-ink);
  background: var(--accent);
  color: var(--accent-ink);
}

.league-week-roster-editor {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.028);
}

/* Fixed 120px + 150px side columns left the name 0px inside the fixtures
   column. Two rows beside the pill instead: the name takes the full width
   and the meta sits under it, readable at any column width. */
.league-week-roster-grid .league-roster-slot {
  min-height: 46px;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "pill name" "pill meta";
  row-gap: 2px;
}

.league-week-roster-grid .league-roster-slot > span {
  grid-area: pill;
}

.league-week-roster-grid .league-roster-slot > strong {
  grid-area: name;
}

.league-week-roster-grid .league-roster-slot > small {
  grid-area: meta;
}

.league-week-roster-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.45;
}

.league-fixture-list {
  display: grid;
  gap: 10px;
}

.league-fixture-list.compact {
  align-content: start;
}

.league-fixture-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.league-fixture-card.is-expanded {
  border-color: rgba(61, 139, 224, 0.56);
  background: rgba(61, 139, 224, 0.06);
}

.league-fixture-card > div:last-child {
  text-align: right;
}

.league-fixture-card strong {
  display: block;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.league-fixture-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.league-fixture-rosters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: -4px;
  border: 1px solid rgba(61, 139, 224, 0.24);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.league-fixture-roster-team {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.league-fixture-roster-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.league-fixture-roster-head strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.league-fixture-roster-head span {
  color: var(--highlight);
  font-size: 0.82rem;
  font-weight: 950;
  white-space: nowrap;
}

.league-fixture-rosters .league-player-table-wrap {
  max-height: none;
  overflow: hidden;
}

.league-fixture-rosters .league-player-table {
  table-layout: fixed;
}

.league-fixture-rosters .league-player-table th,
.league-fixture-rosters .league-player-table td {
  min-width: 0;
  padding: 8px 7px;
  font-size: 0.8rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.league-fixture-odds {
  display: flex;
  align-items: center;
  gap: 6px;
}

.league-fixture-odds button {
  min-width: 64px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-weight: 950;
  cursor: pointer;
}

.league-fixture-odds button:disabled {
  cursor: default;
  opacity: 0.78;
}

.league-fixture-odds button.is-selected {
  border-color: var(--accent-ink);
  background: var(--accent);
  color: var(--accent-ink);
}

.league-fixture-odds span {
  margin: 0;
}

.league-fixtures-sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
  display: grid;
  gap: 16px;
  min-width: 0;
  max-height: calc(100vh - 116px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

.league-ticket-card {
  position: static;
}

.league-week-odds-card {
  gap: 12px;
}

/* Collapsible market rows in the league betting sidebar.
   Selectors carry the row class to out-rank the generic
   .league-week-market-row > div / button rules below. */
.league-week-market-row div.league-market-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.league-week-market-row button.league-market-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  padding: 4px 0;
}

.league-market-caret {
  font-size: 0.6rem;
  color: var(--muted);
}

.league-week-market-row button.league-market-help {
  display: inline-flex;
  width: 22px;
  height: 22px;
  min-height: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 950;
  cursor: help;
  flex: none;
}

.league-market-rules-popover {
  position: absolute;
  z-index: 90;
  width: 280px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 6px;
}

.league-market-rules-popover[hidden] {
  display: none;
}

.league-market-rules-popover p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.league-market-rules-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
}

.league-market-rules-close:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

/* Season 2026 admin card on the Player Model Dashboard */
.season-2026-admin {
  display: grid;
  gap: 12px;
}

.season-2026-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.season-2026-admin-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.season-2026-week-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.season-2026-admin-controls select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 850;
}

.season-2026-upload-button,
.season-2026-toggle {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.season-2026-upload-button {
  border-color: rgba(27, 158, 140, 0.55);
  background: rgba(27, 158, 140, 0.18);
}

.season-2026-upload-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.season-2026-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.season-2026-status.is-error {
  color: #ff6b6b;
  font-weight: 850;
}

.season-2026-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.season-2026-table th,
.season-2026-table td {
  border-bottom: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
}

.season-2026-table th {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.season-2026-metrics h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.season-2026-metrics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.season-2026-metrics-head h3 {
  margin: 0;
}

.season-2026-metrics-filters {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.season-2026-metrics-head select {
  margin-left: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 850;
}

.season-2026-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.season-2026-help {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0;
  cursor: help;
  margin-left: 4px;
  vertical-align: middle;
}

.season-2026-help:hover {
  color: var(--ink);
  border-color: rgba(27, 158, 140, 0.55);
}

.league-ticket-limit-note {
  margin: 0;
  border: 1px solid rgba(255, 107, 107, 0.5);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(255, 107, 107, 0.12);
  color: #ff6b6b;
  font-size: 0.8rem;
  font-weight: 850;
  line-height: 1.4;
}

.league-week-odds-card .league-invite-head {
  align-items: start;
  flex-wrap: wrap;
  gap: 10px;
}

.odds-format-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.odds-format-toggle button {
  border: 0;
  border-radius: 6px;
  padding: 6px 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.odds-format-toggle button.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

.league-week-odds-list {
  display: grid;
  gap: 8px;
}

.league-week-market-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-soft);
}

/* Wrapping, not a fixed split: long team names (emails) take the full card
   width and the projection drops below them instead of squeezing the names
   into mid-word breaks. */
.league-week-market-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 10px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.league-week-market-head strong {
  color: var(--ink);
  line-height: 1.18;
  overflow-wrap: break-word;
  min-width: 0;
}

.league-week-market-head span {
  white-space: nowrap;
}

.league-week-market-head span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.league-week-market-row {
  display: grid;
  gap: 6px;
}

/* The settlement page swaps its two views (history / scoring rules) with the
   hidden attribute, which their display: grid would otherwise override. */
.betting-history-shell [data-settlement-panel][hidden] {
  display: none;
}

/* The H2H matchup's market panel reuses the league market-row pieces; this
   only lays the groups out in columns under the five-zone grid. */
.h2h-market-markets {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.h2h-market-markets-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px 14px;
  align-items: start;
  margin-top: 8px;
}

.league-week-market-row > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.league-week-market-row > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.league-week-market-row button {
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  cursor: pointer;
}

.league-week-market-row button em,
.league-week-market-row button strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-week-market-row button em {
  color: var(--muted);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 850;
}

.league-week-market-row button strong {
  margin-top: 3px;
  font-size: 0.86rem;
  font-weight: 950;
}

.league-week-market-row button.is-selected {
  border-color: var(--accent-ink);
  background: var(--accent);
  color: var(--accent-ink);
}

.league-week-market-row button.is-selected em {
  color: var(--accent-ink);
}

.league-week-odds-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.league-week-odds-row button {
  min-width: 0;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  background: var(--panel-soft);
  color: var(--ink);
  cursor: pointer;
}

.league-week-odds-row button span,
.league-week-odds-row button em,
.league-week-odds-row button strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-week-odds-row button span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
}

.league-week-odds-row button em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 800;
}

.league-week-odds-row button strong {
  margin-top: 3px;
  font-size: 0.92rem;
  font-weight: 950;
}

.league-week-odds-row button:disabled {
  cursor: default;
  opacity: 0.78;
}

.league-week-odds-row button.is-selected {
  border-color: var(--accent-ink);
  background: var(--accent);
  color: var(--accent-ink);
}

.league-week-odds-row button.is-selected span,
.league-week-odds-row button.is-selected em {
  color: var(--accent-ink);
}

.league-week-odds-versus,
.league-fixture-versus {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.league-ticket-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
  margin-top: 16px;
}

.league-ticket-card .league-player-table th,
.league-ticket-card .league-player-table td {
  padding: 9px 7px;
  font-size: 0.82rem;
}

.league-ticket-card .league-player-table-wrap {
  overflow-x: hidden;
}

.league-ticket-card .league-player-table {
  min-width: 0;
  table-layout: fixed;
}

.league-ticket-card .league-player-table td span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
}

.league-ticket-payout {
  display: grid;
  gap: 6px;
  min-width: 120px;
}

.league-ticket-payout span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.league-ticket-payout strong {
  color: var(--text);
  font-size: 1rem;
}

.league-played-ticket-list {
  display: grid;
  gap: 10px;
}

.league-played-ticket {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-soft);
}

.league-played-ticket-head,
.league-played-ticket-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.league-played-ticket-head strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.league-played-ticket-head span,
.league-played-ticket-meta span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.league-played-ticket-meta {
  margin-top: 7px;
}

.league-played-ticket-picks {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.league-played-ticket-picks div {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.league-played-ticket-picks span {
  color: var(--highlight);
  font-weight: 950;
}

.league-played-ticket-picks strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.8rem;
}

.league-played-ticket-picks em {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 800;
}

.league-mini-button {
  min-width: 30px;
  min-height: 30px;
  border: 1px solid rgba(233, 64, 64, 0.35);
  border-radius: 8px;
  background: rgba(233, 64, 64, 0.1);
  color: #e94040;
  font-weight: 900;
  cursor: pointer;
}

.league-season-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.league-standings-card {
  width: 100%;
  min-width: 0;
}

.league-sim-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.league-week-results,
.league-week-standings {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.league-week-results h3,
.league-week-standings h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.25rem;
  letter-spacing: 0;
}

.league-season-grid .league-player-table-wrap {
  overflow-x: visible;
}

.league-season-panel .league-player-table-wrap {
  overflow-x: hidden;
}

.league-season-panel .league-player-table {
  table-layout: fixed;
}

.league-season-panel .league-player-table th,
.league-season-panel .league-player-table td {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.league-standings-card .league-player-table-wrap {
  max-height: none;
  overflow: hidden;
}

.league-standings-table {
  table-layout: fixed;
  width: 100%;
}

.league-standings-table th,
.league-standings-table td {
  padding: 10px 8px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.league-standings-table th:nth-child(1),
.league-standings-table td:nth-child(1) {
  width: 44px;
}

.league-standings-table th:nth-child(3),
.league-standings-table td:nth-child(3) {
  width: 88px;
}

.league-standings-table th:nth-child(4),
.league-standings-table td:nth-child(4),
.league-standings-table th:nth-child(5),
.league-standings-table td:nth-child(5),
.league-standings-table th:nth-child(6),
.league-standings-table td:nth-child(6) {
  width: 62px;
}

.league-standings-table th:nth-child(7),
.league-standings-table td:nth-child(7) {
  width: 98px;
}

.league-standings-table th:nth-child(8),
.league-standings-table td:nth-child(8) {
  width: 78px;
}

.league-division-row td {
  background: rgba(61, 139, 224, 0.1);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.league-standings-card .league-player-table th,
.league-standings-card .league-player-table td,
.league-week-results .league-player-table th,
.league-week-results .league-player-table td,
.league-week-standings .league-player-table th,
.league-week-standings .league-player-table td {
  min-width: 0;
}

.league-settings-shell {
  width: min(1040px, calc(100% - 32px));
  min-height: calc(100vh - 84px);
  margin: 0 auto;
  padding: clamp(38px, 5vw, 66px) 0 120px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.league-settings-hero {
  max-width: 760px;
}

.league-settings-hero h1 {
  margin: 8px 0 10px;
  color: var(--ink);
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.league-settings-hero p:last-child {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.league-settings-card {
  display: grid;
  gap: 22px;
}

.league-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.league-option-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 12px;
}

.league-option-group legend {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.league-option-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 850;
}

.league-option-group input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-2);
}

.league-option-group .is-locked {
  color: var(--muted);
}

.league-option-group em {
  margin-left: auto;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(61, 139, 224, 0.14);
  color: var(--highlight);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.league-settings-selects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.league-roster-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 16px;
}

.my-leagues-card {
  gap: 18px;
}

.my-leagues-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.my-leagues-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.my-leagues-head h2 {
  margin-bottom: 0;
}

.my-leagues-head span {
  color: var(--muted);
  font-weight: 900;
}

.my-leagues-list {
  display: grid;
  gap: 10px;
}

.my-league-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.6fr) minmax(220px, 1.1fr) minmax(190px, 0.9fr) minmax(240px, 1.2fr) minmax(150px, 0.8fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
}

.my-league-row:hover {
  border-color: rgba(61, 139, 224, 0.55);
  background: rgba(61, 139, 224, 0.08);
}

.my-league-row strong {
  font-size: 1.05rem;
}

.my-league-row span,
.my-league-row small,
.my-league-row em {
  color: var(--muted);
  font-weight: 850;
  line-height: 1.35;
}

.my-league-row em {
  font-style: normal;
  text-align: right;
}

.my-league-status {
  width: fit-content;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(61, 139, 224, 0.14);
  color: var(--highlight) !important;
  font-size: 0.72rem;
  font-weight: 950 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.my-leagues-empty {
  display: grid;
  gap: 12px;
  justify-items: start;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
}

.my-leagues-empty strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.my-leagues-empty span {
  color: var(--muted);
  font-weight: 800;
}

.join-league-list {
  display: grid;
  gap: 10px;
}

.join-league-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(160px, 0.8fr) minmax(150px, 0.7fr) minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.join-league-row > div {
  display: grid;
  gap: 8px;
}

.join-league-row strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.join-league-row span,
.join-league-row small {
  color: var(--muted);
  font-weight: 850;
  line-height: 1.35;
}

.join-league-button {
  white-space: nowrap;
}

.join-league-button:disabled {
  cursor: default;
}

.fantasy-protected .topbar,
.fantasy-protected .portal-shell,
.fantasy-protected .h2h-shell,
.admin-protected .topbar,
.admin-protected .h2h-shell,
.admin-protected .app-shell,
.admin-protected .page-shell,
.app-protected .topbar,
.app-protected .portal-shell,
.app-protected .app-shell {
  visibility: hidden;
}

.fantasy-auth-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: calc(100vh - 84px);
  margin: 0 auto;
  padding: clamp(42px, 7vw, 84px) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
}

.fantasy-auth-hero {
  max-width: 680px;
}

.fantasy-auth-hero h1 {
  margin: 10px 0 14px;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.fantasy-auth-hero p:last-child {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.fantasy-auth-panel {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 22px;
  background:
    var(--panel);
  box-shadow: var(--shadow);
}

body[data-theme="light"] .fantasy-auth-panel {
  background:
    var(--panel);
}

.fantasy-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

body[data-theme="light"] .fantasy-auth-tabs {
  background: rgba(23, 35, 28, 0.04);
}

.fantasy-auth-tab {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.fantasy-auth-tab.is-active {
  color: var(--accent-ink);
  background: var(--accent);
}

.fantasy-auth-form {
  display: grid;
  gap: 16px;
}

.fantasy-auth-message {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(61, 139, 224, 0.26);
  background: rgba(61, 139, 224, 0.08);
  color: var(--ink);
  line-height: 1.45;
}

.fantasy-auth-message[data-type="error"] {
  border-color: rgba(255, 107, 107, 0.28);
  background: rgba(255, 107, 107, 0.08);
  color: var(--danger);
}

.fantasy-auth-message[data-type="success"] {
  border-color: rgba(27, 158, 140, 0.32);
  background: rgba(27, 158, 140, 0.09);
}

.admin-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: calc(100vh - 84px);
  margin: 0 auto;
  padding: clamp(42px, 7vw, 84px) 0;
  display: grid;
  align-content: center;
  gap: 28px;
}

.admin-panel {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 22px;
  background:
    var(--panel);
  box-shadow: var(--shadow);
}

body[data-theme="light"] .admin-panel {
  background:
    var(--panel);
}

.admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.admin-panel-head h2 {
  margin: 4px 0 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 0.98;
}

.admin-request-list {
  display: grid;
  gap: 10px;
}

.admin-request-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
}

body[data-theme="light"] .admin-request-card {
  background: rgba(23, 35, 28, 0.03);
}

.admin-request-card div {
  display: grid;
  gap: 4px;
}

.admin-request-card strong {
  font-size: 1.05rem;
}

.admin-request-card span,
.admin-request-card small,
.admin-empty {
  color: var(--muted);
}

.admin-empty {
  margin: 0;
}

.league-action-button:disabled {
  cursor: default;
  opacity: 0.68;
  transform: none;
}

.league-action-button.is-disabled,
.league-action-button[aria-disabled="true"] {
  cursor: default;
  opacity: 0.7;
  transform: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}

body[data-theme="light"] .theme-toggle {
  background: var(--panel);
}

.theme-button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  transition: 120ms ease;
}

.theme-button.is-active {
  color: var(--accent-ink);
  background: var(--accent);
}

body[data-theme="light"] .theme-button.is-active {
  color: var(--accent-ink);
  background: var(--accent);
}

.search-shell {
  min-width: 240px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  gap: 4px;
}

.search-shell span {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.search-shell input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
}

.header-action {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  cursor: pointer;
  transition: 120ms ease;
}

.header-action.ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
}

body[data-theme="light"] .header-action.ghost,
body[data-theme="light"] .hero-cta.secondary,
body[data-theme="light"] .button-row button.secondary,
body[data-theme="light"] .main-nav a,
body[data-theme="light"] .subnav-pill,
body[data-theme="light"] .status-chip {
  background: rgba(23, 35, 28, 0.03);
}

.header-action.solid {
  color: var(--accent-ink);
  font-weight: 700;
  border-color: var(--accent-ink);
  background: var(--accent);
}

.header-action:hover {
  transform: translateY(-1px);
}

.app-shell {
  width: min(1800px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
}

.utility-rail {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 14px;
}

.sidebar-section,
.utility-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-glow);
  box-shadow: var(--shadow-soft);
}

.sidebar-label,
.utility-label {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.sidebar-item,
.sidebar-chip {
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel-2);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: 120ms ease;
}

.sidebar-item:last-child,
.sidebar-chip:last-child {
  margin-bottom: 0;
}

.sidebar-item:hover,
.sidebar-chip:hover,
.sidebar-item.is-active {
  border-color: rgba(27, 158, 140, 0.36);
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(27, 158, 140, 0.14), 0 10px 22px rgba(27, 158, 140, 0.12);
}

.sidebar-stack {
  display: grid;
  gap: 10px;
}

.sidebar-stack span,
.utility-tags span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.utility-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.utility-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.utility-card.highlight {
  background: var(--panel);
  border-color: rgba(27, 158, 140, 0.24);
}

.utility-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.utility-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-shell {
  min-width: 0;
  padding-bottom: 30px;
}

.hero {
  display: grid;
  grid-template-columns: 1.75fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.hero-copy,
.hero-panel,
.card {
  background: var(--panel-glow);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.hero-copy {
  padding: 28px 28px 24px;
  position: relative;
  overflow: hidden;
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: 0;
  background: none;
  pointer-events: none;
}

body[data-theme="light"] .hero-copy::before {
  background: none;
}

.hero-copy > * {
  position: relative;
  z-index: 1;
}

.hero-copy h1 {
  margin: 10px 0 12px;
  font-size: clamp(2.6rem, 4.8vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.lede {
  max-width: 64ch;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--highlight);
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 14px;
}

.hero-cta {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: 120ms ease;
}

.hero-cta.primary {
  color: var(--accent-ink);
  background: var(--accent);
}

.hero-cta.secondary {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.hero-cta:hover {
  transform: translateY(-1px);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.status-chip.live,
.status-chip.hot {
  border-color: rgba(61, 139, 224, 0.3);
  background: rgba(61, 139, 224, 0.12);
  color: var(--highlight);
}

.hero-panel {
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: center;
}

.sports-landing {
  margin-top: 18px;
  padding: 22px;
}

.sports-landing .section-head {
  align-items: end;
}

.sports-landing-note {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.sports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.sport-tile,
.sport-menu > summary {
  width: 100%;
  min-height: 138px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    var(--panel);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

body[data-theme="light"] .sport-tile,
body[data-theme="light"] .sport-menu > summary {
  background:
    var(--panel);
}

.sport-tile:hover,
.sport-menu > summary:hover {
  transform: translateY(-2px);
  border-color: rgba(61, 139, 224, 0.42);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
}

body[data-theme="light"] .sport-tile:hover,
body[data-theme="light"] .sport-menu > summary:hover {
  box-shadow: 0 16px 28px rgba(21, 34, 24, 0.12);
}

.sport-tile-live {
  border-color: rgba(61, 139, 224, 0.5);
  background:
    var(--panel);
}

body[data-theme="light"] .sport-tile-live {
  background:
    var(--panel);
}

.sport-tile-live.is-selected {
  box-shadow: 0 0 0 2px rgba(61, 139, 224, 0.2), 0 18px 44px rgba(27, 158, 140, 0.18);
}

.sport-tile-placeholder {
  cursor: default;
  opacity: 0.78;
}

.sport-tile-placeholder:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}

.sport-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--highlight-soft);
  /* --highlight on its own tint tops out at 4.4:1 dark and 3.7:1 light at any
     alpha. The fill carries the identity; the label takes the ink. */
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body[data-theme="light"] .sport-status {
  color: var(--accent-dark);
}

.sport-tile strong,
.sport-menu strong {
  display: block;
  font-size: clamp(1.35rem, 1.8vw, 1.9rem);
  letter-spacing: -0.04em;
}

.sport-tile small,
.sport-menu small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.sport-menu {
  position: relative;
}

.sport-menu > summary {
  list-style: none;
}

.sport-menu > summary::-webkit-details-marker {
  display: none;
}

.sport-menu > summary::after {
  content: "Open menu";
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.sport-menu[open] > summary::after {
  content: "Close menu";
  color: var(--highlight);
  border-color: rgba(61, 139, 224, 0.3);
}

.sport-submenu {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(15, 19, 26, 0.96);
}

body[data-theme="light"] .sport-submenu {
  background: rgba(255, 255, 255, 0.96);
}

.sport-submenu button {
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 800;
  cursor: default;
}

body[data-theme="light"] .sport-submenu button {
  background: rgba(20, 32, 25, 0.04);
}

.sport-dashboard {
  margin-top: 18px;
}

.sport-dashboard[hidden] {
  display: none !important;
}

.mini-stat {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.mini-stat span {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-2);
}

.mini-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.1rem;
  color: var(--highlight);
}

.card {
  padding: 18px;
}

.tabs-shell {
  position: sticky;
  top: 84px;
  z-index: 20;
  margin-bottom: 18px;
  background: rgba(18, 23, 31, 0.94);
  backdrop-filter: blur(18px);
}

body[data-theme="light"] .tabs-shell {
  background: rgba(255, 255, 255, 0.9);
}

body[data-theme="light"] .search-shell,
body[data-theme="light"] .theme-toggle,
body[data-theme="light"] .mini-stat,
body[data-theme="light"] .sidebar-item,
body[data-theme="light"] .sidebar-chip,
body[data-theme="light"] .sidebar-stack span,
body[data-theme="light"] .utility-tags span,
body[data-theme="light"] .detail-metric,
body[data-theme="light"] .summary-card,
body[data-theme="light"] .diagram-box,
body[data-theme="light"] .fantasy-score-card,
body[data-theme="light"] .fantasy-insight-card,
body[data-theme="light"] .fantasy-breakdown-table,
body[data-theme="light"] .table-wrap {
  background: var(--panel);
}

body[data-theme="light"] .sidebar-item:hover,
body[data-theme="light"] .sidebar-chip:hover,
body[data-theme="light"] .sidebar-item.is-active {
  background: var(--panel);
  color: #17231c;
}

body[data-theme="light"] .utility-card.highlight,
body[data-theme="light"] .detail-header,
body[data-theme="light"] .fantasy-panel {
  background: var(--panel);
  border-color: rgba(18, 133, 117, 0.16);
}

body[data-theme="light"] .utility-card.highlight h3,
body[data-theme="light"] .utility-card.highlight p,
body[data-theme="light"] .utility-card.highlight .utility-label,
body[data-theme="light"] .detail-header h3,
body[data-theme="light"] .detail-header p,
body[data-theme="light"] .fantasy-panel-header h3 {
  color: #17231c;
}

body[data-theme="light"] .mini-stat strong,
body[data-theme="light"] .detail-metric strong,
body[data-theme="light"] .fantasy-score-card strong {
  color: var(--accent);
}

.tab-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-button {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 11px 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-weight: 800;
  cursor: pointer;
  transition: 120ms ease;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 82px;
}

.tab-button span {
  line-height: 1;
}

.tab-button small {
  color: inherit;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 0.72;
}

.tab-button:hover {
  color: var(--ink);
  border-color: rgba(27, 158, 140, 0.24);
}

.tab-button.is-active {
  color: var(--accent-ink);
  border-color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(61, 139, 224, 0.16);
}

.subnav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.subnav-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.subnav-pill.active {
  color: var(--highlight);
  border-color: rgba(61, 139, 224, 0.24);
  background: rgba(61, 139, 224, 0.08);
}

.tab-panel[hidden] {
  display: none !important;
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(220px, 1.3fr);
  gap: 12px;
  margin-bottom: 18px;
  align-items: end;
}

.control label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.control select,
.control input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  padding: 13px 14px;
  outline: 0;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.control select {
  color-scheme: dark;
  appearance: auto;
}

body[data-theme="light"] .control select {
  color-scheme: light;
}

body[data-theme="light"] .control select,
body[data-theme="light"] .control input {
  background: var(--panel);
  color: #17231c;
  border-color: rgba(23, 35, 28, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.control select option,
.control select optgroup {
  color: #f2f7f2;
  background: #101713;
}

body[data-theme="light"] .control select option,
body[data-theme="light"] .control select optgroup {
  color: #17231c;
  background: #ffffff;
}

body[data-theme="light"] .control select:disabled,
body[data-theme="light"] .control input:disabled,
body[data-theme="light"] .control input[readonly] {
  background: #edf2ea;
  color: #5e6d63;
  opacity: 1;
}

.control select:focus,
.control input:focus {
  border-color: rgba(27, 158, 140, 0.42);
  box-shadow: 0 0 0 3px rgba(27, 158, 140, 0.12);
}

body[data-theme="light"] .controls.card {
  background: var(--panel);
  border-color: rgba(23, 35, 28, 0.1);
}

body[data-theme="light"] .controls-note {
  color: #435148;
}

body[data-theme="light"] .detail-header {
  background:
    var(--panel),
    var(--panel);
  border-color: rgba(18, 133, 117, 0.18);
}

body[data-theme="light"] .detail-header h3,
body[data-theme="light"] .detail-header p {
  color: #17231c;
}

body[data-theme="light"] .fantasy-panel {
  background:
    var(--panel);
  border-color: rgba(23, 35, 28, 0.1);
}

body[data-theme="light"] .fantasy-panel-header h3,
body[data-theme="light"] .fantasy-note,
body[data-theme="light"] .fantasy-score-card p,
body[data-theme="light"] .fantasy-row,
body[data-theme="light"] .fantasy-label,
body[data-theme="light"] .fantasy-predicted,
body[data-theme="light"] .fantasy-actual {
  color: #17231c;
}

body[data-theme="light"] .fantasy-score-card.actual {
  background: var(--panel);
  border-color: rgba(47, 125, 225, 0.24);
}

.control select:disabled,
.control input:disabled,
.control input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
}

.control-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-left: 10px;
}

.controls-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.9rem;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button-row button {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: 120ms ease;
}

.button-row button:not(.secondary) {
  color: var(--accent-ink);
  background: var(--accent);
}

.button-row button.secondary {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.button-row button:hover {
  transform: translateY(-1px);
}

.prioritized-detail-card {
  margin-bottom: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 4px 0 0;
  font-size: 1.45rem;
  line-height: 1.1;
}

.detail-panel {
  display: grid;
  gap: 14px;
}

.detail-header {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(27, 158, 140, 0.18);
  background:
    var(--panel),
    var(--panel);
}

.detail-header h3 {
  margin: 0 0 4px;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.detail-header p,
.metric-list li,
.formula-list li,
.assumption-list li {
  margin: 0;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.detail-metric,
.summary-card {
  padding: 15px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.detail-metric span,
.fantasy-score-card span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-2);
}

.detail-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.2rem;
  color: var(--highlight);
}

.detail-help {
  margin: 8px 0 0;
  min-height: 38px;
  font-size: 0.84rem;
  line-height: 1.42;
  color: var(--muted);
}

.summary-grid,
.notes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card h3 {
  margin: 0 0 8px;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.35;
}

.summary-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.85rem;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.summary-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.metric-list,
.formula-list,
.assumption-list {
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.diagram-grid {
  display: grid;
  gap: 12px;
  text-align: center;
}

.diagram-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.diagram-box {
  width: 100%;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-weight: 800;
  color: var(--ink);
}

.diagram-box span {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.diagram-arrow {
  font-size: 1.25rem;
  color: var(--highlight);
}

.accent-a { background: var(--panel); }
.accent-b { background: var(--panel); }
.accent-c { background: var(--panel); }
.accent-d { background: var(--panel); }
.accent-e { background: var(--panel); }

.table-wrap {
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}

thead {
  background: rgba(27, 158, 140, 0.08);
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(152, 163, 179, 0.08);
  font-size: 0.9rem;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.is-selected {
  background: rgba(61, 139, 224, 0.07);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}

.pill.safe { background: rgba(34, 184, 163, 0.16); color: var(--accent-2); }
.pill.average { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.pill.high { background: rgba(255, 107, 107, 0.14); color: var(--danger); }

.fantasy-panel {
  margin: 18px 0 22px;
  padding: 18px;
  border: 1px solid rgba(61, 139, 224, 0.1);
  border-radius: 20px;
  background:
    var(--panel);
}

.fantasy-panel-header h3 {
  margin: 0;
  font-size: 1.45rem;
}

.fantasy-score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 18px;
}

.fantasy-insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.fantasy-insight-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.fantasy-insight-card span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fantasy-insight-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.3;
}

.fantasy-insight-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.fantasy-score-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.fantasy-score-card.actual {
  border-color: rgba(61, 139, 224, 0.18);
  background: var(--panel);
}

.fantasy-score-card strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
  color: var(--highlight);
}

.fantasy-score-card p,
.fantasy-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.fantasy-breakdown-table {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel-2);
}

.fantasy-row {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(110px, 0.7fr) minmax(110px, 0.7fr);
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
  border-top: 1px solid rgba(152, 163, 179, 0.08);
}

.fantasy-row-wide {
  grid-template-columns: minmax(0, 1.8fr) minmax(120px, 0.75fr) minmax(120px, 0.75fr) minmax(110px, 0.7fr) minmax(110px, 0.7fr);
}

.fantasy-row:first-child {
  border-top: 0;
}

.fantasy-row-head {
  background: rgba(27, 158, 140, 0.08);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fantasy-label {
  font-weight: 700;
}

.fantasy-predicted,
.fantasy-actual {
  text-align: right;
}

.fantasy-stat {
  text-align: right;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

.fantasy-stat-actual {
  color: var(--ink);
}

.tab-placeholder {
  display: none;
}

.h2h-shell {
  width: min(1720px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(34px, 5vw, 68px) 0 72px;
  display: grid;
  gap: 24px;
}

.h2h-hero {
  max-width: 980px;
}

.h2h-hero h1 {
  margin: 10px 0 12px;
  font-size: clamp(3rem, 7vw, 6.2rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.h2h-hero p:last-child {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.h2h-control-band,
.h2h-builder {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    var(--panel);
  box-shadow: var(--shadow-soft);
}

body[data-theme="light"] .h2h-control-band,
body[data-theme="light"] .h2h-builder {
  background:
    var(--panel);
}

.h2h-control-band {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 22px;
  align-items: stretch;
  padding: 20px;
}

.h2h-builder {
  padding: 20px;
  display: grid;
  gap: 18px;
}

.h2h-field {
  display: grid;
  gap: 8px;
  align-content: start;
}

.h2h-field span,
.h2h-kicker {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.h2h-field input,
.h2h-field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  outline: none;
}

body[data-theme="light"] .h2h-field input,
body[data-theme="light"] .h2h-field select {
  background: rgba(255, 255, 255, 0.78);
}

.h2h-field input:focus,
.h2h-field select:focus {
  border-color: rgba(61, 139, 224, 0.5);
  box-shadow: 0 0 0 3px rgba(61, 139, 224, 0.1);
}

.h2h-field select option {
  background: #ffffff;
  color: #17231c;
}

.h2h-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.h2h-section-head h2 {
  margin: 4px 0 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1;
  letter-spacing: 0;
}

.h2h-team-panel {
  display: grid;
  gap: 14px;
}

.h2h-team-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.h2h-team-card,
.h2h-empty-state {
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

.h2h-team-card {
  display: grid;
  gap: 8px;
  cursor: pointer;
  transition: 120ms ease;
}

.h2h-team-card:hover {
  border-color: rgba(61, 139, 224, 0.42);
  transform: translateY(-2px);
}

.h2h-team-card span,
.h2h-empty-state strong {
  font-weight: 900;
}

.h2h-team-card small,
.h2h-empty-state span {
  color: var(--muted);
  line-height: 1.35;
}

.h2h-empty-state {
  display: grid;
  align-content: center;
  gap: 6px;
  grid-column: 1 / -1;
}

.h2h-builder-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.h2h-position-tabs {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.h2h-position-tabs button,
.h2h-action-button,
.h2h-icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  transition: 120ms ease;
}

.h2h-position-tabs button {
  min-height: 40px;
  padding: 0 12px;
}

.h2h-position-tabs button:hover,
.h2h-position-tabs button.is-active {
  border-color: rgba(61, 139, 224, 0.42);
  background: var(--highlight-soft);
  color: var(--highlight);
}

body[data-theme="light"] .h2h-position-tabs button:hover,
body[data-theme="light"] .h2h-position-tabs button.is-active {
  color: var(--accent-dark);
}

.h2h-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.virtual-team-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(0, 1.22fr);
  gap: 14px;
  align-items: start;
}

.virtual-control-band {
  grid-template-columns: minmax(220px, 300px) 1fr;
}

.virtual-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 10px;
}

.virtual-stats div {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  align-content: center;
  gap: 6px;
}

.virtual-stats strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.virtual-search {
  min-width: min(360px, 100%);
}

.virtual-team-table {
}

.virtual-team-row {
  cursor: pointer;
}

.virtual-team-row.is-disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.virtual-team-row.is-disabled td {
  color: var(--muted);
}

.virtual-team-row.is-disabled:hover {
  background: rgba(152, 163, 179, 0.035) !important;
}

.virtual-team-row:hover,
.virtual-team-row.is-selected {
  background: rgba(61, 139, 224, 0.1) !important;
}

.virtual-team-row.is-selected td:first-child strong {
  color: var(--highlight);
}

.h2h-table-block {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.h2h-table-title {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
}

.h2h-table-title strong {
  color: var(--ink);
}

.h2h-table-wrap {
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 13, 18, 0.42);
}

body[data-theme="light"] .h2h-table-wrap {
  background: rgba(255, 255, 255, 0.58);
}

.h2h-table {
  width: 100%;
  border-collapse: collapse;
}

.h2h-roster-table {
}

.h2h-table th,
.h2h-table td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(152, 163, 179, 0.1);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.h2h-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-2);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


.h2h-table td {
  color: var(--ink);
}

.h2h-table td strong {
  display: block;
  font-weight: 900;
}

.h2h-table td span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.h2h-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

.h2h-table tbody tr.h2h-player-unavailable {
  background: rgba(152, 163, 179, 0.035);
  opacity: 0.42;
}

.h2h-table tbody tr.h2h-player-unavailable strong,
.h2h-table tbody tr.h2h-player-unavailable td {
  color: var(--muted);
}

.h2h-table tfoot td {
  font-weight: 900;
  background: rgba(255, 255, 255, 0.04);
}

.h2h-table-empty {
  height: 110px;
  text-align: center !important;
  color: var(--muted) !important;
}

.h2h-pagination {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}

.h2h-pagination div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.h2h-pagination strong {
  color: var(--ink);
  white-space: nowrap;
}

.h2h-pagination button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.h2h-pagination button:hover:not(:disabled) {
  border-color: rgba(61, 139, 224, 0.42);
  color: var(--highlight);
}

.h2h-pagination button:disabled {
  cursor: default;
  opacity: 0.42;
}

.h2h-icon-button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  background: var(--highlight);
  border-color: rgba(61, 139, 224, 0.55);
  color: var(--accent-ink);
}

.h2h-icon-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.h2h-icon-button:disabled {
  cursor: default;
  opacity: 0.35;
}

.h2h-icon-button.remove {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.35);
  color: var(--danger);
}

.h2h-slot-filter {
  min-width: 44px;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(61, 139, 224, 0.08);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.h2h-slot-filter:hover,
.h2h-slot-filter:focus-visible {
  border-color: rgba(61, 139, 224, 0.48);
  color: var(--highlight);
  outline: none;
}

.h2h-roster-slot td {
  color: var(--muted);
}

.h2h-budget {
  display: grid;
  gap: 6px;
  min-width: 230px;
  text-align: right;
  color: var(--muted);
  font-weight: 800;
}

.h2h-budget strong {
  color: var(--highlight);
}

.h2h-budget strong.is-negative {
  color: var(--danger);
}

.h2h-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.h2h-wallet-line {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 900;
}

.h2h-wallet-line strong {
  color: var(--highlight);
}

.h2h-settlement-actions {
  justify-content: flex-start;
  margin-top: 18px;
}

.result-shell {
  width: min(1780px, calc(100% - 32px));
}

.result-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.result-head h1 {
  margin: 8px 0 8px;
  color: var(--ink);
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.result-head p:last-child {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.result-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 16px;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.86fr) minmax(360px, 1fr) minmax(360px, 1fr);
  gap: 14px;
  align-items: start;
}

.result-ticket-panel,
.result-team-panel,
.result-history {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.result-ticket-table,
.result-roster-table,
.result-history-table {
  min-width: 0;
  table-layout: fixed;
}

.result-ticket-table th,
.result-ticket-table td,
.result-roster-table th,
.result-roster-table td,
.result-history-table th,
.result-history-table td {
  padding: 11px 10px;
}

/* Won and lost are the same idiom: the state tints the row, the text keeps
   reading. The old beige was the one colour outside the palette, and forcing
   white on it measured 2.9:1 dark and 1.4:1 light. */
.result-ticket-table tbody tr.result-pick-won,
.result-history-table tbody tr.result-pick-won {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.result-ticket-table tbody tr.result-pick-won td,
.result-history-table tbody tr.result-pick-won td {
  color: var(--ink);
}

.result-ticket-table tbody tr.result-pick-lost,
.result-history-table tbody tr.result-pick-lost {
  background: rgba(255, 107, 107, 0.1);
}

.result-ticket-table tbody tr[data-result-index] {
  cursor: pointer;
}

.result-ticket-table tbody tr[data-result-index]:hover,
.result-ticket-table tbody tr[data-result-index].is-selected {
  outline: 2px solid rgba(61, 139, 224, 0.55);
  outline-offset: -2px;
}

.result-money-lines {
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  padding: 18px;
  display: grid;
  gap: 18px;
  /* A literal dark scrim stayed dark in the light theme, dropping a slab of
     night into the page. The panel token follows the theme. */
  background: var(--panel-2);
}

.result-money-lines div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink);
  font-weight: 800;
}

.result-money-lines strong {
  font-size: 1.05rem;
}

.result-history {
  max-width: 900px;
  margin-top: 28px;
}

.betting-history-shell {
  width: min(1680px, calc(100% - 32px));
}

.betting-history-hero {
  margin-bottom: 22px;
}

.betting-history-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.betting-history-list {
  max-width: none;
  margin-top: 0;
}

.betting-history-table th,
.betting-history-table td {
  white-space: nowrap;
}

.betting-history-table tbody tr[data-history-index] {
  cursor: pointer;
}

.betting-history-table tbody tr[data-history-index]:hover,
.betting-history-table tbody tr[data-history-index].is-selected {
  outline: 2px solid rgba(61, 139, 224, 0.55);
  outline-offset: -2px;
}

.betting-history-details {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.betting-history-detail-body {
  display: grid;
  gap: 14px;
}

.betting-history-detail-body p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.betting-history-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.betting-history-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-2);
}

.betting-history-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.betting-history-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
}

.betting-history-pick-table {
  min-width: 0;
  table-layout: fixed;
}

.betting-history-pick-table th:first-child,
.betting-history-pick-table td:first-child,
.betting-history-pick-table th:nth-child(2),
.betting-history-pick-table td:nth-child(2) {
  width: 28%;
}

.betting-history-pick-table th:nth-child(3),
.betting-history-pick-table td:nth-child(3),
.betting-history-pick-table th:nth-child(4),
.betting-history-pick-table td:nth-child(4),
.betting-history-pick-table th:nth-child(5),
.betting-history-pick-table td:nth-child(5) {
  width: 14.66%;
}

.betting-history-pick-table tbody tr[data-detail-pick-index] {
  cursor: pointer;
}

.betting-history-pick-table tbody tr[data-detail-pick-index]:hover,
.betting-history-pick-table tbody tr[data-detail-pick-index].is-selected {
  outline: 2px solid rgba(61, 139, 224, 0.55);
  outline-offset: -2px;
}

.betting-history-roster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.betting-history-roster-card {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.betting-history-roster-table {
  min-width: 0;
  table-layout: fixed;
}

.betting-history-roster-table th,
.betting-history-roster-table td {
  padding: 10px 9px;
}

.h2h-action-button {
  min-height: 44px;
  padding: 0 18px;
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.h2h-action-button.secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}

.h2h-action-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.h2h-action-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.h2h-action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.h2h-message {
  min-height: 22px;
  margin: 0;
  color: var(--highlight);
  font-weight: 800;
}

.h2h-message.is-error {
  color: var(--danger);
}

.matchup-shell {
  width: min(1780px, calc(100% - 32px));
}

.matchup-hero {
  max-width: 1160px;
}

.matchup-filters {
  gap: 16px;
}

.matchup-balance {
  min-width: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 4px;
}

.matchup-balance span {
  color: var(--muted);
  font-weight: 800;
}

.matchup-balance strong {
  color: var(--ink);
  font-size: 1.25rem;
}
.matchup-stake input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: inherit;
}

.matchup-odds-panel,
.matchup-ticket {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.matchup-odds-card,
.matchup-ticket {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(10, 13, 18, 0.42);
}

.matchup-odds-card {
  min-height: 64px;
}

body[data-theme="light"] .matchup-odds-card,
body[data-theme="light"] .matchup-ticket {
  background: rgba(255, 255, 255, 0.58);
}

.matchup-odds-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 900;
}

.matchup-odds-choice {
  min-width: 68px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel-2);
  color: var(--accent-ink);
  text-align: center;
  cursor: pointer;
  font-weight: 800;
}

.matchup-odds-choice:hover,
.matchup-odds-choice.is-selected,
.matchup-pick-button.is-selected {
  border-color: rgba(61, 139, 224, 0.48);
  background: rgba(61, 139, 224, 0.1);
}

.matchup-ticket {
  align-content: start;
}

.matchup-ticket-table {
  min-width: 0;
  table-layout: fixed;
}

.matchup-pick-button {
  min-width: 36px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.matchup-remove-pick {
  min-width: 30px;
  min-height: 30px;
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: 8px;
  background: rgba(255, 107, 107, 0.12);
  color: var(--danger);
  font-weight: 900;
  cursor: pointer;
}

.matchup-empty-note {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.matchup-stake {
  margin-top: 8px;
}

.matchup-to-win {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}

.matchup-to-win strong {
  color: var(--ink);
  font-size: 1.2rem;
}

.h2h-market-builder {
  overflow: visible;
}

/* Five filters now: week, team, player, value and odds. Two fixed columns
   pushed them onto three rows, so they share one row that wraps by itself. */
.h2h-market-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
}

.h2h-market-team:hover:not(.is-disabled),






.h2h-market-team-main strong,



.h2h-market-compare,
.h2h-market-ticket-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(10, 13, 18, 0.42);
  display: grid;
  gap: 10px;
}

body[data-theme="light"] .h2h-market-compare,
body[data-theme="light"] .h2h-market-ticket-card {
  background: rgba(255, 255, 255, 0.58);
}

.h2h-market-selected {
  min-height: 170px;
}

.h2h-market-roster-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.h2h-market-roster-card {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.h2h-market-roster-card.is-empty {
  min-height: 170px;
  align-content: start;
}

.h2h-market-roster-head {
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}

.h2h-market-roster-head strong {
  color: var(--ink);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.h2h-market-roster-head span {
  color: var(--highlight);
  font-size: 0.86rem;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.h2h-market-roster-wrap {
  overflow: hidden;
}

.h2h-market-roster-table {
  min-width: 0;
  table-layout: fixed;
}

.h2h-market-roster-table th,
.h2h-market-roster-table td {
  padding: 8px 7px;
  white-space: normal;
}

.h2h-market-roster-table th:first-child,
.h2h-market-roster-table td:first-child {
  width: 42px;
}

.h2h-market-roster-table th:last-child,
.h2h-market-roster-table td:last-child {
  width: 64px;
  text-align: right;
}

.h2h-market-roster-table td strong {
  display: block;
  color: var(--ink);
  line-height: 1.16;
}

.h2h-market-roster-table td span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.h2h-market-match-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.h2h-market-match-card > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 8px;
  align-content: start;
  background: rgba(255, 255, 255, 0.035);
}

.h2h-market-match-card strong,
.h2h-market-match-card span {
  overflow-wrap: anywhere;
}

.h2h-market-match-card span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.h2h-market-vs {
  align-self: center;
  color: var(--muted);
  font-weight: 900;
}

.h2h-market-ticket-card .matchup-ticket-table td:first-child {
  white-space: normal;
}

.h2h-market-ticket-card .matchup-ticket-table td:first-child span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

@media (max-width: 1480px) {
  .utility-rail {
    grid-column: 1 / -1;
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .topbar-inner,
  .app-shell {
    width: min(100%, calc(100% - 24px));
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .utility-rail {
    position: static;
  }

  .hero,
  .summary-grid,
  .notes-grid,
  .detail-grid,
  .diagram-row,
  .fantasy-score-grid,
  .fantasy-insight-grid {
    grid-template-columns: 1fr;
  }

  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-actions {
    grid-column: 1 / -1;
    padding-left: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .h2h-control-band,
  .h2h-layout,
  .h2h-market-controls,
  .admin-backend-hero,
  .admin-backend-layout,
  .admin-home-grid,
  .admin-competitor-tools,
  .admin-two-column,
  .admin-customer-layout,
  .admin-filter-grid,
  .admin-filter-grid.wide,
  .admin-form-grid,
  .admin-profile-grid,
  .admin-setup-grid,
  .admin-wallet-grid,
  .admin-match-grid,
  .admin-template-grid,
  .admin-ladder-layout,
  .admin-ladder-list,
  .betting-history-layout,
  .betting-history-roster-grid,
  .virtual-team-layout,
  .league-fixtures-layout,
  .league-team-layout,
  .league-draft-grid,
  .league-season-grid,
  .h2h-builder-controls {
    grid-template-columns: 1fr;
  }

  .league-fixtures-sidebar,
  .league-ticket-column,
  .league-trade-sidebar,
  .admin-backend-nav,
  .admin-backend-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .h2h-position-tabs {
    justify-content: flex-start;
  }

  .league-season-grid .league-player-table-wrap {
    overflow-x: hidden;
  }

  .league-standings-card .league-player-table-wrap {
    overflow: hidden;
  }

  .betting-history-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .league-settings-grid,
  .league-email-grid,
  .league-player-controls,
  .league-team-profile-grid,
  .league-draft-status-grid,
  .join-league-row,
  .my-league-row,
  .league-roster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .my-league-row em {
    text-align: left;
  }

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

  .league-invite-status-copy {
    text-align: left;
  }
}

@media (max-width: 820px) {
  .topbar-inner {
    grid-template-columns: 1fr;
  }

  .main-nav,
  .header-actions {
    justify-content: flex-start;
  }

  .utility-rail {
    grid-template-columns: 1fr;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .fantasy-row {
    grid-template-columns: 1fr;
  }

  .fantasy-row-wide {
    grid-template-columns: 1fr;
  }

  .fantasy-insight-grid {
    grid-template-columns: 1fr;
  }

  .fantasy-stat,
  .fantasy-predicted,
  .fantasy-actual {
    text-align: left;
  }

  .hero-copy h1 {
    font-size: 2.7rem;
  }

  .portal-shell {
    width: min(100%, calc(100% - 24px));
    min-height: auto;
    padding: 34px 0;
  }

  .portal-choice-grid {
    grid-template-columns: 1fr;
  }

  .h2h-scoring-grid {
    grid-template-columns: 1fr;
  }

  .portal-choice-card {
    min-height: 180px;
  }

  .portal-choice-card strong {
    font-size: 2.2rem;
  }

  .league-modal {
    padding: 14px;
  }

  .league-dialog {
    padding: 18px;
  }

  .league-modal-head {
    align-items: center;
  }

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

  .league-actions {
    justify-content: stretch;
  }

  .league-action-button {
    flex: 1;
  }

  .fantasy-auth-shell {
    grid-template-columns: 1fr;
    align-content: center;
  }

  .fantasy-auth-panel {
    padding: 18px;
  }

  .h2h-shell {
    width: min(100%, calc(100% - 24px));
    padding: 34px 0 54px;
  }

  .h2h-hero h1 {
    font-size: 3rem;
  }

  .h2h-control-band,
  .h2h-builder {
    padding: 14px;
  }

  .h2h-section-head {
    display: grid;
  }

  .h2h-action-row {
    justify-content: stretch;
  }

  .h2h-action-row .h2h-action-button {
    flex: 1;
  }

  .h2h-budget {
    min-width: 0;
    text-align: left;
  }

  .matchup-balance {
    min-width: 0;
  }

  .betting-history-summary {
    grid-template-columns: 1fr;
  }

  .league-settings-grid,
  .league-settings-selects,
  .league-email-grid,
  .league-invite-link-row,
  .league-player-controls,
  .league-team-profile-grid,
  .league-draft-status-grid,
  .join-league-row,
  .my-league-row,
  .league-roster-grid {
    grid-template-columns: 1fr;
  }

  .my-leagues-head {
    align-items: start;
    flex-direction: column;
  }

  .league-invite-head {
    align-items: start;
    flex-direction: column;
  }

  .league-roster-slot {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .league-week-roster-grid .league-roster-slot {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .league-roster-slot small {
    grid-column: 2;
    text-align: left;
  }

  .h2h-market-roster-compare {
    grid-template-columns: 1fr;
  }

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

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

  .league-fixture-card > div:last-child {
    text-align: left;
  }

  .h2h-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .h2h-action-button {
    width: 100%;
  }

  .h2h-pagination {
    display: grid;
  }

  .h2h-pagination div {
    justify-content: space-between;
  }
}

/* Figtree has no separate numeral face, so tabular figures keep columns aligned. */
.admin-data-table td,
.admin-data-table th,
.admin-log-table td,
.league-team-player-stat-table td,
.betting-history-table td,
.betting-history-pick-table td,
.result-ticket-table td,
.result-roster-table td,
.virtual-team-table td,
.matchup-ticket-table td,
.league-fixture-odds button,
.h2h-market-row-odds,
.league-week-odds-row,
.matchup-odds-row,
.mini-stat strong,
.league-balance-strip dd {
  font-variant-numeric: tabular-nums;
}


/* ---------------------------------------------------------------
   Column width follows content.
   A table is the sum of its columns rather than 100% wide, so spare
   space stays free instead of inflating empty cells. There is no
   horizontal scrolling anywhere: when space runs out, lower priority
   columns are dropped (.col-p3 through .col-p5).
   --------------------------------------------------------------- */
table[class] {
  width: auto;
  max-width: 100%;
  table-layout: auto;
}

/* Wrapping is the default, not the exception. A table ignores `max-width`
   once its min-content exceeds the box, so `nowrap` as the default would
   push every table outside a declared query container into overflow for
   good. Short values (team code, position, number) do not wrap anyway, so
   columns stay as wide as their content. */
table[class] th,
table[class] td {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Numeric and short code columns stay on one line. */
table[class] td.col-num,
table[class] th.col-num,
table[class] td.col-nowrap,
table[class] th.col-nowrap {
  white-space: nowrap;
}

table[class] td {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* stupci koji smiju disati preko dvije linije */
table[class] td.col-wrap {
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 320px;
  text-overflow: clip;
}

/* brojcani stupci: desno poravnato, tabularne znamenke */
table[class] td.col-num,
table[class] th.col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* drop columns by priority instead of scrolling horizontally */
.admin-table-wrap,
.h2h-table-wrap,
.league-player-table-wrap,
.table-wrap,
.season-2026-list,
.h2h-market-roster-wrap {
  container-type: inline-size;
  /* Without this the wrapper grows to fit the table, and the table stays wide
     because its wrapper is wide: a loop that never fits inside the card. */
  max-width: 100%;
  min-width: 0;
}

@container (max-width: 720px) {
  .col-p5 { display: none; }
}
@container (max-width: 580px) {
  .col-p4 { display: none; }
}
@container (max-width: 460px) {
  .col-p3 { display: none; }
}

/* In a narrow box density tightens first; only if that is not enough are
   lower priority columns dropped above. */
@container (max-width: 660px) {
  table[class] th,
  table[class] td {
    padding: 7px 8px;
  }
  table[class] th {
    letter-spacing: 0.06em;
  }
  /* In a narrow box text wraps rather than being clipped: wrapping always
     fits, which makes horizontal overflow impossible. A browser does not
     reliably honour max-width on a table cell in auto layout, so nothing
     here relies on an ellipsis. */
  table[class] th,
  table[class] td {
    max-width: 160px;
  }
}

/* The switch's hidden checkbox sits inside .admin-form-grid, where
   `input { width: 100% }` has higher specificity and stretches it to the
   full page width. It is invisible, but it pushes the layout. */
.admin-form-grid input.admin-switch-input,
input.admin-switch-input {
  width: 1px;
  height: 1px;
}

/* The topbar was a rigid `auto auto` grid whose children do not wrap, so
   below ~820px it pushed every page into horizontal scrolling. */
@media (max-width: 820px) {
  .topbar-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    width: calc(100% - 24px);
  }

  .brand-cluster,
  .header-actions,
  .main-nav,
  .topbar-left {
    flex-wrap: wrap;
    min-width: 0;
  }

  .brand-copy {
    min-width: 0;
  }

  .brand-copy strong,
  .brand-overline {
    overflow-wrap: anywhere;
  }
}

/* Grid and flex children default to `min-width: auto`, so long content
   (a file name, a long field value) stretches them past their track. That
   is what pushed these bars off the page below ~820px. */
@media (max-width: 820px) {
  .admin-competitor-tools {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .admin-competitor-tools > *,
  .season-2026-admin-head > *,
  .season-2026-admin-controls > * {
    min-width: 0;
  }

  .admin-inline-input,
  .admin-per-page-control select {
    max-width: 100%;
  }

  .season-2026-status,
  .season-2026-list {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

/* Multi-column grids carry fixed minimum tracks (up to 460px), and the whole
   stylesheet had only three media queries, so below ~900px they pushed the
   page sideways. They all collapse to one column here, and their children get
   min-width: 0 so long content cannot stretch them back out. */
@media (max-width: 900px) {
  .admin-ladder-layout,
  .admin-ladder-map-row,
  .admin-backend-hero,
  .admin-backend-layout,
  .admin-customer-layout,
  .league-team-profile-grid,
  .league-team-layout,
  .league-player-controls,
  .league-draft-grid,
  .league-fixtures-layout,
  .my-league-row,
  .join-league-row,
  .fantasy-auth-shell,
  .app-shell,
  .controls,
  .h2h-control-band,
  .h2h-builder-controls,
  .virtual-team-layout,
  .virtual-control-band,
  .result-layout,
  .h2h-market-controls,
  .admin-ladder-layout > *,
  .admin-ladder-map-row > *,
  .admin-backend-hero > *,
  .admin-backend-layout > *,
  .admin-customer-layout > *,
  .league-team-profile-grid > *,
  .league-team-layout > *,
  .league-player-controls > *,
  .league-draft-grid > *,
  .league-fixtures-layout > *,
  .my-league-row > *,
  .join-league-row > *,
  .fantasy-auth-shell > *,
  .app-shell > *,
  .controls > *,
  .h2h-control-band > *,
  .h2h-builder-controls > *,
  .virtual-team-layout > *,
  .virtual-control-band > *,
  .result-layout > *,
  .h2h-market-controls > *,
}

/* More grids with fixed minimums that do not fit below ~900px, for example
   repeat(3, minmax(170px, 1fr)) which needs 530px. */
@media (max-width: 900px) {
  .admin-ladder-layout,
  .admin-customer-layout,
  .league-email-grid,
  .league-player-controls,
  .league-draft-status-grid,
  .league-fixtures-layout,
  .my-league-row,
  .join-league-row,
  .virtual-stats,
  .result-layout,
  .h2h-market-controls {
    grid-template-columns: 1fr;
  }

  .app-shell select,
  .app-shell input,
  .page-shell select,
  .page-shell input,
  .h2h-shell select,
  .h2h-shell input {
    max-width: 100%;
  }
}

/* By default a grid column will not shrink below the min-content of its
   widest child. A table with `white-space: nowrap` therefore sets the width
   of the whole card, and headings and controls stretch with it.
   `minmax(0, 1fr)` and `min-width: 0` let the column fall below that, and the
   table then wraps or drops columns on its own. */
.season-2026-admin,
.card,
.detail-panel,
.summary-card,
.admin-card,
.league-card {
  grid-template-columns: minmax(0, 1fr);
}

.season-2026-admin > *,
.card > *,
.detail-panel > *,
.summary-card > * {
  min-width: 0;
}

/* ===================================================================
   App shell: rail (52px) + context column (184px).
   The rail is identical on every page, so the whole map is always visible.
   The middle column is either a panel or a record list, never both: three
   columns of navigation would eat the width a table needs.
   =================================================================== */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: 52px;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.rail__item {
  position: relative;
  width: 38px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  text-decoration: none;
  transition: background 0.14s, color 0.14s;
}

.rail__item:hover {
  background: var(--panel-2);
  color: var(--ink);
}

.rail__item.is-active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-2);
}

.rail__icon {
  font-size: 17px;
  line-height: 1;
}

/* The name is shown beside the icon rather than hidden, because icons alone
   are guesswork until they are learned. */
.rail__label {
  position: absolute;
  left: calc(100% + 8px);
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity 0.12s, transform 0.12s;
  box-shadow: var(--shadow-soft);
}

.rail__item:hover .rail__label,
.rail__item:focus-visible .rail__label {
  opacity: 1;
  transform: translateX(0);
}

.ctx {
  position: fixed;
  inset: 0 auto 0 52px;
  z-index: 55;
  width: 184px;
  padding: 12px 8px calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overflow-x: hidden;
}

.ctx__label {
  padding: 6px 9px 8px;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.ctx__item {
  padding: 8px 9px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.ctx__item:hover {
  background: var(--panel-2);
  color: var(--ink);
}

/* Accent text on an accent tint measured 2.2:1 in the light theme. The tint
   and the bar carry "active"; the label keeps the readable ink. */
.ctx__item.is-active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  box-shadow: inset 3px 0 0 var(--accent);
  color: var(--ink);
  font-weight: 800;
}

body.has-rail {
  padding-left: 52px;
}

body.has-ctx {
  padding-left: 236px;
}

/* Below 900px the rail and the panel become horizontal bars that wrap, so
   they never push the page into horizontal scrolling. */
@media (max-width: 900px) {
  body.has-rail,
  body.has-ctx {
    padding-left: 0;
  }

  .rail,
  .ctx {
    position: static;
    inset: auto;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 12px;
    overflow: visible;
  }

  .rail__item {
    width: auto;
    height: auto;
    padding: 6px 11px;
    gap: 7px;
    grid-auto-flow: column;
  }

  .rail__label {
    position: static;
    opacity: 1;
    transform: none;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    font-size: 12.5px;
    color: inherit;
  }

  .ctx__label {
    padding: 0 8px 0 0;
  }
}

/* The rail carries navigation, so the old link bar in the header is no
   longer needed. The brand, theme switch and Logout stay. */
body.has-rail .main-nav {
  display: none;
}

/* The widest grids summed to 1170px of fixed minimums, which fit only while
   navigation took no width. A media query cannot see how much the rail took,
   so these grids move to auto-fit and follow the space they actually have. */
.result-layout {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.league-fixtures-layout {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* The table's title row is a flex with two children that will not shrink, so
   it asked for 320px inside a 243px panel. */
.h2h-table-title {
  flex-wrap: wrap;
}

.h2h-table-title > *,
.matchup-odds-panel > * {
  min-width: 0;
}

.matchup-odds-panel,
.matchup-odds-card {
  min-width: 0;
}

/* The shell's Admin context menu lists the same sections as the backend's
   own nav column, so that column comes out whenever the menu is present.
   The buttons stay in the DOM: admin-backend.js resolves hash deep-links
   against them. */
body.has-ctx .admin-backend-nav {
  display: none;
}

body.has-ctx .admin-backend-layout {
  grid-template-columns: minmax(0, 1fr);
}

/* The shell takes 236px (rail 52 + panel 184), and a media query measures
   the viewport rather than the available space. The same collapse therefore
   starts 236px earlier when the context column is present, and 52px earlier
   when only the rail is. */
@media (max-width: 1136px) {
  body.has-ctx .admin-backend-hero,
  body.has-ctx .admin-backend-layout,
  body.has-ctx .admin-customer-layout,
  body.has-ctx .admin-ladder-layout,
  body.has-ctx .admin-ladder-map-row,
  body.has-ctx .app-shell,
  body.has-ctx .controls,
  body.has-ctx .fantasy-auth-shell,
  body.has-ctx .h2h-builder-controls,
  body.has-ctx .h2h-control-band,
  body.has-ctx .h2h-market-controls,
  body.has-ctx .join-league-row,
  body.has-ctx .league-draft-grid,
  body.has-ctx .league-draft-status-grid,
  body.has-ctx .league-email-grid,
  body.has-ctx .league-fixtures-layout,
  body.has-ctx .league-player-controls,
  body.has-ctx .league-team-layout,
  body.has-ctx .league-team-profile-grid,
  body.has-ctx .my-league-row,
  body.has-ctx .result-layout,
  body.has-ctx .virtual-control-band,
  body.has-ctx .virtual-stats,
  body.has-ctx .virtual-team-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 952px) {
  body.has-rail .admin-backend-hero,
  body.has-rail .admin-backend-layout,
  body.has-rail .admin-customer-layout,
  body.has-rail .admin-ladder-layout,
  body.has-rail .admin-ladder-map-row,
  body.has-rail .app-shell,
  body.has-rail .controls,
  body.has-rail .fantasy-auth-shell,
  body.has-rail .h2h-builder-controls,
  body.has-rail .h2h-control-band,
  body.has-rail .h2h-market-controls,
  body.has-rail .join-league-row,
  body.has-rail .league-draft-grid,
  body.has-rail .league-draft-status-grid,
  body.has-rail .league-email-grid,
  body.has-rail .league-fixtures-layout,
  body.has-rail .league-player-controls,
  body.has-rail .league-team-layout,
  body.has-rail .league-team-profile-grid,
  body.has-rail .my-league-row,
  body.has-rail .result-layout,
  body.has-rail .virtual-control-band,
  body.has-rail .virtual-stats,
  body.has-rail .virtual-team-layout {
    grid-template-columns: 1fr;
  }
}

/* The header wraps at every width, not only below 820px. With the shell it
   has 236px less room, so its break point depended on how many links a page
   carried rather than on the viewport. */
.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
}

.header-actions,
.topbar-left,
.brand-cluster {
  flex-wrap: wrap;
  min-width: 0;
}

/* ===================================================================
   List and detail side by side.
   The pattern already existed - selecting a row swaps the right pane -
   but the list had `overflow-y: auto` with no `max-height`, so it never
   scrolled on its own: the page scrolled and the detail left with it.
   That removed the only real benefit of the layout, which is keeping the
   context on screen.
   =================================================================== */
@media (min-width: 901px) {
  .admin-two-column > :first-child .admin-table-wrap,
  .admin-customer-layout > :first-child .admin-table-wrap,
  .league-team-layout > :first-child .league-player-table-wrap {
    max-height: calc(100vh - 230px);
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* The detail stays in view while the list is scrolled. */
  .admin-two-column > :last-child,
  .admin-customer-layout > :last-child,
  .league-team-layout > :last-child {
    position: sticky;
    top: 84px;
    align-self: start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    overflow-x: hidden;
  }
}

/* `.logout-link` sets `display: inline-flex`, which outranks `display: none`
   from the browser's own rule for [hidden]. Without this the hidden duplicate
   links keep their space in the header. */
.topbar a[hidden] {
  display: none !important;
}

/* Foot of the rail: theme switch and Logout. They used to sit in the topbar
   as full-size buttons, taking the right third of its width and forcing it to
   82px tall, for controls used about once a session. */
.rail__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  width: 34px;
}

.rail__theme {
  display: grid;
  gap: 2px;
  width: 34px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-3);
}

.rail__theme .theme-button {
  width: 26px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-2);
  font-size: 0; /* the name comes from aria-label, ::after draws the icon */
  display: grid;
  place-items: center;
  cursor: pointer;
}

.rail__theme .theme-button::after {
  font-size: 12px;
  line-height: 1;
}

.rail__theme #theme-dark::after {
  content: "\263E";
}

.rail__theme #theme-light::after {
  content: "\2600";
}

.rail__theme .theme-button.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

body[data-theme="light"] .rail__theme .theme-button.is-active {
  color: #ffffff;
}

.rail__logout {
  color: var(--muted-2);
}

.rail__logout:hover {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
}

/* The bar no longer carries navigation or switches, so it can be thinner. */
body.has-rail .topbar-inner {
  padding: 7px 0;
}

/* Below 900px the rail is horizontal, so "the bottom" is not the bottom: the
   group moves to the end of the row. */
@media (max-width: 900px) {
  .rail__foot {
    margin-top: 0;
    margin-left: auto;
    flex-direction: row;
    width: auto;
    padding-top: 0;
    padding-left: 10px;
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .rail__theme {
    grid-auto-flow: column;
    width: auto;
  }
}

/* Portal cards carry their own sub-options, so any page is one click away
   instead of two. */
.portal-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.portal-card-primary {
  border-color: var(--line-strong);
}

.portal-card-head {
  display: grid;
  gap: 7px;
  color: inherit;
  text-decoration: none;
}

.portal-card-head strong {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.portal-card-head small {
  font-size: 0.82rem;
  color: var(--muted);
}

.portal-subtabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 12px;
}

.portal-subtabs button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.portal-subtabs button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.portal-subtabs button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.portal-card-sub {
  display: grid;
  gap: 1px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.portal-subtabs + .portal-card-sub,
.portal-subtabs ~ .portal-card-sub {
  border-top: 0;
  padding-top: 8px;
}

/* The hidden attribute must win over the grid display above, otherwise all
   three sub-tab link groups render at once. */
.portal-card-sub[hidden] {
  display: none;
}

.portal-card-sub a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.86rem;
  text-decoration: none;
}

.portal-card-sub a:hover,
.portal-card-sub a:focus-visible {
  background: var(--panel-2);
  color: var(--ink);
}

.portal-card-sub b {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Section tabs. League Center, My Leagues and Join a league were three pages
   with the same header and the same frame; they are tabs of one page now. */
.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-tab {
  border: 0;
  background: transparent;
  padding: 10px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--muted-2);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.section-tab:hover {
  color: var(--ink);
}

.section-tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.section-panel[hidden] {
  display: none;
}

/* ===================================================================
   Buttons: centring and a refresh.
   Empty states aligned their content to the left, leaving the call to
   action against the edge. Buttons carried font-weight 900, an 8px
   radius and a hover that lifted the element and threw a heavy shadow,
   all from before the theme change.
   =================================================================== */
.my-leagues-empty,
.h2h-empty-state,
.admin-empty,
.league-trade-selected-empty,
.h2h-table-empty {
  justify-items: center;
  text-align: center;
  padding-block: 28px;
}

.my-leagues-empty span,
.h2h-empty-state span,
.admin-empty span {
  max-width: 46ch;
}

.league-action-button,
.h2h-action-button,
.hero-cta,
.header-action.solid,
.button-row button {
  border-radius: var(--radius-sm);
  font-weight: 700;
  letter-spacing: 0.005em;
  transition: filter 0.14s ease, box-shadow 0.14s ease;
}

/* Hover no longer moves the button: a 1px shift across a row of buttons
   reads as a jitter, and the heavy shadow was a leftover from the dark
   green theme. */
.league-action-button:hover:not(:disabled),
.h2h-action-button:hover:not(:disabled),
.hero-cta:hover,
.button-row button:hover {
  transform: none;
  filter: brightness(1.07);
  box-shadow: var(--shadow-soft);
}

.league-action-button:focus-visible,
.h2h-action-button:focus-visible,
.hero-cta:focus-visible,
.header-action:focus-visible,
.button-row button:focus-visible,
.section-tab:focus-visible,
.rail__item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===================================================================
   Market list: a dense row, not a card per team.
   The 1 and 2 selections were buttons inside each team's card, which put
   the pick controls in the same box as the team and made every row a
   full-width card. The labels move to the list header, so a row carries
   only its two prices under the matching column, and the row itself is
   sized to its content.
   =================================================================== */
.h2h-market-team-list {
  max-height: 620px;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.market-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px 60px;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  font-size: 0.82rem;
}

.market-row.has-odds {
  grid-template-columns: minmax(0, 1fr) 46px 60px 46px 46px;
}

.market-row:last-child {
  border-bottom: 0;
}

.market-row__team {
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-row__num {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.market-row.is-selected {
  background: var(--acc-soft, color-mix(in srgb, var(--accent) 14%, transparent));
  box-shadow: inset 2px 0 0 var(--accent);
}

.market-row.is-selected .market-row__team {
  color: var(--accent-2);
}

.market-row.is-disabled {
  opacity: 0.4;
}

.market-row.is-disabled .market-row__team {
  cursor: not-allowed;
}

/* The header names the columns once, including the two selections. */
.market-row--head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  /* --muted-2 measured 3.4:1 here, the same miss the table headers had. */
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-block: 7px;
}

.market-row--head span {
  color: inherit;
}

/* A price, not a badge: the old yellow fill was never part of the theme. */
.market-odds {
  min-width: 0;
  padding: 3px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  cursor: pointer;
  transition: filter 0.14s ease, border-color 0.14s ease;
}

.market-odds:hover:not(:disabled) {
  border-color: var(--accent);
  filter: brightness(1.06);
}

.market-odds:disabled {
  opacity: 0.4;
  cursor: default;
}

.market-odds:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Three equal columns left the team lists too narrow for a name and the
   sidebar too narrow for its roster table. Above 1100px the lists take the
   space they need and the sidebar is capped; below that the earlier
   auto-fit rule still applies. */
/* The rosters used to live in a 272px sidebar, where two tables side by side
   left about 25px for a player name, so they stacked. They now have the middle
   zone of the matchup screen to themselves and sit side by side, which is what
   comparing two line-ups asks for. Below 820px they stack again. */
.h2h-market-roster-compare {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ===================================================================
   One density and one header treatment for every data table.
   Cell padding was set fourteen different ways across the app, and each
   table header had its own colour: admin used a tinted fill with ink,
   h2h used a white-on-panel in dark and white-on-teal in light. A row in
   the line-up builder also stood 47px tall although every cell held a
   single line, because a 32px action button set the height.
   =================================================================== */
table[class] thead th {
  background: var(--panel-2);
  /* --muted-2 measured 3.4:1 here, below AA for this small uppercase text. */
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 8px;
}

table[class] tbody td {
  padding: 6px 8px;
}

/* The action in a row is a row-sized control, not a filled tile. Fifty
   solid squares down a list read as fifty alerts. */
.h2h-icon-button {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.78rem;
}

.h2h-icon-button:hover:not(:disabled) {
  transform: none;
  border-color: var(--accent);
  color: var(--accent-2);
}

.h2h-icon-button.remove {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  color: var(--danger);
}


/* A name that does not fit is information lost, so inside the narrow picker
   it wraps onto a second line instead of being cut. The numbers stay on the
   first line, aligned to the top of the row. */
.matchup-picker .market-row {
  align-items: start;
}

.matchup-picker .market-row__team {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.25;
}

.matchup-picker .market-row__num,
.matchup-picker .market-odds {
  align-self: start;
}

/* The line-up builder puts one table in each half of the screen with nothing
   beside either, so content-sized tables left 234px empty on the left and
   345px on the right. Here the space is there to be used: both tables fill
   their column and the columns share the room evenly.
   Only while two columns still fit: below 1200px the layout already collapses
   to one, and this rule sits later in the file, so it has to say so itself
   rather than quietly outrank that. */
@media (min-width: 1201px) {
  .h2h-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.h2h-layout table[class] {
  width: 100%;
}

/* Every column shrinks to its content and the name absorbs the slack. Giving
   the name 100% instead starved the others: Team needed 39px for "WAS" and
   got 29. Excluding the second cell instead of naming the header and body
   rows missed the footer, where a colspan puts the total's figure second. */
.h2h-layout table[class] th,
.h2h-layout table[class] td {
  width: 1%;
  white-space: nowrap;
}

.h2h-layout table[class] thead th:nth-child(2),
.h2h-layout table[class] tbody td:nth-child(2) {
  width: auto;
  white-space: normal;
}

/* ===================================================================
   Matchup: five zones in the order the bet is built. Pick Team 1 on the far
   left, read its line-up beside it, read the opponent's beside that, pick the
   opponent from the list to their right, stake on the far right. Stacking the
   two lists in one column had put both rosters away from the lists they
   belong to.
   =================================================================== */
.matchup-five {
  display: grid;
  /* Team 2 carries five columns to Team 1's three, so it needs the widest
     share: at 273px its name cell fell to 45px and wrapped to three lines
     against the projection. */
  grid-template-columns:
    minmax(0, 1fr) minmax(0, 0.95fr) minmax(0, 0.95fr)
    minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.matchup-zone {
  min-width: 0;
}

.matchup-ticket-column {
  position: sticky;
  top: 96px;
  align-self: start;
}

/* Each list keeps its own scroll so the five zones stay in one row however
   many teams a week holds. */
.matchup-five .h2h-market-team-list {
  max-height: 320px;
  overflow-y: auto;
}

.matchup-saved-note {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
}

/* The longest team name in the pool measures 179px, so the wide name cell the
   market used left 148px empty at its worst. */
.matchup-five .market-row {
  grid-template-columns: minmax(0, 1fr) 44px 42px;
  gap: 6px;
  align-items: start;
}

.matchup-five .market-row.has-odds {
  grid-template-columns: minmax(0, 1fr) 44px 42px 40px 40px;
}

/* A name that does not fit is information lost, so it wraps rather than
   being cut. */
.matchup-five .market-row__team {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.25;
}

.matchup-five .market-row__num,
.matchup-five .market-odds {
  align-self: start;
}

/* Position and projection take what they need; the player name takes the
   rest. The roster table used to stretch all three, leaving a gap after
   every value. */
.matchup-roster-zone .h2h-market-roster-card {
  padding: 0;
  border: 0;
  background: none;
}

.matchup-roster-zone .h2h-market-roster-head {
  display: none;
}

.matchup-roster-zone table[class] {
  width: 100%;
}

.matchup-roster-zone table[class] th,
.matchup-roster-zone table[class] td {
  width: 1%;
  white-space: nowrap;
}

.matchup-roster-zone table[class] thead th:nth-child(2),
.matchup-roster-zone table[class] tbody td:nth-child(2) {
  width: auto;
  white-space: normal;
}

/* Five zones need about 1250px. Below that the lists keep their rosters
   beside them and the betslip takes its own row; below 900 everything
   stacks. */
@media (max-width: 1250px) {
  .matchup-five {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr);
  }

  .matchup-ticket-column {
    position: static;
    grid-column: 1 / -1;
  }
}

/* The section menu returned to this page and takes 184px, so five zones run
   out of room 184px earlier: at 1440 they had fallen to 202/192/192/263/202
   and roster rows stood 47 to 80px tall on wrapped names. With the menu the
   betslip drops to its own row below 1620 instead of 1250, which hands the
   four that remain about 305px each. Five zones needed 1340px of content to
   breathe; with the rail and the menu that is a 1620px window. */
@media (max-width: 1620px) {
  body.has-ctx .matchup-five {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr);
  }

  body.has-ctx .matchup-ticket-column {
    position: static;
    grid-column: 1 / -1;
  }
}

@media (max-width: 1180px) {
  body.has-ctx .matchup-five {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 1000px) {
  .matchup-five {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .matchup-five {
    grid-template-columns: 1fr;
  }

  .matchup-five .h2h-market-team-list {
    max-height: 260px;
  }
}

/* A team you built yourself sits at the top of its week's list; the bar marks
   it apart from the five hundred generated ones. */
.matchup-five .market-row.is-saved {
  box-shadow: inset 3px 0 0 var(--accent);
}

/* The bar already says which team is yours; --accent-2 on the row measured
   2.36:1 in the light theme, so the name keeps the readable ink. */
.matchup-five .market-row.is-saved .market-row__team {
  font-weight: 800;
}
