/* picks.hockey: every matchup is a sheet of ice inside a dark arena.
   Big Shoulders Display carries the scoreboard numerals; Barlow does the rest. */

@font-face {
  font-family: "Big Shoulders Display";
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url("../fonts/big-shoulders-display.e1ffd6608051.woff2") format("woff2");
}
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/barlow-400.81419bf5abb5.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/barlow-500.8e986e86d57e.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-600.a1e2a2d7d4c0.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --arena: #13233a;       /* the stands */
  --arena-deep: #0e1a2c;  /* top bar, scoreboard */
  --arena-ink: #e8eef5;
  --arena-muted: #8fa3b8;
  --arena-line: rgb(255 255 255 / 0.08);
  --ice: #f4f8fb;
  --ice-shade: #e7eef5;
  --ice-edge: #d3dfea;    /* the boards */
  --snow: #ffffff;
  --ink: #0c1a2b;
  --ink-soft: #55677a;
  --blue-line: #1e4fae;
  --blue-light: #6ea3ff;
  --blue-tint: #e3ecfa;
  --red-line: #c8102e;
  --goal: #178a4a;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rink: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.4;
  background: var(--arena);
  color: var(--arena-ink);
}
a { color: var(--blue-light); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
b { font-weight: 600; }
:focus-visible { outline: 3px solid var(--blue-light); outline-offset: 2px; }
.empty, .footnote { color: var(--arena-muted); font-size: 0.9rem; }
.empty { text-align: center; padding: 2.5rem 0; }
.footnote { margin: 0.9rem 2px 0; }
button.link { background: none; border: 0; padding: 0; color: var(--blue-light); cursor: pointer; }
button.link:hover { text-decoration: underline; }

/* --- Arena chrome ------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 20px;
  height: 52px; padding: 0 16px;
  background: var(--arena-deep);
  border-bottom: 1px solid var(--arena-line);
}
.brand { font-family: var(--display); font-weight: 800; font-size: 1.55rem; letter-spacing: 0.01em; color: var(--snow); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 18px; height: 100%; }
.nav a { display: inline-flex; align-items: center; color: var(--arena-muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav a[aria-current="page"] { color: var(--snow); border-bottom-color: var(--blue-light); }
.nav a:hover { text-decoration: none; color: var(--arena-ink); }
.whoami { display: flex; align-items: center; gap: 10px; margin: 0 0 0 auto; font-size: 0.85rem; color: var(--arena-muted); white-space: nowrap; }
.container { max-width: 640px; margin: 0 auto; padding: 14px 16px 5rem; }

/* --- Week header --------------------------------------------------------- */
.week-nav { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
.week-nav h1 {
  flex: 1; margin: 0; text-align: center;
  font-family: var(--display); font-weight: 800; font-size: 2.1rem; line-height: 1; letter-spacing: 0.01em;
  color: var(--snow);
}
.week-nav h1 small { display: block; margin-top: 5px; font-family: var(--body); font-weight: 500; font-size: 0.82rem; color: var(--arena-muted); min-height: 1.1em; }
.nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: rgb(255 255 255 / 0.06); border: 1px solid var(--arena-line);
  color: var(--arena-ink); font-size: 1.5rem; line-height: 1;
}
.nav-btn:hover { text-decoration: none; background: rgb(255 255 255 / 0.1); }
.nav-btn[aria-disabled="true"] { opacity: 0.25; }

/* --- Scoreboard (weekly budget) ------------------------------------------ */
.scoreboard {
  position: sticky; top: 60px; z-index: 5;
  display: grid; grid-template-columns: auto 1fr auto; align-items: end;
  padding: 10px 16px 12px; margin-bottom: 6px;
  background: var(--arena-deep); border: 1px solid var(--arena-line); border-radius: 12px;
  box-shadow: 0 10px 24px -14px rgb(0 0 0 / 0.8);
}
.sb-main { grid-column: 1; }
.sb-side { grid-column: 3; text-align: right; }
.sb-num { font-family: var(--display); font-weight: 800; font-size: 2.6rem; line-height: 0.85; color: var(--snow); font-variant-numeric: tabular-nums; }
.sb-num.small { font-size: 1.7rem; }
.sb-label { display: block; margin-top: 4px; font-size: 0.78rem; color: var(--arena-muted); }
.sb-bar { grid-column: 1 / -1; height: 6px; margin-top: 10px; border-radius: 3px; background: rgb(255 255 255 / 0.1); overflow: hidden; }
.sb-fill { height: 100%; border-radius: 3px; background: var(--ice); transition: width 0.3s ease; }

/* --- Days ---------------------------------------------------------------- */
.day {
  display: flex; align-items: baseline; gap: 8px;
  margin: 24px 2px 10px;
  font-family: var(--display); font-weight: 800; font-size: 1.55rem; line-height: 1; letter-spacing: 0.01em;
  color: var(--snow);
}
.day .day-date { color: var(--arena-muted); font-weight: 700; }
.day .day-count { margin-left: auto; font-family: var(--body); font-weight: 500; font-size: 0.8rem; color: var(--arena-muted); }

/* --- A sheet of ice ------------------------------------------------------- */
.game {
  background: var(--ice); color: var(--ink);
  border-radius: var(--rink);
  margin-bottom: 10px; overflow: hidden;
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.4);
}
.game.is-void { opacity: 0.55; }
.rink-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 0; font-size: 0.82rem; color: var(--ink-soft); font-weight: 500; }
.rink-top time { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.status { display: inline-flex; align-items: center; gap: 6px; }
.is-final .status { color: var(--ink); font-weight: 600; }
.is-live .status { color: var(--red-line); font-weight: 600; }
.is-void .status { color: var(--red-line); font-weight: 600; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--red-line); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.faceoff { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2px; padding: 4px 8px 8px; }
.side {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 6px 12px; min-width: 0;
  background: transparent; border: 0; border-radius: 12px;
  cursor: pointer; transition: background 0.12s;
}
.side:not(:disabled):hover { background: var(--ice-shade); }
.side:disabled { cursor: default; }
.side:focus-visible { outline-color: var(--blue-line); }
.side .logo { width: 56px; height: 56px; }
.side .abbrev { font-family: var(--display); font-weight: 800; font-size: 1.6rem; line-height: 1; letter-spacing: 0.03em; color: var(--ink); margin-top: 2px; }
.side .name { font-size: 0.78rem; color: var(--ink-soft); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side.picked { background: var(--blue-tint); }
.side.picked .abbrev { color: var(--blue-line); }
.side.picked::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 6px; height: 3px; border-radius: 2px; background: var(--blue-line); }
.side .record { font-size: 0.74rem; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; white-space: nowrap; }
.side .streak { margin-left: 6px; padding-left: 6px; border-left: 1px solid var(--ice-edge); font-weight: 700; }
.side .streak.is-w { color: var(--goal); }
.side .streak.is-l, .side .streak.is-ot { color: var(--red-line); }
.side.lost { opacity: 0.45; }

.board { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 76px; }
.board .score { display: flex; align-items: center; gap: 8px; }
.board .series { font-size: 0.72rem; font-weight: 500; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.board .num { font-family: var(--display); font-weight: 800; font-size: 2.6rem; line-height: 1; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.board .num.lead { color: var(--ink); }
.board .dash { width: 10px; height: 3px; border-radius: 2px; background: var(--ice-edge); }
.board .dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--ice-edge);
}
.board .at { font-size: 0.8rem; font-weight: 500; color: var(--ink-soft); }

.stake-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px 12px; border-top: 1px solid var(--ice-edge); }
.stepper { display: flex; align-items: center; background: var(--snow); border: 1px solid var(--ice-edge); border-radius: 10px; padding: 2px; }
.step { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.step:not(:disabled):hover { background: var(--ice-shade); }
.step:disabled { opacity: 0.3; cursor: default; }
.step.quick { width: auto; padding: 0 9px; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.02em; }
.stepper .divider { width: 1px; height: 22px; margin: 0 3px; background: var(--ice-edge); }
.stake-num { font-family: var(--display); font-weight: 800; font-size: 1.7rem; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stepper .stake-num { min-width: 34px; text-align: center; }
.stake-text { font-size: 0.95rem; color: var(--ink-soft); display: inline-flex; align-items: baseline; gap: 5px; }
.stake-text b { color: var(--ink); }
button.remove { margin-left: auto; font-size: 0.85rem; color: var(--ink-soft); }
button.remove:hover { color: var(--red-line); }
.result { margin-left: auto; font-family: var(--display); font-weight: 800; font-size: 1.7rem; line-height: 1; font-variant-numeric: tabular-nums; }
.result.win { color: var(--goal); }
.result.loss { color: var(--red-line); }
.result.void, .result.pending { font-family: var(--body); font-weight: 500; font-size: 0.85rem; color: var(--ink-soft); }
.error { margin: 0; padding: 0 14px 12px; font-size: 0.88rem; font-weight: 500; color: var(--red-line); }

.others { list-style: none; margin: 0; padding: 9px 14px 12px; display: flex; flex-wrap: wrap; gap: 5px 16px; border-top: 1px dashed var(--ice-edge); font-size: 0.82rem; color: var(--ink-soft); }
.others .who { color: var(--ink); font-weight: 500; }
.others .amt { font-weight: 600; color: var(--ink); }
.others li.win .amt { color: var(--goal); }
.others li.loss .amt { color: var(--red-line); text-decoration: line-through; }

/* --- Standings ------------------------------------------------------------- */
.week-picker { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 10px; scrollbar-width: thin; }
.week-picker a { flex: none; padding: 6px 12px; border-radius: 999px; background: rgb(255 255 255 / 0.06); border: 1px solid var(--arena-line); color: var(--arena-ink); font-size: 0.85rem; font-weight: 500; }
.week-picker a[aria-current="page"] { background: var(--ice); color: var(--ink); border-color: var(--ice); }
.week-picker a:hover { text-decoration: none; }
.standings { width: 100%; border-collapse: collapse; background: var(--ice); color: var(--ink); border-radius: var(--rink); overflow: hidden; }
.standings th { padding: 10px 12px; text-align: left; font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); border-bottom: 1px solid var(--ice-edge); }
.standings td { padding: 12px; border-bottom: 1px solid var(--ice-edge); }
.standings tr:last-child td { border-bottom: 0; }
.standings .num { text-align: right; font-variant-numeric: tabular-nums; }
.standings .rank { width: 2.4rem; color: var(--ink-soft); font-family: var(--display); font-weight: 700; font-size: 1.2rem; }
.standings .name { font-weight: 500; }
.standings .points { font-family: var(--display); font-weight: 800; font-size: 1.6rem; line-height: 1; }
.standings .points.win { color: var(--goal); }
.standings .points.loss { color: var(--red-line); }
.standings .weeks { font-family: var(--display); font-weight: 800; font-size: 1.6rem; line-height: 1; }
.standings .weeks ~ .points { font-size: 1.15rem; }  /* the season: weeks won decide it, points only break ties */
.standings .soft { color: var(--ink-soft); }
.standings tr.me td { background: var(--blue-tint); }
.standings .empty { color: var(--ink-soft); }

/* --- Forms (login / join) ---------------------------------------------------- */
.card { background: var(--ice); color: var(--ink); border-radius: var(--rink); padding: 22px; }
.form-card { max-width: 400px; margin: 2.5rem auto; }
.form-card h1 { margin: 0 0 16px; font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1; }
.form-card label { display: block; margin-bottom: 14px; font-weight: 500; font-size: 0.9rem; }
.form-card input { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font: inherit; border: 1px solid var(--ice-edge); border-radius: 8px; background: var(--snow); color: var(--ink); }
.form-card input:focus-visible { outline-color: var(--blue-line); }
.form-card small { display: block; margin-top: 4px; font-weight: 400; color: var(--ink-soft); }
.form-card .error { padding: 0; margin-top: 4px; }
.form-card .muted { color: var(--ink-soft); font-size: 0.9rem; }
.form-card a { color: var(--blue-line); }
button.primary { width: 100%; padding: 12px; border: 0; border-radius: 8px; background: var(--blue-line); color: var(--snow); font-weight: 600; font-size: 1rem; cursor: pointer; }
button.primary:hover { background: #1a44a0; }

/* --- Behaviour ----------------------------------------------------------------- */
.htmx-request .side, .htmx-request .step { opacity: 0.6; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
  .sb-fill, .side { transition: none; }
}
@media (max-width: 400px) {
  .stepper ~ .stake-text { display: none; }  /* no room beside +5/Max; the picked side is lit up right above */
  .side .logo { width: 48px; height: 48px; }
  .side .abbrev { font-size: 1.4rem; }
  .board .num { font-size: 2.2rem; }
  .nav { gap: 14px; }
  .whoami span { display: none; }
}

/* --- Account & notices ----------------------------------------------------- */
.flash { background: var(--ice); color: var(--ink); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; font-weight: 500; }
.form-card.account { margin: 0 0 14px; max-width: none; }
.form-card.account h2 { margin: 0 0 10px; font-family: var(--display); font-weight: 800; font-size: 1.4rem; line-height: 1; }
.form-card.account .primary { width: auto; padding: 10px 18px; }
.form-card.account form + form { margin-top: 8px; }
.whoami a { color: var(--arena-muted); }
.whoami a:hover { color: var(--arena-ink); text-decoration: none; }
/* Inside Telegram the WebView has its own chrome; keep ours minimal. */
.in-telegram .whoami { display: none; }
