/* BackgammonX v0.1.9 — 01-base-layout.css
   Owns: design tokens, reset, typography scale, page grid.
   Does not own: board (02), BGX components (03), themes/breakpoints (04), X shell (05). */

:root {
  --bgx-css-01: 1; /* file-health sentinel read by 08-bootstrap.js */

  /* Palette: drawn from the gold board on a dark felt table */
  --felt-900: #0f1713;
  --felt-800: #16211b;
  --felt-700: #1f2d25;
  --felt-600: #2a3a31;
  --ivory: #f1ebdd;
  --ivory-dim: #b9b6a8;
  --gold: #d4a02a;         /* primary action */
  --gold-deep: #a97d1a;
  --green: #3e9b5c;        /* positive / secondary meaning */
  --green-deep: #2d7645;
  --line: rgba(241, 235, 221, 0.12);

  --bg: var(--felt-900);
  --surface: var(--felt-800);
  --surface-raised: var(--felt-700);
  --text: var(--ivory);
  --text-muted: var(--ivory-dim);

  /* Type: engraved serif for the wordmark, a plain grotesk for everything else */
  --font-brand: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-ui: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --text-scale: 1;                    /* overridden by data-text-size in 04 */
  --fs-sm: calc(0.8125rem * var(--text-scale));
  --fs-md: calc(1rem * var(--text-scale));
  --fs-lg: calc(1.25rem * var(--text-scale));
  --fs-xl: calc(1.5625rem * var(--text-scale));

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --radius-sm: 6px;
  --radius-md: 10px;

  --header-height: 72px;
  --bottom-nav-height: 56px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3, p, dl, dd { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* The hidden attribute must win over any display rule below (drawer, modal, panels). */
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.muted { color: var(--text-muted); font-size: var(--fs-sm); }

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -100px;
  padding: var(--space-2) var(--space-3);
  background: var(--gold);
  color: var(--felt-900);
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus { top: var(--space-3); }

/* Page grid: board first, panel column second.
   v0.2.12 §A — desktop max-width raised 1280px -> 1750px (within the
   handoff's own suggested ~1700-1800px range) so the board COLUMN
   (minmax(0,1fr)) can grow well past its old ceiling on large desktop
   viewports; the panel column stays a fixed 340px, unchanged, so it is
   never squeezed. Tablet (<=1023px) and phone (<=639px) overrides in
   css/04-themes-responsive.css are untouched — this only ever raises
   the DESKTOP ceiling, never removes it (no overflow risk: at any
   viewport narrower than 1750px, the grid still only ever fills the
   real available width, same as before). */
.app-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--space-5);
  padding: var(--space-4);
  max-width: 100%;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-height));
}

.panel-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
