:root{font-family:Trebuchet MS,system-ui,sans-serif;color:#fff;background:#10251d;--safe-top: env(safe-area-inset-top, 0px);--safe-bottom: env(safe-area-inset-bottom, 0px)}*{box-sizing:border-box}html,body,#game{width:100%;height:100%;margin:0;overflow:hidden;overscroll-behavior:none}body{display:grid;place-items:center;background:radial-gradient(circle at 50% 30%,#315c3e,#10251d 75%);touch-action:none}#game{position:relative;max-width:540px;max-height:900px;box-shadow:0 24px 80px #06181199}canvas{display:block;margin:0 auto;touch-action:none}.pause-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:10;display:grid;place-items:center;padding:calc(20px + var(--safe-top)) 20px calc(20px + var(--safe-bottom));background:#0b2019d9;backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);touch-action:manipulation}.pause-overlay[hidden]{display:none}.pause-card{width:min(100%,360px);padding:28px 24px 26px;text-align:center;background:#173b2f;border:2px solid #e3c879;border-radius:18px;box-shadow:0 18px 55px #07150fc9,inset 0 1px #ffffff24}.pause-emblem{font-size:35px;line-height:1;color:#ffe298}.pause-card h1{margin:12px 0 8px;font-size:28px;letter-spacing:.06em;color:#ffe7a9}.pause-card p{margin:0 0 26px;font-size:16px;line-height:1.45;color:#dcebdc}.resume-button{width:100%;min-height:56px;border:2px solid #c9edb0;border-radius:10px;background:#427d52;color:#fff;font:800 18px Trebuchet MS,system-ui,sans-serif;cursor:pointer;touch-action:manipulation}.resume-button:active{background:#589967}.resume-button:focus-visible{outline:3px solid #ffe298;outline-offset:3px}.start-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:12;display:grid;place-items:center;overflow-y:auto;padding:calc(18px + var(--safe-top)) 18px calc(18px + var(--safe-bottom));background:linear-gradient(180deg,#10291fea,#0b211beb);backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px);touch-action:pan-y}.start-card{width:min(100%,390px);padding:24px 22px 22px;text-align:center;background:linear-gradient(165deg,#24503e,#122f27 70%);border:2px solid #e5c979;border-radius:20px;box-shadow:0 20px 70px #06140ebf,inset 0 1px #ffffff30}.start-kicker{color:#f8dc93;font-size:13px;font-weight:900;letter-spacing:.2em}.start-portrait{width:165px;height:163px;margin:14px auto 12px;background-image:url(/assets/generated/wizard-sheet.png);background-size:660px 652px;background-position:left top;background-repeat:no-repeat;filter:drop-shadow(0 12px 12px #0618119c)}.start-class{color:#a9dbc0;font-size:12px;font-weight:900;letter-spacing:.11em}.start-card h1{margin:7px 0 0;color:#ffe7a5;font-size:clamp(34px,9vw,45px);line-height:1.1}.start-title{min-height:30px;color:#fff9e8;font-size:20px;font-weight:900}.start-progress{height:15px;margin-top:22px;overflow:hidden;background:#0c251d;border:2px solid #d8c47e;border-radius:20px}.start-progress span{display:block;height:100%;background:linear-gradient(90deg,#7bd599,#f7e18a);border-radius:inherit;transition:width .2s}.start-xp{margin:9px 0 22px;color:#d5e7d5;font-size:12px;font-weight:800;letter-spacing:.04em}.start-button{width:100%;min-height:60px;border:2px solid #eff4bb;border-radius:12px;background:#508e58;color:#fff;font:900 19px Trebuchet MS,system-ui,sans-serif;cursor:pointer;touch-action:manipulation}.start-button:active{background:#69a46a}.start-button:focus-visible{outline:3px solid #ffe298;outline-offset:3px}.start-note{margin-top:17px;color:#b9d3ba;font-size:12px;line-height:1.4}.dev-scenario{margin-top:18px;padding:10px;border:1px dashed #a7c6b0;border-radius:10px;text-align:left;background:#0b241caa}.dev-scenario summary{padding:5px 2px;color:#d9e9c5;font-size:12px;font-weight:900;letter-spacing:.04em;cursor:pointer;touch-action:manipulation}.dev-scenario-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:12px}.dev-scenario-fields label{min-width:0;color:#bde0c8;font-size:11px;font-weight:800}.dev-scenario-fields input{display:block;width:100%;min-height:42px;margin-top:5px;padding:5px 7px;border:1px solid #b8d7b6;border-radius:7px;background:#173e30;color:#fff;font:800 16px Trebuchet MS,system-ui,sans-serif}.dev-scenario p{margin:10px 0;color:#c4d9c8;font-size:11px;line-height:1.35}.dev-start-button{width:100%;min-height:48px;border:1.5px solid #f1db99;border-radius:8px;background:#6b5732;color:#fff4d4;font:900 14px Trebuchet MS,system-ui,sans-serif;cursor:pointer;touch-action:manipulation}.dev-start-button:focus-visible,.dev-scenario-fields input:focus-visible{outline:3px solid #ffe298;outline-offset:2px}@media(max-width:650px){#game{max-width:none;max-height:none;box-shadow:none}}.hud-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:5;pointer-events:none;font-family:Trebuchet MS,system-ui,sans-serif;color:#f7f7e9;-webkit-font-smoothing:antialiased}.hud-overlay[hidden],.hud-overlay [hidden]{display:none!important}.hud-header{position:absolute;top:calc(14px + var(--safe-top));left:14px;right:14px;min-height:66px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) 42px;align-items:center;gap:3px;padding:6px 7px 6px 14px;border:1.5px solid #d6c889ab;border-radius:12px;background:#112b22ed;box-shadow:0 5px 22px #07180f70,inset 0 1px #ffffff1f;pointer-events:auto}.hud-stat{min-width:0}.hud-stat .hud-primary{font-size:clamp(14px,4vw,20px);font-weight:900;line-height:1.2;white-space:nowrap}.hud-stat .hud-secondary{margin-top:2px;font-size:10px;font-weight:800;white-space:nowrap}.hud-gold .hud-primary{color:#ffe38b}.hud-gold .hud-secondary{color:#f4b0a1}.hud-health{text-align:center}.hud-health .hud-primary{color:#9bf1ad}.hud-health .hud-secondary,.hud-wave .hud-secondary{color:#f6dc98}.hud-wave{text-align:right}.hud-gear{width:40px;height:40px;border:1.5px solid #e6d289;border-radius:50%;background:#23493b;color:#ffe9a6;font-size:25px;line-height:1;cursor:pointer;touch-action:manipulation}.hud-actions{position:absolute;top:calc(94px + var(--safe-top));left:12px;right:12px;display:flex;justify-content:space-between;pointer-events:none}.hud-actions button{width:min(156px,43%);min-height:52px;border:1.5px solid #ead491;border-radius:9px;box-shadow:0 4px 13px #09191075,inset 0 1px #ffffff30;color:#fff7e5;cursor:pointer;pointer-events:auto;touch-action:manipulation}.hud-actions strong{display:block;font-size:13px;font-weight:900;white-space:nowrap}.hud-actions small{display:block;margin-top:3px;font-size:10px;font-weight:800;color:#ffe28b;white-space:nowrap}.hud-next{background:#986237}.hud-train{background:#275343}.hud-actions button:active,.hud-option:active,.hud-gear:active{filter:brightness(1.2);transform:translateY(1px)}.hud-minimap{position:absolute;left:12px;bottom:calc(12px + var(--safe-bottom));width:132px;padding:8px;border:1.5px solid #d8c990;border-radius:13px;background:#112b22f2;box-shadow:0 5px 18px #07170f80;pointer-events:auto;transition:bottom .15s ease}.hud-overlay.prompt-open .hud-minimap{bottom:calc(var(--prompt-height, 112px) + 28px + var(--safe-bottom))}.hud-minimap strong{display:block;margin:0 0 5px;font-size:11px;font-weight:900;color:#e7f3dc;letter-spacing:.02em;white-space:nowrap}.hud-minimap strong.incoming{color:#ffb3a4}.hud-minimap canvas{display:block;width:112px;height:112px;border:1px solid #b4d09f;border-radius:3px}.hud-prompt{position:absolute;left:12px;right:12px;bottom:calc(12px + var(--safe-bottom));max-width:516px;margin:0 auto;padding:12px;border:2px solid #e1cc86;border-radius:16px;background:linear-gradient(165deg,#21493a,#10281f 78%);box-shadow:0 14px 34px #07150ec7,inset 0 1px #ffffff25;pointer-events:auto;touch-action:manipulation}.hud-prompt-heading{min-height:35px;display:flex;align-items:center;justify-content:center;padding:0 38px;margin-bottom:10px}.hud-prompt-heading strong{text-align:center;font-size:clamp(14px,4vw,18px);line-height:1.2;font-weight:900;color:#fff7df}.hud-prompt-heading button{position:absolute;top:8px;right:8px;width:36px;height:36px;border:1.5px solid #b6d3b4;border-radius:50%;background:#355847;color:#fff;font-size:24px;line-height:1;cursor:pointer}.hud-prompt-rows{display:grid;gap:7px;max-height:min(42vh,360px);overflow-y:auto;overscroll-behavior:contain}.hud-prompt-row{display:grid;gap:7px}.hud-option{min-width:0;min-height:56px;padding:6px 3px;border:1.5px solid #96d69b;border-radius:8px;background:#315d46;color:#fff;cursor:pointer;touch-action:manipulation}.hud-option strong{display:block;font:900 clamp(11px,3.3vw,15px)/1.1 "Trebuchet MS",system-ui,sans-serif;overflow-wrap:anywhere}.hud-option small{display:block;margin-top:4px;font:800 10px/1.15 Trebuchet MS,system-ui,sans-serif;color:#ffe38e;overflow-wrap:anywhere}.hud-option.danger{background:#805044;border-color:#e8ae87}.hud-option:disabled{background:#344940;border-color:#74877a;color:#bac7ba;cursor:default}.hud-option:disabled small{color:#c4c6a6}.end-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:11;display:grid;place-items:center;padding:calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));background:#0a211ae9;backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px);overflow-y:auto;touch-action:pan-y}.end-card{width:min(100%,390px);padding:24px 20px 20px;border:2px solid #e5c979;border-radius:20px;background:linear-gradient(165deg,#214a39,#122e25 76%);box-shadow:0 20px 70px #06140ebf,inset 0 1px #ffffff30;font-family:Trebuchet MS,system-ui,sans-serif}.end-card h1{margin:0 0 20px;color:#ffe29a;font-size:clamp(25px,7vw,31px);line-height:1.1;text-align:center}.end-stats{display:grid;grid-template-columns:1fr auto;gap:9px 10px;margin:0 0 24px;font-size:14px}.end-stats dt{color:#bcd8c2}.end-stats dd{margin:0;color:#fff5df;font-weight:900;text-align:right}.end-card button{width:100%;min-height:58px;border:2px solid #d8edb4;border-radius:10px;background:#508e58;color:#fff;font:900 17px Trebuchet MS,system-ui,sans-serif;cursor:pointer;touch-action:manipulation}.end-card button:active{background:#69a46a}.hud-banner{position:absolute;top:calc(151px + var(--safe-top));left:18px;right:18px;max-width:480px;margin:0 auto;white-space:pre-line;text-align:center;font:900 clamp(16px,5vw,22px)/1.2 "Trebuchet MS",system-ui,sans-serif;text-shadow:0 2px 0 #173126,0 0 7px #092019,2px 0 #173126,-2px 0 #173126;pointer-events:none}.hud-banner.show{animation:banner-appear .22s ease-out both}@keyframes banner-appear{0%{opacity:0;transform:translateY(7px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}
