:root {
  --navy: #0c2340;
  --navy-2: #122c4f;
  --lake: #236192;
  --green: #78be20;
  --grey: #9ea2a2;
  --ink: #f4f6f8;
  --muted: #a9b4c2;
  --card: #15315a;
  --card-edge: #1f4273;
  --win: #78be20;
  --loss: #ff6b6b;
  --live: #ff4d4d;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--navy);
  color: var(--ink);
  line-height: 1.35;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }

/* Centered masthead. */
.masthead {
  padding: 20px 16px 8px;
  text-align: center;
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
  border-bottom: 3px solid var(--green);
}
.masthead h1 { margin: 0; font-size: 1.5rem; letter-spacing: 0.02em; text-transform: uppercase; font-weight: 800; }
.masthead .city { color: var(--green); display: block; font-size: 0.8rem; letter-spacing: 0.2em; }
.tagline { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }

main { padding: 12px 16px 32px; max-width: 640px; margin: 0 auto; }
.topline { display: flex; justify-content: space-between; gap: 12px; font-size: 0.85rem; color: var(--grey); margin: 4px 0 12px; flex-wrap: wrap; }
.status { color: var(--muted); text-align: center; padding: 24px 0; }
h2.section { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--green); margin: 16px 0 8px; }
.month h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--grey); margin: 20px 0 8px; }

.game {
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 14px;
  padding: 14px 14px 12px;
  margin-bottom: 10px;
}
.game.hero { border-color: var(--green); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35); padding: 18px 16px 14px; }
.game.live { border-color: var(--live); }
.game.over { opacity: 0.78; }

