/* ==========================================================================
   Hanover Soccer Club · WYSA Indoor Rec — styles
   Theme: Sideline palette (royal navy, blue-grey ground, white cards)
   Fonts: Barlow Condensed (headings) + Barlow (body), loaded in index.html
   ========================================================================== */

/* Base reset ------------------------------------------------------------- */
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
body { margin: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
img { max-width: 100%; }

/* Tokens + components ----------------------------------------------------- */
/* Layout: navy masthead with team picker and club numbers; then a stack of game days, each led by a small desk calendar and a countdown, holding scoreboard cards */
:root {
  --primary: #1a254a; --on-primary: #ffffff; --primary-2: #34447a;
  --secondary: #e5e8f1;
  --accent: #c86b0a;
  --bg: #f2f4f8; --surface: #ffffff; --surface-2: #e8ecf3;
  --text: #131a29; --muted: #586377; --border: #d4dae5;
  --cal-band: #dfe6fb; --cal-border: #c7d3f5; --cal-ring: #34447a;
  --cd-bg: #fbeedd; --cd-fg: #a45607; --today-bg: #c86b0a; --today-fg: #ffffff;
  --win-bg: #e1f1e7; --win-fg: #1a7542;
  --draw-bg: #e9ecf1; --draw-fg: #4f5a6c;
  --loss-bg: #f9e3e1; --loss-fg: #b8322a;
  --pend-bg: #fbf0d9; --pend-fg: #8a5f00;
  --note: #8a5f00; --tagfg: #1a254a; --link: #34447a;
  --head: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --primary: #141b2e; --on-primary: #e6ebf4; --primary-2: #8aa8ff;
  --secondary: #1b2540; --accent: #f0a245;
  --bg: #0c111b; --surface: #141b29; --surface-2: #1b2435;
  --text: #e6ebf4; --muted: #97a2b7; --border: #283247;
  --cal-band: #22305a; --cal-border: #33427a; --cal-ring: #8aa8ff;
  --cd-bg: #3a2a14; --cd-fg: #f3b56a; --today-bg: #f0a245; --today-fg: #1a0f02;
  --win-bg: #173726; --win-fg: #6fd39c; --draw-bg: #232b39; --draw-fg: #b4bdcc;
  --loss-bg: #3d1f1d; --loss-fg: #f4877b; --pend-bg: #3a3017; --pend-fg: #e8c070; --note: #e8c070; --tagfg: #8aa8ff; --link: #8aa8ff;
  color-scheme: dark } }
:root[data-theme="dark"] {
  --primary: #141b2e; --on-primary: #e6ebf4; --primary-2: #8aa8ff;
  --secondary: #1b2540; --accent: #f0a245;
  --bg: #0c111b; --surface: #141b29; --surface-2: #1b2435;
  --text: #e6ebf4; --muted: #97a2b7; --border: #283247;
  --cal-band: #22305a; --cal-border: #33427a; --cal-ring: #8aa8ff;
  --cd-bg: #3a2a14; --cd-fg: #f3b56a; --today-bg: #f0a245; --today-fg: #1a0f02;
  --win-bg: #173726; --win-fg: #6fd39c; --draw-bg: #232b39; --draw-fg: #b4bdcc;
  --loss-bg: #3d1f1d; --loss-fg: #f4877b; --pend-bg: #3a3017; --pend-fg: #e8c070; --note: #e8c070; --tagfg: #8aa8ff; --link: #8aa8ff;
  color-scheme: dark }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--text); font-family: var(--body); font-size: 15px; line-height: 1.4; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.inner { max-width: 640px; margin: 0 auto; }
button, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { flex: none; }

