html {
  /* Bumps every rem-based size (headings, buttons, table text, tab labels)
     by ~20% site-wide - this is used by older family members, and the
     default scale read too small. */
  font-size: 120%;
}

/* On phones the fixed-width layout got cramped, so walk the site-wide rem
   bump back to the browser default. Everything rem-based (headings, buttons,
   table text, tab labels) scales down together; the px --space-* gaps stay,
   which also eases the crunch. */
@media (max-width: 600px) {
  html {
    font-size: 100%;
  }

  /* Not enough room for the masthead and a full identity button side by
     side, so the button collapses to its avatar - still an obvious
     control, still opens the same menu. */
  .app-header h1 {
    font-size: 1.7rem;
  }

  .auth-menu-toggle .auth-name,
  .auth-menu-toggle .auth-caret {
    display: none;
  }

  .auth-avatar {
    width: 1.7em;
    height: 1.7em;
  }
}

:root {
  /* Friday-night-lights: a near-black stadium sky with violet/blue floodlight
     glow and an off-white "highlight" reserved for prize/official moments. */
  --color-bg: #0b0b1e;
  --color-surface: #14152e;
  --color-surface-raised: #1c1d3e;
  --color-border: #302f58;
  --color-text: #ece9fa;
  --color-text-muted: #9c98c7;
  --color-accent: #7c4def;
  /* Fill for the signed-in player's own row in Standings - sits halfway
     between an unhighlighted row (--color-bg shows through the table) and
     full accent purple. Enough to find yourself in a 36-row table at a
     glance without the row shouting over the rest of the leaderboard. */
  --color-me-row: #523b8e;


  /* Division badges. The source files are solid black shapes on a
     transparent background - straight <img> on this near-black theme is
     invisible, so they're used as CSS masks and painted in --color-text
     instead. That keeps the interior detail (the Empire cog's spokes are
     transparent gaps, not black) and lets the badge take the surrounding
     text colour on any background. */
  --division-a-logo: url('../assets/empire-logo.webp');
  --division-b-logo: url('../assets/rebels-logo.webp');

  /* Avatar on the header's identity button. Same masking treatment as the
     division badges: the source was a JPEG with the transparency
     checkerboard baked in as real pixels, so it was keyed out to a real
     alpha channel and is painted in the button's own text colour. */
  --person-logo: url('../assets/person-logo.webp');
  --color-accent-2: #4ea1f3;
  --color-accent-contrast: #150b33;
  --color-highlight: #e4e2f2;
  --color-error: #f2545b;
  --color-win: #3987e5;

  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-body: 'Lora', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

  --space-1: 6px;
  --space-2: 10px;
  --space-3: 16px;
  --space-4: 20px;
  --space-5: 30px;
  --radius: 10px;

  /* Fixed width for the spread-badge column in the spreads list, shared by
     .game-matchup and .spread-header-row - see the comment on
     .spread-header-row for why this has to be a fixed length rather than
     "auto". Wide enough for a two-digit decimal spread ("10.5") plus its
     padding. */
  --spread-col-width: 84px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.5;
}

.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.85rem;
  color: var(--color-highlight);
  margin: 0 0 4px;
}

.app-header {
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-raised);
  display: grid;
  /* auto side columns sized to their controls, with the masthead taking
     what's left and allowed to shrink. Was `1fr auto 1fr`, where the
     masthead's content width won and pushed the identity chip off-screen
     on phones. */
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
}

.masthead {
  grid-column: 2;
  justify-self: center;
  text-align: center;
  min-width: 0;
}

.app-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.3rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
}

.menu-toggle {
  grid-column: 1;
  justify-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  border-color: var(--color-text-muted);
}

.menu-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 18px;
}

.menu-icon span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: var(--color-text);
}

/* Scalloped ticket-stub perforation - the site's recurring motif, marking
   the boundary between "official masthead" and the field of play below. */
.ticket-edge {
  height: 12px;
  background-color: var(--color-surface-raised);
  background-image: radial-gradient(circle at 6px 0, var(--color-bg) 6px, transparent 6.5px);
  background-size: 16px 12px;
  background-repeat: repeat-x;
}

.auth-slot {
  grid-column: 3;
  justify-self: end;
  flex-shrink: 0;
  min-width: 0;
  position: relative;
}

