:root{color-scheme:light;--bg:#f8f6ed;--paper:#fffdf7;--ink:#242821;--muted:#565c51;--line:#d8dbcd;--accent:#2d5937;--fill:#e4edd9;font-family:system-ui,sans-serif;color:var(--ink);background:var(--bg);font-synthesis:none}
*{box-sizing:border-box}
body{margin:0;min-height:100vh;color:var(--ink);background:var(--bg)}
body[data-theme=arcade]{color-scheme:dark;--bg:#101821;--paper:#182430;--ink:#f2f8ff;--muted:#acbdd0;--line:#34495d;--accent:#a5e9be;--fill:#233f38}
body[data-theme=shop]{--bg:#faf4eb;--paper:#fffdfa;--ink:#361d25;--muted:#68535a;--line:#edd9d7;--accent:#8a2350;--fill:#f5e3ea}
body[data-theme=studio]{--bg:#eef1f6;--paper:#fff;--ink:#182b46;--muted:#475b72;--line:#cfd9e7;--accent:#234aa6;--fill:#dce6fc}
body[data-theme=docs]{--bg:#f5f6ff;--paper:#fff;--ink:#22243e;--muted:#545775;--line:#d9dbed;--accent:#4843a7;--fill:#e9e8fb}
body[data-theme=desk]{--bg:#fff8e4;--paper:#fffcf4;--ink:#3e2c08;--muted:#66552d;--line:#e7d8b1;--accent:#754a0a;--fill:#ffedb7}
body[data-theme=cdn]{--bg:#edf6f6;--paper:#fff;--ink:#133838;--muted:#456465;--line:#c8dfde;--accent:#1a6567;--fill:#d9edeb}
header,main,footer{width:min(100% - 2.5rem,66rem);margin-inline:auto}
header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.75rem;padding:1.2rem 0;border-bottom:1px solid var(--line)}
header nav, .actions{display:flex;gap:.65rem 1rem;align-items:center;flex-wrap:wrap}
.brand{font-weight:800;text-decoration:none;color:var(--ink);letter-spacing:.035em}
main{min-height:55vh;padding-block:clamp(2.5rem,6vw,5rem)}
h1,h2,h3,p{margin-top:0}
h1{max-width:19ch;font-size:clamp(2.45rem,7.5vw,5.2rem);line-height:1;letter-spacing:-.055em;margin-bottom:1rem}
h2{font-size:1.35rem;line-height:1.25;margin-bottom:.65rem}
h3{font-size:1.05rem}
p,li{line-height:1.6}
.lead{max-width:58ch;color:var(--muted);font-size:1.12rem;margin-bottom:2rem}
a{color:var(--accent);text-underline-offset:.2em}
a:hover{text-decoration-thickness:2px}
:focus-visible{outline:2px solid var(--accent);outline-offset:4px}
button,input,select,textarea{font:inherit;color:inherit}
button,.action{display:inline-flex;gap:.4rem;align-items:center;justify-content:center;min-height:2.75rem;padding:.55rem .85rem;border:1px solid var(--line);border-radius:.45rem;background:var(--paper);color:var(--accent);font-weight:660;cursor:pointer}
button:hover,.action:hover{background:var(--fill)}
button[aria-pressed=true],.primary{background:var(--fill);border-color:var(--accent)}
button:disabled{cursor:default;opacity:.6}
.card{padding:clamp(1rem,3vw,1.5rem);border:1px solid var(--line);border-radius:.65rem;background:var(--paper)}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr));gap:1rem}
.grid p,.card p:last-child{margin-bottom:0}
.filters{margin-bottom:1rem}
label{font-weight:650}
textarea,input:not([type=checkbox]),select{display:block;margin:.35rem 0 .85rem;padding:.65rem .75rem;border:1px solid var(--line);border-radius:.35rem;background:var(--paper);width:100%}
.status{min-height:1.5em;color:var(--muted);margin:.75rem 0}
.swatch{height:5rem;display:grid;grid-template-columns:repeat(3,1fr);margin-bottom:1rem;overflow:hidden;border-radius:.35rem}
.swatch i{background:var(--swatch)}
.catalog .action{margin-top:1rem}
article{max-width:46rem}
article section+section{margin-top:1.75rem}
pre{line-height:1.55;border:1px solid var(--line);border-radius:.4rem;background:var(--paper);padding:1rem;overflow:auto}
code,.mono{font-family:ui-monospace,monospace}
footer{padding:1rem 0 2rem;border-top:1px solid var(--line);color:var(--muted);font-size:.9rem}
.game{display:grid;grid-template-columns:minmax(0,29rem) minmax(0,23rem);gap:1.4rem;align-items:start}
.board{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:clamp(.2rem,1vw,.45rem)}
.tile{padding:0;min-height:0;aspect-ratio:1;position:relative;border-radius:.32rem;display:grid;place-items:center;color:#7d9ab1;background:#213140;overflow:hidden}
button.tile:hover{color:var(--accent);background:#283e4a}
.tile.wall{background:#14212c;border-color:#293e50}
.tile.lit{color:#a5e9be;background:#254638}
.tile .arm{position:absolute;background:currentColor;border-radius:3px}
.tile .n,.tile .s{width:14%;height:54%;left:43%}
.tile .e,.tile .w{width:54%;height:14%;top:43%}
.tile .n{top:0}.tile .s{bottom:0}.tile .e{right:0}.tile .w{left:0}
.tile .cap{position:relative;z-index:1;width:23%;aspect-ratio:1;border:2px solid currentColor;border-radius:100%;background:#182430}
.tile.terminal{color:#ffd78d}
.game .actions{margin-top:1rem}
.note-sheet{min-height:12rem;resize:vertical;line-height:1.7}
.file-list{list-style:none;padding:0;margin:0}
.file-list li{display:flex;justify-content:space-between;align-items:center;gap:.75rem;flex-wrap:wrap;padding:.85rem 0;border-bottom:1px solid var(--line)}
.file-list li:first-child{border-top:1px solid var(--line)}
@media(max-width:680px){.game{grid-template-columns:1fr}.game .rules{grid-row:1}.game .rules p{margin-bottom:.45rem}main{padding-top:2.5rem}}
[hidden]{display:none!important}
