/* Shared by the public pages: the landing page and the guide. */
/* ChessClinic (default): warm paper, one orange accent. Dark mode and the
   optional Classic monochrome style follow the visitor's choice, shared with
   the app (localStorage "theme" and "style"). */
:root {
  --bg: #faf6f1; --bg-elev: #ffffff; --card: #ffffff; --card-hover: #fdf4ec; --border: #eee5db; --border-strong: #e0d3c5;
  --text: #1f1a16; --muted: #6b6159; --faint: #a2978d; --accent: #e8622c; --accent-strong: #d4521e; --accent-ink: #ffffff;
  --accent-soft: rgba(232, 98, 44, 0.1);
  --win: #1f9d55; --draw: #8b8b93; --loss: #d64545; --callout: #e8622c;
  --light-sq: #f0d9b5; --dark-sq: #b58863; --shadow: 0 18px 50px rgba(80, 40, 10, 0.1); color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #12100e; --bg-elev: #191613; --card: #1d1a17; --card-hover: #27221d; --border: #2d2823; --border-strong: #403831;
  --text: #f6f1ec; --muted: #b2a79c; --faint: #7b7168; --accent: #f0703a; --accent-strong: #ff8450; --accent-ink: #ffffff;
  --accent-soft: rgba(240, 112, 58, 0.14);
  --win: #2bb36a; --loss: #e05555; --callout: #f0703a; --shadow: 0 24px 70px rgba(0, 0, 0, 0.30); color-scheme: dark;
}
:root[data-style="classic"] {
  --bg: #fafafa; --bg-elev: #ffffff; --card: #ffffff; --card-hover: #f4f4f5; --border: #e7e7ea; --border-strong: #d4d4d8;
  --text: #0a0a0b; --muted: #5b5b63; --faint: #8e8e96; --accent: #0a0a0b; --accent-strong: #27272a; --accent-ink: #ffffff;
  --accent-soft: rgba(0, 0, 0, 0.05);
  --win: #1a7f37; --draw: #8e8e96; --loss: #c62828; --callout: #d99a00; --shadow: 0 18px 50px rgba(0,0,0,0.08); color-scheme: light;
}
:root[data-style="classic"][data-theme="dark"] {
  --bg: #0a0a0b; --bg-elev: #0f0f11; --card: #141416; --card-hover: #19191c; --border: #232327; --border-strong: #34343a;
  --text: #f5f5f6; --muted: #a0a0a8; --faint: #66666e; --accent: #ffffff; --accent-strong: #e4e4e7; --accent-ink: #0a0a0b;
  --accent-soft: rgba(255, 255, 255, 0.07);
  --win: #3fb950; --loss: #d03b3b; --callout: #f5b301; --shadow: 0 24px 70px rgba(0,0,0,0.30); color-scheme: dark;
}
/* Extra palettes (optional): the same layout with another accent; chosen
   per browser like the theme and kept in step with the public pages. */
/* Ocean blue */
:root[data-style="ocean"] {
  --bg: #f5f7fb;
  --card-hover: #eef3fd;
  --border: #e3e8f0;
  --border-strong: #cfd8e5;
  --text: #111827;
  --muted: #556070;
  --faint: #98a2b3;
  --accent: #2563eb;
  --accent-strong: #1d4fd0;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --bg-elev: #ffffff;
  --card: #ffffff;
  color-scheme: light;
}
:root[data-style="ocean"][data-theme="dark"] {
  --bg: #0e1117;
  --bg-elev: #141922;
  --card: #171d27;
  --card-hover: #1f2733;
  --border: #263040;
  --border-strong: #364357;
  --text: #eef2f8;
  --muted: #a3adbd;
  --faint: #6b7587;
  --accent: #4f8cf7;
  --accent-strong: #6aa0ff;
  --accent-soft: rgba(79, 140, 247, 0.16);
  color-scheme: dark;
}
/* Forest green */
:root[data-style="forest"] {
  --bg: #f5f8f4;
  --card-hover: #edf6ef;
  --border: #e2eae2;
  --border-strong: #cddbcf;
  --text: #14201a;
  --muted: #55645a;
  --faint: #9aa89e;
  --accent: #1f8a5b;
  --accent-strong: #18744c;
  --accent-soft: rgba(31, 138, 91, 0.1);
  --bg-elev: #ffffff;
  --card: #ffffff;
  color-scheme: light;
}
:root[data-style="forest"][data-theme="dark"] {
  --bg: #0e1311;
  --bg-elev: #141a17;
  --card: #18201c;
  --card-hover: #202a25;
  --border: #28332d;
  --border-strong: #38463e;
  --text: #eef4f0;
  --muted: #a5b3aa;
  --faint: #6d7b72;
  --accent: #34b37a;
  --accent-strong: #45c78c;
  --accent-soft: rgba(52, 179, 122, 0.16);
  color-scheme: dark;
}
/* Royal purple */
:root[data-style="royal"] {
  --bg: #f7f6fb;
  --card-hover: #f1eefc;
  --border: #e7e3f2;
  --border-strong: #d6cfea;
  --text: #1a1726;
  --muted: #5f5a72;
  --faint: #a29db5;
  --accent: #6d4fd8;
  --accent-strong: #5b3fc2;
  --accent-soft: rgba(109, 79, 216, 0.1);
  --bg-elev: #ffffff;
  --card: #ffffff;
  color-scheme: light;
}
:root[data-style="royal"][data-theme="dark"] {
  --bg: #110f17;
  --bg-elev: #17141f;
  --card: #1b1824;
  --card-hover: #24202f;
  --border: #2c2839;
  --border-strong: #3d374f;
  --text: #f1eff8;
  --muted: #ada8c0;
  --faint: #736d88;
  --accent: #8c74f0;
  --accent-strong: #a08bff;
  --accent-soft: rgba(140, 116, 240, 0.18);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.num { font-variant-numeric: tabular-nums; }

nav.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
nav.top .wrap { display: flex; align-items: center; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; }
.mark { width: 32px; height: 32px; display: grid; place-items: center; color: var(--accent); font-size: 30px; line-height: 1; font-family: "Apple Symbols", "Segoe UI Symbol", "DejaVu Sans", serif; }
nav.top .links { margin-left: auto; display: flex; gap: 4px; align-items: center; }
nav.top .links a.plain { color: var(--muted); font-size: 14px; padding: 8px 11px; border-radius: 8px; white-space: nowrap; }
nav.top .links a.plain:hover, nav.top .links a.plain.on { color: var(--text); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; font: inherit; font-weight: 700; font-size: 15px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; white-space: nowrap; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ghost:hover { border-color: var(--border-strong); }
.btn.small { padding: 7px 14px; font-size: 14px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }

.theme-toggle { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; }
.theme-toggle:hover { color: var(--text); background: var(--card); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }

footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--faint); font-size: 13px; }
footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
footer .links { display: flex; gap: 18px; flex-wrap: wrap; }
footer .links a { color: var(--muted); }
footer .links a:hover { color: var(--text); }
footer b { color: var(--text); }

@media (max-width: 960px) {
  nav.top .links a.plain.wide { display: none; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  nav.top .links .hide-sm { display: none; }
  .btn.small { padding: 7px 11px; }
}
