* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  padding-inline: 16px;
}
.wrap { max-width: 1500px; margin: 0 auto; padding-block: 18px 48px; }
h1, h2, h3 { font-family: "Big Shoulders Display", system-ui, sans-serif; font-weight: 800; letter-spacing: .01em; margin: 0; text-wrap: balance; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px;
  padding-block: 12px; margin-bottom: 20px; border-bottom: 1px solid var(--border);
}
/* Three zones: the menu, logo and page name on the left, Today's Games dead centre, My Picks and the account on the right. */
.tb-left, .tb-right, .tb-mid { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tb-right { justify-content: flex-end; }
.tb-mid { justify-content: center; }
.tb-mid:empty { display: none; }
/* Today's Games and My Picks are still .tab-btn controls, just drawn as pills in the bar (the site's .tab-btn paints a drawer row). */
.tab-btn.top-btn { display: inline-flex; align-items: center; width: auto; flex: none; white-space: nowrap; padding: 8px 16px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; }
.tab-btn.top-btn[data-g]::before { display: none; }
.tab-btn.top-btn:hover:not(.active) { border-color: var(--gc, var(--accent)); background: var(--surface); }
.tab-btn.top-btn.active { box-shadow: none; border-color: var(--gc, var(--accent)); background: color-mix(in srgb, var(--gc, var(--accent)) 14%, var(--surface)); }
/* On a phone the drawer carries Today's Games, centred between the site name and the X; My Picks is in the account menu. */
.nav-games { display: flex; justify-content: center; flex: 1; }
.nav-games:empty { display: none; }
.nav-head .tab-btn.top-btn { font-family: "IBM Plex Sans", system-ui, sans-serif; font-weight: 600; height: auto; width: auto; padding: 6px 14px; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 99px; }
.nav-head .tab-btn.top-btn.active { background: color-mix(in srgb, var(--gc, var(--accent)) 14%, var(--surface)); border-color: var(--gc, var(--accent)); }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: linear-gradient(155deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: "Big Shoulders Display", sans-serif; font-weight: 800; font-size: 17px;
  flex: none;
}
.brand-mark.brand-fox { width: 34px; height: 34px; background: none; border-radius: 0; }   /* the site's fox logo (public/brand/fox.png) */
.brand-name { font-size: 21px; }
/* Phones/tablets: the top bar scrolls away with the page (scroll to the
   top for the tabs) instead of staying pinned and eating screen space. */
/* A middle-sized window has no room for the page name or the help button's words beside the centred Today's Games. */
@media (min-width: 901px) and (max-width: 1180px) { .topbar .nav-title, .topbar .help-txt { display: none; } }
@media (max-width: 900px) {
  .topbar { position: static; backdrop-filter: none; background: transparent; grid-template-columns: minmax(0, 1fr) auto; }
  .tb-mid, #picksBtn { display: none; }
}
/* The tabs live in a drawer that slides in from the left (opened by the menu button in the top bar), grouped by what
   they are for. Every tab is still a .tab-btn, so everything that clicks or reads a tab keeps working. */
.nav-btn {
  flex: none; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.tabs {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 45; width: 290px; max-width: 86vw;
  display: flex; flex-direction: column; gap: 2px; padding: 16px 12px 24px; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border); box-shadow: 8px 0 28px rgba(16,24,40,.18);
  transform: translateX(-105%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s;
}
body.nav-open .tabs { transform: none; visibility: visible; transition: transform .22s ease; }
.nav-overlay { position: fixed; inset: 0; z-index: 40; background: color-mix(in srgb, #000 42%, transparent); display: none; }
body.nav-open .nav-overlay { display: block; }
.nav-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 10px; font-weight: 800; font-family: "Big Shoulders Display", system-ui, sans-serif; font-size: 20px; }
body.nav-open { overflow: hidden; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }
.espn-panel { margin: 14px 0 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
/* Phone widths: let flex/grid children shrink below their content width
   (min-width:auto was pushing cards past the screen edge), and wrap the
   tab bar instead of letting it run off the side. */
.grid > *, .row > *, .card { min-width: 0; }
.search-box { position: relative; }
.autocomplete {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  max-height: 320px; overflow-y: auto; display: none;
}
.autocomplete.open { display: block; }
.ac-item { padding: 10px 14px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.date-step { display: inline-flex; align-items: center; gap: 4px; }
.ac-name { font-weight: 600; }
.ac-meta { color: var(--text-muted); font-size: 12.5px; }
.profile-name { font-size: 34px; }
.tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.tile-val { font-family: "Big Shoulders Display", sans-serif; font-weight: 800; font-size: 24px; line-height: 1; }
.tile-lbl { color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
  border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.game-time { text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .05em; color: var(--text-muted); margin: -2px 0 6px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
/* Prop-type chips as one sideways-scrolling row, like a sportsbook's
   market tabs, instead of wrapping into several lines on a phone. */
.chip-row.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; max-width: 100%; }
.chip-row.scroll-x::-webkit-scrollbar { display: none; }
.move-mark { font-size: 9px; margin-left: 3px; vertical-align: 2px; }
.move-mark.up { color: var(--good); }
.move-mark.down { color: var(--critical); }
.ck { color: var(--good); font-weight: 800; cursor: help; }
.range-box { display: inline-flex; align-items: center; gap: 6px; }
.range-note { margin: -2px 0 8px; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent-2) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent-2) 40%, var(--border)); }
.be-active { font-size: 12px; color: var(--text-muted); font-family: var(--mono, monospace); cursor: help; }
/* Shot maps (js/ui/rink.js, js/views/shots.js) */
.shot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
/* Line history pop-up on the player profile */
.lh-overlay { position: fixed; inset: 0; z-index: 70; background: color-mix(in srgb, #000 45%, transparent); display: flex; align-items: center; justify-content: center; padding: 16px; }
.lh-body { overflow: auto; margin-top: 10px; border-top: 1px solid var(--border); }
.lh-table { font-size: 13px; }
.lh-menu-wrap { position: relative; }
.lh-menu-btn { padding: 7px 14px; font-size: 13.5px; }
.lh-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 5; min-width: 250px; max-height: 46vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); padding: 6px; }
.lh-grp + .lh-grp { border-top: 1px solid var(--border); margin-top: 2px; padding-top: 2px; }
/* Odds range boxes: type any number (it rounds to the nearest 5) or use the - / + buttons */
.odds-step { display: inline-flex; align-items: stretch; border: 1.5px solid var(--border); border-radius: 11px; background: var(--surface); overflow: hidden; }
/* "How to use" walkthrough: the button in the top bar and its pop-up */
.help-btn { display: inline-flex; align-items: center; gap: 7px; flex: none; height: 34px; padding: 0 12px 0 8px; margin-right: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 999px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.help-q { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; }
.tut-body { overflow: auto; margin-top: 4px; padding-right: 4px; }
.tut-intro { margin: 0 0 12px; color: var(--text-muted); font-size: 14.5px; line-height: 1.5; }
.tut-steps { list-style: none; counter-reset: tut; margin: 0; padding: 0; }
.tut-steps li { counter-increment: tut; position: relative; padding: 0 0 12px 38px; font-size: 14.5px; line-height: 1.5; }
.tut-tip-head { margin: 6px 0 6px; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; color: var(--text-muted); font-weight: 700; }
.tut-tips { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.5; color: var(--text-muted); }
.tut-foot { display: flex; justify-content: flex-end; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.tut-ok { padding: 8px 22px; }

/* Open/close boxes (js/fold.js): the heading is a button; a closed box hides its body. */
.fold-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 14px; flex-wrap: wrap; }
.fold-title { margin: 0 0 2px; font-size: 19px; }
.fold-title.sec-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 700; }
.fold-title.sec-lbl .fold-btn { font-weight: 700; }
.fold-btn { all: unset; cursor: pointer; display: inline-flex; align-items: baseline; gap: 6px; }
.fold-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.fold-title.filters-cta .fold-btn { padding: 5px 12px; border: 1px solid var(--accent); border-radius: 99px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; align-items: center; }
.fold-title.filters-cta .fold-btn:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.fold-btn .tg { color: var(--text-muted); font-size: .8em; width: 1em; }
.fold[data-open="0"] > .fold-body { display: none; }
.fold[data-open="0"] > .fold-head :is(label, select, input, button:not(.fold-btn)) { display: none !important; }      /* a closed box shows its title and summary, not its controls (e.g. the Droughts season filter) */
.fold + .fold { margin-top: 14px; }
/* Stats pages: filter drop downs (select.ctl-select, in the look of the other .search-input boxes) and the checkbox menu that picks which columns show (js/dd-menu.js) */
select.ctl-select { width: auto; max-width: 100%; min-width: 0; padding: 6px 10px; font-size: 13.5px; }
.dd-menu { position: relative; display: inline-block; max-width: 100%; }
.dd-menu > summary { list-style: none; cursor: pointer; width: auto; padding: 6px 28px 6px 10px; font-size: 13.5px; position: relative; user-select: none; }
.dd-menu > summary::-webkit-details-marker { display: none; }
.dd-menu > summary::after { content: "▾"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 11px; }
.dd-menu[open] > summary { border-color: var(--accent); }
.dd-panel { position: absolute; left: 0; top: calc(100% + 4px); z-index: 40; min-width: 220px; max-width: min(92vw, 340px); max-height: 60vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px 4px; }
.dd-item { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.dd-item:hover { background: var(--surface-2); }
.dd-group { padding: 8px 10px 2px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.dd-foot { padding: 6px 8px 2px; border-top: 1px solid var(--border); margin-top: 4px; }
@media (max-width: 600px) { .dd-panel { position: fixed; left: 4vw; right: 4vw; top: auto; bottom: 12px; max-width: none; max-height: 55vh; } }
