/* ==========================================================================
   WYSA Indoor Rec 2026–27 · Hanover Soccer Club Teams — styles
   Fonts: Barlow Condensed (headings) + Barlow (body), loaded in index.html
   Sections: tokens · base · masthead · share panel · team picker · tiles ·
             view tabs · game days · cards · footer · loading
   ========================================================================== */

/* Tokens ------------------------------------------------------------------ */
:root {
  color-scheme: light;
  --primary: #1a254a; --on-primary: #ffffff; --primary-2: #34447a;
  --mast: var(--primary);
  --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;
  --x-bg: #fcf1ef; --x-fg: #c96a61;
  --pend-bg: #fbf6ec; --pend-fg: #a3864a;
  --note: #6f7889; --tagfg: #1a254a; --link: #34447a;
  --hint-bg: #f0a245; --hint-fg: #1a254a;
  --head: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 12px;
}

/* Dark theme "Slate": soft slate-navy body, header in a darker gradient,
   monochrome result tags. Applied by the system setting (automatic) or the
   theme button; both blocks hold the same values. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --primary: #1a2136; --on-primary: #e8ecf3; --primary-2: #9bb3ff;
    --mast: linear-gradient(180deg, #1f2844 0%, #0e1320 100%);
    --secondary: #2a3349; --accent: #f0a245;
    --bg: #1c2333; --surface: #252e41; --surface-2: #2e384d;
    --text: #e8ecf3; --muted: #a4aec0; --border: #364159;
    --cal-band: #31406a; --cal-border: #3f4f80; --cal-ring: #9bb3ff;
    --cd-bg: #423322; --cd-fg: #f3b56a; --today-bg: #f0a245; --today-fg: #1a0f02;
    --win-bg: #2e384d; --win-fg: #e8ecf3; --draw-bg: #2e384d; --draw-fg: #b8c0ce;
    --loss-bg: #2e384d; --loss-fg: #b8c0ce; --x-bg: #2e384d; --x-fg: #8e98ab;
    --pend-bg: #2e384d; --pend-fg: #a4aec0;
    --note: #9aa4b6; --tagfg: #9bb3ff; --link: #9bb3ff;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #1a2136; --on-primary: #e8ecf3; --primary-2: #9bb3ff;
  --mast: linear-gradient(180deg, #1f2844 0%, #0e1320 100%);
  --secondary: #2a3349; --accent: #f0a245;
  --bg: #1c2333; --surface: #252e41; --surface-2: #2e384d;
  --text: #e8ecf3; --muted: #a4aec0; --border: #364159;
  --cal-band: #31406a; --cal-border: #3f4f80; --cal-ring: #9bb3ff;
  --cd-bg: #423322; --cd-fg: #f3b56a; --today-bg: #f0a245; --today-fg: #1a0f02;
  --win-bg: #2e384d; --win-fg: #e8ecf3; --draw-bg: #2e384d; --draw-fg: #b8c0ce;
  --loss-bg: #2e384d; --loss-fg: #b8c0ce; --x-bg: #2e384d; --x-fg: #8e98ab;
  --pend-bg: #2e384d; --pend-fg: #a4aec0;
  --note: #9aa4b6; --tagfg: #9bb3ff; --link: #9bb3ff;
}

/* Base -------------------------------------------------------------------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg); color: var(--text);
  font-family: var(--body); font-size: 15px; line-height: 1.4;
}
button, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { flex: none; }
.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; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Masthead ---------------------------------------------------------------- */
.mast { background: var(--mast); color: var(--on-primary); padding-block: 24px 26px; }
.mast .inner { display: flex; flex-direction: column; gap: 22px; }
.top { display: flex; align-items: center; gap: 12px; }
.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: 13px; opacity: .72; }
.titles .upd { display: flex; align-items: center; gap: 4px; font-size: 11px; white-space: nowrap; opacity: .7; margin-top: 1px; }
.actions { display: flex; gap: 8px; flex: none; }
.hbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: rgba(255,255,255,.12); color: inherit; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.28); }
.hbtn:hover { background: rgba(255,255,255,.18); }

/* Share panel ------------------------------------------------------------- */
.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; }

