/* player guide (site/guide/, generated by tools/build_guide.py) and items page: light theme follows the system or the ◐ button */
:root[data-theme="light"] {
  --bg: #f4f1ea; --bg2: #ebe6db; --cyan: #5b3fc4; --rew: #a85f00; --ff: #00796b; --text: #1d232a; --muted: #5d6870; --line: rgba(91,63,196,.35);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f1ea; --bg2: #ebe6db; --cyan: #5b3fc4; --rew: #a85f00; --ff: #00796b; --text: #1d232a; --muted: #5d6870; --line: rgba(91,63,196,.35);
    color-scheme: light;
  }
}
:root[data-theme="dark"] { color-scheme: dark; }
body.guide::before { opacity: var(--grid-op, .07); }
:root[data-theme="light"] body.guide::before { opacity: .05; }
:root[data-theme="light"] body.guide::after { display: none; }
:root[data-theme="light"] nav { background: rgba(244,241,234,.92); border-bottom-color: rgba(91,63,196,.25); }
:root[data-theme="light"] h2, :root[data-theme="light"] .ghead h1, :root[data-theme="light"] a:hover { text-shadow: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) body.guide::before { opacity: .05; }
  :root:not([data-theme="dark"]) body.guide::after { display: none; }
  :root:not([data-theme="dark"]) nav { background: rgba(244,241,234,.92); border-bottom-color: rgba(91,63,196,.25); }
  :root:not([data-theme="dark"]) h2, :root:not([data-theme="dark"]) .ghead h1, :root:not([data-theme="dark"]) a:hover { text-shadow: none; }
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ghead { padding: 44px 0 20px; position: relative; }
.ghead h1 { font-family: var(--pixel); font-size: clamp(18px, 5vw, 30px); color: var(--cyan); letter-spacing: .08em; margin: 0 0 14px; text-shadow: 0 0 16px rgba(180,156,255,.6); overflow-wrap: anywhere; }
.ghead .lead { max-width: 760px; margin: 0 0 18px; }
.ghead .crumb { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }

.gtools { display: flex; gap: 8px; max-width: 760px; }
.gsearch { flex: 1; min-width: 0; }
.gsearch input { width: 100%; min-height: 44px; padding: 0 12px; background: var(--bg2); color: var(--text); border: 1px solid var(--line); font: 15px var(--mono); border-radius: 0; -webkit-appearance: none; appearance: none; }
.gsearch input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan); }
.gbtn { flex: none; min-width: 44px; min-height: 44px; background: transparent; color: var(--cyan); border: 1px solid var(--line); font: 18px var(--mono); cursor: pointer; }
.gbtn:hover { border-color: var(--cyan); }
.gres { max-width: 760px; margin: 10px 0 0; border: 1px solid var(--line); background: var(--bg2); position: relative; z-index: 3; }
.gres a { display: block; padding: 10px 12px; border-bottom: 1px solid rgba(180,156,255,.15); color: var(--text); }
.gres a:last-child { border-bottom: 0; }
.gres a b { color: var(--cyan); font-weight: 400; }
.gres a small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gres .empty { padding: 10px 12px; color: var(--muted); font-size: 13px; }
.gres .hd { padding: 8px 12px 4px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.glay { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; padding-bottom: 40px; }
.gtoc { position: relative; z-index: 2; }
.gtoc details { position: sticky; top: 72px; }
.gtoc summary { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); cursor: pointer; padding: 6px 0; list-style: none; }
.gtoc summary::-webkit-details-marker { display: none; }
.gtoc ol { list-style: none; margin: 6px 0 0; padding: 0; counter-reset: t; }
.gtoc li a { display: block; padding: 7px 0 7px 10px; font-size: 13px; line-height: 1.4; border-left: 1px solid var(--line); color: var(--text); }
.gtoc li a:hover, .gtoc li a.on { color: var(--cyan); border-left-color: var(--cyan); text-shadow: none; }
@media (max-width: 860px) {
  .glay { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .gtoc details { position: static; border: 1px solid var(--line); padding: 4px 12px 8px; }
  .gtoc summary { min-height: 36px; display: flex; align-items: center; }
  .gtoc summary::after { content: "▾"; margin-left: auto; }
  .gtoc details[open] summary::after { content: "▴"; }
}

.gdoc { min-width: 0; max-width: 760px; position: relative; z-index: 2; }
.gdoc .gs { padding: 18px 0 10px; border-top: 1px solid rgba(180,156,255,.12); scroll-margin-top: 64px; }
.gdoc .gs:first-of-type { border-top: 0; }
.gdoc h2 { margin: 6px 0 14px; line-height: 1.5; }
.gdoc h3 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); margin: 22px 0 8px; scroll-margin-top: 64px; }
.gdoc a.hl { color: inherit; }
.gdoc p, .gdoc li { font-size: 14.5px; }
.gdoc ul, .gdoc ol { padding-left: 22px; }
.gdoc li { margin: 4px 0; }
.gdoc .note { margin: 14px 0; padding: 6px 16px; border-left: 2px solid var(--cyan); background: rgba(180,156,255,.06); }
.gdoc .note p { margin: 8px 0; font-size: 14px; }
.gdoc .tbl { overflow-x: auto; margin: 12px 0; -webkit-overflow-scrolling: touch; }
.gdoc table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.gdoc th, .gdoc td { border: 1px solid rgba(180,156,255,.25); padding: 6px 8px; text-align: left; vertical-align: top; }
.gdoc th { color: var(--cyan); font-weight: 400; white-space: nowrap; }
.gdoc code { font-size: 13px; color: var(--cyan); }
.rv { border-bottom: 1px dotted var(--muted); cursor: help; white-space: nowrap; }
.gnote { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.gdoc mark { background: rgba(180,156,255,.35); color: inherit; padding: 0 1px; }
.gdoc .gs.off { display: none; }
.gnone { color: var(--muted); }
.gpn { display: flex; justify-content: space-between; gap: 12px; margin: 28px 0 0; padding-top: 18px; border-top: 1px solid rgba(180,156,255,.12); font-size: 13px; }
.gpn a { min-height: 44px; display: inline-flex; align-items: center; }

.gindex { padding-bottom: 48px; position: relative; z-index: 2; }
.gindex .gs h2 { margin: 18px 0 10px; }
.gindex p, .gindex li { max-width: 760px; font-size: 14.5px; }
.gcards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 22px; }
.gcard { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); background: rgba(0,0,0,.35); color: var(--text); }
.gcard:hover { border-color: var(--cyan); text-shadow: none; }
.gcard .n { font-family: var(--pixel); font-size: 12px; color: var(--muted); }
.gcard b { color: var(--cyan); font-weight: 400; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }
.gcard span:last-child { font-size: 13px; }
:root[data-theme="light"] .gcard { background: rgba(255,255,255,.6); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .gcard { background: rgba(255,255,255,.6); } }
@media (max-width: 480px) { .ghead { padding: 28px 0 14px; } .gdoc p, .gdoc li { font-size: 14px; } .wrap.glay, .wrap.gindex { padding: 0 16px 40px; } .ghead .wrap { padding: 0 16px; } }