.auth-chip {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* The signed-in player's identity button: avatar + their own name +
   caret, styled as an obvious control rather than the loose label and two
   small buttons this used to be. Change PIN / Not you? moved into the
   menu behind it. */
.auth-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  max-width: 100%;
  padding: var(--space-1) var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.auth-menu-toggle:hover,
.auth-menu-toggle:focus-visible {
  border-color: var(--color-accent);
}

.auth-avatar {
  flex: 0 0 auto;
  width: 1.5em;
  height: 1.5em;
  background-color: currentColor;
  -webkit-mask-image: var(--person-logo);
  mask-image: var(--person-logo);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.auth-caret {
  flex: 0 0 auto;
  font-size: 0.7em;
  color: var(--color-text-muted);
}

/* Scoped through .auth-slot on purpose: .name-dropdown supplies the panel
   chrome but is declared LATER in this file, so at equal specificity its
   `left: 0` would win and - combined with width:max-content - anchor the
   menu to the slot's left edge and run it off the right of the screen. */
.auth-slot .auth-menu {
  min-width: 100%;
  width: max-content;
  left: auto;
  right: 0;
  padding: var(--space-1);
  list-style: none;
}

.auth-menu-item {
  display: block;
  width: 100%;
  padding: var(--space-1) var(--space-2);
  background: none;
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.auth-menu-item:hover,
.auth-menu-item:focus-visible {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
}

.auth-name {
  /* Was 9ch, from when the name sat beside two separate buttons. It is
     the button's own label now, so give it room for the longest real
     roster names (e.g. a shared "A/B" entry) before ellipsising. */
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text);
}

.auth-signout {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  border-radius: var(--radius);
  padding: 2px var(--space-1);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
}

.auth-signout:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

/* Change-PIN popover: a small panel dropped from the header chip (the
   auth-slot is far too narrow to hold a form inline), same absolute-
   anchor + shadow pattern as the name-field dropdown above. */
.auth-changepin-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  width: 240px;
  max-width: 80vw;
  padding: var(--space-3);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  text-align: left;
}

.auth-changepin {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.auth-changepin .name-entry-input {
  font-size: 1rem;
  min-width: 0;
  width: 100%;
}

.auth-changepin-message:not(:empty) {
  margin-top: var(--space-2);
}

#identity-form,
#choose-pin-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

/* First-login "choose a PIN" step (auth.js's renderChoosePinStep) - the
   intro sits on its own full-width line above the two PIN fields. */
.pin-setup-intro {
  flex-basis: 100%;
  margin: 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.name-entry-input {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--color-text);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  min-width: 14ch;
}

.name-entry-input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.name-field {
  position: relative;
}

/* Custom-built dropdown for the name field (see auth.js) - a native
   <datalist> popup can't be restyled, so this reimplements just its list
   chrome to match the rest of the dark theme. */
.name-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  margin: 0;
  padding: var(--space-1) 0;
  list-style: none;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.name-option {
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--color-text);
  cursor: pointer;
}

.name-option:hover,
.name-option.active {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
}

main#tab-panels {
  padding: var(--space-4);
  max-width: 760px;
  margin: 0 auto;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-panel h2 {
  margin-top: 0;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 1.8rem;
  color: var(--color-accent);
}

/* Pairs a tab's h2 with an action button (e.g. Smack Talk's "+ Post") on
   the same line, button pinned to the far edge. */
.tab-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.tab-header-row h2 {
  margin-bottom: 0;
}

.tab-action-button {
  flex-shrink: 0;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
  padding: var(--space-1) var(--space-3);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tab-action-button:hover,
.tab-action-button:focus-visible {
  filter: brightness(1.12);
}

.tab-action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.week-badge {
  display: inline-block;
  margin-left: var(--space-2);
  background: var(--color-highlight);
  color: var(--color-accent-contrast);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
  padding: 3px var(--space-2);
  border-radius: 999px;
  vertical-align: 2px;
}

/* Wraps the week badge/toggle + its dropdown list - see thisWeek.js's
   wireWeekPicker. When the "All Weeks" data isn't available, the toggle
   button gets .week-picker-toggle--static and no dropdown ever opens, so
   it just looks like the plain .week-badge it always was. */
.week-picker {
  position: relative;
  display: inline-block;
}

.week-picker-toggle {
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: inherit;
}

.week-picker-toggle--static {
  cursor: default;
}

.week-picker-caret {
  font-size: 0.7em;
}

.week-picker-list {
  /* .name-dropdown supplies position/background/border/radius/shadow/
     scroll - this narrows it so it doesn't stretch full-width like the
     name field's version does, and right-aligns since the toggle sits at
     the end of the h2 line rather than filling it. */
  min-width: 12rem;
  left: auto;
  right: 0;
}

/* Shared shape for the small pills that sit next to a team's name -
   "Home" (.team-home-tag), "Used" (.team-used-tag), and the Compare-picks
   rival pills (.team-compare-tag, further below) all use this same
   outlined-capsule look, differing only in color/size. */
.team-home-tag,
.team-used-tag,
.team-compare-tag {
  display: inline-block;
  font-family: var(--font-mono);
  text-transform: uppercase;
  border-radius: 999px;
  padding: 1px 5px;
}

/* Small pill next to a team's name when that team is the home team - see
   thisWeek.js's renderTeamMarkup. */
.team-home-tag {
  margin-left: 4px;
  letter-spacing: 0.04em;
  font-size: 0.6rem;
  color: var(--color-highlight);
  border: 1px solid var(--color-highlight);
  vertical-align: middle;
}

/* Small pill next to a team's name once the signed-in player has already
   used that team this season - see thisWeek.js's markUsedTeams(). Styled
   like .team-home-tag, and deliberately reuses that same --color-highlight
   (rather than --color-error) for its color/border: the button carrying
   this badge is always disabled, and .team-pick:disabled's opacity: 0.55
   dims this whole badge along with it - a child element can't opt out of
   an ancestor's opacity. --color-error (#f2545b) composited at 0.55 alpha
   over --color-bg works out to ~2.2:1 contrast, unreadable at this badge's
   font-size; --color-highlight (#e4e2f2) is a near-white that stays
   readable under the same dimming, as proven by .team-home-tag using it
   under this exact same disabled-button opacity. */
.team-used-tag {
  margin-left: 4px;
  letter-spacing: 0.04em;
  font-size: 0.6rem;
  color: var(--color-highlight);
  border: 1px solid var(--color-highlight);
  vertical-align: middle;
}

/* "Compare picks" control - a row of removable player chips + an "add"
   dropdown, sitting between the "Your Pick" widget and the Spreads list.
   Picking a player marks every team they've already used this season (see
   thisWeek.js's applyCompareMarkers) so you can deliberately choose a
   team a rival has burned. Hidden until the roster loads. */
.compare-picks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin: 0 0 var(--space-4);
}

.compare-picks[hidden] {
  display: none;
}

.compare-picks-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

/* Lets the chips sit in the parent's flex flow alongside the label and
   the add button, wrapping as one row. */
.compare-picks-chips {
  display: contents;
}

.compare-picks-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-accent-2);
  border: 1px solid var(--color-accent-2);
  border-radius: 999px;
  padding: 2px var(--space-1) 2px var(--space-2);
}

