/* Homepage (js/pages/home.js). Information-first: a quiet editorial hero with search, tonight's best games
   (where to watch, our model's chances), the college basketball flagship, every league, highlights, the pulse
   and the track record. Tokens in styles.css. */

/* ---------- hero ---------- */
.hp-hero {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 40px; align-items: center;
  padding: 44px 0 40px;
}
.hp-hero h1 { font-size: clamp(36px, 5.2vw, 62px); line-height: 1; letter-spacing: -0.04em; }
.hp-hero h1 span { display: block; color: var(--accent); }
.hp-hero .sub { font-size: 17.5px; max-width: 52ch; margin-top: 18px; }
.hp-search {
  display: flex; align-items: center; gap: 10px; width: min(100%, 480px); min-height: 50px; margin-top: 26px; padding: 0 12px 0 16px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--muted);
  font: inherit; font-size: 15px; text-align: left; cursor: text; box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.hp-search > span:not(.hp-search-ic) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-search:hover { border-color: var(--accent); }
.hp-search:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.hp-search kbd { margin-left: auto; font: 600 12px/1 var(--font-mono); padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); background: var(--surface-2); }
.hp-search-ic { width: 15px; height: 15px; flex: none; border: 2px solid currentColor; border-radius: 50%; position: relative; margin-right: 2px; }
.hp-search-ic::after { content: ""; position: absolute; width: 6px; height: 2px; background: currentColor; right: -5px; bottom: -3px; transform: rotate(45deg); border-radius: 2px; }

