/* Shared styles for the self-hosted classics. Each game runs inside the site's
   click-to-play player (an iframe), so the page fills its box exactly. */
:root {
  color-scheme: light;
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --surface-2: #EFEDE6;
  --text: #1B1D1A;
  --muted: #5D605A;
  --border: #D9D6CC;
  --accent: #1F6B4A;
  --accent-text: #FFFFFF;
  --felt: #2A6448;
  --felt-line: rgb(255 255 255 / .38);
  --danger: #B3261E;
  --radius: 8px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #121412;
  --surface: #1B1E1B;
  --surface-2: #242824;
  --text: #ECEDE9;
  --muted: #A6AAA2;
  --border: #30352F;
  --accent: #5CC08E;
  --accent-text: #0E1A13;
  --felt: #1D4232;
  --felt-line: rgb(255 255 255 / .28);
  --danger: #FF8A80;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); display: flex; flex-direction: column; overflow: hidden; -webkit-tap-highlight-color: transparent; }

.bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--surface); border-bottom: 1px solid var(--border); flex: none; flex-wrap: wrap; min-height: 56px; }
.bar .spacer { flex: 1; }
.bar button, .bar select {
  min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: 500 15px inherit; font-family: inherit; cursor: pointer;
}
.bar button:hover { background: var(--surface-2); }
.bar button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.bar button[aria-pressed='true'] { border-color: var(--accent); color: var(--accent); }
.bar button:disabled { opacity: .45; cursor: default; }
.stat { font: 500 14px/1 inherit; font-family: inherit; color: var(--muted); font-variant-numeric: tabular-nums; padding: 0 4px; white-space: nowrap; }
.stat b { color: var(--text); font-weight: 600; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.overlay { position: fixed; inset: 0; display: none; place-items: center; background: rgb(0 0 0 / .45); z-index: 2000; padding: 16px; }
.overlay.show { display: grid; }
.overlay .panel { background: var(--surface); color: var(--text); border-radius: 12px; padding: 24px; max-width: 340px; width: 100%; text-align: center; box-shadow: 0 10px 40px rgb(0 0 0 / .35); }
.overlay h2 { margin: 0 0 8px; font-size: 22px; }
.overlay p { margin: 0 0 18px; color: var(--muted); }
.overlay button { min-height: 44px; padding: 0 18px; border-radius: var(--radius); border: 0; background: var(--accent); color: var(--accent-text); font: 600 16px inherit; font-family: inherit; cursor: pointer; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 480px) {
  .bar { gap: 4px; padding: 4px 6px; }
  .bar button, .bar select { padding: 0 8px; font-size: 14px; }
  .bar .wide-only { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
