:root{--sl:env(safe-area-inset-left,0px);--sr:env(safe-area-inset-right,0px);--st:env(safe-area-inset-top,0px);--sb:env(safe-area-inset-bottom,0px);--hud:38px;--side:112px;--panel:#121a16eb;--line:#ffffff29;--gold:#e8c33a;--ok:#37b24d;--bad:#e5484d}*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{color:#fff;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:none;overscroll-behavior:none;background:#1b2a1d;height:100%;margin:0;font:600 13px/1.25 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;position:fixed;top:0;bottom:0;left:0;right:0;overflow:hidden}canvas{width:100%;height:100%;display:block;position:fixed;top:0;bottom:0;left:0;right:0}#labels{pointer-events:none}button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation;border:0;margin:0}[hidden]{display:none!important}#hudbg{height:calc(var(--st) + var(--hud));border-bottom:1px solid var(--line);background:#0c120fe0;position:fixed;top:0;left:0;right:0}#hud{top:var(--st);left:var(--sl);right:var(--sr);height:var(--hud);white-space:nowrap;align-items:center;gap:6px;padding:0 8px;display:flex;position:fixed}#hud .menu{background:#ffffff1f;border-radius:8px;flex:none;width:44px;height:34px;font-size:17px;position:relative}#hud .menu:after,#sheet .head .x:after{content:"";position:absolute;top:-5px;bottom:-5px;left:-2px;right:-2px}.chip{background:#ffffff17;border-radius:8px;align-items:center;gap:5px;height:28px;padding:0 9px;font-size:13px;display:flex}.chip b{font-variant-numeric:tabular-nums;font-size:15px;font-weight:800}.chip i.sw{color:#1a1a1a;border-radius:4px;place-items:center;width:16px;height:16px;font-size:10px;font-style:normal;font-weight:900;display:grid}.chip .n{opacity:.8}.chip.wave{background:#ffffff2e}.chip.castle .bar{background:#0000008c;border-radius:5px;width:64px;height:9px;overflow:hidden}.chip.castle .bar i{background:#4ade80;width:100%;height:100%;transition:width .2s;display:block}.chip.hit{animation:.35s hit}@keyframes hit{0%{background:var(--bad)}to{background:#ffffff17}}#hud .sp{flex:1}#side{top:calc(var(--st) + var(--hud) + 6px);right:var(--sr);bottom:max(var(--sb), 6px);width:var(--side);flex-direction:column;gap:6px;padding-right:6px;display:flex;position:fixed}#side button{background:var(--panel);border:1px solid var(--line);border-radius:10px;flex-direction:column;justify-content:center;align-items:center;min-height:44px;padding:4px 6px;display:flex;position:relative;overflow:hidden}#side button:active{filter:brightness(1.3)}#side .info{flex:none;height:84px}#side .info small{opacity:.7;letter-spacing:.06em;font-size:10px;line-height:1.2}#side .info b{font-size:15px}#side .info span{color:#ffb4a8;text-align:center;max-height:2.4em;font-size:12px;line-height:1.2;display:block;overflow:hidden}#side .start{background:var(--ok);letter-spacing:.04em;border-color:#8ce99a;min-height:50px;font-size:16px;font-weight:900}#side .row{gap:6px;display:flex}#side .row button{flex:1;font-size:16px;font-weight:800}#side .row button.on{color:#1a1a1a;background:#f59f00}#side .spell{min-height:54px}#side .spell b{letter-spacing:.03em;z-index:1;font-size:13px;position:relative}#side .spell span{opacity:.85;z-index:1;font-size:11px;position:relative}#side .spell .cd{background:#000000b3;height:0;position:absolute;bottom:0;left:0;right:0}#side .spell.off{opacity:.45}#side .spell.armed{outline-offset:-3px;outline:3px solid #fff}#side .fill{flex:1}#stage{top:calc(var(--st) + var(--hud));left:var(--sl);right:calc(var(--sr) + var(--side));bottom:max(calc(var(--sb) * .6), 4px);pointer-events:none;position:fixed}#sheet{background:var(--panel);border:1px solid var(--line);pointer-events:auto;border-radius:12px;max-width:calc(100% - 16px);padding:7px 8px 8px;position:absolute;bottom:6px;left:8px}#sheet.top{top:6px;bottom:auto}#sheet .head{align-items:center;gap:8px;margin-bottom:6px;display:flex}#sheet .head b{font-size:15px}#sheet .head span{opacity:.85;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:12px;overflow:hidden}#sheet .head .x{background:#ffffff1f;border-radius:8px;flex:none;width:44px;height:36px;font-size:16px;position:relative}#sheet .acts{grid-template-columns:repeat(var(--cols,3), minmax(0, 1fr));gap:6px;display:grid}.act{border:1px solid var(--line);text-align:left;border-left:5px solid var(--c,#ffffff4d);background:#ffffff1c;border-radius:10px;flex-direction:column;justify-content:center;align-items:flex-start;gap:1px;min-width:0;min-height:56px;padding:5px 8px;display:flex;overflow:hidden}.act b{white-space:nowrap;text-overflow:ellipsis;max-width:100%;font-size:14px;overflow:hidden}.act span{color:var(--gold);flex-wrap:wrap;column-gap:5px;max-width:100%;font-size:12px;line-height:1.25;display:flex}.act em,.box em{white-space:nowrap;font-style:normal}.act small{opacity:.8;max-width:100%;max-height:2.4em;font-size:11px;line-height:1.2;display:block;overflow:hidden}.act .sw,.box .sw{color:#1a1a1a;vertical-align:-1px;border-radius:3px;place-items:center;width:13px;height:13px;margin:0 2px 0 1px;font-size:9px;font-style:normal;font-weight:900;display:inline-grid}#sheet.dense .act{min-height:46px;padding-top:3px;padding-bottom:3px}#sheet.dense .act small{max-height:1.2em}.act.poor span{color:#ff8f8f}.act.poor{opacity:.7}.act.cap small{color:#ffb4a8;opacity:1;max-height:3.6em}.act.cap.poor{opacity:.9}#sheet.dense .act.cap small{max-height:2.4em}.act.locked{opacity:.45}.act.danger{--c:var(--bad)}.act.sure{background:var(--bad)}.act:active{filter:brightness(1.3)}#hint{background:var(--panel);pointer-events:auto;white-space:nowrap;border:2px solid #fff;border-radius:10px;align-items:center;max-width:calc(100% - 16px);min-height:44px;padding:0 14px;font-size:14px;display:flex;position:absolute;top:8px;left:50%;transform:translate(-50%)}#toast{white-space:nowrap;background:#000000d9;border-radius:10px;padding:8px 16px;font-size:14px;position:absolute;top:42%;left:50%;transform:translate(-50%)}#modal{padding:max(10px, var(--st)) max(12px, var(--sr)) max(10px, var(--sb)) max(12px, var(--sl));background:#0000008c;place-items:center;display:grid;position:fixed;top:0;bottom:0;left:0;right:0}.box{touch-action:pan-y;border:1px solid var(--line);background:#17211c;border-radius:14px;width:min(480px,100%);max-height:100%;padding:14px 16px;overflow-y:auto}.box h1{letter-spacing:.04em;margin:0 0 2px;font-size:24px}.box h2{margin:0 0 6px;font-size:18px}.box p{opacity:.9;margin:4px 0 8px;font-weight:500}.box ul{margin:4px 0 8px;padding-left:18px;font-weight:500}.box li{margin:3px 0}.box .btns{flex-wrap:wrap;gap:8px;margin-top:10px;display:flex}.box .btns button{border:1px solid var(--line);background:#ffffff21;border-radius:10px;flex:130px;min-height:46px;padding:4px 10px;font-size:15px;font-weight:800}.box .btns button.pri{background:var(--ok);border-color:#8ce99a}.box .btns button.warn{background:#7a2c2f}.box .btns button.full{flex-basis:100%}.box .btns button small{opacity:.85;margin-top:1px;font-size:12px;font-weight:600;display:block}.box table{border-collapse:collapse;width:100%;margin:6px 0;font-size:13px}.box td{border-bottom:1px solid #ffffff14;padding:3px 4px}.box td:last-child{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:800}.box td:only-child{text-align:left;white-space:normal;font-weight:600}.box table.kv td:first-child{white-space:nowrap;vertical-align:top;padding-right:12px}.box table.kv td:last-child{white-space:normal}.box .lost{color:#ff8f8f;font-weight:600}.box .new{border:1px solid var(--gold);background:#e8c33a29;border-radius:8px;margin:6px 0;padding:6px 10px}.box .tag{border-radius:4px;place-items:center;min-width:22px;height:20px;margin-right:6px;padding:0 4px;font-size:11px;font-weight:900;display:inline-grid}.cols{grid-template-columns:1fr 1fr;gap:0 16px;display:grid}#rotate{text-align:center;z-index:50;background:#17211c;place-items:center;font-size:20px;display:none;position:fixed;top:0;bottom:0;left:0;right:0}#rotate small{opacity:.7;margin-top:6px;font-size:13px;font-weight:500;display:block}@media (orientation:portrait) and (max-width:640px){#rotate{display:grid}}@media (max-width:980px){.chip .n{display:none}.chip{gap:4px;padding:0 7px}.chip.castle .bar{width:46px}#hud{gap:5px}}@media (min-height:560px) and (min-width:1000px){:root{--hud:46px;--side:150px}html,body{font-size:15px}.chip{height:34px;font-size:15px}.chip b{font-size:17px}#side .start{min-height:60px;font-size:18px}#side .spell{min-height:64px}#side .spell b{font-size:15px}#side .spell span{font-size:13px}.act{min-height:64px}.act b{font-size:16px}.act span{font-size:14px}.act small{font-size:12px}}.box.wide{width:min(760px,100%)}.box .fine{opacity:.7;font-size:12px}.box .step{opacity:.6;letter-spacing:.05em;text-transform:uppercase;font-size:11px}.box .first{color:#ffd166;font-size:11px;font-weight:700}.camphead{flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:8px;display:flex}.camphead h2{margin:0}.camphead span{color:#ffd166;font-size:14px}.camphead .resline{color:#fff;opacity:.85;align-items:center;gap:4px;margin-left:auto;display:flex}.camphead .sw{color:#1a1a1a;border-radius:4px;place-items:center;width:15px;height:15px;margin-left:6px;font-size:9px;font-style:normal;font-weight:900;display:inline-grid}.lvls{grid-template-columns:repeat(5,1fr);gap:7px;display:grid}.lvl{border:1px solid var(--line);text-align:center;background:#ffffff1c;border-radius:10px;flex-direction:column;justify-content:center;align-items:center;gap:1px;min-height:64px;padding:5px 6px;display:flex}.lvl i{opacity:.7;font-size:11px;font-style:normal;font-weight:800}.lvl b{font-size:13px;line-height:1.1}.lvl span{color:#ffd166;letter-spacing:.05em;font-size:12px}.lvl.lock{opacity:.4}.lvl.next{background:#37b24d47;border-color:#8ce99a}.lvl:active{filter:brightness(1.3)}.box.campmap{color:#3b2a17;background:radial-gradient(at 22% 30%,#fffaeb73,#0000 55%),radial-gradient(at 78% 75%,#8c5f2829,#0000 55%),repeating-linear-gradient(115deg,#785a2809 0 2px,#0000 2px 7px),linear-gradient(#ecdcb4,#dcc495);border:2px solid #8a6a3a;flex-direction:column;width:100%;max-width:none;height:100%;padding:8px 12px 10px;display:flex;overflow:hidden;box-shadow:inset 0 0 38px #6e46148c,inset 0 0 6px #50320f99}.campmap .camphead{margin-bottom:2px}.campmap .camphead h2{color:#3b2a17;letter-spacing:.04em;font-family:Georgia,Times New Roman,serif}.campmap .camphead span{color:#8a5a00;font-weight:800}.campmap .camphead .resline{color:#3b2a17;opacity:1;font-weight:800}.campmap .btns{margin-top:4px}.campmap .btns button{color:#f3e6c4;background:#3b2a17e0;border-color:#2a1d0f}.cmap{flex:1;min-height:180px;position:relative}.cmap .terrain{width:100%;height:100%;position:absolute;top:0;bottom:0;left:0;right:0;overflow:visible}.maptoast{z-index:2;color:#f3e6c4;white-space:nowrap;pointer-events:none;background:#281a0ceb;border:1px solid #8a6a3a;border-radius:10px;padding:8px 16px;font-size:14px;font-weight:800;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.node{color:#3b2a17;background:0 0;border:0;flex-direction:column;align-items:center;min-width:48px;padding:0;display:flex;position:absolute;transform:translate(-50%,-22px)}.node .pin{color:#3b2a17;background:#f6ecd2;border:3px solid #6b4b25;border-radius:50%;place-items:center;width:44px;height:44px;font-size:18px;font-weight:900;display:grid;box-shadow:0 2px #3c280f8c}.node b{white-space:nowrap;text-shadow:0 0 3px #f1e3bd,0 0 3px #f1e3bd,0 0 2px #f1e3bd;margin-top:2px;font-size:11px;line-height:1.1}.node .st{color:#9a6a00;letter-spacing:.04em;white-space:nowrap;text-shadow:0 0 3px #f1e3bd,0 0 3px #f1e3bd;font-size:11px;font-weight:800;line-height:1.1}.node.cleared .pin{color:#fff;background:#5f9e48;border-color:#35602a}.node.next .pin{background:#ffd166;border-color:#a86f00;animation:1.4s ease-in-out infinite nodepulse}.node.next b{font-size:12px}.node.lock .pin{box-shadow:none;background:#d4c49c;border-color:#9c8a64;font-size:15px}.node.lock b{opacity:.55}.node.final .pin{border-color:#7a1f2b;width:50px;height:50px;margin-top:-3px}.node.final.lock .pin{border-color:#8a6a64}.node:active .pin{filter:brightness(1.15);transform:scale(.96)}@keyframes nodepulse{0%,to{box-shadow:0 0 #ffbe3cd9,0 2px #3c280f8c}50%{box-shadow:0 0 0 9px #ffbe3c00,0 2px #3c280f8c}}@media (max-height:400px){.box.campmap{padding:6px 10px 8px}.campmap .camphead h2{font-size:16px}.campmap .btns button{min-height:44px}}.stars{color:#ffd166;letter-spacing:.12em;text-align:center;margin:2px 0 6px;font-size:34px}.chip small{opacity:.6;font-size:10px;font-weight:600}.chip b.full{color:#ffb4a8}#fit{background:var(--panel);border:1px solid var(--line);pointer-events:auto;border-radius:10px;min-height:44px;padding:0 12px;font-size:13px;font-weight:800;position:absolute;top:8px;left:8px}@media (max-width:760px){.lvl b{font-size:12px}.chip small{display:none}.box td{font-size:12px}}@media (max-height:400px){.box{padding:10px 14px}.box h1{font-size:20px}.stars{margin:0 0 2px;font-size:26px}.lvl{min-height:56px}.box .btns button{min-height:44px}}#fit.low{top:auto;bottom:8px}@media (max-height:360px){#side{top:calc(var(--st) + var(--hud) + 4px);bottom:max(var(--sb), 4px);gap:4px}#side .row{gap:4px}#side .info{height:44px;padding:2px 6px}#side .info small{display:none}#side .info span{max-height:1.2em}#side .start{min-height:44px;font-size:15px}#side .spell{min-height:44px;padding:2px 6px}#side button{min-height:44px}#sheet .act small{max-height:1.2em}.act{min-height:48px}}@media (max-height:310px){:root{--hud:34px}.chip{height:26px}#hud .menu{height:30px}#side,#side .row{gap:3px}#side .info b{font-size:13px}}