/* today panel */
.hh-today { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; box-shadow: var(--shadow); }
.hh-label { display: flex; align-items: center; gap: 8px; font: 700 11px/1.2 var(--font-text); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hh-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.hh-big { display: flex; align-items: center; gap: 12px; margin: 12px 0 14px; }
.hh-big b { font: 800 64px/.9 var(--font-display); letter-spacing: -0.05em; color: var(--text); font-variant-numeric: tabular-nums; }
.hh-big span { color: var(--text-2); font-size: 14px; line-height: 1.3; }
.hh-leagues { display: flex; flex-wrap: wrap; gap: 6px; }
.hh-leagues .chip { min-height: 32px; padding: 5px 12px; font-size: 12.5px; letter-spacing: .02em; }
.hp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0 0; padding: 16px 0 0; border-top: 1px solid var(--grid); }
.hp-stats div { min-width: 0; }
.hp-stats dt { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.hp-stats dd { margin: 0 0 2px; font: 750 20px/1.1 var(--font-display); letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.hp-stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.hh-today .lc-more { display: inline-block; margin-top: 16px; padding-top: 0; }
@media (max-width: 900px) {
  .hp-hero { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 32px 0 28px; }
}
@media (max-width: 640px) {
  .hp-hero { padding: 22px 0 20px; }
  .hp-hero .sub { font-size: 16px; }
  .hp-search { font-size: 14.5px; margin-top: 20px; }
  .hp-search kbd { display: none; }
  .hh-today { display: none; } /* "Tonight" right below carries the same information */
  .hp-hero h1 { font-size: 34px; }
  .hp-hero .eyebrow { margin-bottom: 8px; }
}

/* ---------- college basketball flagship ---------- */
.hp-flag { margin: 8px 0 8px; padding-top: 28px; border-top: 1px solid var(--border); }
.hp-flag-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 28px; margin-bottom: 18px; }
.hp-flag-head h2 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -0.03em; margin: 2px 0 8px; }
.hp-flag-sub { margin: 0; max-width: 62ch; color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
/* section links: a compact tab strip */
.hp-links { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--radius-sm); background: var(--surface-3); border: 1px solid var(--border); }
.hp-links a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 7px; color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.hp-links a:hover { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.hp-flag-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.hp-side { display: grid; gap: 20px; }
.hp-side .card, .hp-top25 { margin-bottom: 0; }
.hp-top25 { padding-bottom: 18px; }
.hp-top25 .card-head { margin-bottom: 6px; }
.hp-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0 0 10px; font-size: 12px; }
.hp-key { display: inline-flex; align-items: center; gap: 6px; }
.hp-key i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; border: 1px solid var(--border); }
.hp-top25 .table-wrap { margin: 0 -22px; max-width: none; }
.hp-table { font-size: 14px; font-variant-numeric: tabular-nums; }
.hp-table th { position: static; background: none; }
.hp-table th:first-child, .hp-table td:first-child { padding-left: 22px; }
.hp-table th:last-child, .hp-table td:last-child { padding-right: 22px; }
.hp-table td { padding-top: 6px; padding-bottom: 6px; height: 42px; }
.hp-table .rank { width: 2.6em; color: var(--muted); font-weight: 600; }
.hp-table .hp-team { white-space: nowrap; }
.hp-table .team-cell { display: inline-flex; vertical-align: middle; gap: 9px; min-width: 0; }
.hp-table .hp-conf { margin-left: 7px; vertical-align: middle; }
.hp-table .team-cell .logo { width: 22px; height: 22px; }
.hp-table .team-cell span { font-weight: 600; }
.hp-table a.team-cell, .hp-side .mini-list a { text-decoration: none; color: inherit; }
.hp-table a.team-cell:hover span { color: var(--accent); }
.hp-conf { color: var(--muted); font-size: 12px; white-space: nowrap; }
.hp-wl { color: var(--text-2); }
.hp-em { min-width: 64px; font: 700 15px/1.4 var(--font-display); letter-spacing: -0.01em; color: var(--text); }
.hp-table td.t-heat-1, .hp-table td.t-heat-2, .hp-table td.t-heat-3, .hp-table td.t-heat-4, .hp-table td.t-heat-5,
.hp-table td.t-cold-1, .hp-table td.t-cold-2, .hp-table td.t-cold-3, .hp-table td.t-cold-4, .hp-table td.t-cold-5 { background-clip: padding-box; }
.hp-tempo { color: var(--text-2); }
.hp-table .t-rank { display: block; font-size: 10.5px; line-height: 1.1; color: var(--muted); font-weight: 500; }
.hp-explain { margin: 0 0 8px; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.hp-table th .hp-sub { display: block; font-size: 10px; font-weight: 500; letter-spacing: .02em; text-transform: none; color: var(--muted); }
.hp-all25 { display: none; }
.hp-n { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
@media (max-width: 960px) { .hp-flag-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .hp-flag { padding-top: 22px; }
  .hp-links { width: 100%; }
  .hp-links a { flex: 1 1 auto; justify-content: center; min-height: 36px; }
  .hp-conf { display: none; }
  .hp-top25 .table-wrap { margin: 0 -16px; }
  .hp-table th:first-child, .hp-table td:first-child { padding-left: 14px; }
  .hp-table th:last-child, .hp-table td:last-child { padding-right: 14px; }
  .hp-table td { height: 44px; }
  /* phones: the top 10, with a button for the rest */
  .hp-top25:not(.all) .hp-table tr.hp-x { display: none; }
  .hp-all25 { display: block; width: 100%; margin-top: 12px; }
}

/* ---------- game of the day ---------- */
.featured { padding: 26px 28px; position: relative; overflow: hidden; }
.featured::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent); }
.fx-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.fx-top .lg-tag { margin: 0; }
.fx-badge { font: 700 11px/1 var(--font-text); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 6px 9px; }
.fx-body { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; margin-bottom: 18px; }
.fx-team { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; color: var(--text); text-decoration: none; min-width: 0; padding: 10px 8px; border-radius: var(--radius); transition: background .15s; }
.fx-team:hover { background: var(--surface-2); color: var(--text); }
.fx-team:hover .fx-name { text-decoration: underline; }
.fx-logo-wrap { display: grid; place-items: center; width: 88px; height: 88px; border-radius: 50%; background: var(--surface-2); margin-bottom: 6px; border: 1px solid var(--border); }
/* dark theme: team logos are drawn for light backgrounds, so they sit on a light badge */
.fx-logo-wrap:has(img) { background: var(--logo-plate); }
.fx-logo { width: 58px; height: 58px; object-fit: contain; }
span.fx-logo { border-radius: 50%; background: var(--surface-3); }
.fx-name { font: 700 19px/1.2 var(--font-display); letter-spacing: -0.01em; }
.fx-pct { font: 800 46px/1 var(--font-display); letter-spacing: -0.04em; margin-top: 8px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fx-team.fav .fx-pct { color: var(--series-1); }
.fx-at { color: var(--muted); font: 700 14px var(--font-display); width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); }
.featured .probbar { height: 10px; }
.fx-why { margin: 14px 0 0; color: var(--text-2); font-size: 14px; }
.fx-tv { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); margin-left: auto; }
.fx-tv b { color: var(--text); }
@media (max-width: 560px) {
  .featured { padding: 18px 16px; }
  .fx-logo-wrap { width: 62px; height: 62px; }
  .fx-logo { width: 40px; height: 40px; }
  .fx-pct { font-size: 32px; }
  .fx-name { font-size: 15px; }
  .fx-body { gap: 6px; }
  .fx-at { width: 30px; height: 30px; font-size: 12px; }
  .fx-team .hint { font-size: 12px; }
  .fx-tv { margin-left: 0; width: 100%; }
}

