@font-face { font-family: Manrope; src: url(fonts/manrope-cyr.woff2) format('woff2'); font-weight: 200 800; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Manrope; src: url(fonts/manrope-lat.woff2) format('woff2'); font-weight: 200 800; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Unbounded; src: url(fonts/unbounded-cyr.woff2) format('woff2'); font-weight: 200 900; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Unbounded; src: url(fonts/unbounded-lat.woff2) format('woff2'); font-weight: 200 900; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #070c18;
  --panel: rgba(255, 255, 255, .04);
  --panel-2: rgba(255, 255, 255, .07);
  --line: rgba(255, 255, 255, .09);
  --text: #e8eefc;
  --muted: #8e9ab8;
  --home: #ff4c63;
  --away: #4fb0ff;
  --win: #3ccf8e;
  --loss: #ff5d6c;
  --ot: #f5b94a;
  --radius: 16px;
  --head: rgba(10, 18, 34, .88);
  --dialog: #0f1830;
  --chip-on-text: #0a1222;
  --glow-a: rgba(255, 76, 99, .13);
  --glow-b: rgba(79, 176, 255, .14);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f5fa;
  --panel: #ffffff;
  --panel-2: #eef1f7;
  --line: rgba(10, 20, 40, .1);
  --text: #121a2c;
  --muted: #5f6b85;
  --home: #d91f3a;
  --away: #1f78d1;
  --win: #1aa56a;
  --loss: #e03a4b;
  --ot: #d68f12;
  --head: rgba(255, 255, 255, .9);
  --dialog: #ffffff;
  --chip-on-text: #ffffff;
  --glow-a: rgba(217, 31, 58, .08);
  --glow-b: rgba(31, 120, 209, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 500px at 15% -10%, var(--glow-a), transparent 60%),
              radial-gradient(1200px 500px at 85% -10%, var(--glow-b), transparent 60%), var(--bg);
  background-repeat: no-repeat; background-color: var(--bg);
  color: var(--text); font: 14px/1.45 Manrope, system-ui, sans-serif; min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
.muted { color: var(--muted); }
h2, h3 { font-family: Unbounded, Manrope, sans-serif; font-weight: 600; margin: 0; }
h3 { font-size: 13px; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 22px; min-height: 60px;
  padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  background: var(--head); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: Unbounded; font-weight: 700; font-size: 15px; white-space: nowrap; }
.brand img { width: 30px; height: 30px; }
.tabs { display: flex; gap: 4px; }
.tabs button {
  background: none; border: 0; padding: 8px 14px; border-radius: 10px; cursor: pointer; color: var(--muted); font-weight: 700;
}
.tabs button:hover { color: var(--text); background: var(--panel); }
.tabs button.on { color: var(--text); background: var(--panel-2); }
.ghost.icon { width: 36px; padding: 7px 0; }
.tabs i { font-style: normal; font-size: 11px; background: var(--panel-2); border-radius: 8px; padding: 1px 6px; margin-left: 2px; }
.tabs i:empty { display: none; }
.actions { margin-left: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.actions .muted { font-size: 12px; }
.ghost, .primary {
  border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 7px 12px; cursor: pointer; font-weight: 700;
}
.ghost:hover { background: var(--panel-2); }
.primary { background: linear-gradient(90deg, var(--home), #c42b6a); border: 0; color: #fff; }
#refresh.spin { opacity: .6; pointer-events: none; }

.errors { margin: 12px 20px 0; padding: 10px 14px; border-radius: 12px; background: rgba(255, 93, 108, .12); border: 1px solid rgba(255, 93, 108, .35); font-size: 13px; }

main { padding: 20px; }
.foot { text-align: center; font-size: 12px; padding: 4px 16px 28px; }
.tab { display: none; max-width: 1280px; margin: 0 auto; }
.tab.on { display: block; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; }
.grid2 > *, .grid3 > * { min-width: 0; } /* let wide tables scroll inside the card */
.stack { display: flex; flex-direction: column; gap: 16px; }
.loading { padding: 60px; text-align: center; color: var(--muted); }

/* ---------- match hero ---------- */
.hero {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding: 26px 24px;
  background: linear-gradient(100deg, rgba(255, 76, 99, .16), rgba(255, 255, 255, .03) 40%, rgba(255, 255, 255, .03) 60%, rgba(79, 176, 255, .16));
}
.side { display: flex; align-items: center; gap: 18px; }
.side.right { flex-direction: row-reverse; text-align: right; }
.logo { width: 96px; height: 96px; object-fit: contain; border-radius: 20px; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .5)); }
.logo.sm { width: 22px; height: 22px; border-radius: 5px; filter: none; vertical-align: -6px; }
.logo.md { width: 40px; height: 40px; border-radius: 10px; }
.side h2 { font-size: 26px; }
.side .place { font-size: 12px; font-weight: 700; margin-top: 6px; color: var(--muted); }
.side .place b { color: var(--text); }
.center { text-align: center; }
.center .when { font-family: Unbounded; font-size: 34px; font-weight: 700; }
.center .day { font-weight: 700; margin-top: 2px; }
.center .count {
  display: inline-block; margin-top: 10px; padding: 5px 12px; border-radius: 20px; font-weight: 800; font-size: 13px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.center .count.live { background: rgba(255, 76, 99, .25); border-color: var(--home); }
.center .meta { margin-top: 8px; font-size: 12px; color: var(--muted); }
.center a { color: var(--away); text-decoration: none; font-weight: 700; font-size: 12px; }

/* ---------- comparison ---------- */
.cmp { display: grid; grid-template-columns: 70px 1fr 160px 1fr 70px; align-items: center; row-gap: 10px; column-gap: 10px; }
.cmp .v { font-weight: 800; font-size: 15px; }
.cmp .v.l { text-align: right; }
.cmp .lbl { text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; }
.bar { height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; display: flex; }
.bar.l { justify-content: flex-end; }
.bar span { display: block; height: 100%; border-radius: 4px; }
.bar.l span { background: var(--home); }
.bar.r span { background: var(--away); }
.better { color: var(--win); }

/* ---------- form, games ---------- */
.dots { display: flex; gap: 6px; }
.dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.dot.win { background: var(--win); }
.dot.lose, .dot.loss { background: var(--loss); }
.dot.draw, .dot.ot { background: var(--ot); }
.games { width: 100%; border-collapse: collapse; }
.games td { padding: 7px 6px; border-top: 1px solid var(--line); white-space: nowrap; }
.games tr:first-child td { border-top: 0; }
.games .d { color: var(--muted); font-size: 12px; width: 92px; }
.games .s { font-weight: 800; text-align: right; width: 78px; }
.games .s a { text-decoration: none; }
.games .w { width: 8px; padding: 0; }
.games .w i { display: block; width: 4px; height: 22px; border-radius: 2px; }
.games .w i.win { background: var(--win); }
.games .w i.loss { background: var(--loss); }
.games .o { overflow: hidden; text-overflow: ellipsis; max-width: 1px; width: 100%; }
.games .o small { color: var(--muted); margin-left: 6px; }
.formrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.formrow b { font-family: Unbounded; font-size: 13px; }

.h2h { display: flex; flex-direction: column; gap: 8px; }
.h2h div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--panel); }
.h2h b { font-family: Unbounded; }

/* leaders */
.leaders { width: 100%; border-collapse: collapse; font-size: 13px; }
.leaders th { text-align: right; color: var(--muted); font-size: 11px; font-weight: 700; padding: 0 4px 6px; }
.leaders th:first-child, .leaders td:first-child { text-align: left; }
.leaders td { padding: 6px 4px; border-top: 1px solid var(--line); text-align: right; }
.leaders td.pts { font-weight: 800; }
.leaders .num { color: var(--muted); display: inline-block; width: 26px; }

/* ---------- news ---------- */
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--panel); border-radius: 20px; padding: 6px 13px; cursor: pointer; font-weight: 700; font-size: 13px;
}
.chip.on { background: var(--text); color: var(--chip-on-text); }
.chip i { font-style: normal; opacity: .6; margin-left: 4px; }
.check { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; }
#news-search {
  margin-left: auto; width: 260px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; outline: none;
}
#news-search:focus { border-color: var(--away); }
.news { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; text-decoration: none; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
}
.item:hover { background: var(--panel-2); }
.item .t { font-weight: 800; font-size: 15px; line-height: 1.35; }
.item .d { color: var(--muted); font-size: 13px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .m { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 12px; color: var(--muted); font-weight: 700; }
.item img { width: 120px; height: 80px; object-fit: cover; border-radius: 10px; }
.tag { font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 6px; text-transform: uppercase; letter-spacing: .03em; }
.tag.home { background: rgba(255, 76, 99, .2); color: var(--home); }
.tag.away { background: rgba(79, 176, 255, .2); color: var(--away); }
.tag.both { background: rgba(245, 185, 74, .2); color: var(--ot); }
.tag.bets { background: var(--panel-2); color: var(--muted); }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.mini .item { padding: 10px 12px; }
.mini .item .t { font-size: 14px; }

/* ---------- rosters ---------- */
.teamhead { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.teamhead h2 { font-size: 20px; }
.teamhead .muted { font-size: 12px; font-weight: 700; }
.roster { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 18px; }
.roster caption { text-align: left; font-family: Unbounded; font-size: 12px; text-transform: uppercase; color: var(--muted); padding: 4px 0 8px; }
.roster th { color: var(--muted); font-size: 11px; font-weight: 700; text-align: right; padding: 0 5px 6px; }
.roster td { padding: 6px 5px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.roster th:nth-child(-n+2), .roster td:nth-child(-n+2) { text-align: left; }
.roster td:first-child { color: var(--muted); width: 30px; }
.roster td.pts { font-weight: 800; }
.roster a { text-decoration: none; }
.roster a:hover { text-decoration: underline; }
.pos { color: var(--win); } .neg { color: var(--loss); }

/* ---------- standings ---------- */
.standings { width: 100%; border-collapse: collapse; font-size: 13px; }
.standings th { color: var(--muted); font-size: 11px; font-weight: 700; padding: 0 5px 8px; text-align: right; }
.standings td { padding: 7px 5px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.standings th:nth-child(2), .standings td:nth-child(2) { text-align: left; }
.standings td:first-child { color: var(--muted); width: 26px; }
.standings td.p { font-weight: 800; }
.standings tr.cut td { border-top: 2px dashed var(--muted); }
.standings tr.me-home td { background: rgba(255, 76, 99, .14); }
.standings tr.me-away td { background: rgba(79, 176, 255, .14); }
.standings .mini-dots { display: inline-flex; gap: 3px; }
.standings .mini-dots i { width: 7px; height: 7px; border-radius: 50%; }
.mini-dots i.win { background: var(--win); } .mini-dots i.lose { background: var(--loss); } .mini-dots i.draw { background: var(--ot); }

/* ---------- picker ---------- */
dialog { background: var(--dialog); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 24px; width: 480px; }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog h2 { font-size: 18px; margin-bottom: 6px; }
dialog p { margin: 0 0 16px; font-size: 13px; }
.pick-row { display: flex; align-items: center; gap: 10px; }
.pick-row select { flex: 1; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px; }
.pick-row option { background: var(--dialog); }
.pick-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Wide tables scroll inside their card instead of the page. */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.skeleton { padding: 60px 20px; text-align: center; color: var(--muted); }

@media (max-width: 1100px) {
  .grid3 { grid-template-columns: 1fr 1fr; }
  .grid3 > :first-child { grid-column: 1 / -1; }
  .brand span { display: none; }
}
@media (max-width: 820px) {
  .top { flex-wrap: wrap; gap: 0 10px; padding-bottom: 0; }
  .brand { order: 1; height: 52px; flex: 1; }
  .actions { order: 2; gap: 6px; }
  .brand { font-size: 14px; gap: 8px; }
  .brand img { width: 26px; height: 26px; }
  #pick { padding: 7px 10px; }
  .actions #updated { display: none; }
  .tabs { order: 3; width: calc(100% + 40px); margin: 0 -20px; padding: 0 14px 8px; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; padding: 7px 12px; }
  .brand span { display: inline; }
  main { padding: 14px 12px; }
  .grid2, .grid3 { grid-template-columns: 1fr; gap: 12px; }
  .grid3 > :first-child { grid-column: auto; }
  .card { padding: 14px; }
  .hero { grid-template-columns: 1fr 1fr; padding: 18px 14px; gap: 14px 10px; }
  .hero .center { grid-column: 1 / -1; order: 3; }
  .side, .side.right { flex-direction: column; text-align: center; gap: 8px; }
  .logo { width: 64px; height: 64px; border-radius: 14px; }
  .side h2 { font-size: 18px; }
  .center .when { font-size: 28px; }
  .cmp { grid-template-columns: 52px 1fr 120px 1fr 52px; column-gap: 6px; }
  .cmp .lbl { font-size: 11px; }
  .toolbar { gap: 10px; }
  #news-search { width: 100%; margin-left: 0; order: -1; }
  .item { grid-template-columns: 1fr; }
  .item img { width: 100%; height: 160px; order: -1; }
  .item .t { font-size: 14.5px; }
  .roster, .standings { font-size: 12.5px; }
  /* On a phone the roster keeps the season numbers; age, height and ice time stay on wide screens. */
  .roster th:nth-child(3), .roster td:nth-child(3), .roster th:nth-child(4), .roster td:nth-child(4),
  .roster th:nth-child(10), .roster td:nth-child(10) { display: none; }
  .roster td:nth-child(2) { white-space: normal; }
  .roster td:nth-child(2) .muted { display: none; }
  dialog { width: calc(100vw - 24px); }
  .pick-row { flex-direction: column; align-items: stretch; }
  .pick-row span { display: none; }
}
