/* The Hockey Tree — mobile-first stylesheet.
   Base rules target phones; @media (min-width: …) layers on tablet/desktop. */

:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1b1f24;
  --muted: #6b7280;
  --line: #e3e6ea;
  --accent: #0b5cad;
  --accent-soft: #e8f0fa;
  --stripe: #f4f6f9;
  --accent-ink: #ffffff;
  --danger: #b42318;
  --ok: #1a7f37;
  --tap: 2.5rem; /* minimum tap target */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.35rem; margin: 0 0 .75rem; line-height: 1.25; }
h2 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: .85rem; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap;
  padding: .55rem .9rem; background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.topbar nav { display: flex; gap: .15rem; flex-wrap: wrap; }
.topbar nav a { padding: .35rem .5rem; border-radius: 5px; min-height: var(--tap); display: inline-flex; align-items: center; }
.topbar nav a:hover { background: var(--bg); text-decoration: none; }

.content { max-width: 1100px; margin: 0 auto; padding: 1rem .9rem 3rem; }

/* ---------- Messages ---------- */
.alert {
  background: #fdecea; color: var(--danger); border: 1px solid #f5c2c0;
  padding: .6rem .8rem; border-radius: 6px; margin-bottom: 1rem;
}
.notice { background: var(--accent-soft); border: 1px solid #cfe0f5; border-radius: 6px; padding: .5rem .8rem; margin: 0 0 1rem; }

/* ---------- What's new ---------- */
.news { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .9rem; margin: 0 0 1.25rem; }
.news summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: var(--tap); list-style: none; }
.news summary::-webkit-details-marker { display: none; }
.news summary .toggle { font-weight: normal; font-size: .85rem; color: var(--muted); }
.news[open] summary .toggle::after { content: "Hide"; }
.news:not([open]) summary .toggle::after { content: "Show"; }
.news ul { margin: .25rem 0 .5rem; padding-left: 1.1rem; }
.news li { margin: .3rem 0; }
.news li time { color: var(--muted); font-size: .8rem; white-space: nowrap; margin-right: .35rem; }
.news .more { display: inline-block; margin: .2rem 0 .4rem; font-size: .9rem; }
.news-page li { margin: .4rem 0; }
.news-page h2 { margin-top: 1.25rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -.9rem; padding: 0 .9rem; }
table { border-collapse: collapse; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
th, td { padding: .5rem .55rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafbfc; white-space: nowrap; }
tbody tr:nth-child(even) td { background: var(--stripe); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #eaf1fa; }
table.stats th, table.stats td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.stats th.left, table.stats td.left { text-align: left; white-space: normal; min-width: 10rem; }
table.list td:first-child { min-width: 10rem; }
tbody tr.highlight td, tbody tr.highlight:nth-child(even) td { background: var(--accent-soft); }

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.1rem;
  padding: .3rem .7rem; border: 1px solid var(--accent); border-radius: 6px;
  background: var(--card); color: var(--accent); font: inherit; font-size: .9rem; cursor: pointer; line-height: 1.2;
  white-space: nowrap;
}
.btn:hover { background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.btn.active { background: var(--accent); color: var(--accent-ink); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.small-btn { font-size: .75rem; padding: .15rem .5rem; min-height: 1.6rem; margin-left: .5rem; vertical-align: middle; }
.actions { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 2.1rem; padding: .3rem .75rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer;
}
.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip .count { font-size: .75rem; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 0 .4rem; }
.chip.active .count { color: var(--accent-ink); background: rgba(255,255,255,.25); }
.chip.small { font-size: .82rem; min-height: 1.8rem; padding: .15rem .6rem; }

/* ---------- Forms ---------- */
form.inline { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .5rem 0 1rem; }
form.inline.compact { margin: 0; gap: .3rem; }
form.inline.compact input { width: 7.5rem; min-width: 0; padding: .3rem .45rem; }
form.stack { display: grid; gap: .6rem; max-width: 22rem; }
form.stack label { display: grid; gap: .25rem; font-size: .9rem; }
input[type=text], input[type=search], input[type=number], input[type=password], select {
  padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 16px; /* prevents iOS zoom */
  min-height: 2.3rem; max-width: 100%; background: var(--card);
}
form.inline > input[type=text], form.inline > input[type=search], form.inline > input[type=number], form.inline > input[type=password], form.inline > select { flex: 1 1 10rem; }
details.muted { margin-top: 1.25rem; }
details summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; }

/* ---------- Page header & sections ---------- */
.page-head { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .75rem; }
.page-head h1, .page-head h2 { margin: 0; }
.page-head .actions { margin-top: .25rem; }
.section-head { display: flex; flex-direction: column; gap: .5rem; margin: 1.75rem 0 .75rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.section-head h2 { margin: 0; }
.subtitle { margin: -.25rem 0 1rem; }

.tabs { display: flex; gap: .25rem; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: .5rem 0 1rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: .5rem .7rem; border-radius: 6px 6px 0 0; color: var(--muted); white-space: nowrap; min-height: var(--tap); display: inline-flex; align-items: center; }
.tabs a.active { color: var(--ink); background: var(--card); border: 1px solid var(--line); border-bottom-color: var(--card); margin-bottom: -1px; }

.summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: 0 0 1rem; }
.summary div { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: .5rem .7rem; min-width: 0; }
.summary .label { display: block; font-size: .72rem; text-transform: uppercase; color: var(--muted); }
.summary .value { font-size: 1.1rem; font-weight: 600; }

.season { display: inline-block; font-size: .78rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: .1rem .45rem; vertical-align: middle; white-space: nowrap; }
.result { display: inline-block; min-width: 1.3rem; text-align: center; font-size: .75rem; font-weight: 700; border-radius: 4px; padding: 0 .3rem; color: #fff; background: var(--muted); }
.result.w { background: var(--ok); } .result.l { background: var(--danger); } .result.t { background: #8a6d00; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: 1fr; gap: .6rem; margin: 0 0 .5rem; }
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .75rem 2.2rem .75rem .9rem; display: flex; flex-direction: column; gap: .35rem; }
.card-title { font-weight: 600; font-size: 1rem; }
.card-sub { font-size: .82rem; }
.card-groups { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .2rem; align-items: center; }
.card-hide { position: absolute; top: .25rem; right: .25rem; margin: 0; }
.card-hide button { border: 0; background: transparent; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; width: var(--tap); height: var(--tap); border-radius: 6px; }
.card-hide button:hover { background: var(--bg); color: var(--danger); }
.hidden-cards { margin: .25rem 0 .5rem; }
.hidden-cards .chips { margin: .5rem 0 0; }
button.chip { font: inherit; cursor: pointer; }

/* ---------- Login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1.5rem; width: min(360px, 100%); display: grid; gap: .6rem; }
.login-card h1 { margin: 0 0 .5rem; }
.login-card button { padding: .65rem; border: 0; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font: inherit; cursor: pointer; min-height: var(--tap); }

/* ---------- Tablet and up ---------- */
@media (min-width: 640px) {
  h1 { font-size: 1.5rem; }
  .content { padding: 1.25rem 1rem 3rem; }
  .table-wrap { margin: 0; padding: 0; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .page-head { flex-direction: row; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
  .section-head { flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; }
  .tabs { flex-wrap: wrap; overflow: visible; }
}

/* ---------- Desktop ---------- */
@media (min-width: 960px) {
  body { font-size: 15px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  th, td { padding: .45rem .6rem; }
}

/* Picker row inside a section header: select and button share one line */
.section-head form.inline.compact { display: flex; flex-wrap: nowrap; width: 100%; gap: .4rem; }
.section-head form.inline.compact select { flex: 1 1 auto; min-width: 0; }
@media (min-width: 640px) {
  .section-head form.inline.compact { width: auto; }
  .section-head form.inline.compact select { flex: 0 1 18rem; }
}

/* ---------- Logos ---------- */
img.logo { max-width: 44px; max-height: 44px; }
.logo { width: 26px; height: 26px; object-fit: contain; vertical-align: middle; border-radius: 4px; background: #fff; flex: 0 0 auto; }
.logo.sm { width: 20px; height: 20px; }
.logo.lg { width: 44px; height: 44px; border-radius: 6px; }
.with-logo { display: flex; align-items: center; gap: .5rem; }
td.with-logo { display: table-cell; }
td.with-logo > .logo { margin-right: .45rem; }
h1.with-logo, h2.with-logo { display: flex; }

/* ---------- Leaderboards ---------- */
.boards { display: grid; grid-template-columns: 1fr; gap: 0 1.5rem; }
.boards h2 { margin-top: 1.25rem; }
table.leaders td.left { min-width: 8rem; }
@media (min-width: 960px) { .boards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

td.logo-cell, th.logo-cell { width: 1%; padding-right: 0; text-align: center; white-space: nowrap; }
td.logo-cell + td { padding-left: .45rem; }
table.stats th.num, table.stats td.num { text-align: right; width: 1%; padding-right: .2rem; }
.nowrap { white-space: nowrap; }
table.leaders td.team-short { white-space: nowrap; min-width: 0; }

/* ---------- Team hubs (themed via --hub-* set per space) ---------- */
body.hub { --hub-primary: #0b0b0b; --hub-accent: #dc3a2a; --hub-highlight: #f8d40a; }
.hub-band { background: var(--hub-primary); color: #fff; padding: .7rem .9rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; border-bottom: 4px solid var(--hub-accent); }
.hub-brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; min-width: 0; }
.hub-brand:hover { text-decoration: none; }
.hub-logo { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; flex: 0 0 auto; }
.hub-titles { display: flex; flex-direction: column; min-width: 0; }
.hub-name { font-weight: 800; font-size: 1.15rem; letter-spacing: .01em; line-height: 1.2; }
.hub-team { font-size: .8rem; color: rgba(255,255,255,.75); }
.hub-links { display: flex; gap: .2rem; flex-wrap: wrap; }
.hub-links a { color: rgba(255,255,255,.85); padding: .35rem .5rem; border-radius: 5px; min-height: var(--tap); display: inline-flex; align-items: center; font-size: .9rem; }
.hub-links a:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.hub-tabs { display: flex; gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--card); border-bottom: 1px solid var(--line); }
.hub-tabs a { flex: 1 0 auto; text-align: center; padding: .7rem .8rem; color: var(--ink); font-weight: 600; font-size: .9rem; border-bottom: 3px solid transparent; white-space: nowrap; min-height: var(--tap); }
.hub-tabs a:hover { text-decoration: none; background: var(--bg); }
.hub-tabs a.active { border-bottom-color: var(--hub-accent); color: var(--hub-accent); }
.hub-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.hub-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .75rem .9rem; min-width: 0; }
.hub-card h2 { margin: 0 0 .5rem; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.hub-card h2 .more { margin-left: auto; font-weight: normal; font-size: .85rem; }
.hub-card .table-wrap { margin: 0 -.9rem; padding: 0 .9rem; }
.hub-card table { border-left: 0; border-right: 0; border-radius: 0; }
.hub-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.hub .summary .value { color: var(--hub-primary); }
body.hub tbody tr.us td, body.hub tbody tr.us:nth-child(even) td { background: color-mix(in srgb, var(--hub-highlight) 22%, #fff); }
body.hub tbody tr.us td:first-child { box-shadow: inset 4px 0 0 var(--hub-accent); }
body.hub .chip.active { background: var(--hub-accent); border-color: var(--hub-accent); }
body.hub .btn.hub-btn, body.hub .btn { border-color: var(--hub-accent); color: var(--hub-accent); }
body.hub .btn:hover { background: var(--hub-accent); color: #fff; }
body.hub a { color: var(--hub-accent); }
body.hub .hub-tabs a { color: var(--ink); }
body.hub .hub-tabs a.active { color: var(--hub-accent); }
body.hub .season { color: var(--hub-primary); background: color-mix(in srgb, var(--hub-highlight) 35%, #fff); }
.hub-foot { text-align: center; padding: 1.5rem 1rem 2.5rem; }
@media (min-width: 640px) { .hub-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); } .hub-card .table-wrap { margin: 0; padding: 0; } .hub-card table { border: 1px solid var(--line); border-radius: 6px; } }
@media (min-width: 960px) { .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* admin: hubs */
.swatch { display: inline-block; width: 1.1rem; height: 1.1rem; border-radius: 4px; border: 1px solid var(--line); vertical-align: middle; margin-right: .2rem; }
form.stack.wide { max-width: 34rem; }
.color-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.color-row label { display: grid; gap: .25rem; font-size: .9rem; }
.color-row input[type=color] { width: 4rem; height: 2.4rem; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.preview { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; --hub-primary: #0b0b0b; --hub-accent: #dc3a2a; --hub-highlight: #f8d40a; }
.preview-band { background: var(--hub-primary); color: #fff; padding: .6rem .8rem; font-weight: 800; border-bottom: 4px solid var(--hub-accent); }
.preview-tabs { display: flex; background: #fff; border-bottom: 1px solid var(--line); }
.preview-tabs span { flex: 1; text-align: center; padding: .4rem; font-size: .85rem; font-weight: 600; border-bottom: 3px solid transparent; }
.preview-tabs span.active { color: var(--hub-accent); border-bottom-color: var(--hub-accent); }
.preview-row { padding: .5rem .8rem; background: color-mix(in srgb, var(--hub-highlight) 22%, #fff); box-shadow: inset 4px 0 0 var(--hub-accent); font-size: .9rem; }
.hub-filter { align-items: center; }
.filter-label { margin-right: .25rem; }

/* hub readability: calmer links in tables, roomier rows, two-line game cells */
body.hub table td a { color: var(--ink); }
body.hub table td a:hover { color: var(--hub-accent); }
body.hub .hub-card td, body.hub .hub-card th { padding: .6rem .55rem; }
body.hub .hub-card table.games { table-layout: fixed; width: 100%; }
body.hub .hub-card table.games td.when { width: 42%; }
body.hub .hub-card table.games td.logo-cell { width: 2.4rem; }
body.hub .hub-card table.games td.score { width: 4.6rem; }
body.hub table.games td.when { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.hub table.games td.when .day { font-weight: 600; }
body.hub table.games td.when .arena { display: block; line-height: 1.2; margin-top: .1rem; max-width: 8.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.hub table.games td.opp { white-space: normal; min-width: 0; overflow-wrap: anywhere; }
body.hub table.games td.score { text-align: right; white-space: nowrap; width: 1%; }
body.hub table.games td.score .muted { white-space: normal; display: inline-block; max-width: 5rem; line-height: 1.2; text-align: right; }
body.hub table.games td.when .arena { max-width: 8rem; }
body.hub .hub-card table.list td:first-child { min-width: 0; }
body.hub table.stats td.left { white-space: nowrap; }
body.hub table.group-games td.score-mid { text-align: center; }

/* next game + countdown */
.next-game { background: var(--hub-primary); color: #fff; border-radius: 8px; padding: .8rem 1rem; margin: 0 0 1rem; border-left: 5px solid var(--hub-accent); }
.next-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--hub-highlight); font-weight: 700; margin-bottom: .35rem; }
.next-main { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.next-who { flex: 1 1 12rem; min-width: 0; }
.next-opp { font-size: 1.15rem; font-weight: 700; }
.next-opp a { color: #fff; }
.next-when { color: rgba(255,255,255,.75); font-size: .88rem; }
.countdown { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cd-num { font-size: 1.5rem; font-weight: 800; color: #fff; }
.cd-unit { font-size: .8rem; color: var(--hub-highlight); margin-left: .1rem; margin-right: .3rem; font-weight: 600; }
@media (min-width: 640px) { .cd-num { font-size: 1.9rem; } .next-main { flex-wrap: nowrap; } }

/* video embeds */
.video-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.video-box { margin: 0; }
.video-box video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 6px; }
.video-row { padding: .25rem 0; border-bottom: 1px dashed var(--line); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.video-row:last-child { border-bottom: 0; }
@media (min-width: 960px) { .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* game page v2: full-width player with angle tabs, period cards, team stats tabs */
.player-wrap { margin: 0 0 1rem; }
.main-video { margin: 0; }
.main-video video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; display: block; }
.main-video figcaption { margin-top: .35rem; }
.media-tabs { margin: 0 0 .5rem; border-bottom: 0; }
.media-tabs a { border: 1px solid var(--line); border-radius: 999px; padding: .35rem .9rem; margin-right: .3rem; color: var(--ink); display: inline-flex; align-items: center; gap: .35rem; }
body.hub .media-tabs a.active { background: var(--hub-accent); border-color: var(--hub-accent); color: #fff; }
.periods { margin-bottom: .5rem; }
.period h2 { margin-bottom: .25rem; }
.sub-head { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: .6rem 0 .25rem; }
table.events td { vertical-align: middle; }
table.events td.clock { width: 1%; font-variant-numeric: tabular-nums; color: var(--muted); }
table.events td .main { font-weight: 600; }
table.events td.run { width: 1%; font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 0 .35rem; border-radius: 3px; background: var(--hub-accent); color: #fff; margin-left: .35rem; vertical-align: middle; }
.stats-tabs { margin-bottom: .75rem; }
@media (min-width: 960px) { .periods { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* scoreboard header on the game page */
.scoreboard { background: var(--hub-primary); color: #fff; border-radius: 10px; padding: 1rem .9rem .75rem; margin: 0 0 1rem; border-top: 5px solid var(--hub-accent); }
.sb-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; }
.sb-team { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3rem; min-width: 0; }
.sb-logo { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 10px; padding: 4px; }
.sb-name { font-weight: 700; font-size: 1rem; line-height: 1.2; }
.sb-name a { color: #fff; }
.sb-team.us .sb-name { color: var(--hub-highlight); }
.sb-side { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.55); }
.sb-center { text-align: center; padding: 0 .5rem; }
.sb-score { font-size: 2.6rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-score .sep { color: rgba(255,255,255,.45); font-weight: 400; padding: 0 .15rem; }
.sb-score.sb-time { font-size: 1.4rem; }
.sb-status { margin-top: .35rem; font-size: .8rem; color: rgba(255,255,255,.75); text-transform: uppercase; letter-spacing: .06em; }
.line-score { width: auto; margin: .9rem auto 0; background: transparent; border: 0; color: #fff; font-variant-numeric: tabular-nums; }
.line-score th, .line-score td { padding: .25rem .6rem; border-bottom: 0; background: transparent !important; color: #fff; text-align: center; }
.line-score th { font-size: .7rem; color: rgba(255,255,255,.6); }
.line-score td.team { text-align: left; white-space: nowrap; font-weight: 600; }
.line-score td.tot, .line-score th.tot { font-weight: 800; border-left: 1px solid rgba(255,255,255,.2); }
.line-score tr.us td { color: var(--hub-highlight); }
.line-score tbody tr:hover td { background: transparent; }
.sb-meta { text-align: center; color: rgba(255,255,255,.7); font-size: .85rem; margin-top: .75rem; }
@media (min-width: 640px) { .sb-team { flex-direction: row; gap: .8rem; text-align: left; } .sb-team.away { flex-direction: row-reverse; text-align: right; } .sb-side { display: none; } .sb-score { font-size: 3.4rem; } .sb-logo { width: 72px; height: 72px; } }
.line-score tr.us td:first-child { box-shadow: none; }
.joblog { white-space: pre-wrap; font-size: .8rem; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: .6rem; max-height: 16rem; overflow: auto; }
.clip-review.approved figcaption strong { color: var(--ok); }
.clip-review.rejected { opacity: .55; }

/* clip review: candidates assigned to a goal */
.clip-review.assigned { outline: 2px solid var(--ok); outline-offset: 2px; }
.clip-review.discarded { opacity: .45; }
.goals-review td form { margin: 0; }

/* admin videos: inline player per recording */
.inline-player { margin: .35rem 0; flex-basis: 100%; }
.inline-player summary { cursor: pointer; min-height: 2.5rem; display: flex; align-items: center; color: var(--accent, #1d4ed8); }
.inline-player video { width: 100%; max-width: 640px; background: #000; border-radius: 6px; }

.clip-caption { font-size: .9rem; line-height: 1.4; margin-top: .3rem; }
.clip-caption .chip { margin-left: .25rem; }

.highlight-list { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.highlight { margin: 0; }
.highlight h3 { margin: 0 0 .4rem; font-size: 1rem; }
.highlight .media-tabs a { padding: .3rem .75rem; min-height: 2.5rem; }
@media (min-width: 960px) { .highlight-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.media-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.media-tabs .tabs-label { margin-right: .35rem; white-space: nowrap; }

.section-title { margin: 1.25rem 0 .5rem; font-size: 1.15rem; }
.section-title .muted { font-weight: 400; margin-left: .35rem; }

/* highlights: one card per moment, themed like the scoreboard */
.highlight { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.hl-head { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; background: var(--hub-primary); color: #fff; border-top: 4px solid var(--hub-accent); }
.highlight.them .hl-head { background: #2b2f36; border-top-color: #6b7280; }
.hl-badge { flex: 0 0 auto; background: var(--hub-accent); color: #fff; font-weight: 800; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; padding: .3rem .55rem; border-radius: 6px; }
.highlight.them .hl-badge { background: #6b7280; }
.highlight.save .hl-badge { background: var(--hub-highlight); color: #111; }
.hl-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.hl-title strong { font-size: 1.02rem; overflow-wrap: anywhere; }
.highlight.us .hl-title strong { color: var(--hub-highlight); }
.hl-sub { font-size: .8rem; color: rgba(255,255,255,.75); }
.hl-logo { flex: 0 0 auto; width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; }
.highlight .main-video { margin: 0; }
.highlight .main-video video { border-radius: 0; }
.hl-tabs { padding: .55rem .75rem .7rem; margin: 0; }
.hl-single { padding: .5rem .75rem .7rem; margin: 0; }

.hl-download { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border: 1px solid var(--line); border-radius: 999px; color: var(--hub-accent); }
.hl-download:hover, .hl-download:focus { background: var(--hub-accent); color: #fff; }
.hl-single { display: flex; align-items: center; }

body.hub a.row-link { color: inherit; text-decoration: none; }
body.hub a.row-link:hover .day, body.hub a.row-link:hover { text-decoration: underline; }

.roster input[type=text] { width: 100%; max-width: 16rem; }
.roster .row-remove td { padding-top: 0; border-top: 0; }
.btn.small { min-height: 2.2rem; padding: .25rem .6rem; font-size: .85rem; }

.clip-review { scroll-margin-top: 4.5rem; }
#goals { scroll-margin-top: 4.5rem; }

/* ---------- Mobile review fixes (2026-09-25) ---------- */
/* five hub tabs fit a 390px phone; no cut-off tab */
.hub-tabs a { flex: 1 1 0; padding: .7rem .3rem; font-size: .84rem; }
@media (min-width: 640px) { .hub-tabs a { flex: 1 0 auto; padding: .7rem .8rem; font-size: .9rem; } }
/* grid children must be allowed to shrink or a wide table scrolls the whole page */
.boards > div, .hub-grid > * { min-width: 0; }
/* columns that only matter on a wide screen */
.mobile-only { display: inline; }
.desktop-only { display: none; }
@media (max-width: 639px) {
  table .optional { display: none; }
  table.games td.when .clock { display: block; }
}
@media (min-width: 640px) {
  .mobile-only { display: none; }
  .desktop-only { display: inline; }
  table td.mobile-only, table th.mobile-only { display: none; }
  table td.desktop-only, table th.desktop-only { display: table-cell; }
}
@media (max-width: 639px) {
  table td.desktop-only, table th.desktop-only { display: none; }
  table td.mobile-only, table th.mobile-only { display: table-cell; }
}
/* camera tabs stay on one line */
.media-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.media-tabs .tabs-label { flex: 0 0 auto; }

/* phones: game lists keep the score on screen */
@media (max-width: 639px) {
  body.hub table.list td:first-child { min-width: 0; }
  body.hub table.games td, body.hub table.games th { padding-left: .4rem; padding-right: .4rem; }
  body.hub table.games td.when { white-space: normal; }
}

@media (max-width: 639px) {
  body.hub table.stats th.left, body.hub table.stats td.left { min-width: 6.5rem; }
  body.hub table.stats th, body.hub table.stats td { padding-left: .4rem; padding-right: .4rem; }
  body.hub table.leaders td.left { min-width: 6rem; }
}

/* highlight cards: label + two tabs + download fit a 390px phone */
@media (max-width: 639px) {
  .hl-tabs { flex-wrap: nowrap; gap: .25rem; padding: .5rem .5rem .6rem; }
  .hl-tabs .tabs-label { display: none; }
  .hl-tabs a { padding: .3rem .6rem; font-size: .85rem; }
  .hl-download { width: 2.25rem; height: 2.25rem; flex: 0 0 auto; }
}

.login-note { margin: .4rem 0 0; text-align: center; }

/* brand */
.brand { display: inline-flex; align-items: center; gap: .5rem; }
.brand img { border-radius: 6px; }
.login-mark { display: block; margin: 0 auto .25rem; border-radius: 16px; }
.login-card h1 { text-align: center; }
.site-link { display: inline-flex; align-items: center; gap: .4rem; }
.site-link img { border-radius: 5px; }
