/* NPL season hub (npl-hub.js): what /npl.html shows between games. Builds on theme.css and styles.css.
   The hero is always night-dark over the stadium art (lib/stadium.js), in league crimson and marigold. */

/* ---------- Stadium backdrop ---------- */
.stadium { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; pointer-events: none; }
.st-land { fill: #1d3322; }
.tr-a { fill: #24432a; }
.tr-b { fill: #2c5132; }
.st-road { fill: none; stroke: #b8a27a; stroke-width: 14; stroke-linecap: round; opacity: .45; }
.st-path { fill: #9c8f74; opacity: .55; }
.st-apron { fill: #2f6b2b; }
.mow-a { fill: none; stroke: #6cbf4f; stroke-width: 14; opacity: .14; }
.mow-b { fill: none; stroke: #2f7a2c; stroke-width: 14; opacity: .16; }
.st-rope { fill: none; stroke: #fff; stroke-width: 2; opacity: .55; }
.st-ring30 { fill: none; stroke: #fff; stroke-width: 1.5; stroke-dasharray: 3 7; opacity: .45; }
.st-square { fill: #78b65a; opacity: .55; }
.st-square2 { fill: #5ea446; opacity: .7; }
.st-pitch { fill: #cbb488; }
.st-crease { stroke: #fff; stroke-width: 1.2; opacity: .8; }
.st-r { fill: #c8201b; }
.st-y { fill: #f2b705; }
.st-m { fill: #7a1d2a; }
.st-rim { fill: #e9e4da; opacity: .8; }
.pv-shadow { fill: #000; opacity: .3; }
.pv-wall { fill: #ece6da; }
.pv-roof { fill: #c8281f; }
.pv-ridge { stroke: #ff8a75; stroke-width: 1.5; opacity: .6; }
.st-plan-ring { fill: #fff; opacity: .05; }
.st-plan-ribs { fill: none; stroke: #fff; stroke-width: 1.2; opacity: .16; stroke-dasharray: 2000; animation: st-draw 6s ease-out both; }
.fl-mast { fill: #3a3d44; }
.fl-glow { fill: url(#stGlow); opacity: .45; animation: st-glow 4s ease-in-out infinite; }
.fl { transform-box: fill-box; }
.st-orbit { transform-origin: 600px 400px; animation: st-orbit 240s linear infinite; }
.st-ball {
  fill: #fff; filter: drop-shadow(0 0 4px #fff); offset-path: path('M600 400Q690 180 790 250'); offset-rotate: 0deg;
  animation: st-ball 7s cubic-bezier(.3, .6, .4, 1) infinite; opacity: 0;
}
@keyframes st-orbit { to { transform: rotate(360deg); } }
@keyframes st-glow { 50% { opacity: .85; } }
@keyframes st-draw { from { stroke-dashoffset: 2000; } to { stroke-dashoffset: 0; } }
@keyframes st-ball {
  0%, 62% { offset-distance: 0%; opacity: 0; }
  64% { opacity: 1; }
  80% { offset-distance: 100%; opacity: 1; }
  86%, 100% { offset-distance: 100%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .st-orbit, .st-ball, .fl-glow, .st-plan-ribs, .hub-cd.is-zero, .hub-champ .confetti i { animation: none !important; }
}

/* ---------- Hero ---------- */
.hub-hero {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  padding: 34px 16px 84px; border-radius: 0 0 28px 28px; background: #12100f;
}
/* Night over the ground: dark on the text side, the stadium showing through on the right. */
.hub-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(14, 10, 12, .94) 0%, rgba(14, 10, 12, .74) 40%, rgba(14, 10, 12, .1) 100%),
    linear-gradient(180deg, color-mix(in srgb, #7d0f22 55%, transparent) 0%, transparent 40%, rgba(14, 10, 12, .65) 100%);
}
@media (max-width: 700px) {
  .hub-hero::before { background: linear-gradient(180deg, rgba(14, 10, 12, .9) 0%, rgba(14, 10, 12, .74) 55%, rgba(14, 10, 12, .9) 100%); }
}
.hub-hero .flags { color: rgba(255, 255, 255, .35); }
.hub-hero .ridge-back { fill: #f3b08a; opacity: .18; }
.hub-hero .ridge-front { fill: var(--bg); opacity: 1; }
.hub-hero .ridge-snow { opacity: .3; }
.hub-in { max-width: var(--wrap); margin: 0 auto; display: grid; gap: 14px; }
.hub-kicker { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; font-size: .82rem; font-weight: 700; letter-spacing: .02em; color: rgba(255, 255, 255, .82); }
.hub-kicker .pill { color: #fff; border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); }
.hub-kicker .pill--live { color: #fff; background: var(--brand); border-color: var(--brand); }
.hub-kicker .pill--live::before { background: #fff; }
.hub-h1 { font-family: var(--display); font-stretch: var(--narrow); font-weight: 900; font-size: clamp(1.9rem, 6vw, 3.2rem); line-height: 1; letter-spacing: -.01em; }
.hub-h1 .np { display: block; font-size: .42em; font-weight: 500; letter-spacing: 0; color: rgba(255, 255, 255, .7); margin-top: 6px; }

/* Next match: the two sides */
.hub-vs { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.hub-side { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: #fff; }
.hub-side .crest { flex: none; }
.hub-side b { font-family: var(--display); font-stretch: var(--narrow); font-size: clamp(1.25rem, 4.2vw, 1.9rem); font-weight: 800; line-height: 1.05; }
.hub-side small { display: block; font-family: var(--deva); font-size: .8rem; color: rgba(255, 255, 255, .65); }
.hub-side:hover b { text-decoration: underline; text-underline-offset: 4px; }
.hub-v { font-family: var(--display); font-weight: 800; color: var(--gold); font-size: 1.1rem; }
.hub-tbc { color: rgba(255, 255, 255, .75); font-weight: 700; }

/* Countdown */
.hub-cd { display: flex; gap: 8px; align-items: stretch; margin-top: 2px; }
.hub-cd > div {
  min-width: 68px; padding: 8px 10px 6px; border-radius: 14px; text-align: center;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(4px);
}
.hub-cd b { display: block; font-family: var(--display); font-stretch: var(--narrow); font-weight: 900; font-size: clamp(2rem, 7vw, 3rem); line-height: 1; font-variant-numeric: tabular-nums; }
.hub-cd span { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.hub-cd span i { font-style: normal; font-family: var(--deva); text-transform: none; letter-spacing: 0; margin-left: 4px; color: rgba(255, 255, 255, .5); }
.hub-cd--soon b { color: var(--gold); }
.hub-cd.is-zero { animation: breathe 1.6s ease-in-out infinite; }
.hub-cd-label { font-size: .85rem; font-weight: 700; color: var(--gold); }
@media (max-width: 420px) { .hub-cd > div { min-width: 0; flex: 1; padding: 6px 4px 4px; } }

.hub-meta { font-size: .9rem; color: rgba(255, 255, 255, .82); }
.hub-meta b { color: #fff; }
.hub-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px; cursor: pointer; text-decoration: none;
  font-weight: 700; font-size: .88rem; color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .28);
}
.hub-btn:hover { background: rgba(255, 255, 255, .18); }
.hub-btn--go { background: var(--brand); border-color: var(--brand); }
.hub-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hub-whatif { font-size: .88rem; color: rgba(255, 255, 255, .85); }
.hub-whatif b { color: var(--gold); }
.hub-also { font-size: .88rem; color: rgba(255, 255, 255, .78); display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; }
.hub-also a { color: #fff; font-weight: 700; }

/* Who wins? poll */
.hub-poll { display: grid; gap: 8px; max-width: 520px; padding: 12px; border-radius: 16px; background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .12); }
.hub-poll h2 { color: #fff; font-family: var(--display); font-size: 1rem; font-weight: 800; display: flex; gap: 8px; align-items: baseline; }
.hub-poll h2 .np { font-size: .82rem; font-weight: 500; color: rgba(255, 255, 255, .6); }
.hub-poll-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hub-poll-opts button {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; cursor: pointer; font-weight: 700; color: var(--team-ink, #fff);
  background: var(--team); border: 2px solid color-mix(in srgb, var(--team-accent) 70%, transparent); text-align: left;
}
.hub-poll-opts button:hover { filter: brightness(1.12); }
.hub-bar { display: flex; height: 30px; border-radius: 10px; overflow: hidden; font-size: .8rem; font-weight: 800; }
.hub-bar span { display: flex; align-items: center; padding: 0 10px; min-width: 44px; background: var(--team); color: var(--team-ink, #fff); transition: flex-basis .8s cubic-bezier(.2, .8, .2, 1); white-space: nowrap; }
.hub-bar span + span { justify-content: flex-end; }
.hub-poll small { color: rgba(255, 255, 255, .65); font-size: .78rem; }

/* Season over: champions */
.hub-champ { display: grid; gap: 10px; justify-items: start; }
.hub-champ .crest.crest--emb.crest--lg { width: 96px; height: 96px; animation: pop-logo .9s cubic-bezier(.2, 1.4, .4, 1) both; }
.hub-champ .confetti { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hub-champ .confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: hub-fall 5s linear infinite; opacity: .9; }
@keyframes hub-fall { to { transform: translateY(560px) rotate(540deg); } }

/* ---------- Body ---------- */
.hub-body { max-width: var(--wrap); margin: -40px auto 0; padding: 0 16px 24px; position: relative; display: grid; gap: 14px; }
.hub-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .hub-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); } }
.hub-col { display: grid; gap: 14px; min-width: 0; align-content: start; }
.hub-body .card h2 .act { margin-left: auto; display: inline-flex; gap: 6px; }
.icon-btn {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); border-radius: 99px; padding: 3px 10px; cursor: pointer;
  font: 600 .8rem var(--body); display: inline-flex; align-items: center; gap: 5px; text-decoration: none;
}
.icon-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.icon-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Fixtures strip */
.hub-strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 2px 8px; scrollbar-width: thin; }
.fxc {
  flex: none; width: 148px; scroll-snap-align: start; display: grid; gap: 4px; padding: 9px 10px; border-radius: 12px; text-decoration: none; color: inherit;
  background: var(--paper-2); border: 1px solid transparent; font-size: .82rem;
}
.fxc.is-next { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--paper)); }
.fxc.is-done { background: var(--paper); border-color: var(--line); }
.fxc.is-dim { opacity: .35; }
.fxc-top { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-weight: 700; font-size: .72rem; }
.fxc-top .tag { font-size: .66rem; }
.fxc-t { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.fxc-t .num { margin-left: auto; font-family: var(--display); font-stretch: var(--narrow); font-weight: 800; }
.fxc-t.is-won { color: var(--ink); }
.fxc-t.is-lost { color: var(--muted); }
.fxc-res { color: var(--muted); font-size: .74rem; line-height: 1.25; }
.hub-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.hub-filter button {
  border: 1px solid var(--line); background: var(--paper); border-radius: 99px; padding: 3px 9px 3px 4px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: .78rem; color: var(--ink-2);
}
.hub-filter button:first-child { padding-left: 10px; }
.hub-filter button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.hub-path { font-size: .88rem; color: var(--ink-2); margin-top: 6px; }

/* Points table */
.ptab { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.ptab th { font-size: .75rem; font-weight: 700; color: var(--muted); text-align: right; padding: 4px 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ptab td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.ptab th:nth-child(2), .ptab td:nth-child(2) { text-align: left; }
.ptab td:first-child { color: var(--muted); font-weight: 700; width: 22px; }
.ptab .tm { display: flex; align-items: center; gap: 8px; font-weight: 700; color: inherit; text-decoration: none; }
.ptab .tm .full { display: inline; }
.ptab .tm .short { display: none; }
@media (max-width: 520px) { .ptab .tm .full { display: none; } .ptab .tm .short { display: inline; } .ptab .col-l, .ptab .col-nr { display: none; } }
.ptab td.pts { font-family: var(--display); font-stretch: var(--narrow); font-weight: 900; font-size: 1.1rem; }
.ptab tr.cut td { border-bottom: 2px dashed color-mix(in srgb, var(--brand) 55%, transparent); }
.ptab tr.is-move td { animation: hub-row .9s cubic-bezier(.2, .8, .2, 1); }
@keyframes hub-row { from { background: color-mix(in srgb, var(--gold) 28%, transparent); } }
.qb { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; font-size: .66rem; font-weight: 900; color: #fff; }
.qb--Q { background: var(--win); }
.qb--E { background: var(--muted); }
.fdots { display: inline-flex; gap: 3px; }
.fdots i { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font: 800 .58rem var(--body); color: #fff; font-style: normal; }
.fdots .W { background: var(--win); }
.fdots .L { background: var(--loss); }
.fdots .T, .fdots .N { background: var(--muted); }
.ptab-key { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; color: var(--muted); margin-top: 8px; }
.ptab-key span { display: inline-flex; align-items: center; gap: 5px; }
.ptab-key .cutk { width: 18px; border-top: 2px dashed color-mix(in srgb, var(--brand) 55%, transparent); }

/* Last result */
.lr { display: grid; gap: 10px; }
.lr-row { display: flex; align-items: center; gap: 10px; }
.lr-row .nm { font-weight: 700; }
.lr-row .num { margin-left: auto; font-family: var(--display); font-stretch: var(--narrow); font-weight: 900; font-size: 1.35rem; }
.lr-row .num small { font: 500 .8rem var(--body); color: var(--muted); margin-left: 4px; }
.lr-row.is-lost { opacity: .72; }
.lr-res { font-weight: 800; color: var(--win); }
.lr-star { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--gold) 12%, var(--paper)); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); }
.lr-star .star { width: 30px; height: 30px; flex: none; fill: var(--gold); }
.lr-star b { display: block; }
.lr-star small { color: var(--muted); }
.lr-notes { margin: 0; padding-left: 18px; font-size: .9rem; color: var(--ink-2); display: grid; gap: 4px; }

/* Caps */
.caps-tabs { margin-bottom: 10px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.caps-tabs button { white-space: nowrap; }
.cap-list { list-style: none; margin: 0; padding: 0; display: grid; }
.cap-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-2); }
.cap-list li:first-child { border-top: 0; }
.cap-list .rk { font-family: var(--display); font-weight: 900; color: var(--muted); text-align: center; }
.cap-list li:first-child .rk { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--cap, var(--gold)); }
.cap-list .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-list .who small { color: var(--muted); display: flex; align-items: center; gap: 5px; }
.cap-list .val { font-family: var(--display); font-stretch: var(--narrow); font-weight: 900; font-size: 1.35rem; text-align: right; line-height: 1; }
.cap-list .val small { display: block; font: 600 .72rem var(--body); color: var(--muted); }

/* Records, recap */
.rec { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.rec > div { padding: 10px 12px; border-radius: 12px; background: var(--paper-2); }
.rec b { display: block; font-family: var(--display); font-stretch: var(--narrow); font-weight: 900; font-size: 1.5rem; line-height: 1.1; }
.rec span { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rec small { display: block; font-size: .82rem; color: var(--ink-2); }

/* Playoff bracket */
.br { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) { .br { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; } .br-col { display: grid; gap: 10px; } }
.br-m { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--paper); display: grid; gap: 4px; font-size: .86rem; }
.br-m.is-final { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 30%, transparent); }
.br-m h3 { font-family: var(--body); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; justify-content: space-between; }
.br-t { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.br-t.is-tbc { color: var(--muted); font-weight: 600; font-style: italic; }
.br-t.is-won::after { content: "✓"; margin-left: auto; color: var(--win); font-weight: 900; }
.br-note { font-size: .78rem; color: var(--muted); }

/* Teams (pre-season) */
.tcards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tcard {
  position: relative; overflow: hidden; isolation: isolate; border-radius: var(--radius); padding: 14px; color: var(--team-ink, #fff); text-decoration: none;
  background: linear-gradient(160deg, var(--team) 45%, color-mix(in srgb, var(--team) 70%, var(--team-shade, #000)));
  display: grid; gap: 6px; min-height: 170px; box-shadow: var(--shadow);
}
.tcard .watermark { top: auto; bottom: -26px; right: -26px; width: 120px; opacity: .14; }
.tcard-h { display: flex; align-items: center; gap: 10px; }
.tcard-h b { font-family: var(--display); font-stretch: var(--narrow); font-size: 1.25rem; font-weight: 900; line-height: 1.05; }
.tcard-h small { display: block; font-family: var(--deva); font-size: .78rem; opacity: .75; }
.tcard p { font-size: .82rem; opacity: .9; }
.tcard .tc-stars { font-size: .8rem; }
.tcard .tc-stars b { color: var(--team-accent); }
.tcard .tc-fin { display: inline-block; font-size: .72rem; font-weight: 800; padding: 1px 8px; border-radius: 99px; background: rgba(0, 0, 0, .22); justify-self: start; }
.tcard details { font-size: .8rem; }
.tcard summary { cursor: pointer; font-weight: 700; }
.tcard ul { margin: 6px 0 0; padding-left: 16px; columns: 2; column-gap: 12px; }
.tcard:hover { transform: translateY(-2px); transition: transform .15s; }

.recap { display: grid; gap: 12px; }
.recap-champ { display: flex; align-items: center; gap: 12px; }
.recap-champ b { font-family: var(--display); font-stretch: var(--narrow); font-size: 1.4rem; font-weight: 900; display: block; line-height: 1.1; }
.recap-champ small { color: var(--muted); }
.trophy { width: 34px; height: 34px; fill: var(--gold); flex: none; }

/* News, learn */
.hub-news { list-style: none; margin: 0; padding: 0; display: grid; }
.hub-news li { padding: 8px 0; border-top: 1px solid var(--line-2); }
.hub-news li:first-child { border-top: 0; }
.hub-news a { font-weight: 700; color: var(--ink); text-decoration: none; }
.hub-news a:hover { text-decoration: underline; }
.hub-news small { display: block; color: var(--muted); }
.learn-cta { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.learn-cta svg { width: 40px; height: 40px; flex: none; fill: none; stroke: var(--brand); stroke-width: 1.6; }
.learn-cta b { display: block; font-family: var(--display); font-size: 1.1rem; }

/* Share card preview */
.share-dlg { border: 0; border-radius: var(--r-lg); padding: 16px; max-width: min(420px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.share-dlg::backdrop { background: rgba(10, 10, 12, .6); }
.share-dlg img { width: 100%; height: auto; border-radius: 12px; display: block; }
.share-dlg .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }

/* Live-now banner while the hub is open on purpose (?hub) */
.hub-live { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 700; text-decoration: none; }
.hub-live .pill--live { color: #fff; border-color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .16); }
.hub-live .pill--live::before { background: #fff; }
.hub-btn--wa { background: #1f9d55; border-color: #1f9d55; }
.hub-btn--wa:hover { background: #188046; }
