:root{--bg:#f5efe3;--ink:#1f2128;--muted:#5b616c;--line:#dccfb6;--line-soft:#e6dcc7;--card:#fffcf5;--accent:#a4560f;--accent-ink:#8a4510;--stage:#1d1a22;--stage2:#2b2230;--stage-ink:#fbf1de;--stage-muted:#d8c9ad;--pay:#c8432e;color-scheme:light}
html[data-theme="dark"]{--bg:#121318;--ink:#ece4d2;--muted:#a9adb8;--line:#33343d;--line-soft:#2a2b33;--card:#1b1c23;--accent:#eda55a;--accent-ink:#f3b878;--stage:#16141a;--stage2:#241d27;--stage-ink:#fbf1de;--stage-muted:#d8c9ad;--pay:#ff7b66;color-scheme:dark}
@media (prefers-color-scheme:dark){html:not([data-theme="light"]){--bg:#121318;--ink:#ece4d2;--muted:#a9adb8;--line:#33343d;--line-soft:#2a2b33;--card:#1b1c23;--accent:#eda55a;--accent-ink:#f3b878;--pay:#ff7b66;color-scheme:dark}}
*{box-sizing:border-box}
html{scroll-padding-top:70px}
body{margin:0;background:var(--bg);color:var(--ink);font:18px/1.62 Georgia,'Iowan Old Style','Times New Roman',serif;-webkit-text-size-adjust:100%}
a{color:var(--accent-ink);text-underline-offset:.18em}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
[hidden]{display:none!important}
.ui,button,input,table,.topbar,.small,.kv,.legend,.stat,footer{font-family:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif}
/* topbar */
.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:.9rem;height:46px;padding:0 1rem;padding-top:var(--browser-safe-top,env(safe-area-inset-top));background:var(--bg);border-bottom:1px solid var(--line-soft);font-size:14px}
.topbar .home{color:var(--ink);text-decoration:none;font-weight:600;white-space:nowrap}
.topnav{display:flex;gap:1rem;overflow-x:auto;scrollbar-width:none;white-space:nowrap}.topnav::-webkit-scrollbar{display:none}
.topnav a{color:var(--muted);text-decoration:none}.topnav a:hover{color:var(--ink)}
.spacer{flex:1}
.chip{color:var(--ink);text-decoration:none;border:1px solid var(--line);border-radius:999px;padding:.18rem .7rem;font-size:13px;white-space:nowrap}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;border:1px solid var(--line);background:transparent;color:var(--ink);cursor:pointer;padding:0}
@media (max-width:640px){.topnav{display:none}}
/* layout */
main{max-width:72rem;margin:0 auto;padding:0 1rem 3rem}
.narrow{max-width:42rem}
section{scroll-margin-top:70px}
h1{font-size:clamp(1.8rem,4.2vw,2.9rem);line-height:1.12;margin:1.3rem 0 .7rem;letter-spacing:-.01em;max-width:24ch;font-weight:700}
h2{font-size:clamp(1.45rem,3vw,1.9rem);line-height:1.2;margin:3.2rem 0 .8rem}
h3{line-height:1.25}
.deck{font-size:1.18rem;line-height:1.55;max-width:42rem;margin:0 0 .7rem}
.byline{font-size:14px;color:var(--muted);margin:.4rem 0 1rem}
.small{font-size:.86rem;color:var(--muted);line-height:1.5}
/* the stage */
.stage{position:relative;background:radial-gradient(120% 90% at 18% 0%,#3a2b2a 0%,var(--stage2) 38%,var(--stage) 100%);color:var(--stage-ink);border-radius:18px;padding:1rem 1rem .8rem;margin:1rem 0 1rem;box-shadow:0 18px 44px -26px rgba(20,10,0,.55);overflow:hidden;border:1px solid rgba(255,236,200,.10)}
.stage a{color:#ffd79a}
.stage .controls{display:flex;gap:.55rem;flex-wrap:wrap;align-items:center;margin:0 0 .7rem}
.stage input[type=search]{flex:1 1 15rem;min-width:0;max-width:26rem;font-size:16px;padding:.6rem .85rem;border-radius:10px;border:1px solid rgba(255,243,220,.28);background:rgba(255,248,236,.08);color:var(--stage-ink);min-height:44px}
.stage input::placeholder{color:rgba(255,243,220,.6)}
.btn{font-size:14.5px;padding:.5rem .85rem;border-radius:999px;border:1px solid rgba(255,243,220,.32);background:rgba(255,248,236,.06);color:var(--stage-ink);min-height:40px;cursor:pointer}
.btn:hover{background:rgba(255,248,236,.14)}
#hits{list-style:none;margin:-.3rem 0 .6rem;padding:0;max-width:26rem}
#hits button{display:block;width:100%;text-align:left;font-size:15px;padding:.55rem .8rem;border:0;border-bottom:1px solid rgba(255,243,220,.12);background:rgba(255,248,236,.07);color:var(--stage-ink);cursor:pointer;min-height:44px}
#hits button:hover{background:rgba(255,248,236,.16)}
.scene{display:grid;grid-template-columns:minmax(0,1.32fr) minmax(0,1fr);gap:1.2rem;align-items:start}
@media (max-width:900px){.scene{grid-template-columns:1fr}}
.wrap{position:relative}
#map{width:100%;height:auto;display:block;touch-action:manipulation;cursor:pointer}
.legend{display:flex;flex-wrap:wrap;gap:.2rem .9rem;font-size:12.5px;color:var(--stage-muted);margin:.5rem 0 0}
.legend i{display:inline-block;width:.95em;height:.95em;border-radius:3px;margin-right:.35em;vertical-align:-.12em}
.maphint{font-size:12.5px;color:var(--stage-muted);margin:.35rem 0 0}
.tip{position:absolute;pointer-events:none;background:#fffaf0;color:#1f2128;border-radius:8px;padding:.35rem .6rem;font:13px/1.35 system-ui,sans-serif;display:none;z-index:5;box-shadow:0 6px 18px rgba(0,0,0,.3);max-width:200px}
.tip small{display:block;color:#6b6258;font-size:11.5px}
.pop{position:absolute;z-index:6;width:250px;background:#fffaf0;color:#1f2128;border-radius:12px;padding:.75rem .85rem .8rem;box-shadow:0 14px 34px rgba(0,0,0,.42);font:14px/1.4 system-ui,sans-serif;animation:popin .14s ease-out}
.pop h4{margin:0 1.6rem .1rem 0;font-size:16px}
.pop .small{color:#5b616c;margin:.1rem 0 .4rem}
.pop .big{margin:.2rem 0 .5rem;font-size:15px}
.pop .x{position:absolute;right:.35rem;top:.25rem;width:32px;height:32px;border:0;background:none;font-size:20px;cursor:pointer;color:#5b616c}
.pop .go{width:100%;border:0;border-radius:9px;background:#a4560f;color:#fff;font:600 14px system-ui,sans-serif;padding:.55rem;min-height:40px;cursor:pointer}
.pop .picks{display:flex;flex-wrap:wrap;gap:.35rem}.pop .picks button{border:1px solid #d8ccb5;border-radius:999px;background:#fff;padding:.3rem .65rem;font:13px system-ui,sans-serif;cursor:pointer;min-height:36px}
.pop.sheet{left:6px!important;right:6px;bottom:6px;top:auto!important;width:auto}
@keyframes popin{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.jarcol{display:flex;flex-direction:column}
.jarhead h3{margin:.1rem 0 0;font-size:1.3rem;color:#fff6e6}
.jarhead p{margin:.1rem 0 0;font-size:13px;color:var(--stage-muted)}
#vessel{margin:.2rem -.4rem 0;min-height:200px}
#vessel svg{max-height:min(440px,52vh);margin:0 auto}
#vessel .jt{font-family:system-ui,-apple-system,'Segoe UI',sans-serif}
.ans{font-size:1.12rem;line-height:1.45;margin:.1rem 0 .5rem;color:#fff6e6}
.ans b{color:#ffc67a}
.bani{font:13.5px/1.5 system-ui,sans-serif;color:var(--stage-muted);margin:0}
.bani i{display:inline-block;width:.8em;height:.8em;border-radius:2px;margin:0 .3em 0 .1em;vertical-align:-.05em}
.rungs{display:flex;flex-wrap:wrap;gap:.4rem;margin:.9rem 0 .2rem;align-items:center}
.rungs .lab{font:600 13px system-ui,sans-serif;color:var(--stage-muted);margin-right:.2rem}
.rungs button{font:13.5px system-ui,sans-serif;padding:.42rem .75rem;border-radius:999px;border:1px solid rgba(255,243,220,.3);background:transparent;color:var(--stage-ink);cursor:pointer;min-height:40px}
.rungs button[aria-checked="true"]{background:#fbf1de;color:#1f1a16;border-color:#fbf1de;font-weight:600}
#rungCount{font:14px/1.45 system-ui,sans-serif;color:var(--stage-muted);margin:.3rem 0 0;min-height:1.45em}
#rungCount b{color:#fff6e6}
#loadStatus{font:14px system-ui,sans-serif;color:var(--stage-muted)}
#sharedNote{font:15px system-ui,sans-serif;background:var(--card);border:1px solid var(--accent);border-radius:10px;padding:.6rem .8rem;margin:.6rem 0}
.stage-reset{position:absolute;right:1rem;top:1rem}
/* full card */
.result{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:1rem 1.1rem;margin:1rem 0;scroll-margin-top:60px}
.result h3{margin:.1rem 0 .1rem;font-size:1.3rem}
.result h3:focus{outline:none}
.kv{font-size:15px;columns:2 22rem;column-gap:2rem}
.kv div{display:flex;justify-content:space-between;gap:1rem;border-bottom:1px solid var(--line-soft);padding:.36rem 0;break-inside:avoid}
.kv b{font-variant-numeric:tabular-nums;white-space:nowrap}
.sw{display:inline-block;width:.8em;height:.8em;border-radius:2px;margin-right:.45em;vertical-align:-.05em}
/* figures and tables */
.panel{background:radial-gradient(120% 120% at 10% 0%,#30262c 0%,var(--stage) 80%);border-radius:16px;padding:.8rem;margin:1rem 0}
#strip{width:100%;height:auto;aspect-ratio:960/320;display:block}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(13rem,1fr));gap:.8rem;margin:1rem 0}
.stat{background:var(--card);border:1px solid var(--line-soft);border-radius:12px;padding:.8rem .9rem;font-size:14.5px;line-height:1.4;color:var(--muted)}
.stat b{display:block;font:700 1.6rem/1.15 Georgia,serif;color:var(--ink);margin-bottom:.2rem}
.tablewrap{overflow-x:auto;margin:1rem 0}
table{width:100%;border-collapse:collapse;font-size:15px}
th,td{padding:.5rem .55rem;border-bottom:1px solid var(--line-soft);text-align:right;vertical-align:top}
th{font-weight:600;color:var(--muted);font-size:13.5px}
th:first-child,td:first-child{text-align:left}
td{font-variant-numeric:tabular-nums}
td button{font:inherit;background:none;border:none;color:var(--accent-ink);cursor:pointer;padding:0;text-align:left;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.18em}
.ladder td:nth-child(2){text-align:left;color:var(--muted)}
.ladder tr.cur td{background:color-mix(in srgb,var(--accent) 10%,transparent)}
.more{font:14px system-ui,sans-serif;padding:.5rem .9rem;border-radius:999px;border:1px solid var(--line);background:var(--card);color:var(--ink);cursor:pointer;min-height:40px}
/* share */
.share-row{display:flex;gap:.45rem;align-items:center;flex-wrap:wrap;margin:.6rem 0 1rem;font:14px system-ui,sans-serif;color:var(--muted)}
.share-row a,.share-row button{display:inline-flex;width:40px;height:40px;border-radius:50%;border:1px solid var(--line-soft);background:transparent;color:var(--ink);align-items:center;justify-content:center;cursor:pointer;padding:0}
.share-row a:hover,.share-row button:hover{border-color:var(--accent);color:var(--accent-ink)}
@media (pointer:coarse){.share-row a,.share-row button{width:44px;height:44px}}
/* rail */
.rail{position:fixed;right:.7rem;top:50%;transform:translateY(-50%);display:none;flex-direction:column;gap:.6rem;z-index:8;opacity:0;transition:opacity .3s}
.past-hero .rail{opacity:1}
.rail a{width:9px;height:9px;border-radius:50%;border:1.5px solid var(--muted);display:block;position:relative}
.rail a[aria-current="true"]{background:var(--accent);border-color:var(--accent)}
.rail a span{position:absolute;right:16px;top:50%;transform:translateY(-50%);background:var(--card);color:var(--ink);border:1px solid var(--line);padding:.1rem .5rem;border-radius:6px;font:12px system-ui,sans-serif;white-space:nowrap;display:none;pointer-events:none}
.rail a:hover span,.rail a:focus span{display:block}
@media (min-width:1260px){.rail{display:flex}}
footer{border-top:1px solid var(--line-soft);margin-top:3rem;padding:1.2rem 0;font-size:14px;color:var(--muted)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media (max-width:640px){.stage .controls{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin-right:-.7rem;padding-right:.7rem}.stage .controls::-webkit-scrollbar{display:none}.stage input[type=search]{flex:0 0 72%}.btn{white-space:nowrap;flex:0 0 auto}.deck{font-size:1.05rem}body{font-size:17px}.stage{padding:.75rem .7rem .7rem;border-radius:14px;margin-left:-.4rem;margin-right:-.4rem}.kv{columns:1}h1{margin-top:1.1rem}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
