/* How to Play page. Builds on /assets/site.css tokens. */
.htp { max-width: 1180px; margin: 0 auto; padding: 0 22px 64px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; }
.htp main { min-width: 0; max-width: 760px; }
.toc { position: sticky; top: 64px; align-self: start; font-size: 14px; max-height: calc(100vh - 80px); overflow: auto; }
.toc summary { font-size: 15px; }
.toc ol { list-style: none; margin: 8px 0 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 3px 0; color: var(--muted); line-height: 1.3; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc .sub a { padding-left: 14px; font-size: 12.5px; }
.toc details { border: 0; padding: 0; }
.toc details:first-of-type { border: 0; }
.toc details summary::after { content: none; }
@media (max-width: 900px) {
  .htp { grid-template-columns: 1fr; gap: 0; }
  .toc { top: 48px; z-index: 5; margin: 0 -22px; padding: 10px 22px; background: var(--nav);
    backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--rule); max-height: 70vh; }
  .toc details summary::after { content: "▾"; font-size: 14px; }
}
@media (min-width: 901px) { .toc details { display: block; } .toc summary { pointer-events: none; font-weight: 600; } }

.htp section { scroll-margin-top: 110px; padding-top: 40px; }
.htp h2 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; margin: 0 0 16px; }
.htp h3 { font-size: 22px; margin: 36px 0 8px; scroll-margin-top: 110px; }
.htp p, .htp li { margin: 0 0 12px; }
.htp .kicker { color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 6px; }
.rule { background: var(--band); border-left: 4px solid var(--guzhi-accent); border-radius: 12px; padding: 14px 18px; margin: 16px 0; }
.rule strong { color: var(--text); }
.note { color: var(--muted); font-size: 15px; }

/* Boards */
.gboard { margin: 20px 0 28px; }
.gboard > img, .gstage svg { width: 100%; height: auto; display: block; border-radius: 14px; }
.gstage svg.board { color: var(--text); }
.gstage .pit.legal { cursor: pointer; }
.gstage .pit.legal:focus { outline: none; }
.gstage .pit.legal:focus-visible .glow, .gstage .pit.legal:hover .glow { stroke-width: 9; }
.gcaption { min-height: 3em; margin: 12px 0 8px; font-size: 16px; }
.gcontrols { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gcontrols button { font: inherit; font-size: 15px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--rule);
  background: var(--bg); color: var(--text); cursor: pointer; }
.gcontrols button.primary { background: var(--guzhi); border-color: var(--guzhi); color: #fff; }
@media (prefers-color-scheme: dark) {
  .gcontrols button.primary { color: #1d1d1f; }
}
.gcontrols button:disabled { opacity: 0.4; cursor: default; }
.gcount { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.glog { margin-top: 10px; border: 0; padding: 0; }
.glog summary { font-size: 15px; font-weight: 600; }
.glog ol { font-size: 15px; color: var(--muted); padding-left: 22px; max-height: 280px; overflow: auto; margin-top: 8px; }
.gstage svg.gclock { max-width: 560px; }
.gclock .gbig { font: 700 44px -apple-system, BlinkMacSystemFont, sans-serif; fill: #f5ebd4; text-anchor: middle; dominant-baseline: central; }
.gclock .gmid { font: 600 26px -apple-system, BlinkMacSystemFont, sans-serif; fill: #f5ebd4; }
.gclock .gsmall { font: 600 20px -apple-system, BlinkMacSystemFont, sans-serif; fill: #cfc6ee; text-anchor: middle; }
.gclock .gwarn { fill: #ff3db8; }
.gring, .gbank { transition: stroke-dashoffset 0.6s ease, width 0.6s ease; }
@media (prefers-reduced-motion: reduce) { .gring, .gbank { transition: none; } }

/* Cards, tables, flow */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 18px 0; }
.card { background: var(--band); border-radius: 16px; padding: 16px 18px; }
.card h4 { margin: 0 0 6px; font-size: 18px; }
.card p { font-size: 15px; margin: 0 0 8px; }
.tablewrap { overflow-x: auto; margin: 16px 0; }
table.compare { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 460px; }
table.compare th, table.compare td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.compare th { font-weight: 600; }
.flow { width: 100%; height: auto; margin: 16px 0; color: var(--text); }
.flow-list { display: none; }
@media (max-width: 600px) { .flow { display: none; } .flow-list { display: block; padding-left: 22px; } }
dl.gloss dt { font-weight: 600; margin-top: 14px; }
dl.gloss dd { margin: 2px 0 0; color: var(--muted); }
ol.mistakes > li, ol.tips > li { margin-bottom: 14px; }
