:root {
  --scarlet: #d22630;
  --scarlet-dark: #a81c25;
  --cream: #f7f3ea;
  --ink: #1a1715;
  --muted: #6b625b;
  --line: #e0d8cb;
  --card: #ffffff;
  --ok: #2f7d4f;
  --shadow: 0 1px 2px rgba(26,23,21,.06), 0 8px 24px rgba(26,23,21,.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --cream: #16130f;
    --ink: #f2ece2;
    --muted: #9c9187;
    --line: #322b24;
    --card: #201b16;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 680px; margin: 0 auto; padding: 0 20px 120px; }

/* ---------- header ---------- */
header.hero {
  background: var(--scarlet);
  color: #fff;
  padding: 40px 20px 34px;
  margin-bottom: 28px;
  border-bottom: 5px solid var(--scarlet-dark);
}
header.hero .inner { max-width: 680px; margin: 0 auto; }
header.hero .kicker {
  text-transform: uppercase; letter-spacing: .14em; font-size: 12px;
  font-weight: 700; opacity: .82; margin: 0 0 8px;
}
header.hero h1 {
  margin: 0 0 10px; font-size: clamp(28px, 6vw, 40px); line-height: 1.1;
  font-weight: 800; letter-spacing: -.02em;
}
header.hero p { margin: 0; opacity: .92; font-size: 15px; max-width: 46ch; }

/* ---------- sections ---------- */
section.block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
section.block > h2 {
  margin: 0 0 4px; font-size: 20px; font-weight: 750; letter-spacing: -.01em;
}
section.block > .blurb { margin: 0 0 20px; color: var(--muted); font-size: 14.5px; }

/* ---------- questions ---------- */
.q { padding: 18px 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; padding-top: 4px; }
.q .prompt { font-weight: 650; margin-bottom: 3px; display: block; }
.q .req { color: var(--scarlet); margin-left: 3px; }
.q .help { color: var(--muted); font-size: 13.5px; margin-bottom: 12px; }
.q .prompt + .controls, .q .help + .controls { margin-top: 10px; }

input[type=text], input[type=email], input[type=number], textarea {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--ink);
  background: var(--cream); border: 1.5px solid var(--line); border-radius: 9px;
}
input[type=text]:focus, input[type=email]:focus, input[type=number]:focus, textarea:focus {
  outline: none; border-color: var(--scarlet); background: var(--card);
}
textarea { min-height: 92px; resize: vertical; }
input[type=number] { max-width: 130px; }

/* choice pills */
.choice {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 14px; margin-bottom: 8px;
  border: 1.5px solid var(--line); border-radius: 10px;
  cursor: pointer; transition: border-color .12s, background .12s;
}
.choice:hover { border-color: var(--muted); }
.choice input { margin: 3px 0 0; accent-color: var(--scarlet); flex: none; }
.choice.selected { border-color: var(--scarlet); background: color-mix(in srgb, var(--scarlet) 7%, transparent); }
.choice span { flex: 1; }

/* game grid */
.games { display: flex; flex-direction: column; gap: 7px; }
.game {
  display: grid; grid-template-columns: 54px 1fr auto auto; align-items: center; gap: 10px;
  padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  transition: border-color .12s ease, background-color .12s ease;
}
.game[data-pick=W] { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.game[data-pick=L] { border-color: color-mix(in srgb, var(--scarlet) 55%, var(--line)); }
.game .date { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.game .matchup { display: flex; align-items: center; gap: 8px; min-width: 0; }
.game .vs {
  color: var(--muted); font-size: 12.5px; width: 16px; flex: none;
}
/* Fixed slot so rows stay aligned even when a logo fails to load. */
.game .mark-slot {
  width: 26px; height: 26px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.game .mark { max-width: 100%; max-height: 100%; object-fit: contain; }
.game .opp {
  font-weight: 600; font-size: 14.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.game .ha {
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 8px; flex: none;
}
.game.is-away .ha { color: var(--muted); opacity: .75; }

@media (max-width: 560px) {
  .game { grid-template-columns: 46px 1fr auto; gap: 8px; }
  .game .ha { display: none; }
}
.wl { display: flex; gap: 6px; }
.wl button {
  font: inherit; font-weight: 700; font-size: 13px; width: 38px; padding: 6px 0;
  border: 1.5px solid var(--line); border-radius: 8px; background: transparent;
  color: var(--muted); cursor: pointer;
}
.wl button[aria-pressed=true][data-v=W] { background: var(--ok); border-color: var(--ok); color: #fff; }
.wl button[aria-pressed=true][data-v=L] { background: var(--scarlet); border-color: var(--scarlet); color: #fff; }
.record { margin-top: 12px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* score */
.score-row { display: flex; align-items: center; gap: 12px; }
.score-side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.score-side label { font-weight: 600; font-size: 14px; white-space: nowrap; }
.score-side input { max-width: 88px; }
.score-dash { color: var(--muted); flex: none; }

/* footer bar */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding: 12px 20px;
}
.bar .inner {
  max-width: 680px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.bar .status { font-size: 13px; color: var(--muted); }
button.submit {
  font: inherit; font-weight: 700; font-size: 15px; padding: 12px 26px;
  background: var(--scarlet); color: #fff; border: 0; border-radius: 10px; cursor: pointer;
}
button.submit:hover { background: var(--scarlet-dark); }
button.submit:disabled { opacity: .5; cursor: not-allowed; }

.err {
  background: color-mix(in srgb, var(--scarlet) 12%, transparent);
  border: 1px solid var(--scarlet); color: var(--scarlet-dark);
  padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14.5px;
}
@media (prefers-color-scheme: dark) { .err { color: #ff9ba1; } }
.q.missing { background: color-mix(in srgb, var(--scarlet) 5%, transparent); border-radius: 8px; }

/* done screen */
.done { text-align: center; padding: 40px 0; }
.done .big { font-size: 52px; margin-bottom: 8px; }
.done h2 { margin: 0 0 8px; font-size: 26px; }
.done p { color: var(--muted); max-width: 42ch; margin: 0 auto 18px; }
.recap { text-align: left; margin-top: 26px; }
.recap h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 12px; }
.recap dl { margin: 0; }
.recap dt { font-size: 13px; color: var(--muted); margin-top: 12px; }
.recap dd { margin: 2px 0 0; font-weight: 600; }
button.link {
  background: none; border: 0; color: var(--scarlet); font: inherit;
  text-decoration: underline; cursor: pointer; padding: 0;
}

/* landing page cards */
.card-link { text-decoration: none; color: inherit; display: block; }
.card-link .block { transition: border-color .12s, transform .12s; }
.card-link:hover .block { border-color: var(--scarlet); transform: translateY(-1px); }
.card-link .cta { margin: 0; font-weight: 700; color: var(--scarlet); }

/* optional comment box under a question */
.comment { margin-top: 12px; }
.comment label { display: block; margin-bottom: 5px; }
.comment textarea { min-height: 54px; }
.recap dd.note { font-weight: 400; color: var(--muted); font-style: italic; margin-top: 3px; }

/* ------------------------------------------------------------------ results */
.count { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.rblock {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; margin-bottom: 14px;
}
.rblock h3 { font-size: 16px; margin: 0 0 4px; }
.rblock h4 { font-size: 13px; color: var(--muted); margin: 18px 0 6px; font-weight: 600; }
.stat { color: var(--muted); font-size: 12.5px; margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 13px; }

/* horizontal bars */
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(0,1fr) 2.2fr auto; gap: 10px; align-items: center; }
.bar-label {
  font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bar-track { background: var(--line); border-radius: 5px; height: 16px; overflow: hidden; }
.bar-fill { background: var(--scarlet); height: 100%; border-radius: 5px; min-width: 2px; }
.bar-value { font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-pct { color: var(--muted); }

/* per-game W/L split */
.gamebars { display: flex; flex-direction: column; gap: 6px; }
.gamebar { display: grid; grid-template-columns: 165px 1fr auto; gap: 10px; align-items: center; }
.gb-team { display: flex; align-items: center; gap: 7px; min-width: 0; }
.gb-logo { width: 20px; height: 20px; object-fit: contain; flex: none; }
.gb-vs { color: var(--muted); font-size: 12px; flex: none; }
.gb-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-track { display: flex; height: 20px; border-radius: 5px; overflow: hidden; background: var(--line); }
.gb-w, .gb-l {
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700; color: #fff; overflow: hidden; white-space: nowrap;
}
.gb-w { background: var(--ok); }
.gb-l { background: var(--scarlet); }
.gb-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* win-total histogram */
.chartwrap { overflow-x: auto; }
.chart { width: 100%; min-width: 380px; height: auto; display: block; }
.wt-bar { fill: var(--scarlet); }
.wt-axis { fill: var(--muted); font-size: 11px; }
.wt-count { fill: var(--fg); font-size: 11px; font-weight: 700; }

.quotes { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.quotes li { font-size: 13.5px; }

@media (max-width: 560px) {
  .gamebar { grid-template-columns: 120px 1fr auto; }
  .bar-row { grid-template-columns: minmax(0,1fr) 1.4fr auto; }
}
.seeresults { margin: 14px 0 0; }
.seeresults a { color: var(--scarlet); font-weight: 600; text-decoration: none; }
.seeresults a:hover { text-decoration: underline; }

/* ------------------------------------------------- hot takes carousel */
.carousel {
  position: relative;
  display: grid; grid-template-columns: 34px 1fr 34px; align-items: center;
  gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 12px 14px; margin-bottom: 18px;
}
.carousel .stage { position: relative; min-height: 118px; }
.carousel .slide {
  position: absolute; inset: 0; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 4px;
  opacity: 0; visibility: hidden;
  transition: opacity .6s ease;
}
.carousel .slide.on { opacity: 1; visibility: visible; }
.carousel blockquote {
  margin: 0; font-size: 19px; line-height: 1.4; font-weight: 600;
  text-wrap: balance;
}
.carousel blockquote::before { content: "\201C"; }
.carousel blockquote::after  { content: "\201D"; }
.carousel figcaption {
  margin-top: 10px; color: var(--muted); font-size: 11.5px;
  letter-spacing: .05em; text-transform: uppercase;
}
.carousel .cbtn {
  font: inherit; font-size: 22px; line-height: 1;
  background: transparent; border: 0; color: var(--muted);
  cursor: pointer; padding: 8px 4px; border-radius: 8px;
}
.carousel .cbtn:hover { color: var(--fg); }
.carousel .cbtn:focus-visible { outline: 2px solid var(--scarlet); outline-offset: 2px; }
.carousel .dots {
  grid-column: 1 / -1; display: flex; justify-content: center; flex-wrap: wrap;
  gap: 6px; padding-top: 14px;
}
.carousel .dot {
  width: 6px; height: 6px; padding: 0; border: 0; border-radius: 50%;
  background: var(--line); cursor: pointer;
}
.carousel .dot.on { background: var(--scarlet); }
.carousel .dot:focus-visible { outline: 2px solid var(--scarlet); outline-offset: 3px; }

/* No motion: cross-fade instantly rather than sliding under the reader. */
@media (prefers-reduced-motion: reduce) {
  .carousel .slide { transition: none; }
}
@media (max-width: 560px) {
  .carousel blockquote { font-size: 17px; }
  .carousel .stage { min-height: 140px; }
}

/* ------------------------------------------------------------------ mobile
   Most of these get filled out on a phone. Below 560px the priorities are
   thumb-sized controls and never splitting a label from its input. */
@media (max-width: 560px) {
  /* Score: two labelled rows rather than a wrapped line with an orphan box. */
  .score-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .score-side { justify-content: space-between; }
  .score-side input { max-width: 110px; }
  .score-dash { display: none; }

  /* 44px is the smallest comfortable touch target; these were 38x35.
     46 rather than 52 — the 12px back buys "Michigan State" room to render. */
  .wl button { width: 46px; padding: 12px 0; font-size: 14px; }

  /* One line can't hold date + logo + "Michigan State" + two thumb-sized
     buttons in 375px — the name was truncating to "Mi…". Stack the date above
     the matchup and let the W/L pair span both rows. */
  .game {
    padding: 10px; gap: 8px; row-gap: 2px;
    grid-template-columns: 1fr auto;
    grid-template-areas: "date wl" "matchup wl";
  }
  .game .date    { grid-area: date; }
  .game .matchup { grid-area: matchup; }
  .game .wl      { grid-area: wl; align-self: center; }
  .game .opp { font-size: 14.5px; }
  .game .matchup { gap: 6px; }
  .game .mark-slot { width: 22px; height: 22px; }

  .carousel { grid-template-columns: 28px 1fr 28px; padding: 18px 6px 12px; }
}

/* opt-out, sitting just above the submit bar */
.privacy { padding: 16px 20px; }
.privacy-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.privacy-row input { margin: 2px 0 0; accent-color: var(--scarlet); flex: none; width: 18px; height: 18px; }
.privacy-row strong { display: block; font-size: 14.5px; }
.privacy-row small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.5; margin-top: 3px; }