.compare-picks-chip-remove {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.compare-picks-chip-remove:hover,
.compare-picks-chip-remove:focus-visible {
  color: var(--color-error);
}

.compare-picks-add-wrap {
  position: relative;
  display: inline-block;
}

.compare-picks-add {
  background: none;
  border: 1px dashed var(--color-border);
  border-radius: 999px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 2px var(--space-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.compare-picks-add:hover:not(:disabled),
.compare-picks-add:focus-visible {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.compare-picks-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Reuses .name-dropdown for the popup chrome; narrows it and pins it to
   the left edge of the add button instead of stretching full-width. */
.compare-picks-list {
  min-width: 10rem;
  left: 0;
  right: auto;
}

/* Marker(s) shown inside a team's name in the Spreads list when a
   "Compare picks" rival has already used that team - one small pill per
   rival. Deliberately --color-accent-2 (blue) to stay distinct from the
   near-white "Used"/"Home" pills and the red "Locked" badge. Advisory
   only: the button underneath stays fully enabled. */
.team-compare-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-left: 4px;
  vertical-align: middle;
}

.team-compare-tag {
  letter-spacing: 0.03em;
  font-size: 0.55rem;
  color: var(--color-accent-2);
  border: 1px solid var(--color-accent-2);
}

.tab-panel h3 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--color-highlight);
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tab-panel h4 {
  font-family: var(--font-mono);
  margin: var(--space-4) 0 var(--space-2);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.state {
  color: var(--color-text-muted);
  padding: var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius);
}

.state-error {
  color: var(--color-error);
}

.form-link-wrap {
  margin: var(--space-3) 0 var(--space-4);
}

.form-link {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 1.2rem;
  text-decoration: none;
  padding: var(--space-3) var(--space-5);
  border-radius: 999px;
  border: 2px dashed var(--color-accent-contrast);
  cursor: pointer;
}

.form-link:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint {
  color: var(--color-text-muted);
  font-size: 1rem;
  margin-top: 0;
}

/* "Your Pick" status widget - replaces the old external Form link. Shows
   "Not Yet Selected" until a team is tapped in the spreads list below,
   then mirrors that same team's logo+name here before Submit is enabled. */
.pick-status {
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin: 0 0 var(--space-4);
  text-align: center;
}

.pick-status-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 56px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  margin: var(--space-2) 0 var(--space-3);
}

/* Immediate loading state in the "Your Pick" box (see thisWeek.js's
   renderPickLoading) - stacks the spinner (site/assets/loading.webp)
   above the text; the <img> removes itself via onerror if it's missing. */
.pick-loading {
  flex-direction: column;
  gap: var(--space-2);
}

.pick-loading-gif {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

/* Submit / change / resubmit in-flight state, shown in #pick-status-message
   (see thisWeek.js's submittingHtml) - the dancing #85 above the busy
   label; the <img> removes itself via onerror if it's missing. */
.pick-submitting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.pick-submitting-gif {
  width: auto;
  height: 104px;
  object-fit: contain;
}

/* The submitted Total Score guess shown read-only in the right half of the
   "Your Pick | Your Total Score Guess" split (see thisWeek.js's state-3
   branch) - a plain number, sized to sit alongside the team name opposite
   it, no input chrome so it reads as "already submitted". */
.pick-status-body--guess {
  color: var(--color-text);
  font-size: 1.3rem;
}

/* The "change guess" affordance under the read-only number - same quiet
   underlined-link treatment as .pick-cancel, just nudged below the value. */
.pick-change-guess {
  display: block;
  margin: var(--space-2) auto 0;
}

/* The label-less Total Score field used inside the narrow "Your Total
   Score Guess" panel when "change guess" is tapped - the panel heading
   already names it, so it just needs to sit tight above its Submit row. */
.pick-total-score--compact {
  margin-bottom: var(--space-2);
}

.pick-status-success {
  color: var(--color-highlight);
  font-family: var(--font-mono);
  margin: var(--space-3) 0 0;
}

/* Once a pick is submitted with nothing pending, the button becomes an
   inert confirmation rather than an action - dimmer, not clickable. */
.pick-submit--done {
  opacity: 0.55;
  cursor: default;
}

/* Tapping a DIFFERENT team than what's actually submitted splits the
   widget into "what's submitted" vs "what you just tapped", so it's
   always clear nothing has changed yet until Change Pick is pressed. */
.pick-split {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin: var(--space-2) 0 var(--space-3);
}

.pick-split-side {
  flex: 1;
  min-width: 0;
}

.pick-split-side .pick-status-body {
  margin: var(--space-1) 0 0;
}

.pick-split-divider {
  width: 1px;
  align-self: stretch;
  background: var(--color-border);
}

.pick-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

/* Only rendered on a flagged "tiebreaker week" (see gamesData.gs's
   TiebreakerWeek column) - a required whole-number guess alongside the
   team pick itself. */
.pick-total-score {
  margin: 0 0 var(--space-3);
  text-align: center;
}

.pick-total-score label {
  display: block;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-bottom: var(--space-2);
}

.pick-total-score-input {
  width: 6em;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  text-align: center;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
}

.pick-total-score-input:disabled {
  opacity: 0.5;
}

.pick-cancel {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
  padding: var(--space-2);
}

.pick-cancel:hover {
  color: var(--color-text);
}

.pick-cancel:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: none;
}

/* One header row above the whole spreads list, not per-game - sticky so
   it acts like a spreadsheet's frozen header row as the game list scrolls
   underneath it. Each game-row grid is sized independently (the middle
   column auto-fits that row's own spread text), so an "auto" middle
   column here wouldn't land in the same place two rows down. Both this
   row and .game-matchup instead share a fixed --spread-col-width middle
   track so every row's team columns start/end at the same x position and
   the header lines up exactly. The border-left/padding here mirror
   .game-row's so the left edge matches too. */
.spread-header-row {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr var(--spread-col-width) 1fr;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  background: var(--color-surface-raised);
  box-shadow: 0 2px 0 var(--color-border);
}

.spread-header-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-2);
  text-align: center;
}