.fx-model { margin: 0 0 6px; text-align: center; font-size: 12px; }
.fx-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 14px; }
.fx-foot .fx-why { margin: 0; flex: 1 1 320px; }
.fx-cta { flex: none; text-decoration: none; }
@media (max-width: 560px) { .fx-cta { width: 100%; justify-content: center; text-align: center; } }

/* ---------- tonight: the next best games, in tip-off order ---------- */
.hp-tonight .section-title { margin-top: 8px; }
.hp-tonight .featured { margin-bottom: 16px; }
.hpn-card .card-head { margin-bottom: 4px; }
.hpn-list { list-style: none; margin: 0; padding: 0; }
.hpn-list li + li { border-top: 1px solid var(--grid); }
.hpn-row {
  display: grid; grid-template-columns: 78px minmax(0, 1fr) minmax(0, 190px) 96px; align-items: center; gap: 6px 14px;
  min-height: 52px; padding: 8px 6px; margin: 0 -6px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none;
}
.hpn-row:hover { background: var(--surface-2); color: var(--text); }
.hpn-row:hover .hpn-teams b { text-decoration: underline; text-underline-offset: 3px; }
.hpn-time { font: 700 14px/1.2 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hpn-time small { font: 600 10.5px var(--font-text); color: var(--muted); }
.hpn-match { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hpn-match .lg-tag { margin: 0; flex: none; }
.hpn-teams { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; font-size: 14px; }
.hpn-teams b { font-weight: 650; white-space: nowrap; }
.hpn-teams .logo { width: 20px; height: 20px; }
.hpn-v { color: var(--muted); font-size: 12.5px; }
.hpn-tv { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hpn-tv b { color: var(--text); }
.hpn-p { display: grid; justify-items: end; line-height: 1.15; }
.hpn-p small { font-size: 10.5px; color: var(--muted); }
.hpn-p b { font: 700 14px var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hp-tonight .section-title .hint { display: block; margin-top: 4px; }
@media (max-width: 640px) {
  /* three short lines: time and our model's favorite, the matchup, where to watch */
  .hpn-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "time p" "match match" "tv tv"; gap: 4px 10px; padding: 11px 4px; margin: 0 -4px; }
  .hpn-time { grid-area: time; font-size: 13.5px; }
  .hpn-match { grid-area: match; }
  .hpn-tv { grid-area: tv; }
  .hpn-p { grid-area: p; grid-auto-flow: column; align-items: baseline; gap: 6px; }
  .hpn-teams { flex-wrap: nowrap; overflow: hidden; font-size: 14px; }
  .hpn-teams b { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .hp-legend.hide-sm { display: none; }
}

/* ---------- every league ---------- */
.hp-leagues { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.hp-leagues > .card { margin-bottom: 0; }
@media (max-width: 1100px) { .hp-leagues { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .hp-leagues { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
.league-card { display: flex; flex-direction: column; }
.league-card .card-head { margin-bottom: 10px; }
.league-card h2 a, .card-head h2 a { color: var(--text); text-decoration: none; }
.league-card h2 a:hover, .card-head h2 a:hover { color: var(--accent); }
.lc-cols { display: flex; justify-content: space-between; font: 650 10.5px/1.3 var(--font-text); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.league-card .mini-list b { font-family: var(--font-display); font-size: 16px; }
.lc-foot { margin-top: 12px; line-height: 1.45; }
.lc-more { display: inline-block; margin-top: auto; padding-top: 14px; font-weight: 650; font-size: 13.5px; text-decoration: none; }
.lc-more:hover { text-decoration: underline; }
.card-links { display: flex; gap: 18px; flex-wrap: wrap; font-weight: 650; font-size: 14px; margin: 14px 0 0; }
.card-links a { text-decoration: none; }
.card-links a:hover { text-decoration: underline; }

/* next UFC card: fights in two columns on wide screens */
.hp-ufc .card-head h2 { font-size: 20px; }
.hp-ufc .eyebrow { margin-bottom: 6px; }
.hp-ufc .games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-height: none; overflow: visible; margin: 0; padding: 0; }
@media (max-width: 760px) { .hp-ufc .games { grid-template-columns: minmax(0, 1fr); } }

/* ---------- lists (pulse, side cards) ---------- */
.ic { display: inline-block; width: 26px; height: 26px; border-radius: 8px; flex: none; margin-right: 4px; background-repeat: no-repeat; background-position: center; background-size: 16px; }
.ic-watch { background-color: var(--brand-2-soft); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 2.5 20h19L12 3Z' fill='none' stroke='%23c98a10' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M12 10v4.5M12 17.2v.3' stroke='%23c98a10' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.ic-up { background-color: var(--good-soft); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m4 16 6-6 4 4 6-7M15 7h5v5' fill='none' stroke='%2322a35a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ic-down { background-color: var(--critical-soft); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m4 8 6 6 4-4 6 7M15 17h5v-5' fill='none' stroke='%23d64545' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.pulse .card-head { margin-bottom: 8px; }

.mini-list { list-style: none; margin: 0; padding: 0; display: grid; }
.mini-list li { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 7px 0; border-bottom: 1px solid var(--grid); min-width: 0; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; flex: 1; font-weight: 600; font-size: 14px; }
.mini-list a:hover { color: var(--text); }
.mini-list a:hover .ml-name { text-decoration: underline; text-underline-offset: 3px; }
.mini-list .logo { width: 22px; height: 22px; }
.mini-list .ml-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.mini-list .ml-name .hint { font-weight: 400; }
.mini-list .lg-tag { margin: 0; flex: none; }
.mini-list b { flex: none; min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- this week's best games ---------- */
.hl-cards { display: grid; gap: 14px; align-content: start; }
.hl-feature { padding-bottom: 14px; border-bottom: 1px solid var(--grid); }
.hl-feature:last-child { border-bottom: 0; padding-bottom: 0; }
.hl-feature .eyebrow { margin: 0 0 8px; }
.hl-score { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--font-display); font-size: 18px; letter-spacing: -0.01em; }
.hl-score:hover { color: var(--text); }
.hl-score:hover b { text-decoration: underline; }
.hl-feature .hint { margin: 4px 0 0; }

/* ---------- track record + newsletter ---------- */
.hp-proof .card { display: flex; flex-direction: column; }
.hp-proof .card-links { margin-top: auto; padding-top: 14px; }
.cta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; background: var(--surface); position: relative; overflow: hidden; }
.cta::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 150px; height: 150px; border-radius: 50%; border: 22px solid var(--brand-2); opacity: .16; pointer-events: none; }
.cta .eyebrow { margin-bottom: 4px; }
.cta h2 { font-size: 26px; letter-spacing: -0.02em; }
.cta p { margin: 0 0 14px; color: var(--text-2); max-width: 46ch; }
.hp-proof .cta { justify-content: center; padding: 28px; }
.cta .btn-primary { margin-top: 4px; }

/* ---------- how it works: always an ink panel, in both themes ---------- */
.how { margin: 56px 0 8px; padding: 40px; border-radius: 24px; background: var(--ink-panel); color: var(--ink-panel-text); position: relative; overflow: hidden; }
.how::before { content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid var(--brand-2); opacity: .12; }
.how .eyebrow { color: var(--brand-2); }
.how-head h2 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -0.03em; max-width: 22ch; color: var(--ink-panel-text); }
.how-steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; position: relative; }
.how-step { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius-lg); padding: 22px; display: flex; flex-direction: column; }
.how-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-2); color: #1d1606; font: 800 15px var(--font-display); margin-bottom: 14px; }
.how-step h3 { font-size: 19px; color: var(--ink-panel-text); margin-bottom: 8px; }
.how-step p { color: color-mix(in oklab, var(--ink-panel-text) 80%, var(--ink-panel)); font-size: 14.5px; line-height: 1.6; margin: 0 0 14px; }
.how-step b { color: var(--ink-panel-text); }
.how-step a { margin-top: auto; color: var(--brand-2); font-weight: 650; font-size: 14px; text-decoration: none; }
.how-step a:hover { color: var(--brand-2); text-decoration: underline; }
.how a:focus-visible { outline-color: var(--brand-2); }
@media (max-width: 860px) { .how-steps { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .how { margin-top: 40px; padding: 26px 18px; border-radius: var(--radius-lg); } }
.hpn-p .hpn-mk { display: block; margin-top: 2px; }
