/* public/stylesheets/base.css -- reset and document defaults. */
*, *::before, *::after { box-sizing: border-box; }

body, h1, h2, h3, h4, p, ul, ol, figure, fieldset, legend {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  /* No visible scrollbar anywhere. On a phone this changes nothing -- iOS and
     Android already draw an overlay bar that only appears while you drag --
     so it is really a desktop rule, and there it removes the drag handle as
     well as the stripe. Scrolling still works by wheel, trackpad, touch,
     keyboard (Space/PgDn/arrows on a focused document) and the scrollbar
     keyboard shortcuts; what is lost is the visual indication of how far
     through a long page you are. Requested deliberately -- it is not a tidy-up
     to reapply if it ever gets reverted. */
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar { display: none; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  /* Scales with the viewport instead of jumping at breakpoints. The floor is
     16px because iOS zooms a focused input below that. */
  font-size: var(--text-body);
  line-height: 1.6;
  /* svh, not vh -- see the same change on .page in layout.css. 100vh here left
     the DOCUMENT 844px tall on a 390x844 phone whose visible viewport is 680,
     so even a page that fit exactly could still be scrolled 164px down into
     blank background. */
  min-height: 100svh;
}

h1 { font-size: var(--text-h1); line-height: 1.2; font-weight: 650; }
h2 { font-size: var(--text-h2); line-height: 1.25; font-weight: 600; }
h3 { font-size: var(--text-lg); font-weight: 600; color: var(--text); }

a { color: var(--go); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Visible on every focusable element, in both themes. Removing focus rings
   makes the app unusable by keyboard; this one is deliberately loud. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

ul { list-style: none; }
img { max-width: 100%; height: auto; }

h1, h2, h3 { color: var(--text); }

/* Vertical rhythm for the top-level flow inside .main. Scoped to DIRECT
   children only, so it doesn't reach inside .dash-grid or .stat-grid --
   those already space their own cards via `gap`, and doubling that here
   would open a bigger vertical gap between grid rows than between columns. */
.main > * + * { margin-top: var(--space-4); }
/* The pinned play-screen bar is position: sticky, so unlike the fixed bar
   this rule used to zero out, its margin is now real layout: it is the gap
   between the bar and the last control above it -- the captain's exit
   button. Left to the rhythm above deliberately. */