.spread-header-label--underdog {
  grid-column: 3;
}

.game-list {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.game-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  background: var(--color-surface);
  border-left: 3px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono);
}

.game-time {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-align: center;
  letter-spacing: 0.04em;
}

.game-matchup {
  display: grid;
  grid-template-columns: 1fr var(--spread-col-width) 1fr;
  align-items: center;
  gap: var(--space-2);
}

.team {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

/* Favorite sits in the left column: reverse the row so the logo (last in
   the DOM) lands next to the spread badge and the name extends outward
   to the left edge of the card. */
.team--favorite {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

/* Underdog sits in the right column: normal row order already puts the
   logo (first in the DOM) next to the spread badge, name extending right. */
.team--underdog {
  flex-direction: row;
  justify-content: flex-start;
}

/* The static preview inside the "Your Pick" widget - not a button, just
   centers the same logo+name markup a selected team-pick button shows. */
.team--display {
  justify-content: center;
  color: var(--color-text);
}

/* Each team in the spreads list is a real <button> (see thisWeek.js) so
   tapping it selects that team as the week's pick. Reset button chrome
   back to plain text/flex, then highlight on selection. */
.team-pick {
  background: none;
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: var(--space-1);
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.team-pick:hover,
.team-pick:focus-visible {
  background: var(--color-surface-raised);
}

/* Disabled until identity is confirmed in the "Your Pick" widget above -
   browsing/viewing spreads never requires identity, only picking does. */
.team-pick:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.team-pick.selected {
  border-color: var(--color-accent);
  background: var(--color-surface-raised);
}

/* Whole card grays out once its kickoff has passed - pointer-events:none
   is belt-and-suspenders alongside the disabled buttons inside (see
   thisWeek.js's applyStartedState), so the row can't be interacted with
   even if something else re-enables a button underneath it. */
.game-row--started {
  opacity: 0.45;
  filter: grayscale(0.7);
  pointer-events: none;
}

.game-started-badge {
  display: inline-block;
  margin-left: var(--space-1);
  color: var(--color-error);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.team-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.team-name {
  font-size: 1.1rem;
  line-height: 1.25;
}

.spread-badge {
  justify-self: center;
  background: var(--color-highlight);
  color: var(--color-accent-contrast);
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  padding: var(--space-1) var(--space-3);
  border-radius: 8px;
  white-space: nowrap;
}

/* ---- Phone: unstack the team blocks in the spreads list --------------
   The .game-matchup grid only gives each team a narrow 1fr column. On a
   phone the logo + team name + the Home/Used/rival pills couldn't fit on
   one line, so the logo spilled sideways over the centre .spread-badge.
   Here each team becomes its own little grid: the logo and name share the
   first line, and every pill drops onto a line beneath them. The cards
   are free to grow taller instead. */
@media (max-width: 600px) {
  .game-matchup .team {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: var(--space-2);
    row-gap: 4px;
  }

  .game-matchup .team-logo {
    width: 36px;
    height: 36px;
    grid-row: 1;
  }

  .game-matchup .team-name {
    grid-row: 1;
    overflow-wrap: anywhere;
  }

  /* The favorite sits in the left grid column - keep its logo on the
     RIGHT of the pair so it still hugs the centre spread badge (mirrors
     the desktop row-reverse), name out toward the card edge. */
  .game-matchup .team--favorite {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .game-matchup .team--favorite .team-logo { grid-column: 2; }
  .game-matchup .team--favorite .team-name { grid-column: 1; }
  .game-matchup .team--underdog .team-logo { grid-column: 1; }
  .game-matchup .team--underdog .team-name { grid-column: 2; }

  /* "Home" is a sibling pill - drop it onto its own row, in the same
     column as the name so it lines up under the name text. */
  .game-matchup .team-home-tag {
    grid-row: 2;
    justify-self: start;
    margin-left: 0;
  }
  .game-matchup .team--favorite .team-home-tag { grid-column: 1; }
  .game-matchup .team--underdog .team-home-tag { grid-column: 2; }

  /* "Used" and the rival pills are nested inside .team-name, so they wrap
     within that cell - break each onto its own line under the name text
     rather than trailing off the end of it. */
  .game-matchup .team-used-tag {
    display: block;
    width: fit-content;
    margin-left: 0;
  }
  .game-matchup .team-compare-tags {
    display: flex;
    margin-left: 0;
  }
}

.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  white-space: nowrap;
}

thead {
  background: var(--color-surface-raised);
}

thead th {
  color: var(--color-accent-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
}

th,
td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Info explainer: a small "i" button beside a heading or column label that
   reveals a plain-language tip on hover, keyboard focus, or tap
   (focus-within covers touch, where :hover never fires). The tip opens
   downward - on the Standings table the surrounding .table-scroll clips
   vertically as well as horizontally, so an upward bubble would be cut. */
.info-tip-wrap {
  position: relative;
  display: inline-block;
}

.info-tip-btn {
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  color: var(--color-text-muted);
  cursor: help;
  display: inline-flex;
  vertical-align: middle;
  line-height: 0;
}

.info-tip-icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.info-tip-btn:hover,
.info-tip-btn:focus-visible {
  color: var(--color-accent-2);
}

.info-tip {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 240px;
  white-space: normal;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--color-text);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  /* Above the sticky .spread-header-row (z-index: 10) it opens down over. */
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.info-tip-btn:hover + .info-tip,
.info-tip-btn:focus-visible + .info-tip,
.info-tip-wrap:focus-within .info-tip {
  opacity: 1;
  visibility: visible;
}

/* Standings tab - a season-stats leaderboard: two callout tiles above an
   enhanced table with a per-player win/loss sparkline (see standings.js's
   renderSparkline). The .dashboard-* class names predate the tab being
   renamed from "Dashboard" to "Standings" and are kept as-is. Win/loss
   colors are blue/red, not green/red - a green/red pairing failed the
   dataviz skill's colorblind separation check (ΔE 5.9) at this size;
   blue/red passed cleanly (ΔE 20.7) against this site's dark surface. */
/* One row holding the callout tiles and, to their right, the Division +
   Time Period filters. Both deliberately live OUTSIDE .table-scroll: that
   container clips vertically (see the .info-tip note below it), so a
   dropdown opening from inside it would be cut off.

   Wraps on narrow screens, dropping the filters underneath the tiles
   rather than squeezing them alongside. */
.dashboard-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}

/* The tiles keep their natural width; the filters take what's left and sit
   against the right edge. Both are allowed to shrink (min-width: 0 defeats
   flex's auto minimum) so a few pixels over budget compresses the controls
   instead of wrapping the whole group onto its own line - inside
   main#tab-panels' 760px cap the row has very little slack. */
#standings-tiles {
  flex: 0 1 auto;
  min-width: 0;
}

.dashboard-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
  gap: var(--space-2);
}

/* Phones: the tiles alone already fill the width, so give the filters
   their own full-width line underneath and align them left with
   everything else. Without the explicit wrap they overflow the viewport
   and push Time Period off-screen. */
@media (max-width: 700px) {
  .dashboard-filters {
    flex-basis: 100%;
    justify-content: flex-start;
  }
}

.dashboard-filter {
  flex: 0 1 auto;
  min-width: 0;
}

.dashboard-filters:empty {
  display: none;
}

.dashboard-filter {
  position: relative; /* anchors .name-dropdown */
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dashboard-filter-label,
.dashboard-filter-toggle > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-filter-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.dashboard-filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
  /* Sized to fit two controls beside the tiles inside the 760px page cap:
     with webfonts applied the tiles take ~384px, leaving ~320px for both.
     Division needs the room ("Galactic Empire"); Time Period's values are
     short, so a small min-width lets it give way rather than forcing the
     whole group onto its own line. */
  min-width: 5rem;
  padding: var(--space-1) var(--space-2);
  font: inherit;
  font-size: 0.95rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
}

.dashboard-filter-toggle:hover {
  border-color: var(--color-accent);
}

.dashboard-filter-caret {
  font-size: 0.7em;
  color: var(--color-text-muted);
}

.dashboard-filter-list {
  /* .name-dropdown supplies position/background/border/radius/shadow/
     scroll. The list sizes to its longest option rather than to the
     toggle, which is narrow - "Galactic Empire" would otherwise wrap onto
     two lines - but never past max-width. */
  min-width: 100%;
  width: max-content;
  max-width: 14rem;
  left: 0;
  right: auto;
}

.dashboard-filter-option {
  white-space: nowrap;
}

.dashboard-filter-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

/* Division options carry their badge, so the dropdown doubles as the
   legend for the tags on each row. */
#division-filter-list .dashboard-filter-option[data-value='A']::before,
#division-filter-list .dashboard-filter-option[data-value='B']::before {
  content: '';
  flex: 0 0 auto;
  width: 1.1em;
  height: 1.1em;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

#division-filter-list .dashboard-filter-option[data-value='A'] {
  justify-content: flex-start;
  gap: var(--space-2);
}

#division-filter-list .dashboard-filter-option[data-value='B'] {
  justify-content: flex-start;
  gap: var(--space-2);
}

