: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-overlay.is-library-open{padding:0}.start-card{width:min(100%,390px);padding:18px 20px;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:112px;height:110px;margin:2px auto 1px;background-image:var(--hero-sheet);background-size:448px 435px;background-position:left top;background-repeat:no-repeat;filter:drop-shadow(0 12px 12px #0618119c)}.start-card h1{margin:7px 0 12px;color:#ffe7a5;font-size:clamp(24px,7vw,31px);line-height:1.1}.start-title{min-height:30px;color:#fff9e8;font-size:20px;font-weight:900}.hero-choice-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.hero-choice{min-width:0;min-height:105px;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:56px auto auto;justify-items:center;align-items:center;gap:1px;padding:6px 4px;border:1.5px solid #91b59d;border-radius:12px;background:#102d24;color:#fff;font-family:inherit;text-align:center;cursor:pointer;touch-action:manipulation}.hero-choice.is-selected{border:2px solid #ffe28e;background:#315b40;box-shadow:0 0 0 2px #f8dc9330}.hero-choice.is-locked{color:#bfd0c3;cursor:default}.hero-choice:focus-visible{outline:3px solid #ffe298;outline-offset:2px}.hero-choice-portrait{width:56px;height:56px;align-self:end;background-image:var(--hero-sheet);background-size:224px 218px;background-position:left top;background-repeat:no-repeat;filter:drop-shadow(0 4px 4px #0618119c)}.library-choice-icon{align-self:end;height:56px;color:#f5dc91;font-size:43px;font-weight:900;line-height:1.15;text-shadow:0 3px 5px #061811}.hero-choice.is-locked .hero-choice-portrait{filter:grayscale(1) brightness(.55);opacity:.7}.hero-choice-name{align-self:end;overflow:hidden;font-size:14px;font-weight:900;white-space:nowrap;text-overflow:ellipsis}.hero-choice-state{align-self:start;min-height:13px;margin-top:2px;color:#e5d59e;font-size:8px;font-weight:900;letter-spacing:.025em;line-height:1.25}.hero-detail{margin:8px 0 6px}.start-class{color:#b7e0bd;font-size:11px;font-weight:900;letter-spacing:.09em}.hero-description{max-width:300px;min-height:29px;margin:4px auto 0;color:#e0ecdc;font-size:12px;line-height:1.3}.player-rank{padding-top:7px;border-top:1px solid #d8c47e66}.player-rank>strong{display:block;color:#ffe7a5;font-size:15px;letter-spacing:.07em}.player-rank .start-title{min-height:auto;margin-top:2px;font-size:14px}.start-progress{height:13px;margin-top:9px;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:6px 0 12px;color:#d5e7d5;font-size:11px;font-weight:800;letter-spacing:.04em}.start-button{width:100%;min-height:54px;border:2px solid #eff4bb;border-radius:12px;background:#508e58;color:#fff;font:900 17px 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:10px;color:#b9d3ba;font-size:11px;line-height:1.4}.start-main[hidden],.character-library[hidden]{display:none}.character-library{max-height:min(72vh,650px);overflow-y:auto;padding:4px 2px 2px;text-align:left}.start-card.is-library-open{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;max-width:none;overflow-y:auto;padding:calc(22px + var(--safe-top)) clamp(18px,4vw,44px) calc(22px + var(--safe-bottom));border:0;border-radius:0;box-shadow:none;background:linear-gradient(160deg,#1d4938,#102a22 74%);text-align:left}.start-card.is-library-open .character-library{max-height:none;overflow:visible;padding:0}.library-header{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:10px;margin-bottom:7px}.library-back{min-height:38px;padding:4px 8px;border:1px solid #b4d2ae;border-radius:8px;background:#14352a;color:#e9efcf;font:900 10px Trebuchet MS,system-ui,sans-serif;cursor:pointer;touch-action:manipulation}.library-back:focus-visible{outline:3px solid #ffe298;outline-offset:2px}.library-header h2{margin:0;color:#ffe7a5;font-size:clamp(20px,5vw,27px);text-align:left}.library-intro{margin:0 0 16px;color:#d8e7d6;font-size:13px;line-height:1.35;text-align:left}.library-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.library-card{min-width:0;padding:9px;border:1px solid #8aa992;border-radius:12px;background:linear-gradient(160deg,#1a4032,#102b23)}.library-art{width:100%;aspect-ratio:1;margin-bottom:8px;border-radius:8px;background-color:#f4eedf;background-image:url(/assets/generated/future-hero-concepts.png);background-size:300% 200%;background-position:var(--concept-x) var(--concept-y);background-repeat:no-repeat}.library-profile-art{background-color:#18352b;background-image:var(--hero-sheet),url(/assets/generated/library-current-backdrops.png);background-size:400% 400%,200% 100%;background-position:left top,var(--hero-backdrop-position) center}.library-current.is-locked .library-profile-art{filter:grayscale(.9) brightness(.58)}.library-card-top{display:flex;align-items:center;justify-content:space-between;gap:4px}.library-status{color:#f5d788;font-size:7px;font-weight:900;letter-spacing:.04em;white-space:nowrap}.library-status.is-unlocked{color:#a8e0a5}.library-status.is-locked{color:#e8bb8f}.library-card h3{margin:7px 0 1px;color:#fff5d7;font-size:18px}.library-role{color:#b8dba9;font-size:8px;font-weight:900;letter-spacing:.055em}.library-card p{margin:8px 0 0;color:#d6e3d5;font-size:11px;line-height:1.35}.library-card p.library-tradeoff{color:#f2d6a5}.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}}@media(max-width:500px){.library-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.library-card{padding:7px}}.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) 38px 38px;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,.hud-help{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-help{width:34px;height:34px;border-radius:50%;border:1.5px solid #b5d5a6;background:#23493b;color:#e7f2d5;font-size:19px;font-weight:900;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}.learning-coach,.learning-guide{position:absolute;z-index:8;left:50%;width:min(460px,calc(100% - 28px));padding:18px 20px;border:1.5px solid #e4cd7c;border-radius:12px;background:#15372dec;box-shadow:0 8px 28px #07170f99,inset 0 1px #ffffff24;transform:translate(-50%);pointer-events:auto}.learning-coach{top:calc(220px + var(--safe-top));display:grid;grid-template-columns:78px minmax(0,1fr);align-items:start;gap:16px}.learning-coach-art{width:78px;height:78px;display:grid;place-items:center;border:2px solid #f1d98b;border-radius:22px;background:radial-gradient(circle at 35% 28%,#628b55,#284f3a 70%);box-shadow:inset 0 1px #fff5,0 4px 12px #07170f66;font-size:46px;line-height:1}.learning-coach-art img,.learning-guide-icon img,.wave-intel-art img{max-width:100%;max-height:100%;object-fit:contain;filter:drop-shadow(0 4px 5px #06140ca8)}.learning-coach-art img{width:72px;height:72px}.learning-coach-copy{min-width:0}.learning-coach-heading,.learning-guide-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.learning-coach-heading strong,.learning-guide-heading strong{color:#ffe7a5;font-size:20px;font-weight:900;line-height:1.2}.learning-coach-heading button,.learning-guide-heading button{width:30px;height:30px;border:1px solid #a9c6a7;border-radius:50%;background:#315847;color:#fff;font:700 21px/1 Trebuchet MS,system-ui,sans-serif;cursor:pointer}.learning-coach p{margin:9px 0 10px;color:#edf4e4;font-size:17px;line-height:1.45}.learning-coach-copy>small{display:inline-block;padding:5px 8px;border:1px solid #c5d9a57a;border-radius:20px;color:#d9e9c4;font-size:10px;font-weight:900;letter-spacing:.08em}.learning-guide{top:calc(220px + var(--safe-top));max-height:calc(100% - 242px - var(--safe-top));overflow:auto}.learning-guide-intro{margin:10px 0 2px;color:#dbe9d7;font-size:13px;line-height:1.4}.learning-guide-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 0;border-top:1px solid #ffffff20}.learning-guide-icon{width:38px;height:38px;display:grid;place-items:center;flex:0 0 auto;border:1px solid #e4cf8c88;border-radius:11px;background:#254735;font-size:23px}.learning-guide-copy{display:grid;gap:3px;min-width:0}.learning-guide-copy strong{color:#f2f2df;font-size:14px}.learning-guide-copy small{color:#b9d3ad;font-size:9px;font-weight:900;letter-spacing:.06em}.learning-guide-row button{flex:0 0 auto;min-height:34px;padding:0 10px;border:1px solid #ddcf8e;border-radius:7px;background:#385f47;color:#fff5d8;font:900 10px Trebuchet MS,system-ui,sans-serif;cursor:pointer}.learning-guide-icon img{width:34px;height:34px}.wave-intel{position:absolute;z-index:9;top:calc(220px + var(--safe-top));left:50%;width:min(520px,calc(100% - 28px));padding:16px 18px 18px;border:2px solid #f0d783;border-radius:16px;background:linear-gradient(145deg,#173f30f5,#102b23f5);box-shadow:0 12px 36px #06150fd4,inset 0 1px #ffffff30;transform:translate(-50%);pointer-events:auto;animation:wave-intel-in .24s cubic-bezier(.2,.8,.2,1) both}.wave-intel-kicker{color:#f8dc93;font-size:12px;font-weight:900;letter-spacing:.15em}.wave-intel>button{position:absolute;top:10px;right:11px;width:34px;height:34px;border:1px solid #b7cba8;border-radius:50%;background:#315847;color:#fff;font:800 23px/1 Trebuchet MS,system-ui,sans-serif;cursor:pointer}.wave-intel-content{display:grid;grid-template-columns:96px minmax(0,1fr);align-items:center;gap:17px;margin-top:12px}.wave-intel-art{width:96px;height:96px;display:grid;place-items:center;overflow:hidden;border:2px solid #e8d38f;border-radius:20px;background:radial-gradient(circle at 40% 30%,#6d8e51,#244633 72%)}.wave-intel-art img{width:90px;height:90px}.wave-intel-title{display:block;padding-right:32px;color:#ffe7a5;font-size:22px;font-weight:900;line-height:1.15}.wave-intel-body{margin:8px 0 9px;color:#f1f4e6;font-size:16px;line-height:1.4}.wave-intel-content small{color:#c8ddb8;font-size:9px;font-weight:900;letter-spacing:.09em}@keyframes wave-intel-in{0%{opacity:0;transform:translate(-50%,8px) scale(.98)}to{opacity:1;transform:translate(-50%) scale(1)}}@media(max-width:420px){.learning-coach{grid-template-columns:56px minmax(0,1fr);gap:12px;padding:14px}.learning-coach-art{width:56px;height:56px;border-radius:16px;font-size:34px}.learning-coach-heading strong{font-size:17px}.learning-coach p{font-size:15px}.wave-intel{padding:14px}.wave-intel-content{grid-template-columns:68px minmax(0,1fr);gap:11px}.wave-intel-art{width:68px;height:68px;border-radius:15px}.wave-intel-art img{width:64px;height:64px}.wave-intel-title{font-size:18px}.wave-intel-body{font-size:14px}}.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)}}
