/* Layout: seal header → coverage + legend → scrollable game-day pill strip → selected game (big date + slot cards) beside a photo column */
:root {
  --bg: #f3f2f1;
  --card: #ffffff;
  --ink: #17171a;
  --muted: #6a6670;
  --line: #e2dfdd;
  --chip: #ebe8e6;
  --red: #b3121f;
  --red-ink: #ffffff;
  --red-soft: #f8e3e4;
  --selected: #17171a;
  --selected-ink: #ffffff;
  --r-chains: #b3121f;
  --r-app: #c98612;
  --r-entree: #2c6688;
  --r-snack: #5f8a2c;
  --ok-bg: #e4efe0;
  --ok-ink: #2f5d22;
  --shadow: 0 1px 2px rgba(23,23,26,.06), 0 8px 24px rgba(23,23,26,.06);
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Barlow", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 20px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121214; --card: #1c1c20; --ink: #f1eff0; --muted: #a29ea6; --line: #2e2d33; --chip: #26252b;
  --red: #e0323f; --red-ink: #ffffff; --red-soft: #3a1a1d; --selected: #f1eff0; --selected-ink: #121214;
  --r-chains: #ef4a56; --r-app: #e5a63a; --r-entree: #5aa2cc; --r-snack: #8dbb55;
  --ok-bg: #1f2e1b; --ok-ink: #a9d48f; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #121214; --card: #1c1c20; --ink: #f1eff0; --muted: #a29ea6; --line: #2e2d33; --chip: #26252b;
  --red: #e0323f; --red-ink: #ffffff; --red-soft: #3a1a1d; --selected: #f1eff0; --selected-ink: #121214;
  --r-chains: #ef4a56; --r-app: #e5a63a; --r-entree: #5aa2cc; --r-snack: #8dbb55;
  --ok-bg: #1f2e1b; --ok-ink: #a9d48f; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--body); }
.page { max-width: 1120px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 56px; }

.preview { background: var(--red-soft); color: var(--ink); font-size: 13px; text-align: center;
  padding-block: 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* header */
.head { display: flex; align-items: center; gap: 16px; padding-block: 24px 20px; flex-wrap: wrap; }
.seal { width: 64px; height: 64px; border-radius: 50%; flex: none; box-shadow: var(--shadow); }
.head-text { min-width: 0; flex: 1 1 260px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
h1 { font: 900 clamp(30px, 5vw, 44px)/1 var(--display); margin: 2px 0 0; text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; }

/* summary row */
.summary { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.tile { background: var(--card); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.tile-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cov-row { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.cov-big { font: 900 44px/1 var(--display); font-variant-numeric: tabular-nums; }
.cov-of { color: var(--muted); font-weight: 600; }
.ticks { display: flex; gap: 3px; margin-top: 12px; height: 26px; }
.ticks span { flex: 1; border-radius: 3px; background: var(--chip); }
.ticks span.on { background: var(--red); }
.cov-note { font-size: 13px; color: var(--muted); margin-top: 8px; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-top: 12px; }
.legend div { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.legend small { color: var(--muted); font-weight: 500; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--c); border: 2px solid var(--c); }
.dot.ring { background: transparent; }

/* game strip */
.strip-head { display: flex; justify-content: space-between; align-items: baseline; margin: 28px 0 10px; gap: 12px; }
.strip-head h2 { font: 700 22px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; margin: 0; }
.strip-head span { font-size: 13px; color: var(--muted); }
.strip-wrap { overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 4px 4px 10px; }
.strip-wrap::-webkit-scrollbar { display: none; }
.strip { display: flex; gap: 10px; width: max-content; }
.pill { appearance: none; border: 0; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--card); box-shadow: var(--shadow); border-radius: 999px;
  width: 104px; padding: 16px 8px 18px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: background .25s, color .25s, transform .25s; }
.pill:hover { transform: translateY(-2px); }
.pill:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.pill .dow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pill .num { font: 900 38px/1 var(--display); font-variant-numeric: tabular-nums; }
.pill .mon { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.pill .opp { font-size: 13px; font-weight: 600; margin-top: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill .dots { display: flex; gap: 4px; margin-top: 8px; }
.pill .dots .dot { width: 9px; height: 9px; }
.pill .ha { font-size: 10px; font-weight: 700; letter-spacing: .1em; padding: 2px 7px; border-radius: 999px; margin-top: 6px; background: var(--red-soft); color: var(--red); }
.pill .ha.away { background: var(--chip); color: var(--muted); }
.pill[aria-pressed="true"] { background: var(--selected); color: var(--selected-ink); }
.pill[aria-pressed="true"] .dow { color: inherit; opacity: .7; }
.pill[aria-pressed="true"] .ha { background: var(--red); color: var(--red-ink); }
.pill[aria-pressed="true"] .ha.away { background: rgba(127,127,127,.35); color: inherit; }

/* game detail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; margin-top: 18px; align-items: start; }
.game { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; min-width: 0; }
.game-top { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 2px solid var(--ink); }
.bigdate { font: 900 clamp(64px, 11vw, 112px)/.82 var(--display); font-variant-numeric: tabular-nums; }
.bigmon { font: 700 clamp(26px, 4vw, 38px)/1 var(--display); text-transform: lowercase; }
.matchup { margin-left: auto; text-align: right; min-width: 0; }
.matchup .vs { font: 700 26px/1.1 var(--display); text-transform: uppercase; }
.matchup .meta { color: var(--muted); font-size: 14px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--red); color: var(--red-ink); margin-left: 6px; vertical-align: middle; letter-spacing: .04em; }

.slots { display: grid; gap: 12px; margin-top: 18px; }
.slot { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 16px; align-items: start;
  background: var(--bg); border-radius: 16px; padding: 14px 16px 14px 14px; }
.slot .bar { align-self: stretch; border-radius: 3px; background: var(--c); }
.slot-title { font-weight: 700; font-size: 17px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.count { font-size: 13px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.blurb { font-size: 14px; color: var(--muted); }
.who { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.who li { background: var(--card); border-radius: 999px; padding: 4px 12px 4px 4px; font-size: 14px; display: flex; gap: 8px; align-items: center; max-width: 100%; }
.who .av { width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.who .what { color: var(--muted); overflow-wrap: anywhere; }
.slot-act { text-align: center; }
.btn { appearance: none; border: 0; cursor: pointer; font: 600 15px/1 var(--body); padding: 12px 18px; border-radius: 999px;
  background: var(--red); color: var(--red-ink); min-height: 44px; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.filled { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px; background: var(--ok-bg); color: var(--ok-ink); font-weight: 600; font-size: 14px; }
.left { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }

.about { margin-top: 20px; font-size: 15px; }
.about summary { cursor: pointer; font-weight: 700; color: var(--red); }
.about p { margin: 10px 0 0; max-width: 65ch; color: var(--ink); }

/* photo column */
.photos { display: grid; gap: 14px; }
.photo { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.photo img { display: block; width: 100%; max-width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo .ph { aspect-ratio: 4 / 3; max-width: 100%; display: grid; place-items: center; text-align: center; padding: 16px;
  color: var(--muted); font-size: 13px;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), var(--line) calc(10% - 1px) 10%),
    var(--chip); }
.photo .ph b { display: block; font: 900 28px/1 var(--display); color: var(--ink); opacity: .35; text-transform: uppercase; }
.photo .cap { padding: 10px 14px; font-size: 13px; white-space: nowrap; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }

.foot { color: var(--muted); font-size: 13px; margin-top: 32px; }

/* motion */
.anim > * { animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }
.anim > *:nth-child(2) { animation-delay: .05s; }
.anim > *:nth-child(3) { animation-delay: .1s; }
.anim > *:nth-child(4) { animation-delay: .15s; }
@keyframes rise { from { transform: translateY(14px); opacity: .001; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .anim > * { animation: none; } .pill { transition: none; } }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(560px, calc(100% - 32px)); background: var(--selected); color: var(--selected-ink); padding: 14px 16px; border-radius: 16px;
  font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; gap: 12px; align-items: center; z-index: 30; }
.toast[hidden] { display: none; }
.toast button { margin-left: auto; flex: none; background: var(--red); color: var(--red-ink); border: 0; border-radius: 999px; padding: 8px 14px; font: 600 14px var(--body); cursor: pointer; }

@media (max-width: 860px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .photos { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .summary { grid-template-columns: minmax(0, 1fr); }
  .game { padding: 18px; }
  .matchup { margin-left: 0; text-align: left; flex-basis: 100%; }
  .slot { grid-template-columns: 6px minmax(0, 1fr); }
  .slot-act { grid-column: 2; text-align: left; }
  .left { display: inline; margin-left: 8px; }
  .photos { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ---------- added for the live sheet ---------- */

/* One-column layout when the photo column is turned off (SHOW_PHOTOS=0). */
.detail.no-photos { grid-template-columns: minmax(0, 1fr); }

/* Coverage ticks need a floor so a long season doesn't render hairlines. */
.ticks span { min-width: 3px; }

.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { filter: none; background: var(--bg); }
.btn[disabled] { opacity: .55; cursor: default; filter: none; }

/* ---------- sign-up dialog ---------- */

.dlg {
  border: 0; border-radius: var(--radius); padding: 24px;
  width: min(460px, calc(100% - 32px)); max-height: 86vh; overflow: auto;
  background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.dlg::backdrop { background: rgba(10,10,12,.55); }
.dlg h3 { font: 900 26px/1.1 var(--display); text-transform: uppercase; margin: 0 36px 2px 0; }
.dlg-sub { color: var(--muted); font-size: 14px; margin: 0 0 4px; }
.dlg-x { position: absolute; top: 10px; right: 12px; }
.dlg-x button {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font-size: 28px; line-height: 1; cursor: pointer; padding: 6px 10px; border-radius: 999px;
}
.dlg-x button:hover { background: var(--bg); color: var(--ink); }

.dlg label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 4px; }
.dlg label .opt { font-weight: 400; color: var(--muted); }
.dlg input {
  width: 100%; padding: 12px; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
}
.dlg input:focus-visible { outline: 3px solid var(--red); outline-offset: 1px; }
.dlg .hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.dlg-err {
  margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 14px;
  background: var(--red-soft); color: var(--red); font-weight: 600;
}
.dlg-err[hidden] { display: none; }
.dlg-ok { font-weight: 700; font-size: 17px; margin: 8px 0 0; }
.dlg-act { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.linkbox {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  word-break: break-all; background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px; margin: 10px 0 0;
}

.flashmsg { padding: 12px 14px; border-radius: 12px; font-size: 15px; margin: 0 0 14px;
  background: var(--ok-bg); color: var(--ok-ink); font-weight: 600; }
.flashmsg.error { background: var(--red-soft); color: var(--red); }