#division-filter-list .dashboard-filter-option[data-value='A']::before {
  -webkit-mask-image: var(--division-a-logo);
  mask-image: var(--division-a-logo);
}

#division-filter-list .dashboard-filter-option[data-value='B']::before {
  -webkit-mask-image: var(--division-b-logo);
  mask-image: var(--division-b-logo);
}

/* Playoffs: listed so the shape of the season is visible, but the bracket
   tournaments aren't built yet, so it can't be selected. */
.dashboard-filter-option--disabled {
  color: var(--color-text-muted);
  cursor: default;
}

.dashboard-filter-option--disabled:hover {
  background: transparent;
  color: var(--color-text-muted);
}

.dashboard-filter-note {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.dashboard-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.dashboard-tile {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: var(--space-2) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
}

.dashboard-tile-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.dashboard-tile-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

/* Record-holder line inside a callout tile: a small crown + the player
   who currently holds that stat, sitting between the big number and its
   caption. One quiet mono line so the number stays the hero. */
.stat-tile-holder {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text);
}

.stat-tile-crown {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  fill: var(--color-accent-2);
}

.stat-tile-more {
  color: var(--color-text-muted);
}

.dashboard-spark {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.dashboard-spark-cell {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.dashboard-spark-cell--win {
  background: var(--color-win);
}

.dashboard-spark-cell--loss {
  background: var(--color-error);
}

.dashboard-spark-cell--empty {
  background: transparent;
  border: 1px solid var(--color-border);
}

/* The signed-in player's own row. Colour is the only thing distinguishing
   it, so it's deliberately a full-strength band rather than a subtle tint.
   Applied to the cells, not the <tr>: the table is border-collapse, where
   a row background sits underneath cell backgrounds and borders.
   The left bar is an inset box-shadow rather than a border-left so it
   can't shift the collapsed border grid and nudge the column widths. */
.dashboard-me-row > td {
  background: var(--color-me-row);
  font-weight: 700;
}

/* The sparkline's win/loss squares are mid-tone blue and red: against this
   row's purple they measure 2.43:1 and 2.61:1, well under the ~5:1 they
   have elsewhere. Give the strip its own dark backing inside this row so
   they keep it - better than recolouring them here, which would leave the
   table with two different win/loss palettes depending on whose row
   you're looking at. */
.dashboard-me-row .dashboard-spark {
  background: var(--color-accent-contrast);
  padding: 3px 5px;
  border-radius: 999px;
}

/* Division badges on each standings row: the division's logo in the left
   gutter, painted in the row's own text colour via a mask so it stays
   legible on the normal row and on the signed-in player's purple one
   alike.

   The gutter is reserved on every first cell, not only tagged ones, so
   rows stay aligned in views where divisions don't apply and no badge is
   drawn. Scoped to #standings-content so the Past Picks tables are
   untouched. */
#standings-content thead th:first-child,
#standings-content tbody td:first-child {
  padding-left: calc(var(--space-3) + 28px);
}

#standings-content tbody tr[data-division] td:first-child {
  position: relative;
}

