/* Shared style for the readable pages next to the web game (generated by tools/web/build_site.py). */
:root {
  --bg: #f7f5fc; --surface: #ffffff; --text: #1f1a2e; --muted: #5d5670; --line: #e4dff0;
  --brand: #3b1f7a; --brand-deep: #1d1140; --accent: #f5bc14; --link: #5b2fc4;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #140c2b; --surface: #1f1640; --text: #efeaf8; --muted: #b4abc8; --line: #34295a;
    --link: #c3a8ff; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: clamp(28px, 6vw, 40px); margin: 8px 0 12px; }
h2 { font-size: 22px; margin: 32px 0 8px; }
h3 { font-size: 18px; margin: 0 0 4px; }
main { max-width: 880px; margin: 0 auto; padding: 16px 16px 40px; }
.lead { font-size: 19px; color: var(--muted); }
.small { font-size: 14px; color: var(--muted); }

.top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--brand-deep); color: #fff; }
.top a { color: #fff; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-style: italic; font-size: 20px; }
.brand img { border-radius: 8px; }
.top nav { display: flex; gap: 16px; flex-wrap: wrap; flex: 1; font-size: 15px; }
.top nav a { opacity: .85; }
.top nav a[aria-current="page"], .top nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.play { display: inline-block; background: var(--accent); color: #1f1a2e !important; font-weight: 800;
  padding: 8px 16px; border-radius: 999px; text-decoration: none; }
.play.big { font-size: 18px; padding: 12px 22px; }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
.toc a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  text-decoration: none; color: var(--text); font-size: 15px; white-space: nowrap; }
.category { scroll-margin-top: 80px; padding-top: 8px; }
.category h2 { margin-top: 36px; }
.category h3 { font-size: 16px; color: var(--muted); margin: 18px 0 0; text-transform: uppercase; letter-spacing: .04em; }
.count { font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; margin-top: 10px; }
.item { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; }
.item h4 { margin: 0 0 2px; font-size: 17px; }
.item p { margin: 2px 0; font-size: 15px; }
.px { width: 96px; height: 96px; border-radius: 10px; image-rendering: pixelated; image-rendering: crisp-edges; }

.box, .qa, .news { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 18px 14px;
  margin-top: 16px; }
.box h2, .qa h2, .news h2 { margin-top: 14px; }
.news .date { margin: 14px 0 0; font-size: 14px; color: var(--muted); font-weight: 700; }
.news h2 { margin-top: 2px; }

.stages { border-collapse: collapse; margin: 8px 0 16px; min-width: 260px; }
.stages th, .stages td { border: 1px solid var(--line); padding: 6px 14px; text-align: center; }
.stages th { background: var(--surface); }

footer { background: var(--brand-deep); color: #d9d2ee; padding: 28px 16px 36px; text-align: center; font-size: 15px; }
footer a { color: #fff; }
footer .small { color: #a99fc6; }
.cta { display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

@media (max-width: 520px) {
  .items { grid-template-columns: 1fr; }
  .item { grid-template-columns: 80px 1fr; gap: 12px; }
  .px { width: 80px; height: 80px; }
  .top { gap: 10px 16px; }
  .top nav { order: 3; flex: 1 1 100%; gap: 6px 16px; }
  .play { margin-left: auto; }
}
