:root {
  --ink: #14261e;
  --green: #173a2b;
  --green-light: #245a42;
  --cream: #f4f0e5;
  --paper: #fffdf7;
  --orange: #d8642b;
  --orange-dark: #b84d1b;
  --line: #d8d2c2;
  --muted: #65736b;
  --shadow: 0 18px 50px rgba(20, 38, 30, 0.11);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 6%, rgba(216, 100, 43, 0.12), transparent 24rem),
    linear-gradient(180deg, #f8f5ec 0%, var(--cream) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input { font: inherit; }

.page-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(20, 38, 30, 0.15);
}

.brand { display: flex; align-items: center; color: inherit; text-decoration: none; }
.brand strong { font-family: Georgia, serif; font-size: 20px; }
.week-badge { padding: 8px 14px; color: var(--green); background: rgba(23, 58, 43, .08); border: 1px solid rgba(23, 58, 43, .17); border-radius: 999px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }

main { padding: 76px 0 56px; }
.intro { max-width: 770px; margin-bottom: 56px; }
.eyebrow { margin: 0 0 10px; color: var(--orange-dark); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; line-height: 1.05; }
h1 { margin-bottom: 20px; font-size: clamp(46px, 8vw, 82px); letter-spacing: -.045em; }
.intro > p:last-child { max-width: 650px; color: var(--muted); font-size: 19px; }

.player-card, .submit-card, .success-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.player-card { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: end; padding: 34px; margin-bottom: 64px; overflow: hidden; }
.player-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--orange); }
.player-card h2, .section-heading h2, .submit-card h2, .success-panel h2 { margin-bottom: 8px; font-size: clamp(28px, 4vw, 38px); }
.player-card p, .submit-card p { margin-bottom: 0; color: var(--muted); }