#standings-content tbody tr[data-division] td:first-child::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-color: var(--color-text);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

#standings-content tbody tr[data-division='A'] td:first-child::before {
  -webkit-mask-image: var(--division-a-logo);
  mask-image: var(--division-a-logo);
}

#standings-content tbody tr[data-division='B'] td:first-child::before {
  -webkit-mask-image: var(--division-b-logo);
  mask-image: var(--division-b-logo);
}

/* Past Picks: one expandable card per player (native <details>/<summary>,
   no JS needed to toggle) so a season's worth of players stays scannable
   collapsed, with each player's week-by-week picks a tap away. */
.player-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.player-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.player-card[open] {
  border-color: var(--color-accent);
}

.player-card-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.player-card-summary::-webkit-details-marker {
  display: none;
}

/* Custom chevron replacing the native disclosure triangle, flipped via the
   [open] attribute rather than a JS-toggled class. */
.player-card-summary::after {
  content: '\25BE';
  flex-shrink: 0;
  color: var(--color-text-muted);
  font-size: 1rem;
  transition: transform 0.15s ease;
}

.player-card[open] .player-card-summary::after {
  transform: rotate(-180deg);
}

.player-card-summary:hover,
.player-card-summary:focus-visible {
  background: var(--color-surface-raised);
}

