.ptitle.sm{font-size:clamp(2.4rem,7vw,7rem)}
.meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));gap:1.5rem;margin:3rem 0 0;max-width:56rem}
.meta dt{font-size:.8rem;margin-bottom:.4rem}.meta dd{font-weight:500;line-height:1.25}
.blk{margin-top:9rem}
.h2s{font-size:clamp(2.6rem,8vw,8rem);line-height:.9;letter-spacing:-.05em}
.note{max-width:34rem;margin-top:1.5rem;font-weight:500;line-height:1.4}
:root{--pk:#ffd1e3;--mint:#c9f2e1;--butter:#fff0a8;--lav:#dcd3ff;--peach:#ffd9bd}

/* game (styled after the original p5 version) */
.game{position:relative;overflow:hidden;background:#f8f8f8;padding:1.2rem 1.5rem 2rem;margin-top:2.5rem}
.gtop{display:flex;justify-content:space-between;font-size:.65rem;font-weight:700;letter-spacing:.04em;padding-bottom:.6rem;border-bottom:1px solid #333}
.gtitle{text-align:center;font-size:clamp(1.3rem,2.6vw,1.9rem);letter-spacing:-.02em;margin:1.2rem 0 .3rem}
.gbar{display:flex;justify-content:center;align-items:center;gap:1.6rem;margin-bottom:1.4rem;font-size:.8rem;font-weight:500}
.gbar b{margin-left:.3rem}
.gbar button{border:2px solid #000;border-radius:8px;background:#000;color:#fff;padding:.3rem .9rem;font:inherit;font-weight:700;font-size:.75rem;transition:background .2s}
.gbar button:hover{background:#333}
.wall{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:1.4rem}
.wall figure{background:#fff;border:1.5px solid #333;padding:.5rem .5rem 0;margin:0}
.wall img{width:100%;aspect-ratio:4/5;object-fit:cover;display:block}
.wall figcaption{font-size:.7rem;padding:.5rem 0;margin:0}
#grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.gc{margin:0;border:1.5px solid #333;border-radius:0;background:#fff;height:4.4rem;padding:0 .5rem;font:inherit;font-weight:700;font-size:clamp(.72rem,1.4vw,.95rem);color:#111;transition:border-width .1s,background .15s}
.gc:hover{border-width:3px}
.gc.sel{background:#d0d0d0}
.gc.shake{animation:shake .45s}
@keyframes shake{20%{transform:translateX(-7px)}40%{transform:translateX(7px)}60%{transform:translateX(-5px)}80%{transform:translateX(5px)}}
.sv{margin-bottom:12px;animation:pop .4s var(--ease)}
.sv small{display:block;font-size:.65rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;margin-bottom:.35rem}
.sv .cells{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.sv .cells span{display:grid;place-items:center;height:4.4rem;padding:0 .5rem;background:var(--c);color:#fff;border:1.5px solid #333;font-weight:700;font-size:clamp(.72rem,1.4vw,.95rem)}
@keyframes pop{from{transform:scale(.96);opacity:0}}
#msg{text-align:center;margin-top:1.3rem;font-size:.85rem;font-weight:500;min-height:1.4em}
.cf{position:absolute;top:-1.5rem;pointer-events:none;font-size:1.3rem;animation:fall 2.6s linear forwards}
@keyframes fall{to{transform:translateY(40rem) rotate(360deg);opacity:0}}

/* research map */
.hmw{max-width:52rem;margin-top:2.5rem;font-size:clamp(1.4rem,3vw,2.6rem);line-height:1.08;letter-spacing:-.03em}
.tl{display:flex;flex-wrap:wrap;justify-content:space-between;gap:.5rem 1rem;margin:3.5rem 0 2.5rem;border-top:2px solid #000;padding-top:.8rem}
.tl button{position:relative;background:none;border:0;font:inherit;text-align:left;padding:.5rem 0}
.tl button::before{content:"";position:absolute;top:-1.3rem;left:0;width:.8rem;height:.8rem;border-radius:50%;background:#000;transition:transform .2s,background .2s}
.tl button:hover::before,.tl button.on::before{background:var(--pink);transform:scale(1.5)}
.tl b{display:block;font-size:.9rem}.tl span{font-size:.8rem;font-weight:500}
.rmwrap{display:grid;grid-template-columns:1fr 21rem;gap:3rem;align-items:start}
.rm{position:relative;display:grid;grid-template-columns:repeat(4,1fr);gap:2.6rem}
.col{display:flex;flex-direction:column;justify-content:space-around;gap:.9rem}
.col h3{font-size:.8rem;margin-bottom:.4rem}
#links{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}
#links path{fill:none;stroke:#bbb;stroke-width:1.5;transition:opacity .25s,stroke .25s}
#links path.on{stroke:#000;stroke-width:2.5;stroke-dasharray:6 6;animation:flow 1s linear infinite}
@keyframes flow{to{stroke-dashoffset:-12}}
.nd{position:relative;z-index:1;display:block;text-align:left;border:2px solid #000;border-radius:14px;background:#fff;padding:.7rem .8rem .7rem 1.9rem;font:inherit;transition:opacity .25s,transform .2s,box-shadow .2s}
.nd i{position:absolute;left:.7rem;top:.85rem;width:.7rem;height:.7rem;border-radius:50%;background:var(--c);border:1.5px solid #000}
.nd b{display:block;font-size:.85rem;line-height:1.1}.nd span{font-size:.7rem;font-weight:500}
.nd:hover,.nd.on{transform:translate(-2px,-2px);box-shadow:3px 3px 0 #000}
.rm.sel .nd:not(.on){opacity:.22}.rm.sel #links path:not(.on){opacity:.1}
.panel{position:sticky;top:6rem;background:#fff4f8;border:2px solid #000;border-radius:20px;padding:1.4rem;box-shadow:5px 5px 0 #000}
.panel .tg{display:inline-block;background:var(--c);border:2px solid #000;border-radius:99px;padding:.15rem .7rem;font-size:.7rem;margin-bottom:.8rem}
.panel h3{font-size:1.5rem;letter-spacing:-.03em;line-height:1;margin-bottom:.7rem}
.panel p{font-weight:500;line-height:1.4;font-size:.9rem}
.panel ul{margin:.9rem 0 0 1.1rem;font-weight:500;font-size:.85rem;line-height:1.4}.panel li{margin-bottom:.45rem}
.sws{display:flex;gap:.4rem;margin-top:1rem}.sws span{flex:1;height:2.6rem;border:2px solid #000;border-radius:10px}

/* systems map */
#sysmap{display:block;width:100%;max-width:62rem;margin:2rem auto 0}
#sysmap line{stroke:#d9cfe3;stroke-width:1.2;stroke-linecap:round;transition:opacity .3s,stroke .3s}
#sysmap circle{stroke:none}
#sysmap text{font-weight:700;pointer-events:none}
#sysmap .n{outline:none;transform-box:fill-box;transform-origin:center;transition:opacity .3s,transform .35s var(--ease)}
#sysmap .n:hover,#sysmap .n:focus{transform:scale(1.1)}
#sysmap.hov .n:not(.lit){opacity:.18}
#sysmap.hov line:not(.lit){opacity:.1}
#sysmap line.lit{stroke:#ff7eb6;stroke-width:2}

@media (max-width:1100px){.rmwrap{grid-template-columns:1fr}.panel{position:static}}
@media (max-width:900px){
  .rm{grid-template-columns:1fr}#links{display:none}
  .panel{position:sticky;top:auto;bottom:.8rem;max-height:34vh;overflow:auto;z-index:3}
}
@media (max-width:700px){
  .game{padding:1rem}.wall{grid-template-columns:repeat(2,1fr)}
  #grid,.sv .cells{grid-template-columns:repeat(2,1fr)}.blk{margin-top:6rem}
}
@media (prefers-reduced-motion:reduce){#links path.on{animation:none}.cf{display:none}}