/* masthead */
.mast { background: var(--primary); color: var(--on-primary); padding-block: 18px 16px; }
.mast .inner { display: flex; flex-direction: column; gap: 14px; }
.top { display: flex; align-items: center; gap: 12px; }
.crest { --logo: url("../img/crest.png"); width: 66px; height: 66px; flex: none; background: var(--on-primary); -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.titles { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.titles h1 { margin: 0 0 2px; font-family: var(--head); font-weight: 700; font-size: clamp(23px, 6.4vw, 30px); line-height: 1; }
.titles .sub { font-size: 12px; opacity: .72; }
.titles .upd { display: flex; align-items: center; gap: 4px; font-size: 11px; white-space: nowrap; opacity: .7; margin-top: 1px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.actions { display: flex; align-items: center; gap: 8px; flex: none; }
.iconrow { display: flex; gap: 8px; }
.hbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: rgba(255,255,255,.12); color: inherit; border-radius: 10px; min-width: 40px; min-height: 40px; padding: 0 10px; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.28); }
.hbtn:hover { background: rgba(255,255,255,.18); }

.sharepanel { background: var(--surface); color: var(--text); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.sp-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sp-title { font-family: var(--head); font-size: 20px; font-weight: 700; }
.sp-scope { font-size: 13px; color: var(--muted); }
.sp-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sp-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; }
.sp-btn.wa { background: var(--win-bg); color: var(--win-fg); border-color: transparent; }
.sp-url { width: 100%; min-width: 0; font: 13px var(--body); color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; }

.picker { position: relative; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); border-radius: 10px; padding: 0 12px; }
.picker { min-height: 48px; cursor: pointer; }
.picker:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.picker .pick-name { flex-grow: 1; min-width: 0; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker select { appearance: none; -webkit-appearance: none; position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; opacity: 0; border: 0; font-size: 16px; cursor: pointer; }
.picker select:focus-visible { outline: none; }
.picker select option { color: #131a29; }
.picker .chev { position: absolute; right: 12px; pointer-events: none; }
.picker .meta { font-size: 12px; opacity: .75; white-space: nowrap; margin-right: 22px; }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 8px; background: rgba(255,255,255,.08); text-align: center; }
.tile .v { font-family: var(--head); font-size: 22px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tile .k { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }

main { padding-block: 20px 56px; }
main .inner { display: flex; flex-direction: column; gap: 34px; }

.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--secondary); border-radius: 10px; padding: 3px; }
.seg button { border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; padding: 9px 6px; display: flex; gap: 6px; align-items: center; justify-content: center; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(19,26,41,.12); }

/* days */
.days { display: flex; flex-direction: column; gap: 48px; }
.day { display: flex; flex-direction: column; gap: 12px; }
.dayhead { display: flex; align-items: center; gap: 12px; }
.cal { position: relative; width: 48px; flex: none; padding-top: 5px; }
.cal::before, .cal::after { content: ""; position: absolute; top: 0; width: 4px; height: 10px; border-radius: 2px; background: var(--cal-ring); }
.cal::before { left: 12px; } .cal::after { right: 12px; }
.cal .box { border-radius: 8px; overflow: hidden; border: 1px solid var(--cal-border); background: var(--surface); display: flex; flex-direction: column; }
.cal .mon { background: var(--cal-band); color: var(--primary-2); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-align: center; padding: 4px 0 2px; }
.cal .num { font-family: var(--head); font-size: 24px; font-weight: 700; line-height: 1; text-align: center; padding: 3px 0 5px; }
.dayname { flex-grow: 1; display: flex; flex-direction: column; min-width: 0; }
.dayname .wd { font-family: var(--head); font-size: 21px; font-weight: 600; text-transform: uppercase; line-height: 1.1; }
.dayname .n { font-size: 12px; color: var(--muted); }
.count { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 5px 11px; white-space: nowrap; background: var(--cd-bg); color: var(--cd-fg); }
.count.today { background: var(--today-bg); color: var(--today-fg); }
.count.past { background: var(--surface-2); color: var(--muted); }
.count.far { background: var(--secondary); color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.cardtop { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.divtag { font-weight: 600; color: var(--tagfg); background: var(--secondary); border-radius: 4px; padding: 2px 6px; }
.where { display: inline-flex; align-items: center; gap: 4px; min-width: 0; text-align: right; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.tag.W { background: var(--win-bg); color: var(--win-fg); }
.tag.D { background: var(--draw-bg); color: var(--draw-fg); }
.tag.L, .tag.X { background: var(--loss-bg); color: var(--loss-fg); }
.tag.P { background: var(--pend-bg); color: var(--pend-fg); }
.board { display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); align-items: center; gap: 8px; }
.team { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.team.away { text-align: right; align-items: flex-end; }
.team .nm { font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.team.club .nm { font-weight: 700; }
.team.dim .nm { color: var(--muted); }
.team .ha { font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.mid { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mid .t { font-family: var(--head); font-size: 23px; font-weight: 700; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mid .ap { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mid .score { font-family: var(--head); font-size: 32px; font-weight: 700; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.foot { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.note { display: flex; gap: 6px; font-size: 12px; color: var(--note); line-height: 1.35; }
.empty { color: var(--muted); margin: 0; padding: 18px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }

footer { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
footer p { margin: 0; }
footer a { color: var(--link); }

@media (max-width: 380px) { .crest { width: 58px; height: 58px; } .board { grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); } .titles h1 { font-size: 26px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Loading / error states --------------------------------------------------- */
.loading { display: flex; flex-direction: column; gap: 12px; }
.skel { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; border: 1px solid var(--border); }
.skel.short { height: 54px; width: 60%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.stale { font-size: 12px; color: var(--note); }