.player-card-name {
  font-weight: 700;
  font-size: 1.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-card-count {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.player-card .table-scroll {
  border: none;
  border-top: 1px solid var(--color-border);
  border-radius: 0;
}

.player-card-empty {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
}

/* Standings: jersey-number-scale rank digits, emerald highlight on the top 3 */
#standings-table td:first-child {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

#standings-table tbody tr:nth-child(-n + 3) {
  border-left: 3px solid var(--color-highlight);
}

#standings-table tbody tr:nth-child(-n + 3) td:first-child {
  color: var(--color-highlight);
}

.rules-prose p {
  line-height: 1.55;
  color: var(--color-text);
  margin: 0 0 1em;
}

/* Full Rulebook: same expandable-card pattern as Past Picks' player cards
   (native <details>/<summary>), one card per rule topic. */
.rule-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.rule-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.rule-card[open] {
  border-color: var(--color-accent);
}

.rule-card-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}

.rule-card-summary::-webkit-details-marker {
  display: none;
}

.rule-card-summary::after {
  content: '\25BE';
  flex-shrink: 0;
  color: var(--color-text-muted);
  font-size: 1rem;
  transition: transform 0.15s ease;
}

.rule-card[open] .rule-card-summary::after {
  transform: rotate(-180deg);
}

