/* The page tabs, shared by every page so they sit in exactly the same place on each one.
   Same font, size and spacing everywhere; each tab reserves the width of its bold (active)
   label, so switching tabs never shifts the others. */
header { padding-top: 16px !important; }
.site-nav { display: flex; gap: 20px; margin: 0 0 16px; padding: 0; border-bottom: 1px solid var(--line);
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* The line under the tabs runs the full width of the window: the border is drawn with an
     outset border-image, which paints past the edges without widening the page. */
  border-image: linear-gradient(var(--line), var(--line)) 0 0 1 0 / 0 0 1px 0 / 0 100vw 0 100vw; }
.site-nav a { display: inline-block; text-align: center; position: relative;
  color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 400; letter-spacing: 0;
  margin: 0 0 -1px; padding: 0 0 8px; border-bottom: 2px solid transparent; white-space: nowrap; }
.site-nav a::after { content: attr(data-label); display: block; height: 0; overflow: hidden; visibility: hidden; font-weight: 600; pointer-events: none; }
.site-nav a.on { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }
@media (max-width: 520px) { .site-nav { gap: 12px; overflow-x: auto; scrollbar-width: none; } }
@media (max-width: 400px) { .site-nav a { font-size: 12px; } }

/* Page title, status and header buttons line up with the page's content column (main), which is
   centered at --content-w (set per page). The tabs line up with it too; their bottom line still
   runs the full width of the window. */
:root { --content-w: 1280px; --head-inset: max(0px, calc((100vw - var(--content-w)) / 2)); }
header > div > h1, header .status, header .title-row, header .site-nav { margin-left: var(--head-inset) !important; }
header .title-row, header > div + div { margin-right: var(--head-inset) !important; }

/* Breathing room: more space above the page title (below the tabs) and below the status line. */
header > div > h1, header .title-row { margin-top: 28px !important; }
header { padding-bottom: 28px !important; }

/* Tonight's open bets on each tab (public/nav.js): a muted green count after the label, in both
   themes. Clicking marks them seen (the count stays). */
/* Inline after the label, so the space between tabs is the same with or without a count. */
.site-nav { gap: 24px; }
.site-nav a .nav-count { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; margin-left: 6px;
  border-radius: 999px; background: color-mix(in srgb, var(--good) 22%, var(--panel, #fff)); color: var(--good); font-size: 10px; font-weight: 700; line-height: 1; vertical-align: 1px; }
.site-nav a .nav-count[hidden] { display: none; }
.site-nav a .nav-count { cursor: pointer; }
.site-nav a .nav-count:not(.seen):hover { background: color-mix(in srgb, var(--good) 35%, var(--panel, #fff)); }
/* Seen: muted green, no click needed. */
.site-nav a .nav-count.seen { background: color-mix(in srgb, var(--good) 22%, var(--panel, #fff)); color: var(--good); cursor: default; }

/* Utility buttons (Sound, Light/Dark, moved here by public/nav.js) at the right end of the tab row,
   in the tabs' font. The tab row spans the content column so they line up with its right edge. */
header .site-nav { width: calc(min(100vw, var(--content-w)) - 40px); box-sizing: border-box; }
.site-nav .nav-utils { margin-left: auto; display: inline-flex; align-items: flex-start; gap: 18px; }
.site-nav .nav-util { all: unset; display: inline-flex; align-items: center; gap: 6px; padding: 0 0 8px; cursor: pointer;
  font: 13px/1.4 var(--sw, -apple-system), -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--muted); white-space: nowrap; }
.site-nav .nav-util:hover { color: var(--text); }
.site-nav .nav-util svg { width: 14px; height: 14px; }
/* Narrow windows: the utility buttons show just their icons so the tab row fits. */
@media (max-width: 900px) { .site-nav .nav-util { font-size: 0; gap: 0; } .site-nav .nav-utils { gap: 14px; } }
/* Phones: the tab row scrolls sideways only (overflow-x: auto made it scroll up/down too). */
@media (max-width: 900px) { .site-nav { overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain; touch-action: pan-x pan-y; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .site-nav::-webkit-scrollbar { display: none; } .site-nav > * { flex: none; } }
/* Phones: a taller tab row, easier to tap. */
@media (max-width: 900px) { .site-nav a, .site-nav .nav-util { padding: 14px 0 12px; } .site-nav .nav-utils { align-items: stretch; } }
/* Phones: the tab row is the top of the page, with its text centered between the top and the line. */
@media (max-width: 900px) { body > header { padding-top: 0 !important; } .site-nav a, .site-nav .nav-util { padding: 13px 0 11px; } }
/* A tab row moved to the top of the header (nav.js) fills its own line. */
header > .site-nav { flex: 0 0 auto; }
header > .site-nav + div { flex: 1 1 auto; }