.when { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--muted); flex-wrap: wrap; }
.when .day { font-weight: 600; color: var(--ink); }
.when .time { font-variant-numeric: tabular-nums; }
.hero .when .time { color: var(--ink); font-weight: 700; font-size: 1rem; }
.pill {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--green);
  color: var(--navy);
}
.pill.live { background: var(--live); color: #fff; animation: pulse 1.6s ease-in-out infinite; }
.pill.ppd { background: var(--grey); color: var(--navy); }
@keyframes pulse { 50% { opacity: 0.55; } }

.matchup { margin: 6px 0 2px; font-size: 1.25rem; font-weight: 700; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hero .matchup { font-size: 1.6rem; }
.vs { color: var(--grey); font-weight: 500; font-size: 0.85em; }
.score { margin-left: auto; font-variant-numeric: tabular-nums; }
.score.win { color: var(--win); }
.score.loss { color: var(--loss); }
.score.live { color: #fff; }
.sub { font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; }

.nets { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 10px; }
.net {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--c, #3a3f47);
  color: var(--t, #fff);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.net.not-mine { opacity: 0.55; text-decoration: line-through; text-decoration-thickness: 2px; }
.net.free { opacity: 0.7; border-style: dashed; }

.watch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  background: var(--c, var(--green));
  color: var(--t, var(--navy));
  border: 2px solid rgba(255, 255, 255, 0.25);
}
.watch.mine { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); }
.watch.assumed { border-style: dashed; }
.watch.not-mine { background: #2a3a54; color: var(--muted); border-style: dashed; font-weight: 600; }
.watch .via { font-weight: 500; opacity: 0.85; font-size: 0.9em; }
.watch .arrow { opacity: 0.8; }
.watch.none { background: #2a3a54; color: var(--ink); font-weight: 500; font-size: 0.95rem; text-align: center; display: block; }
.alt { display: block; text-align: center; margin-top: 8px; font-size: 0.85rem; color: var(--muted); }

.others { list-style: none; padding: 0; margin: 10px 0 0; font-size: 0.85rem; color: var(--muted); }
.others li { padding: 3px 0; }
.others a { color: var(--ink); }
.tag { font-style: normal; font-size: 0.7rem; padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
.tag.yes { background: rgba(120, 190, 32, 0.2); color: var(--green); }
.tag.no { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.venue { margin-top: 10px; font-size: 0.8rem; }

.tabs { display: flex; gap: 6px; margin: 4px 0 8px; position: sticky; top: 0; background: var(--navy); padding: 8px 0; z-index: 2; }
.tab {
  flex: 1;
  min-height: 44px;
  background: var(--navy-2);
  color: var(--muted);
  border: 1px solid var(--card-edge);
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.tab.on { background: var(--lake); color: #fff; border-color: var(--lake); }
.tab.link { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; flex: 0 0 auto; }

footer { margin-top: 32px; border-top: 1px solid var(--card-edge); padding-top: 16px; }
.notify { margin-bottom: 20px; }
.notify p { margin: 0 0 8px; }
.notify-row { display: flex; align-items: center; gap: 12px; }
.notify-btn { flex: 0 0 auto; min-width: 120px; padding: 0 16px; }
.notify-btn:disabled { opacity: 0.6; cursor: default; }
footer h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--grey); margin: 0 0 8px; }
.subs { list-style: none; padding: 0; margin: 0; font-size: 0.85rem; }
.subs li { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; }

@media (min-width: 560px) {
  .masthead h1 { font-size: 1.9rem; }
}

/* ---------------------------------------------------------- week view --- */
.week { margin: 4px 0 8px; }
.week-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.week-title { flex: 1; text-align: center; display: flex; flex-direction: column; line-height: 1.2; }
.week-range { font-weight: 800; font-size: 1.05rem; }
.week-rel { font-size: 0.78rem; }
.wnav {
  flex: 0 0 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--navy-2);
  color: var(--ink);
  border: 1px solid var(--card-edge);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.wnav:active { background: var(--lake); }

.strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; touch-action: pan-y; }
.dcell {
  min-width: 0;
  min-height: 92px;
  padding: 7px 2px 6px;
  border-radius: 12px;
  background: var(--navy-2);
  border: 1px solid var(--card-edge);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
}
.dcell.past { opacity: 0.6; }
.dcell.has-game { background: var(--card); }
.dcell.today { border-color: var(--green); }
.dcell.today .dnum { color: var(--green); }
.dcell.selected { background: var(--lake); border-color: var(--lake); opacity: 1; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.dcell.selected .dnum, .dcell.selected .dwd { color: #fff; }
.dwd { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.dnum { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.dgames { display: flex; flex-direction: column; gap: 2px; width: 100%; margin-top: 2px; }
.dgame {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  border-radius: 6px;
  padding: 3px 0 2px;
  background: rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--c, #3a3f47);
  line-height: 1.1;
}
.dgame.none { visibility: hidden; height: 30px; }
.dgame.not-mine { border-left-style: dashed; opacity: 0.75; }
.dgame.live { background: rgba(255, 77, 77, 0.25); }
.dgame.final.win { border-left-color: var(--win); }
.dgame.final.loss { border-left-color: var(--loss); }
.dopp { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.02em; }
.dmeta { font-size: 0.62rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dgame.live .dmeta { color: #fff; font-weight: 800; animation: pulse 1.6s ease-in-out infinite; }
.dgame.final.win .dmeta { color: var(--win); font-weight: 800; }
.dgame.final.loss .dmeta { color: var(--loss); font-weight: 800; }
.dcell.selected .dmeta { color: #e6eef8; }
.today-btn {
  display: block;
  margin: 8px auto 0;
  background: none;
  border: 0;
  color: var(--green);
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px 10px;
}

/* Selected day with no game */
.nogame { background: var(--card); border: 1px solid var(--card-edge); border-radius: 14px; padding: 14px 16px; }
.nogame-title { margin: 0 0 10px; font-size: 1.1rem; font-weight: 700; }
.nextup { border-top: 1px solid var(--card-edge); padding-top: 10px; }
.nextup-head { display: flex; align-items: center; gap: 8px; }
.nextup-head .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--green); font-weight: 700; }
.nextup-match { font-size: 1.3rem; font-weight: 700; margin: 4px 0 2px; }
.nextup-when { color: var(--muted); font-size: 0.9rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nextup-actions { display: flex; gap: 8px; margin-top: 12px; }
.nextup-actions .tab { flex: 1; }

/* Compact game rows (rest of week, season list) */
.rest-title, .month h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--grey); margin: 18px 0 8px; }
.rows { display: flex; flex-direction: column; gap: 6px; }
.row {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--card-edge);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.row.over { opacity: 0.7; }
.row.live { border-color: var(--live); }
.row-day { font-size: 0.75rem; color: var(--muted); font-weight: 700; min-width: 44px; }
.row-time { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 54px; }
.row-match { font-weight: 700; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.net.sm { font-size: 0.62rem; padding: 2px 6px; }
.row-tail { font-size: 0.8rem; white-space: nowrap; }
.row-tail .score { margin-left: 0; font-weight: 700; }
.row-go { color: var(--green); font-weight: 700; text-decoration: none; }
.row-go.live { color: var(--live); animation: pulse 1.6s ease-in-out infinite; }
.season-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 0 0; }
.season-tools .tab { min-height: 36px; font-size: 0.85rem; }

/* Alternate links under the watch button */
.alts { display: flex; gap: 6px 14px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.altlink { font-size: 0.85rem; color: var(--muted); }

@media (max-width: 360px) {
  .row { grid-template-columns: auto 1fr auto; }
  .row-time, .row-tail { display: none; }
}
