/* The Five That Score — The Pick'em Challenge. Standalone styles (the scoreboard's
   styles.css stays untouched); palette and header match the scoreboard. */
:root {
  --bg: #f5f4fa; --card: #fff; --ink: #17142b; --muted: #6b6880; --line: #e6e3f0;
  --brand: #14112b; --accent: #ffcf4a; --live: #e5243b; --final: #2a2740; --up: #3a6df0;
  --radius: 14px; --shadow: 0 1px 2px rgba(20,17,43,.06), 0 4px 16px rgba(20,17,43,.06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e0c1c; --card: #1a1730; --ink: #f1effa; --muted: #a29fb8; --line: #2c2847; --final: #cfcbe6; --shadow: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--up); }
.wrap { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 14px; }
main.wrap { flex: 1; padding-top: 10px; padding-bottom: 30px; }
.muted { color: var(--muted); }

.site-header { background: var(--brand); color: #fff; padding: 14px 0 12px; padding-top: max(14px, env(safe-area-inset-top)); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.header-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 220px; }
.site-header h1 { margin: 0; font-size: 1.12rem; line-height: 1.25; font-weight: 700; letter-spacing: .01em; min-width: 0; }
.site-header .brand { color: var(--accent); }
.site-header .dash { opacity: .6; }
.title-home { color: inherit; text-decoration: none; }
.home-btn, .pickem-nav {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 75%, #fff);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  text-decoration: none;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .03em;
  line-height: 1;
  white-space: nowrap;
}
.pickem-nav { background: var(--accent); color: #14112b; border-color: var(--accent); }
.header-meta { display: flex; align-items: center; justify-content: flex-end; gap: 8px 10px; flex-wrap: wrap; margin-left: auto; }
.handle { color: #cfcaf5; text-decoration: none; font-size: .82rem; font-weight: 600; white-space: nowrap; }

.weekbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.weekbar .wrap { display: flex; align-items: center; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
.nav-btn, .today-btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; height: 40px; min-width: 40px; font-size: 1.3rem; cursor: pointer; }
.today-btn { font-size: .85rem; font-weight: 600; padding: 0 12px; }
.week-label { flex: 1; text-align: center; }
.week-label strong { display: block; font-size: .98rem; }
.week-label span { display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }

.tabs { display: flex; gap: 6px; margin: 8px 0 12px; }
.tab { flex: 1; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 8px 6px; font-weight: 700; font-size: .85rem; cursor: pointer; text-align: center; text-decoration: none; }
.tab.on { background: var(--brand); color: #fff; border-color: var(--brand); }
@media (prefers-color-scheme: dark) { .tab.on { background: var(--accent); color: #14112b; border-color: var(--accent); } }

.lock-banner {
  display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; box-shadow: var(--shadow);
}
.lock-kicker { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lock-copy { font-weight: 700; line-height: 1.35; }
.lock-copy span { display: block; font-weight: 500; font-size: .82rem; color: var(--muted); }
.user-chip { justify-self: end; background: color-mix(in srgb, var(--accent) 22%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line)); color: var(--ink); font-size: .75rem; font-weight: 800; padding: 5px 10px; border-radius: 999px; }

.layout { display: grid; gap: 14px; }
@media (min-width: 760px) { .layout { grid-template-columns: 1.4fr .9fr; align-items: start; } }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.meet { padding: 12px 14px 14px; }
.meet + .meet { border-top: 1px solid var(--line); }
.conf-group + .conf-group { border-top: 1px solid var(--line); }
.conf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; padding: 9px 14px 0; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.conf-head .conf-name { color: var(--ink); }
.conf-group.wildcard .conf-name { color: var(--up); }
.conf-head .conf-pts { font-weight: 600; letter-spacing: .02em; text-transform: none; font-variant-numeric: tabular-nums; }
.conf-group .meet { padding-top: 6px; }
.meta { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); flex-wrap: wrap; }
.mtitle { font-size: 1rem; margin: 6px 0 10px; line-height: 1.3; font-weight: 700; }
.mtitle a { color: inherit; text-decoration: none; }
.mtitle a:hover { color: var(--up); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 800; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; }
.badge.upcoming { background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up); }
.badge.tv { background: var(--line); color: var(--ink); letter-spacing: .04em; }

.teams { display: grid; gap: 8px; }
@media (min-width: 520px) { .teams.dual { grid-template-columns: 1fr 1fr; } }
.team-btn {
  display: grid; grid-template-columns: 6px 1fr auto; align-items: center; gap: 10px;
  width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card);
  color: inherit; font: inherit; border-radius: 12px; padding: 10px 12px; cursor: pointer;
}
.team-btn .swatch { width: 6px; height: 28px; border-radius: 3px; }
.team-btn .tname { font-weight: 700; display: flex; flex-direction: column; gap: 1px; }
.team-btn .tname small { font-weight: 600; color: var(--muted); font-size: .75rem; }
.team-btn .rank { font-size: .75rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.team-btn.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--card)); box-shadow: 0 0 0 1px var(--accent); }
.team-btn.on .rank { color: var(--ink); }

.score-guess { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.score-guess label { font-size: .78rem; color: var(--muted); font-weight: 700; }
.score-guess input {
  width: 110px; height: 36px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 10px; padding: 0 10px; font: inherit; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right;
}
.score-guess input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.bonus-hint { font-size: .75rem; color: var(--muted); }

.tens-card, .side-card { background: var(--card); border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line)); border-radius: 16px; box-shadow: var(--shadow); padding: 14px; }
.tens-card h2, .side-card h2 { margin: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; }
.tens-lead { margin: 6px 0 12px; font-weight: 700; font-size: 1.02rem; }
.tens-row { display: flex; align-items: center; gap: 10px; }
.step {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font-size: 1.3rem; font-weight: 700; cursor: pointer;
}
.ten-value { font-size: 2.4rem; font-weight: 900; color: var(--brand); letter-spacing: -.05em; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: center; }
@media (prefers-color-scheme: dark) { .ten-value { color: var(--accent); } }
.ten-scale { margin: 10px 0 0; font-size: .78rem; color: var(--muted); line-height: 1.45; }
.tiebreak { margin-top: 12px; }
.tiebreak label { display: block; font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.tiebreak input {
  width: 100%; height: 44px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 10px; padding: 0 12px; font: inherit;
}

.submit {
  display: block; width: 100%; min-height: 48px; margin-top: 12px; border: 0; border-radius: 12px;
  background: var(--accent); color: #14112b; font-weight: 800; font-size: 1rem; letter-spacing: .03em; cursor: pointer;
}
.submit:hover { filter: brightness(1.05); }
.save-note { margin: 8px 0 0; text-align: center; font-size: .8rem; color: var(--muted); }

.lb { list-style: none; margin: 10px 0 0; padding: 0; }
.lb li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.lb li:first-child { border-top: 0; }
.lb .pos { color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.lb .who { font-weight: 700; }
.lb .who small { display: block; font-weight: 600; color: var(--muted); font-size: .72rem; }
.lb .pts { font-weight: 800; font-variant-numeric: tabular-nums; }
.lb li.me { background: color-mix(in srgb, var(--accent) 16%, transparent); margin: 0 -8px; padding: 8px; border-radius: 10px; border-top-color: transparent; }
.rules { margin: 10px 0 0; padding: 0; font-size: .82rem; color: var(--muted); line-height: 1.5; }
.rules li { margin: 0 0 6px; }
.side-card .more { display: inline-block; margin-top: 8px; font-size: .85rem; font-weight: 700; }

.site-footer { border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); padding: 14px 0 max(18px, env(safe-area-inset-bottom)); }
.site-footer p { margin: 4px 0; line-height: 1.5; }
.site-footer a { color: inherit; font-weight: 600; }

@media (max-width: 430px) {
  .site-header { padding: 10px 0; padding-top: max(10px, env(safe-area-inset-top)); }
  .site-header h1 { font-size: 1rem; }
  .handle { font-size: .75rem; }
}

/* ---- Phase 1 additions ---- */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.user-chip { cursor: pointer; font: inherit; font-size: .75rem; font-weight: 800; }
.user-chip.signed-out { background: var(--accent); border-color: var(--accent); color: #14112b; }
.lock-banner.locked { border-left-color: var(--live); }
.lock-banner.upcoming { border-left-color: var(--accent); }
.lock-banner.final { border-left-color: var(--final); }
.badge.final { background: color-mix(in srgb, var(--final) 14%, transparent); color: var(--final); }
.badge.void { background: color-mix(in srgb, var(--live) 14%, transparent); color: var(--live); }
.badge.locked { background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); }
.team-btn[disabled] { cursor: default; }
.team-btn.won { border-color: #1f9d55; }
.team-btn .result { font-size: .75rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.team-btn.won .result { color: #1f9d55; }
.pick-verdict { font-size: .78rem; font-weight: 800; margin-left: auto; }
.pick-verdict.hit { color: #1f9d55; }
.pick-verdict.miss { color: var(--live); }
.score-guess input[disabled] { opacity: .75; }
.step[disabled], .submit[disabled] { opacity: .55; cursor: default; }
.tiebreak input[disabled] { opacity: .75; }
.msg { margin: 8px 0 0; font-size: .85rem; font-weight: 700; text-align: center; }
.msg.err { color: var(--live); }
.msg.ok { color: #1f9d55; }
.empty-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 18px; text-align: center; }
.empty-card h2 { margin: 0 0 6px; font-size: 1.1rem; }
.empty-card p { margin: 4px 0; color: var(--muted); }
.signin-card { margin: 0 0 12px; }
.signin-card form { display: grid; gap: 8px; margin-top: 10px; }
.signin-card label { font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.signin-card input { width: 100%; height: 44px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 10px; padding: 0 12px; font: inherit; }
.signin-card .fine { margin: 6px 0 0; font-size: .78rem; color: var(--muted); line-height: 1.45; }
.signin-card .linkish { background: none; border: 0; color: var(--up); font: inherit; font-weight: 700; padding: 0; cursor: pointer; }
.signin-card .nl-optin {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 2px 0 0; padding: 10px 0;
  min-height: 44px;
  font-size: .9rem; font-weight: 650; letter-spacing: 0;
  text-transform: none; color: var(--ink); line-height: 1.35;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.signin-card .nl-optin input[type="checkbox"] {
  appearance: checkbox; -webkit-appearance: checkbox;
  width: 22px; height: 22px; min-width: 22px; min-height: 22px;
  margin: 1px 0 0; padding: 0;
  border-radius: 4px; flex: none;
  accent-color: var(--brand);
  cursor: pointer;
}
.signin-card .nl-optin span { flex: 1; padding-top: 1px; }
@media (prefers-color-scheme: dark) {
  .signin-card .nl-optin input[type="checkbox"] { accent-color: var(--accent); }
}
.lb-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.lb-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 8px; }
.lb-table td { padding: 8px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.lb-table td.num, .lb-table th.num { text-align: right; }
.lb-table tr.me td { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.panel { padding: 14px; }
.panel h2 { margin: 0 0 4px; font-size: 1rem; }
.panel .sub { margin: 0 0 10px; color: var(--muted); font-size: .85rem; }
.rules-full { padding-left: 18px; line-height: 1.6; color: var(--ink); font-size: .92rem; }
.rules-full li { margin-bottom: 6px; }
.mtitle .mevent { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-top: 2px; }

.save-card { background: var(--card); border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line)); border-radius: 16px; box-shadow: var(--shadow); padding: 14px; }
.save-card .submit { margin-top: 0; }
.signin-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--brand); color: #fff;
  border-top: 3px solid var(--accent);
  box-shadow: 0 -8px 24px rgba(20,17,43,.22);
}
.signin-banner[hidden] { display: none !important; }
.signin-banner p { margin: 0; font-weight: 800; font-size: .95rem; line-height: 1.3; }
.signin-banner button {
  flex: 0 0 auto; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--accent); color: #14112b; font: inherit; font-weight: 800; cursor: pointer;
}
body.has-signin-banner { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
