/* Light = the board's cream and the piece colours from the app; dark = the
   app's night mode. Follows the system until the visitor picks one with the
   header button (assets/theme.js sets data-theme on <html>). */
:root {
  color-scheme: light;
  --bg: #fbf3dc;
  --surface: #fffdf6;
  --text: #2a241b;
  --muted: #7a6b52;
  --border: #ead9ad;
  --accent: #d63a3a;
  --accent-text: #ffffff;
  --shadow: rgba(122, 92, 30, .16);
  --red: #d63a3a;
  --blue: #2f6fd6;
  --green: #2f9e5b;
  --yellow: #e8b52a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #15140f;
    --surface: #1f1d18;
    --text: #f1eee8;
    --muted: #a39d92;
    --border: #34312a;
    --accent: #ef5a5a;
    --shadow: rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15140f;
  --surface: #1f1d18;
  --text: #f1eee8;
  --muted: #a39d92;
  --border: #34312a;
  --accent: #ef5a5a;
  --shadow: rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 720px; margin: 0 auto; padding: 32px 16px 64px; }
header.site { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
header.site a { color: inherit; text-decoration: none; font-weight: 700; font-size: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
h1 { font-size: 32px; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 32px 0 8px; }
.muted { color: var(--muted); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin: 24px 0;
}
.btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 600;
  margin: 4px 8px 4px 0;
}
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.code {
  font: 700 36px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 6px;
  margin: 8px 0 16px;
}
footer.site { margin-top: 48px; font-size: 14px; color: var(--muted); }
footer.site a { color: var(--muted); margin-right: 16px; }
header.site { justify-content: space-between; }
.lang-pick { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); border: 1px solid var(--border);
  border-radius: 10px; padding: 5px 8px; background: var(--surface); }
.lang-pick select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 14px; cursor: pointer; padding-right: 2px; max-width: 9.5em; }
.lang-pick select:focus { outline: none; }
.lang-pick:focus-within { border-color: var(--accent); }
[dir="rtl"] footer.site a { margin-right: 0; margin-left: 16px; }
.en-only { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; color: var(--muted); font-size: 14px; }
/* Light/dark button + language picker: on the logo row; on the invite page
   (no logo row) in a bar at the very top. */
.site-tools { display: inline-flex; align-items: center; gap: 8px; }
body > .topbar { display: flex; justify-content: flex-end; width: 100%; max-width: 720px; margin: 0 auto; padding: 12px 16px 0; }
.brand { white-space: nowrap; }
@media (max-width: 420px) {
  header.site a.brand { font-size: 18px; gap: 10px; }
  header.site .lang-pick svg { display: none; }
  header.site .lang-pick select { max-width: 7em; }
}
.theme-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; }
.theme-btn:hover, .theme-btn:focus-visible { color: var(--text); border-color: var(--accent); outline: none; }
.theme-btn svg { width: 18px; height: 18px; }