.name-field > span, .field-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.name-field input, .margin-field input { width: 100%; color: var(--ink); background: #fff; border: 1px solid #bdb7a8; border-radius: 10px; outline: none; transition: border-color .15s, box-shadow .15s; }
.name-field input { height: 54px; padding: 0 16px; }
.name-field input:focus, .margin-field input:focus { border-color: var(--green-light); box-shadow: 0 0 0 4px rgba(36, 90, 66, .12); }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 22px; }
.progress-text { flex: none; margin-bottom: 8px; color: var(--green); font-weight: 800; }
.picks-tools { display: flex; align-items: flex-end; gap: 24px; }
.rankings-controls { text-align: right; }
.ranking-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-size: 13px; font-weight: 800; cursor: pointer; }
.ranking-toggle > input { position: absolute; opacity: 0; pointer-events: none; }
.ranking-toggle > label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.rankings-link { margin-left: -4px; color: inherit; }
.toggle-track { width: 38px; height: 22px; padding: 3px; display: block; background: #aaa99f; border-radius: 999px; transition: background .15s; }
.toggle-track span { width: 16px; height: 16px; display: block; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.ranking-toggle input:checked + label .toggle-track { background: var(--green); }
.ranking-toggle input:checked + label .toggle-track span { transform: translateX(16px); }
.ranking-toggle input:focus-visible + label .toggle-track { outline: 3px solid rgba(36, 90, 66, .25); outline-offset: 2px; }
.games-list { display: grid; gap: 28px; }
.game-day { padding: 18px; background: rgba(23, 58, 43, .035); border: 1px solid rgba(23, 58, 43, .16); border-radius: 20px; }
.game-day-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 2px 6px 14px; }
.game-day-heading span { display: block; margin-bottom: 2px; color: var(--orange-dark); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .14em; }
.game-day-heading h3 { margin: 0; color: var(--green); font-family: Georgia, "Times New Roman", serif; font-size: clamp(22px, 3vw, 28px); line-height: 1.15; }
.game-day-heading strong { flex: none; padding: 6px 10px; color: var(--green); background: rgba(23, 58, 43, .08); border-radius: 999px; font-size: 12px; }
.game-day-games { display: grid; gap: 12px; }
.game-card { min-width: 0; display: grid; grid-template-columns: 52px minmax(260px, 1fr) 190px 112px; gap: 24px; align-items: center; margin: 0; padding: 22px 24px; background: rgba(255, 253, 247, .82); border: 1px solid var(--line); border-radius: 14px; transition: background .15s, border-color .15s, transform .15s; }
.game-card:focus-within { border-color: #9cae9f; }
.game-card.is-complete { background: var(--paper); border-color: rgba(23, 58, 43, .45); }
.game-number { width: 42px; height: 42px; display: grid; place-items: center; color: var(--muted); background: var(--cream); border-radius: 50%; font-family: Georgia, serif; font-weight: 800; }
.is-complete .game-number { color: var(--paper); background: var(--green); }
.matchup > span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.matchup-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 7px; font-family: Georgia, serif; font-size: 20px; }
.matchup-team { min-width: 0; display: inline-flex; align-items: baseline; gap: 4px; }
.team-name-text { min-width: 0; }
.matchup-divider { color: #9a9b94; }
.team-record { color: var(--muted); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 12px; font-weight: 600; white-space: nowrap; }
.collision-initial { color: var(--team-color); font-weight: 900; }
.initial-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.initial-options label { cursor: pointer; }
.initial-options input { position: absolute; opacity: 0; pointer-events: none; }
.initial-options span { min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--green); background: #fff; border: 1px solid #aaa796; border-radius: 9px; font-size: 18px; font-weight: 900; transition: .15s ease; }
.initial-options b { font: inherit; }
.team-rank { min-width: 27px; padding: 2px 4px; color: var(--orange-dark); background: rgba(216, 100, 43, .1); border-radius: 4px; font-size: 10px; font-weight: 900; line-height: 1.25; }
.rankings-hidden .team-rank { display: none; }
.initial-options input:hover + span { border-color: var(--green); }
.initial-options input:focus-visible + span { outline: 3px solid rgba(36, 90, 66, .25); outline-offset: 2px; }
.initial-options input:checked + span { color: #fff; background: var(--green); border-color: var(--green); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12); }
.initial-options input:checked + span .collision-initial { color: #fff; }
.margin-field input { height: 46px; padding: 0 10px; text-align: center; font-weight: 800; }
.margin-field input.is-invalid, .margin-field input.is-invalid:focus { color: #9f1515; background: #fff1f1; border: 4px solid #d62424; box-shadow: 0 0 0 5px rgba(214, 36, 36, .22); }

.submit-card { display: grid; grid-template-columns: 1fr auto; gap: 28px 48px; align-items: center; padding: 34px; margin-top: 36px; }
#submit-button { min-width: 248px; min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 0 20px; color: #fff; background: var(--orange); border: 0; border-radius: 10px; font-weight: 900; cursor: pointer; box-shadow: 0 6px 0 var(--orange-dark); transition: transform .15s, box-shadow .15s, opacity .15s; }
#submit-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 0 var(--orange-dark); }
#submit-button:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--orange-dark); }
#submit-button:disabled { cursor: not-allowed; opacity: .42; box-shadow: 0 4px 0 #9b806f; }
.form-error { grid-column: 1 / -1; margin: 0; padding: 14px 16px; color: #8e251f; background: #fff1ef; border: 1px solid #efb7b1; border-radius: 9px; font-weight: 700; }

.success-panel { max-width: 720px; margin: 20px auto 0; padding: 48px; text-align: center; }
.success-check { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 22px; color: white; background: var(--green); border-radius: 50%; font-size: 34px; }
.success-panel > p { color: var(--muted); }
.confirmation { padding: 12px; background: var(--cream); border-radius: 8px; }

.loading, .schedule-error { padding: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.schedule-error { color: #8e251f; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.sr-only { 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: 820px) {
  .game-card { grid-template-columns: 42px 1fr 92px; gap: 14px; }
  .winner-choice { grid-column: 2; }
  .margin-field { grid-column: 3; grid-row: 1 / span 2; }
  .player-card { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 580px) {
  .page-shell { width: min(100% - 20px, 1120px); }
  .site-header { min-height: 82px; }
  .week-badge { padding: 7px 9px; font-size: 11px; }
  main { padding-top: 50px; }
  .intro { margin-bottom: 40px; }
  h1 { font-size: 48px; }
  .player-card, .submit-card { padding: 24px 20px; }
  .section-heading { align-items: start; flex-direction: column; gap: 4px; }
  .picks-tools { width: 100%; align-items: center; justify-content: space-between; }
  .rankings-controls { text-align: left; }
  .progress-text { margin: 0; }
  .game-day { padding: 12px; border-radius: 16px; }
  .game-day-heading { align-items: center; padding: 2px 4px 12px; }
  .game-card { grid-template-columns: 38px 1fr; padding: 18px 16px; }
  .game-number { width: 34px; height: 34px; }
  .matchup-label { font-size: 18px; }
  .matchup-label { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .matchup-divider { display: none; }
  .winner-choice, .margin-field { grid-column: 2; grid-row: auto; }
  .margin-field input { max-width: 120px; }
  .submit-card { grid-template-columns: 1fr; }
  #submit-button { width: 100%; min-width: 0; }
  .success-panel { padding: 34px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
