/* Goalie Cam website. Colour tokens match the Studio (goalie_cam/static/style.css), light or dark by the device. */
:root {
  --bg: #eef2f5; --panel: #ffffff; --line: #d3dce4; --text: #14202b; --muted: #5d6c7b;
  --accent: #1f4fbf; --save: #1f8a52; --goal: #c8102e; --miss: #c77d00; --faceoff: #1a8a8a; --play: #7a4fd6;
  --on-accent: #ffffff; --hover: #e3eaf0; --net: #f7f9fb; --selected: #d6e4fa;
  --ok-bg: #dff3e7; --ok-line: #9fd3b4; --ok-text: #14603a; --err-bg: #fde4e7; --err-line: #e8a3ab; --err-text: #8f0c22;
  --note-bg: #fff4d6; --note-line: #e3c36a; --note-text: #6b4a00;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1520; --panel: #152030; --line: #263446; --text: #e8eef4; --muted: #8b9bad;
    --accent: #5b8cff; --save: #3ccf86; --goal: #ff4d5e; --miss: #f2a93b; --faceoff: #4fc3c3; --play: #b18cff;
    --on-accent: #06101c; --hover: #1d2c40; --net: #101a27; --selected: #1f3550;
    --ok-bg: #0f2a1c; --ok-line: #1f5a3a; --ok-text: #9be3bb; --err-bg: #3a1214; --err-line: #7a2a2e; --err-text: #ffb4b6;
    --note-bg: #2a2210; --note-line: #5a4716; --note-text: #f5d68a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; overflow-wrap: anywhere; }
h2 { font-size: 15px; margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 13px; }

main { max-width: 980px; margin: 0 auto; padding: 18px 18px 50px; display: grid; gap: 18px; }
main.narrow { max-width: 440px; padding-top: 8vh; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; min-width: 0; }

/* Forms and buttons */
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
form { display: grid; gap: 12px; }
button, .btn { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text);
               border-radius: 8px; padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
button:hover, .btn:hover { background: var(--hover); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary:hover, .btn.primary:hover { filter: brightness(1.08); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
button.danger { color: var(--goal); }
button:disabled { opacity: .55; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }
.msg { border-radius: 8px; padding: 10px 12px; font-size: 14px; border: 1px solid; }
.msg.err { background: var(--err-bg); border-color: var(--err-line); color: var(--err-text); }
.msg.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-text); }
.msg.note { background: var(--note-bg); border-color: var(--note-line); color: var(--note-text); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.empty { color: var(--muted); padding: 20px 0; text-align: center; }
.pill { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--hover); color: var(--muted); white-space: nowrap; }
.pill.pending { background: var(--note-bg); color: var(--note-text); }

/* Lists of games / teams / members */
.list { display: grid; }
.list > * { display: flex; gap: 12px; align-items: center; padding: 12px 6px; border-top: 1px solid var(--line); color: var(--text); min-width: 0; }
.list > *:first-child { border-top: 0; }
a.item:hover { background: var(--hover); text-decoration: none; border-radius: 8px; }
.list .grow b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.item img { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; }

/* Game page (as the Phase 1 share page) */
.head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.head .who { flex: 1 1 260px; min-width: 0; }
.result { font-weight: 700; padding: 4px 12px; border-radius: 999px; background: var(--hover); font-variant-numeric: tabular-nums; }
.result.win { background: var(--save); color: var(--on-accent); }
.result.loss { background: var(--goal); color: var(--on-accent); }
video { display: block; width: 100%; max-height: 72vh; background: #000; border-radius: 10px; aspect-ratio: 16 / 9; }
.reels { display: grid; gap: 4px; margin-top: 12px; }
.reel-row { display: flex; gap: 6px; align-items: center; }
.reel { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; text-align: left; flex: 1; min-width: 0;
        background: none; border: 0; border-radius: 8px; padding: 9px 10px; color: var(--text); font: inherit; cursor: pointer; }
.reel:hover { background: var(--hover); }
.reel[aria-current=true] { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.reel b { font-weight: 600; min-width: 0; }
.reel span { white-space: nowrap; }
.dl { font-size: 13px; padding: 5px 10px; white-space: nowrap; }
.goalie { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; align-items: center; }
.nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.num { text-align: center; padding: 10px 4px; border-radius: 10px; background: var(--hover); }
.num b { display: block; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.num small { color: var(--muted); font-size: 12px; }
.net { width: 100%; height: auto; display: block; }
.net .frame { fill: var(--net); stroke: var(--goal); stroke-width: 4; }
.net .mesh { stroke: var(--line); stroke-width: 1; }
.net circle { stroke: var(--panel); stroke-width: 2; }
.net .save { fill: var(--save); } .net .goal { fill: var(--goal); }
.net circle:hover { stroke: var(--text); }
.key { display: flex; gap: 14px; justify-content: center; margin-top: 6px; flex-wrap: wrap; }
.key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* Review: one clip at a time */
.review { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.step { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.step .now { flex: 1; text-align: center; font-weight: 600; min-width: 0; }
.tags { display: grid; gap: 8px; margin-top: 10px; }
.tags .shot { font-size: 14px; padding: 8px 10px; border-radius: 8px; background: var(--hover); }
.clips { display: grid; gap: 2px; max-height: 560px; overflow: auto; position: relative; }
.clip { display: flex; gap: 10px; align-items: center; text-align: left; width: 100%; background: none; border: 0; border-radius: 8px;
        padding: 8px 10px; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.clip:hover { background: var(--hover); }
.clip[aria-current=true] { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.clip .when { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 64px; }
.clip i { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.clip i.save { background: var(--save); } .clip i.goal { background: var(--goal); } .clip i.miss { background: var(--miss); }
.clip i.play { background: var(--play); } .clip i.faceoff { background: var(--faceoff); }

/* Teams */
.invite-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: end; }
.copy { display: flex; gap: 8px; }
.copy input { font-size: 13px; }
.member-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.member-actions select { width: auto; padding: 5px 8px; font-size: 13px; }
.member-actions button { padding: 5px 10px; font-size: 13px; }

footer { text-align: center; color: var(--muted); font-size: 12px; }

@media (max-width: 760px) {
  .review { grid-template-columns: minmax(0, 1fr); }
  .clips { max-height: 340px; }
}
@media (max-width: 640px) {
  main { padding: 14px 12px 40px; gap: 14px; }
  .card { padding: 14px; }
  .goalie { grid-template-columns: minmax(0, 1fr); }
  .num b { font-size: 20px; }
  .invite-form { grid-template-columns: minmax(0, 1fr) auto; }
  .invite-form label:first-child { grid-column: 1 / -1; }
  .list > .member { flex-wrap: wrap; }
  .member .member-actions { width: 100%; justify-content: flex-start; }
}
#hint .msg { margin-bottom: 12px; }

/* Goalie profile (My profile), copied from the desktop's goalie form */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex: none;
          object-fit: cover; background: var(--c, var(--line)); color: var(--on-accent); font-weight: 700; vertical-align: middle; }
.goalie-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
.goalie-form .photo { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.goalie-form input[type=color] { width: 48px; height: 34px; padding: 2px; }
.seg-radio { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-radio label { padding: 6px 12px; cursor: pointer; color: var(--text); }
.seg-radio input { display: none; }
.seg-radio label:has(input:checked) { background: var(--accent); color: var(--on-accent); font-weight: 600; }
@media (max-width: 800px) { .goalie-form { grid-template-columns: minmax(0, 1fr); } }
.totals { display: flex; gap: 28px; flex-wrap: wrap; }
.totals b { display: block; font-size: 22px; }
table.games { width: 100%; border-collapse: collapse; font-size: 14px; }
table.games th, table.games td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.games th { color: var(--muted); font-weight: 600; font-size: 13px; }

/* Home pages (home.html, team.html; their pieces are in home-bits.js) */
main.hb-page { max-width: 1140px; padding: 28px 36px 60px; gap: 22px; }
.hb-i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hb-hello { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hb-hello:empty { display: none; }
.hb-face { width: 56px; height: 56px; font-size: 21px; --c: var(--accent); }
.hb-who { flex: 1 1 260px; min-width: 0; }
.hb-who h1 { font-size: 24px; }
.hb-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 3px; color: var(--muted); }
.hb-sub p, .hb-who > p { margin: 0; }
.hb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
select.hb-season { width: auto; padding: 3px 8px; font-size: 13px; background: var(--panel); }
.hb-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.hb-stack { display: grid; gap: 22px; min-width: 0; }
.hb-stack:not(:has(> .card:not([hidden]))) { display: none; }
.hb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.hb-head h2 { flex: 1; margin: 0; }
.hb-quiet { font-size: 13px; padding: 4px 8px; border-radius: 8px; }
.hb-quiet:hover { background: var(--hover); text-decoration: none; }
.hb-small { font-size: 13px; padding: 5px 12px; }

/* Stat tiles */
.hb-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.hb-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 12px; position: relative; min-width: 0; }
.hb-label { font-size: 13px; color: var(--muted); }
.hb-val { font-size: 28px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.hb-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hb-note b { font-weight: 600; }
.hb-up { color: var(--save); } .hb-down { color: var(--goal); }
.hb-spark { position: absolute; right: 16px; top: 38px; width: 64px; height: 24px; overflow: visible; }
.hb-spark path { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .5; }
.hb-spark circle { fill: var(--text); }

/* Latest game */
.hb-latest { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; }
.hb-poster { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden;
  background: var(--net); border: 1px solid var(--line); }
.hb-poster svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hb-poster .hb-frame { fill: none; stroke: var(--goal); stroke-width: 2.5; stroke-linejoin: round; }
.hb-poster .hb-mesh { stroke: var(--line); stroke-width: .8; }
.hb-play { position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--text) 75%, transparent); color: var(--panel); transition: transform .15s; }
.hb-poster:hover .hb-play { transform: scale(1.08); }
.hb-game { display: grid; gap: 8px; align-content: start; min-width: 0; }
.hb-score { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hb-score b { font-size: 17px; overflow-wrap: anywhere; }
.hb-score .result { font-size: 13px; padding: 2px 10px; }
.hb-line { display: flex; gap: 18px; flex-wrap: wrap; }
.hb-line b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.hb-line small { color: var(--muted); font-size: 12px; }
.hb-reels { display: grid; gap: 6px; }
.hb-reel { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line);
  color: var(--text); font-size: 14px; min-width: 0; }
.hb-reel:hover { background: var(--hover); text-decoration: none; }
.hb-reel .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-sw { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--play); }
.hb-reel .hb-i { color: var(--muted); }

/* Save % chart */
.hb-seg { display: inline-flex; background: var(--hover); border-radius: 8px; padding: 3px; }
.hb-seg button { border: 0; background: none; padding: 4px 10px; font-size: 13px; border-radius: 6px; color: var(--muted); }
.hb-seg button[aria-pressed=true] { background: var(--panel); color: var(--text); font-weight: 600; }
.hb-chart { position: relative; }
.hb-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.hb-grid line { stroke: var(--line); stroke-width: 1; }
.hb-grid text { fill: var(--muted); font-size: 11px; }
.hb-avg { stroke: var(--muted); stroke-dasharray: 4 4; stroke-width: 1.5; }
.hb-path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.hb-pt { stroke: var(--panel); stroke-width: 2; fill: var(--muted); }
.hb-pt.win { fill: var(--save); } .hb-pt.loss { fill: var(--goal); }
.hb-hit { fill: transparent; cursor: pointer; }
.hb-cross { stroke: var(--muted); stroke-width: 1; }
.hb-tip { position: absolute; pointer-events: none; background: var(--text); color: var(--panel); font-size: 12px; padding: 7px 10px;
  border-radius: 8px; white-space: nowrap; transform: translate(-50%, -100%); z-index: 5; }
.hb-tip b { display: block; font-size: 13px; }
.hb-key { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.hb-key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; background: var(--muted); }
.hb-key i.win { background: var(--save); } .hb-key i.loss { background: var(--goal); }
.hb-key i.hb-dash { width: 16px; height: 0; border-radius: 0; border-top: 2px dashed var(--muted); background: none; vertical-align: 3px; }

/* For you */
.hb-feed { display: grid; }
.hb-item { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); min-width: 0; }
.hb-item:first-child { border-top: 0; padding-top: 0; }
.hb-item b { display: block; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.hb-item .muted { display: block; overflow-wrap: anywhere; }
.hb-feed .empty { padding: 10px 0; }

@media (max-width: 900px) {
  main.hb-page { padding: 18px 14px 50px; gap: 16px; }
  .hb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hb-cols, .hb-latest { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) { .hb-spark { display: none; } }
@media (max-width: 640px) {
  .hb-grid text { font-size: 16px; }
  .hb-poster { aspect-ratio: 21 / 9; }
}
.hb-page > div:empty { display: none; }
