:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #657085;
  --line: #d9dee8;
  --surface: #ffffff;
  --page: #f4f6f8;
  --primary: #c5162e;
  --primary-dark: #9f0f23;
  --gold: #f2c94c;
  --sky: #0d8fa3;
  --accent: #087f8c;
  --track: #252a34;
  --asphalt: #111722;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(13, 143, 163, 0.11), transparent 30rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(244, 246, 248, 0.92)),
    repeating-linear-gradient(45deg, rgba(17, 23, 34, 0.03) 0 2px, transparent 2px 10px),
    var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

header {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(197, 22, 46, 0.92) 0 5px, transparent 5px 12px),
    linear-gradient(135deg, #111722, var(--track));
  color: white;
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}

header::after {
  background:
    repeating-conic-gradient(#ffffff 0 25%, #141923 0 50%) 0 0 / 18px 18px;
  bottom: 0;
  content: "";
  height: 4px;
  left: 0;
  opacity: 0.8;
  position: absolute;
  right: 0;
}

a {
  color: inherit;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-short {
  display: none;
}

.brand-mark {
  background:
    repeating-conic-gradient(#ffffff 0 25%, #141923 0 50%) 50% / 10px 10px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 4px;
  box-shadow: 8px 0 0 var(--primary), 13px 0 0 var(--gold);
  display: inline-block;
  height: 24px;
  width: 24px;
}

nav {
  align-items: center;
  display: flex;
  gap: 18px;
}

nav a {
  color: #eef2f7;
  font-size: 0.95rem;
  text-decoration: none;
}

nav form {
  margin: 0;
}

button,
.link-button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  padding: 10px 14px;
  text-decoration: none;
}

nav button {
  background: #3b4251;
  color: white;
}

.primary {
  background: var(--primary);
  color: white;
  font-weight: 750;
}

.primary:hover {
  background: var(--primary-dark);
}

.ghost {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: white;
  font-weight: 750;
}

.ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

main {
  margin: 0 auto;
  max-width: 1160px;
  padding: 28px;
}

.hero {
  align-items: end;
  background:
    linear-gradient(90deg, rgba(11, 14, 21, 0.94), rgba(17, 23, 34, 0.72) 48%, rgba(197, 22, 46, 0.22)),
    url("/assets/daytona-grandstands.jpg") center 44% / cover;
  border-bottom: 6px solid var(--primary);
  color: white;
  display: flex;
  gap: 28px;
  justify-content: space-between;
  margin: -28px -28px 28px;
  min-height: 205px;
  overflow: hidden;
  padding: 38px 28px 26px;
  position: relative;
}

.hero::before {
  background:
    linear-gradient(90deg, transparent, rgba(242, 201, 76, 0.92) 32%, rgba(197, 22, 46, 0.95) 32% 68%, rgba(13, 143, 163, 0.92) 68%, transparent);
  bottom: 0;
  content: "";
  height: 6px;
  left: 0;
  position: absolute;
  right: 0;
}

.hero::after {
  background:
    repeating-conic-gradient(rgba(255, 255, 255, 0.18) 0 25%, rgba(0, 0, 0, 0.12) 0 50%) 0 0 / 24px 24px;
  content: "";
  height: 72px;
  opacity: 0.5;
  position: absolute;
  right: -20px;
  top: -16px;
  transform: rotate(6deg);
  width: 220px;
}

.hero-copy,
.hero-cta {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(1.85rem, 3vw, 3rem);
  line-height: 1.02;
  margin: 0;
  max-width: 820px;
}

.hero p:not(.eyebrow) {
  color: #e4ecf5;
  margin: 18px 0 0;
}

.hero-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  margin-top: 18px;
  max-width: 920px;
}

.hero-metrics span {
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  color: #f6f8fb;
  display: inline-grid;
  gap: 1px;
  min-width: 108px;
  padding: 8px 11px;
}

.hero-metrics strong {
  color: white;
  font-size: 1.05rem;
}

.hero-metrics em {
  font-style: normal;
}

.hero-cta {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.eyebrow {
  color: #c9d4e2;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.page-heading {
  margin-bottom: 24px;
}

.page-heading h1 {
  font-size: 2.3rem;
  line-height: 1.1;
  margin: 0 0 8px;
}

.page-heading p,
.muted {
  color: var(--muted);
}

.standings-heading {
  background:
    linear-gradient(90deg, rgba(17, 23, 34, 0.93), rgba(197, 22, 46, 0.8)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 8px, transparent 8px 18px);
  border-radius: 8px;
  color: white;
  margin-bottom: 18px;
  overflow: hidden;
  padding: 26px;
  position: relative;
}

.standings-heading::after {
  background:
    repeating-conic-gradient(rgba(255, 255, 255, 0.28) 0 25%, rgba(0, 0, 0, 0.18) 0 50%) 0 0 / 18px 18px;
  bottom: -18px;
  content: "";
  height: 66px;
  opacity: 0.5;
  position: absolute;
  right: -12px;
  transform: rotate(-7deg);
  width: 180px;
}

.standings-heading h1,
.standings-heading p {
  position: relative;
  z-index: 1;
}

.standings-heading p {
  color: #e8eef7;
}

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

.standings-summary article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(23, 32, 51, 0.07);
  display: grid;
  gap: 4px;
  overflow: hidden;
  padding: 18px;
  position: relative;
}

.standings-summary article::before {
  background: linear-gradient(90deg, var(--primary), var(--gold), var(--sky));
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.standings-summary span,
.standings-summary em,
.all-star-key {
  color: var(--muted);
  font-size: 0.86rem;
  font-style: normal;
}

.standings-summary strong {
  font-size: 1.45rem;
  line-height: 1.15;
}

.standings-summary .all-star-summary {
  background:
    linear-gradient(135deg, rgba(242, 201, 76, 0.18), rgba(255, 255, 255, 0.96) 46%),
    var(--surface);
  border-color: rgba(242, 201, 76, 0.7);
}

.panel-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.panel-heading h2 {
  margin: 0;
}

.standings-panel {
  padding-bottom: 10px;
}

.standings-table td:first-child,
.standings-table th:first-child {
  width: 68px;
}

.standings-table td:nth-child(2) {
  font-weight: 760;
}

.all-star-winner-row {
  background:
    linear-gradient(90deg, rgba(242, 201, 76, 0.24), rgba(255, 255, 255, 0.88) 54%);
}

.all-star-winner-row td {
  border-bottom-color: rgba(242, 201, 76, 0.8);
}

.all-star-badge,
.all-star-key {
  background: rgba(242, 201, 76, 0.22);
  border: 1px solid rgba(242, 201, 76, 0.65);
  border-radius: 999px;
  color: #735000;
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 850;
  margin-left: 8px;
  padding: 3px 8px;
  text-transform: uppercase;
}

.momentum-panel {
  margin-bottom: 20px;
}

.momentum-callouts {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.momentum-callouts article {
  background:
    linear-gradient(135deg, rgba(13, 143, 163, 0.09), rgba(197, 22, 46, 0.05)),
    #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 14px;
}

.momentum-callouts span,
.momentum-callouts em,
.momentum-player em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.momentum-callouts strong {
  font-size: 1.15rem;
  line-height: 1.15;
}

.momentum-list {
  display: grid;
  gap: 8px;
}

.momentum-list article {
  align-items: center;
  background: linear-gradient(90deg, rgba(248, 250, 252, 0.95), #ffffff);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(150px, 0.8fr) minmax(140px, 1fr) 130px;
  padding: 10px 12px;
}

.momentum-player {
  display: grid;
  gap: 2px;
}

.momentum-player span {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.momentum-player strong {
  line-height: 1.1;
}

.momentum-bar {
  background: rgba(101, 112, 133, 0.13);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.momentum-bar span {
  background: linear-gradient(90deg, var(--primary), var(--gold), var(--sky));
  border-radius: inherit;
  display: block;
  height: 100%;
}

.sparkline {
  height: 34px;
  width: 120px;
}

.sparkline polyline {
  fill: none;
  stroke: var(--sky);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid > * {
  min-width: 0;
}

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

.race-week-panel {
  margin-bottom: 20px;
}

.my-pick-card {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 20px;
  overflow: hidden;
  position: relative;
}

.my-pick-card::before {
  background: linear-gradient(180deg, var(--accent), var(--gold));
  bottom: 0;
  content: "";
  left: 0;
  position: absolute;
  top: 0;
  width: 6px;
}

.my-pick-card > * {
  position: relative;
}

.my-pick-card div {
  display: grid;
  gap: 3px;
}

.my-pick-card span,
.my-pick-card em {
  color: var(--muted);
  font-size: 0.86rem;
  font-style: normal;
}

.my-pick-card strong {
  font-size: 1.45rem;
  line-height: 1.15;
}

.pick-lock-card {
  background: rgba(31, 122, 74, 0.08);
  border: 1px solid rgba(31, 122, 74, 0.18);
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 16px;
}

.pick-lock-card span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.pick-lock-card strong {
  font-size: 1.55rem;
  line-height: 1.1;
}

.pick-lock-card em {
  color: var(--muted);
  font-style: normal;
}

.pick-lock-card .muted {
  margin: 4px 0 0;
}

.race-week-command {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.45fr) minmax(190px, 0.75fr) minmax(220px, 0.9fr);
}

.race-week-main .race-card {
  height: 100%;
}

.race-week-clock,
.race-week-stats {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 14px;
}

.race-week-clock span,
.race-week-stats span {
  color: var(--muted);
  font-size: 0.82rem;
}

.race-week-clock strong {
  font-size: 1.35rem;
}

.race-week-clock em {
  color: var(--muted);
  font-style: normal;
}

.race-week-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.race-week-stats span {
  border: 1px solid transparent;
  border-radius: 6px;
  display: grid;
  gap: 2px;
  padding: 8px;
}

.race-week-stats strong {
  color: var(--ink);
  font-size: 1.3rem;
}

.compact-order {
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-top: 18px;
  padding-top: 14px;
}

.compact-order li {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  gap: 10px;
  padding: 7px 12px 7px 18px;
}

.compact-order li span:first-child {
  display: inline-block;
  min-width: 88px;
}

.compact-order em {
  display: grid;
  gap: 3px;
  justify-items: end;
  min-width: 0;
  text-align: right;
}

.compact-order em strong {
  font-size: 0.9rem;
  font-style: normal;
  font-weight: 750;
  line-height: 1.15;
}

.compact-order .pick-status-pill {
  margin-top: 0;
}

.stat-strip {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-areas: "second first third";
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr) minmax(0, 1fr);
  margin: -6px auto 18px;
  max-width: 920px;
}

.stat-strip article {
  background:
    linear-gradient(90deg, rgba(197, 22, 46, 0.08), transparent 34%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(23, 32, 51, 0.07);
  display: grid;
  gap: 1px;
  overflow: hidden;
  min-height: 82px;
  padding: 13px 16px 12px;
  position: relative;
}

.stat-strip article::before {
  background:
    linear-gradient(90deg, var(--primary), var(--gold), var(--sky));
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.stat-strip .podium-rank-1 {
  grid-area: first;
  min-height: 104px;
  padding-top: 18px;
}

.stat-strip .podium-rank-2 {
  grid-area: second;
}

.stat-strip .podium-rank-3 {
  grid-area: third;
}

.stat-strip span,
.stat-strip em,
.order-list em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.stat-strip strong {
  font-size: 1.2rem;
  line-height: 1.12;
}

.stat-strip .podium-rank-1 strong {
  font-size: 1.45rem;
}

.panel,
.auth-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(23, 32, 51, 0.06);
  padding: 22px;
}

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

.health-grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(23, 32, 51, 0.06);
  display: grid;
  gap: 3px;
  overflow: hidden;
  padding: 16px;
  position: relative;
}

.health-grid article::before {
  background: linear-gradient(90deg, var(--accent), var(--gold));
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.health-grid span,
.health-grid em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.health-grid strong {
  line-height: 1.15;
}

.admin-tabs {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.admin-tabs a {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
  padding: 8px 12px;
  text-decoration: none;
}

.admin-tabs a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.data-health-warnings {
  margin-bottom: 16px;
}

.health-warning-list {
  display: grid;
  gap: 10px;
}

.health-warning {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px 12px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.5fr) auto;
  padding: 12px 14px;
}

.health-warning span {
  color: var(--muted);
}

.health-warning a {
  color: var(--accent);
  font-weight: 800;
}

.health-warning.notice {
  background: rgba(101, 112, 133, 0.05);
}

.health-warning.warning {
  background: rgba(242, 201, 76, 0.13);
  border-color: rgba(183, 132, 0, 0.28);
}

.health-warning.danger {
  background: rgba(197, 22, 46, 0.08);
  border-color: rgba(197, 22, 46, 0.24);
}

.auth-panel {
  margin: 8vh auto;
  max-width: 460px;
}

h1,
h2 {
  margin-top: 0;
}

.stack {
  display: grid;
  gap: 14px;
}

.admin-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-actions form {
  margin: 0;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.92rem;
  gap: 6px;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 42px;
  padding: 9px 10px;
  width: 100%;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.alert {
  background: #fff1cc;
  border: 1px solid #efc14d;
  border-radius: 6px;
  color: #684600;
  padding: 10px 12px;
}

.race-list {
  display: grid;
  gap: 12px;
}

.order-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.order-list li {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.race-card {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(13, 143, 163, 0.08), transparent 42%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.05);
  display: grid;
  gap: 12px;
  grid-template-columns: auto 1fr auto auto;
  overflow: hidden;
  padding: 14px;
  position: relative;
}

.race-card::before {
  background:
    repeating-conic-gradient(#111722 0 25%, #ffffff 0 50%) 0 0 / 14px 14px;
  bottom: 0;
  content: "";
  left: 0;
  opacity: 0.18;
  position: absolute;
  top: 0;
  width: 34px;
}

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

.race-week {
  background: var(--track);
  border-radius: 6px;
  color: white !important;
  font-size: 0.78rem !important;
  font-weight: 850;
  min-width: 72px;
  padding: 6px 9px;
  text-align: center;
  text-transform: uppercase;
}

.race-card span {
  color: var(--muted);
  display: block;
  font-size: 0.92rem;
}

.status {
  background: #e9f7f8;
  border-radius: 999px;
  color: var(--accent) !important;
  font-weight: 750;
  padding: 4px 10px;
}

.site-footer {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0 auto;
  max-width: 1160px;
  padding: 8px 28px 28px;
}

.site-footer a {
  color: var(--accent);
}

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

.table-scroll {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

.picks-panel {
  padding: 0;
}

.picks-panel h2 {
  padding: 22px 22px 0;
}

.picks-matrix-wrap {
  max-height: 70vh;
  overscroll-behavior: contain;
}

.picks-matrix {
  min-width: 1100px;
}

.picks-matrix th,
.picks-matrix td {
  min-width: 150px;
  vertical-align: top;
}

.picks-matrix thead th {
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 3;
}

.picks-matrix .sticky-col {
  background: var(--surface);
  box-shadow: 1px 0 0 var(--line);
  left: 0;
  min-width: 96px;
  position: sticky;
  z-index: 4;
}

.picks-matrix tbody .sticky-col {
  color: var(--ink);
  font-size: 0.9rem;
  text-transform: none;
}

.race-label strong,
.race-label span,
.pick-driver,
.pick-flag {
  display: block;
}

.race-label span,
.empty-pick {
  color: var(--muted);
  font-size: 0.86rem;
}

.pick-driver {
  font-weight: 750;
  line-height: 1.25;
}

.pick-flag {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  margin-top: 4px;
  text-transform: uppercase;
}

.pick-order-note {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 0 0 12px;
  padding: 9px 12px;
}

.payout-note {
  border-top: 1px solid var(--line);
  margin: 12px 0 0;
  padding-top: 10px;
}

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

.payout-summary article {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  padding: 12px;
}

.payout-summary span,
.payout-summary em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.payout-summary strong {
  font-size: 1.2rem;
}

.payout-settings-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.payout-settings-form button {
  align-self: end;
}

.password-reset-form {
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr) auto;
}

.password-reset-form button {
  align-self: end;
}

.pick-row-picked {
  background: rgba(31, 122, 74, 0.08);
}

.pick-row-current {
  background: rgba(242, 201, 76, 0.14);
}

.pick-row-behind {
  background: rgba(197, 22, 46, 0.08);
}

.pick-row-upcoming {
  background: rgba(101, 112, 133, 0.04);
}

.pick-row-picked td {
  border-bottom-color: rgba(31, 122, 74, 0.24);
}

.pick-row-current td {
  border-bottom-color: rgba(183, 132, 0, 0.26);
}

.pick-row-behind td {
  border-bottom-color: rgba(197, 22, 46, 0.24);
}

.pick-status-pill {
  border-radius: 999px;
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 850;
  margin-top: 6px;
  padding: 2px 7px;
  text-transform: uppercase;
  white-space: nowrap;
}

.pick-row-picked .pick-status-pill {
  background: rgba(31, 122, 74, 0.14);
  color: #1f6f46;
}

.pick-row-current .pick-status-pill {
  background: rgba(242, 201, 76, 0.28);
  color: #735000;
}

.pick-row-behind .pick-status-pill {
  background: rgba(197, 22, 46, 0.13);
  color: var(--primary-dark);
}

.pick-row-upcoming .pick-status-pill {
  background: rgba(101, 112, 133, 0.12);
  color: var(--muted);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 8px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.result-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.rules-layout {
  display: grid;
  gap: 18px;
}

.rules-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.rules-card h2 {
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  padding-bottom: 10px;
}

.rule-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.rule-list li {
  padding-left: 2px;
}

.rules-card .table-scroll {
  margin-top: 12px;
}

.data-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
  overflow: hidden;
}

.data-block summary {
  background: #f8fafc;
  cursor: pointer;
  font-weight: 750;
  padding: 12px 14px;
}

.data-block table {
  min-width: 880px;
}

@media (max-width: 780px) {
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  header {
    align-items: stretch;
    gap: 10px;
    min-height: 0;
    padding: 10px 12px 12px;
    position: relative;
  }

  .brand {
    gap: 8px;
  }

  .brand-full {
    display: none;
  }

  .brand-short {
    display: inline;
    font-size: 0.95rem;
    font-weight: 850;
  }

  .brand-mark {
    height: 22px;
    width: 22px;
  }

  nav {
    display: flex;
    gap: 8px;
    margin: 0 -4px;
    overflow-x: auto;
    padding: 0 4px 2px;
    scrollbar-width: none;
    white-space: nowrap;
    width: calc(100% + 8px);
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  nav a,
  nav button {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-size: 0.82rem;
    min-height: 34px;
    padding: 7px 10px;
  }

  nav form {
    flex: 0 0 auto;
  }

  button,
  .link-button {
    min-height: 40px;
    padding: 9px 11px;
  }

  main {
    padding: 14px;
  }

  .page-heading {
    margin-bottom: 12px;
  }

  .page-heading h1 {
    font-size: 1.55rem;
    margin-bottom: 3px;
  }

  .page-heading p {
    font-size: 0.9rem;
    margin: 0;
  }

  .panel,
  .auth-panel,
  .rules-card {
    border-radius: 7px;
    padding: 14px;
  }

  .hero {
    margin: -14px -14px 14px;
    min-height: 0;
    padding: 14px 14px 12px;
  }

  .hero h1 {
    font-size: 1.16rem;
    line-height: 1.1;
  }

  .hero p:not(.eyebrow) {
    font-size: 0.82rem;
    margin-top: 6px;
  }

  .hero-metrics {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 9px 0 0;
    max-width: none;
    width: 100%;
  }

  .hero-metrics span {
    font-size: 0.72rem;
    min-width: 0;
    padding: 7px 8px;
  }

  .hero-metrics strong {
    font-size: 0.84rem;
  }

  .hero-metrics em {
    display: none;
  }

  .hero-cta {
    justify-content: flex-start;
    width: 100%;
  }

  .hero-cta .link-button {
    flex: 1 1 130px;
    min-height: 36px;
    padding: 7px 10px;
    text-align: center;
  }

  .two,
  .health-grid,
  .race-week-command,
  .health-warning,
  .stat-strip,
  .standings-summary,
  .payout-summary,
  .payout-settings-form,
  .password-reset-form,
  .result-form {
    grid-template-columns: 1fr;
  }

  .grid,
  .rules-layout,
  .race-list,
  .stack {
    gap: 10px;
  }

  .panel-heading {
    align-items: start;
    gap: 6px;
  }

  .panel-heading h2 {
    font-size: 1.12rem;
  }

  .standings-heading {
    border-radius: 7px;
    margin-bottom: 12px;
    padding: 16px;
  }

  .standings-heading::after {
    height: 44px;
    width: 120px;
  }

  .standings-summary {
    gap: 8px;
    margin-bottom: 12px;
  }

  .momentum-panel {
    margin-bottom: 12px;
  }

  .momentum-callouts {
    gap: 8px;
    grid-template-columns: 1fr;
    margin-bottom: 10px;
  }

  .momentum-callouts article {
    padding: 12px;
  }

  .momentum-list article {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
  }

  .momentum-player {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .momentum-player em {
    grid-column: 1 / 3;
  }

  .sparkline {
    width: 100%;
  }

  .standings-summary article {
    padding: 14px;
  }

  .standings-summary strong {
    font-size: 1.15rem;
  }

  .all-star-badge,
  .all-star-key {
    margin-left: 0;
    margin-top: 4px;
  }

  .admin-tabs {
    flex-wrap: nowrap;
    margin: 0 -4px 12px;
    overflow-x: auto;
    padding: 0 4px 2px;
    scrollbar-width: none;
  }

  .admin-tabs::-webkit-scrollbar {
    display: none;
  }

  .admin-tabs a {
    flex: 0 0 auto;
    font-size: 0.82rem;
    padding: 7px 10px;
  }

  .health-warning {
    padding: 10px;
  }

  .health-warning a {
    justify-self: start;
  }

  .table-scroll {
    margin: 0 -14px;
    padding: 0 14px;
  }

  table {
    font-size: 0.84rem;
    min-width: 100%;
  }

  th,
  td {
    padding: 8px 6px;
  }

  .picks-panel h2 {
    padding: 14px 14px 0;
  }

  .picks-matrix-wrap {
    max-height: 68vh;
  }

  .picks-matrix {
    min-width: 860px;
  }

  .picks-matrix th,
  .picks-matrix td {
    min-width: 124px;
  }

  .my-pick-card {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .my-pick-card strong {
    font-size: 1.12rem;
  }

  .my-pick-card .link-button {
    text-align: center;
  }

  .race-week-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .race-week-panel {
    margin-bottom: 14px;
  }

  .race-week-panel .panel-heading {
    align-items: center;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .race-week-panel .panel-heading h2 {
    font-size: 1.15rem;
  }

  .race-week-panel .panel-heading .link-button {
    padding: 8px 10px;
  }

  .race-week-command {
    gap: 8px;
  }

  .race-week-clock,
  .race-week-stats {
    padding: 10px;
  }

  .race-week-clock strong {
    font-size: 1.1rem;
  }

  .race-week-stats span {
    padding: 7px;
  }

  .race-week-stats strong {
    font-size: 1.08rem;
  }

  .compact-order {
    gap: 6px;
    grid-template-columns: 1fr;
    margin-top: 10px;
    padding-top: 10px;
  }

  .compact-order li {
    min-height: 52px;
    padding: 8px 10px 8px 12px;
  }

  .compact-order li span:first-child {
    min-width: 82px;
  }

  .compact-order em {
    gap: 4px;
    font-size: 0.78rem;
  }

  .compact-order em strong {
    font-size: 0.86rem;
  }

  .stat-strip {
    gap: 6px;
    grid-template-areas: "second first third";
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: none;
  }

  .stat-strip article,
  .stat-strip .podium-rank-1 {
    min-height: 70px;
    padding: 9px 8px 8px;
  }

  .stat-strip strong,
  .stat-strip .podium-rank-1 strong {
    font-size: 0.96rem;
  }

  .stat-strip em {
    font-size: 0.78rem;
  }

  .race-card {
    align-items: start;
    gap: 6px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 12px;
  }

  .race-card::before {
    height: 6px;
    right: 0;
    width: auto;
  }

  .race-card .status {
    justify-self: end;
  }

  .race-card a {
    grid-column: 2 / 4;
    justify-self: start;
    margin-top: 2px;
  }

  .race-card strong {
    line-height: 1.15;
  }

  .race-card span {
    font-size: 0.84rem;
  }

  .race-week {
    font-size: 0.7rem !important;
    min-width: 58px;
    padding: 5px 7px;
  }

  .auth-panel {
    margin: 4vh auto;
    max-width: 100%;
  }

  .auth-panel h1 {
    font-size: 1.55rem;
  }

  .site-footer {
    font-size: 0.72rem;
    padding: 4px 14px 18px;
  }
}