.rule-card-summary:hover,
.rule-card-summary:focus-visible {
  background: var(--color-surface-raised);
}

.rule-card-body {
  padding: 0 var(--space-4) var(--space-3);
  border-top: 1px solid var(--color-border);
}

.rule-card-body ul {
  margin: var(--space-3) 0 0;
  padding-left: 1.2em;
}

.rule-card-body li {
  margin-bottom: var(--space-2);
  line-height: 1.5;
}

.rule-card-body li:last-child {
  margin-bottom: 0;
}

.rule-card-body p:first-child {
  margin-top: var(--space-3);
}

/* Smack Talk's composer - shown/hidden by the "+ Post" toggle in the tab
   header. Holds either the identity form (not signed in yet) or the
   message textarea, same dashed-border treatment as This Week's pick
   status widget. */
.smack-composer {
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin: 0 0 var(--space-4);
}

.smack-textarea {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--color-text);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  resize: vertical;
}

.smack-textarea:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.smack-composer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-2);
}

/* Smack Talk: pinned corkboard notes, alternating tilt */
.smack-feed {
  list-style: none;
  margin: 0;
  padding: var(--space-2) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.smack-item {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-3) var(--space-3);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.smack-feed li:nth-child(odd) .smack-item {
  transform: rotate(-0.6deg);
}

.smack-feed li:nth-child(even) .smack-item {
  transform: rotate(0.5deg);
}

.smack-item::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-accent-2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.smack-meta {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--color-accent-2);
  margin-bottom: var(--space-1);
}

.smack-date {
  margin-left: var(--space-2);
  color: var(--color-text-muted);
}

.smack-message {
  font-style: italic;
}

/* Slide-in nav drawer, opened via the hamburger button in the header.
   Styled like a torn ticket stub: dashed perforations separate each
   destination, echoing the .ticket-edge/.ticket-stub motif used elsewhere. */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 16, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}

.nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(80vw, 300px);
  display: flex;
  flex-direction: column;
  padding: var(--space-3) 0 var(--space-4);
  background: var(--color-surface-raised);
  border-right: 1px dashed var(--color-border);
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.4);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  z-index: 50;
}

.nav-drawer.open {
  transform: translateX(0);
}

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4) var(--space-3);
  margin-bottom: var(--space-2);
  border-bottom: 1px dashed var(--color-border);
}

.nav-drawer-header .eyebrow {
  margin: 0;
}

.nav-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.6rem;
  line-height: 1;
  padding: 0 var(--space-1);
  cursor: pointer;
}

.nav-close:hover {
  color: var(--color-text);
}

.tab-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px dashed var(--color-border);
  border-left: 3px solid transparent;
}

.nav-drawer .tab-link:last-child {
  border-bottom: none;
}

.tab-link .tab-icon {
  font-size: 1.4rem;
}

.tab-link.active {
  color: var(--color-accent);
  background: var(--color-surface);
  border-left-color: var(--color-highlight);
}