/* Team picker: a styled label with an invisible native <select> on top ---- */
.picker { position: relative; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border: 1px solid rgba(255,255,255,.22); border-radius: 10px; background: rgba(255,255,255,.1); cursor: pointer; }
.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; color-scheme: light; color: #131a29; background-color: #ffffff; }
.picker select:focus-visible { outline: none; }
.picker option { color: #131a29; background-color: #ffffff; }
.pick-name { flex-grow: 1; min-width: 0; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker .meta { font-size: 12px; opacity: .75; white-space: nowrap; margin-right: 22px; }
.picker .chev { position: absolute; right: 12px; pointer-events: none; }
/* While no team is chosen, the meta text gives way to an orange hint */
.pick-hint { display: none; }
.picker.prompt .meta { display: none; }
.picker.prompt .pick-hint { display: block; flex: none; margin-right: 22px; padding: 5px 10px; border-radius: 999px; background: var(--hint-bg); color: var(--hint-fg); font-size: 12px; font-weight: 700; line-height: 1.2; white-space: nowrap; }

/* Team tiles (shown only when one team is selected) ----------------------- */
.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 column + view tabs ------------------------------------------------- */
main { padding-block: 26px 64px; }
main .inner { display: flex; flex-direction: column; gap: 40px; }
.seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 3px; border-radius: 10px; background: var(--secondary); }
.seg button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 6px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; 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); }

/* Game days --------------------------------------------------------------- */
.days { display: flex; flex-direction: column; gap: 64px; }
.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 { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--cal-border); border-radius: 8px; background: var(--surface); }
.cal .mon { padding: 4px 0 2px; background: var(--cal-band); color: var(--primary-2); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-align: center; }
.cal .num { padding: 3px 0 5px; font-family: var(--head); font-size: 24px; font-weight: 700; line-height: 1; text-align: center; }
.dayname { flex-grow: 1; display: flex; flex-direction: column; min-width: 0; }
.dayname .wd { margin: 0; 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; padding: 5px 11px; border-radius: 999px; background: var(--cd-bg); color: var(--cd-fg); font-size: 12px; font-weight: 700; white-space: nowrap; }
.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); }

/* Game cards -------------------------------------------------------------- */
.card { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.cardtop { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 24px; font-size: 12px; color: var(--muted); }
.divtag { padding: 2px 6px; border-radius: 4px; background: var(--secondary); color: var(--tagfg); font-weight: 600; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; 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 { background: var(--loss-bg); color: var(--loss-fg); }
.tag.X { background: var(--x-bg); color: var(--x-fg); font-weight: 600; }
.tag.P { background: var(--pend-bg); color: var(--pend-fg); font-weight: 600; }
.board { display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); align-items: center; gap: 8px; }
.team { min-width: 0; padding-bottom: 17.4px; } /* bottom space keeps the names level with the time */
.team.away { text-align: right; }
.team .nm { display: block; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.team.club .nm { font-weight: 700; }
.team.dim .nm { color: var(--muted); }
.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); }
.foot { flex-wrap: wrap; row-gap: 6px; }
.foot .where { white-space: nowrap; }
.foot .sheet { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding-left: 8px; color: var(--link); font-weight: 600; text-decoration: none; white-space: nowrap; }
.foot .sheet:hover { text-decoration: underline; }
.foot .reported { margin-left: auto; padding-left: 8px; font-style: italic; white-space: nowrap; }
.note { display: flex; gap: 6px; font-size: 12px; line-height: 1.35; color: var(--note); }
.empty { margin: 0; padding: 18px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface); color: var(--muted); }

/* Footer ------------------------------------------------------------------ */
footer { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
footer p { margin: 0; }
footer a { color: var(--link); }
.stale { font-size: 12px; color: var(--note); }
.noscript { padding: 16px; }

/* Loading skeleton -------------------------------------------------------- */
.loading { display: flex; flex-direction: column; gap: 12px; }
.skel { height: 120px; border: 1px solid var(--border); 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; }
.skel.short { height: 54px; width: 60%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Small screens + motion -------------------------------------------------- */
@media (max-width: 420px) { .seg button { gap: 4px; padding: 9px 2px; font-size: 13px; } }
@media (max-width: 380px) { .board { grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); } .titles h1 { font-size: 26px; } }
@media (max-width: 370px) { .seg button svg { display: none; } }
@media (max-width: 360px) { .picker.prompt .pick-hint { padding: 4px 8px; font-size: 11px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
