@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-italic.woff") format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("fonts/libre-franklin.woff") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #1b365d;
  --navy-deep: #0e1c33;
  --navy-mid: #2e4a6e;
  --gold: #c4a35a;
  --gold-lt: #f8f0dc;
  --ink: #1c2833;
  --muted: #5d6d7e;
  --line: #d5cdb8;
  --paper: #f4efe4;
  --card: #fbf8f1;
  --input: #e7f1f8;
  --input-line: #b7c9d6;
  --calc: #eef1f4;
  --green: #1f7a4d;
  --green-lt: #d5f5e3;
  --red: #9b2e2e;
  --red-lt: #fadbd8;
  --orange: #c05600;
  --orange-lt: #fdebd0;
  --white: #ffffff;
  --shadow: 0 1px 2px rgba(14, 28, 51, 0.06), 0 8px 24px rgba(14, 28, 51, 0.05);
  --display: "Instrument Serif", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --ui: "Libre Franklin", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --wrap: 1080px;
  --radius: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at top, rgba(196, 163, 90, 0.08), transparent 32rem),
    var(--paper);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

.wrap,
.card,
.cta,
.field,
.seg,
.team-card,
.team-row,
.stats {
  min-width: 0;
}

.wrap {
  width: min(var(--wrap), calc(100% - 2rem));
  margin-inline: auto;
}

header {
  background: var(--navy-deep);
  color: var(--white);
  padding: 2.25rem 0 2.5rem;
  border-bottom: 3px solid var(--gold);
}

header .eyebrow {
  margin: 0 0 0.65rem;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

header h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.25rem, 5vw, 3.4rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

header .lede {
  margin: 0.85rem 0 0;
  max-width: 38rem;
  color: #e8eef5;
  font-size: 1.05rem;
  font-weight: 400;
}

main {
  padding: 1.5rem 0 3.5rem;
  display: grid;
  gap: 1.25rem;
}

.banner {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  border: 1px solid #e8d48a;
  background: var(--gold-lt);
  color: #7d6608;
  font-size: 0.92rem;
  font-weight: 550;
}

.banner[hidden] {
  display: none;
}

.card,
.cta {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1.4rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

h2 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 400;
  color: var(--navy-deep);
  letter-spacing: -0.01em;
}

.section-head h2 {
  margin: 0;
}

.hint {
  margin: -0.4rem 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label,
.field .label-like,
.team-row label,
.week-cell label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
}

.field.span-2 {
  grid-column: span 2;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--input-line);
  border-radius: 5px;
  background: var(--input);
  color: var(--navy-deep);
  font: inherit;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

input[type="number"] {
  font-weight: 550;
}

input::placeholder {
  color: #7e8fa0;
  opacity: 1;
}

input:focus,
select:focus,
button:focus-visible,
a.btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.25rem;
  background: var(--calc);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.seg label {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0;
  padding: 0.45rem 0.5rem;
  border-radius: 4px;
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg label:has(input:checked) {
  background: var(--navy);
  color: var(--white);
}

.seg label:has(input:focus-visible) {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.btn,
button.linkish {
  font-family: inherit;
  cursor: pointer;
}

button.linkish,
.btn-ghost {
  appearance: none;
  border: 1px solid var(--navy);
  background: transparent;
  color: var(--navy);
  border-radius: 5px;
  padding: 0.4rem 0.8rem;
  font-size: 0.88rem;
  font-weight: 600;
}

button.linkish:hover,
.btn-ghost:hover {
  background: var(--gold-lt);
}

.team-list {
  display: grid;
  gap: 0.65rem;
}

.team-head,
.team-row {
  display: grid;
  grid-template-columns: 2.2rem minmax(8rem, 1.7fr) repeat(4, minmax(4.2rem, 5.5rem));
  gap: 0.45rem 0.55rem;
  align-items: end;
}

.stats {
  display: contents;
}

.team-head {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 0.15rem;
}

.team-head span:first-child {
  text-align: center;
}

.team-card {
  padding: 0.7rem 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffcf7;
}

.team-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  border-radius: 5px;
  background: var(--navy);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.matchups {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.45rem 0.55rem;
  padding-top: 0.45rem;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.kpi {
  padding: 0.85rem 1rem;
  border-radius: 6px;
  background: var(--navy-deep);
  color: var(--white);
}

.kpi .label {
  margin: 0;
  color: #c9d4e3;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kpi .value {
  margin: 0.15rem 0 0;
  font-family: var(--display);
  font-size: 1.85rem;
  line-height: 1.15;
  color: var(--gold-lt);
}

.kpi .sub {
  margin: 0.2rem 0 0;
  color: #c9d4e3;
  font-size: 0.8rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

table.results {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  min-width: 680px;
}

table.results th,
table.results td {
  padding: 0.6rem 0.7rem;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.results th {
  background: var(--navy);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

table.results th:nth-child(2),
table.results td:nth-child(2),
table.results th:nth-child(7),
table.results td:nth-child(7) {
  text-align: left;
}

table.results th:first-child,
table.results td:first-child {
  text-align: center;
}

table.results tbody tr:nth-child(even) {
  background: #f3efe6;
}

table.results tbody tr.in-cutoff td:first-child {
  box-shadow: inset 3px 0 0 var(--gold);
}

table.results tbody tr:last-child td {
  border-bottom: 0;
}

.team-name {
  font-weight: 600;
  color: var(--navy-deep);
}

.prob-cell {
  min-width: 11rem;
}

.prob {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.prob .pct {
  width: 3.4rem;
  font-weight: 650;
}

.bar {
  flex: 1;
  height: 0.55rem;
  border-radius: 99px;
  background: #e3ddd0;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--navy);
}

.bar > span.likely { background: var(--green); }
.bar > span.bubble { background: var(--gold); }
.bar > span.outside { background: var(--orange); }
.bar > span.longshot { background: var(--red); }

.pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.pill.likely { background: var(--green-lt); color: var(--green); }
.pill.bubble { background: var(--gold-lt); color: #7a5b16; }
.pill.outside { background: var(--orange-lt); color: var(--orange); }
.pill.longshot { background: var(--red-lt); color: var(--red); }

.method,
.disclaimer {
  color: var(--muted);
  font-size: 0.88rem;
}

.disclaimer {
  margin: -0.5rem 0 1rem;
  font-weight: 550;
  color: #6a4b12;
}

.method {
  margin: 1rem 0 0;
}

.cta {
  background: var(--navy-deep);
  color: #e8eef5;
  border-color: var(--navy-deep);
  display: grid;
  gap: 0.4rem;
}

.cta h2 {
  color: var(--white);
  margin-bottom: 0.35rem;
}

.cta p,
.cta li {
  color: #d5deea;
}

.cta p {
  margin: 0.2rem 0;
  max-width: 42rem;
}

.cta ul {
  margin: 0.4rem 0 0.6rem;
  padding-left: 1.15rem;
}

.cta li {
  margin: 0.2rem 0;
}

.cta .price {
  margin-top: 0.5rem;
  color: var(--gold-lt);
  font-weight: 550;
}

a.btn {
  display: inline-block;
  margin-top: 0.7rem;
  width: fit-content;
  padding: 0.7rem 1.15rem;
  border-radius: 5px;
  background: var(--gold);
  color: var(--navy-deep);
  font-weight: 700;
  text-decoration: none;
}

a.btn:hover {
  background: #d4b56e;
}

footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2.2rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

footer p {
  margin: 0.25rem auto;
  max-width: 42rem;
}

@media (max-width: 860px) {
  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }
  .kpis {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 681px) {
  .team-head {
    padding: 0 0.7rem;
  }
  .team-row label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (max-width: 680px) {
  .wrap {
    width: min(var(--wrap), calc(100% - 1.25rem));
  }
  .card,
  .cta {
    padding: 1rem;
  }
  .team-head {
    display: none;
  }
  .team-row {
    grid-template-columns: 2.2rem 1fr;
    align-items: start;
  }
  .team-row .field-name {
    grid-column: 2;
  }
  .team-row .stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 0.55rem;
    grid-column: 1 / -1;
  }
  header {
    padding: 1.6rem 0 1.8rem;
  }
}

@media (max-width: 560px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .field.span-2 {
    grid-column: auto;
  }
  .seg label {
    font-size: 0.8rem;
    line-height: 1.25;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
