:root{color-scheme:dark;--ink:#f3ead6;--muted:#b4c1ac;--gold:#e6bd78;--dark:#10251e;--line:#81987932;--green:#8fb778;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#0d201a;color:var(--ink)}button,a,input{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;color:inherit;border:1px solid var(--line);background:#1c382c;border-radius:10px;transition:background .16s,transform .16s}button:hover{background:#38583b}button:active{transform:translateY(1px)}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid var(--gold);outline-offset:3px}button:disabled{opacity:.45;cursor:default}a{color:inherit;text-decoration:none}.hidden{display:none!important}#app{height:calc(100dvh - 28px - env(safe-area-inset-bottom));height:calc(100svh - 28px - env(safe-area-inset-bottom));}.screen{height:100%;position:relative;overflow:auto}.home{background:linear-gradient(90deg,rgba(7,27,22,.91) 0%,rgba(7,27,22,.76) 28%,rgba(7,27,22,.12) 65%),url('assets/forest.webp') center 48%/cover}.home:after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(0deg,#0b211bed,transparent 27%)}.topline{position:relative;z-index:2;display:flex;align-items:center;justify-content:space-between;padding:25px 5%}.brand{font-size:12px;letter-spacing:3px;font-weight:650;display:flex;align-items:center;gap:12px}.brand-leaf{font-size:32px;color:var(--gold)}.top-actions{display:flex;gap:16px;align-items:center}.badge{font-size:11px;letter-spacing:.4px;color:#e2e7cc;border:1px solid #c6dbab33;background:#0d2b2380;padding:8px 12px;border-radius:30px}.icon-button{width:42px;height:42px;font-size:20px;display:inline-grid;place-items:center;background:#10271ebd}.hero{position:relative;z-index:2;padding:5vh 7% 0}.eyebrow{font-size:10px;letter-spacing:2.7px;color:var(--gold);font-weight:600}h1,h2,h3,p{margin:0}h1{font-family:Georgia,serif;font-size:clamp(64px,8.8vw,132px);font-weight:500;line-height:.9;letter-spacing:-5px;margin:20px 0 28px;position:relative;width:max-content;text-shadow:0 4px 30px #071e1c80}h1 em{font-weight:400;color:var(--gold)}.title-leaf{font-size:.48em;position:absolute;right:-65px;bottom:14px;transform:rotate(-25deg);color:#c2cda0}.hero p{color:#d0dac8;line-height:1.8;font-size:15px;max-width:430px}.hero-buttons{display:flex;gap:10px;margin-top:30px}.primary{background:var(--gold);color:#243322;border-color:#f7d89b;font-weight:700;box-shadow:0 5px 25px #0003;padding:15px 23px}.primary:hover{background:#f1d09a}.primary span{margin-left:20px}.secondary{padding:14px 20px;background:#183d2e8c;border-color:#a8bc8666}.hero-links{display:flex;gap:20px;margin-top:20px}.hero-links button{background:none;border:0;border-radius:0;font-size:12px;padding:6px 0;border-bottom:1px solid #c8d4b544;color:#e1dbc6}.home-facts{display:flex;gap:18px;align-items:center;font-size:10px;color:#afbea4;margin-top:36px;letter-spacing:.4px}.home-facts b{color:var(--gold);font-size:16px;margin-right:5px}.home-facts i{width:1px;height:20px;background:var(--line)}.home-dwarves{position:absolute;bottom:7%;right:4%;width:48%;height:24%;z-index:1;background:url('assets/dwarves.webp') center bottom/contain no-repeat;filter:drop-shadow(0 10px 12px #0008)}.forest-caption{position:absolute;right:5%;bottom:3%;z-index:2;text-align:right;font:italic 16px Georgia,serif;color:#d4d9ba}.forest-caption span{font:9px system-ui;letter-spacing:2px;color:var(--gold);line-height:3}footer{height:calc(28px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);position:fixed;bottom:0;left:0;right:0;background:#0a1b16;z-index:100;display:flex;align-items:center;justify-content:center;border-top:1px solid #76956b22;font-size:11px;letter-spacing:.4px}footer a{padding:5px 15px;color:#c9d3bb}footer a:hover{color:var(--gold)}.map-screen{padding:20px 5% 40px;background:linear-gradient(#102a24e8,#102a24f5),url('assets/forest.webp') center/cover}.section-header{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:10px 0 28px}.section-header h2{font:36px Georgia,serif;margin-top:8px}.text-button{background:none;border:none;padding:10px;color:var(--muted)}.level-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:15px;max-width:1200px;margin:0 auto}.level-card{text-align:left;position:relative;overflow:hidden;padding:0;min-height:160px;background:#1a372b}.level-card .landscape{height:72px;background:linear-gradient(0deg,#19382b20,#19382b70),url('assets/forest.webp') center/cover;position:relative}.level-card:nth-child(4n+2) .landscape{background-position:20% 60%;filter:hue-rotate(-15deg)}.level-card:nth-child(4n+3) .landscape{background-position:80% 70%;filter:hue-rotate(25deg)}.level-card .level-no{position:absolute;left:14px;top:12px;font:25px Georgia,serif;color:var(--gold)}.level-card .stars{position:absolute;right:12px;top:15px;color:#f1ce84;font-size:12px;letter-spacing:3px}.level-card .card-body{padding:12px 14px 16px}.level-card h3{font:18px Georgia,serif;margin-bottom:6px}.level-card small{font-size:10px;color:var(--muted)}.game-screen{display:flex;flex-direction:column;overflow:hidden}.game-header{height:66px;flex-shrink:0;display:flex;align-items:center;gap:14px;padding:8px max(14px,env(safe-area-inset-left));border-bottom:1px solid var(--line);background:#10271f}.level-heading{flex:1;min-width:0}.level-heading h2{font:21px Georgia,serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:4px}.game-stats{display:flex;gap:22px}.game-stats span{display:flex;flex-direction:column;gap:4px;min-width:46px}.game-stats small{font-size:8px;letter-spacing:1.5px;color:#adbea2}.game-stats b{font-size:16px;font-weight:600;color:var(--gold);font-variant-numeric:tabular-nums}.game-actions{display:flex;gap:6px}#stage{position:relative;flex:1;min-height:0;overflow:hidden;background:#10271f}#canvas{display:block;width:100%;height:100%;touch-action:none;cursor:crosshair}.stage-label{position:absolute;top:10px;left:16px;pointer-events:none;max-width:70%;font-size:11px;color:#e8eed3;background:#0b241abf;padding:7px 10px;border:1px solid #91ae6733;border-radius:6px}.view-controls{position:absolute;right:12px;bottom:10px;display:flex;align-items:center;background:#10271fe0;border:1px solid var(--line);border-radius:8px;overflow:hidden;font-size:11px}.view-controls button{border:0;border-radius:0;width:38px;height:34px;font-size:21px;background:none}.view-controls span{min-width:25px;text-align:center}.toolbar{flex-shrink:0;padding:8px max(12px,env(safe-area-inset-left));display:flex;gap:14px;align-items:center;background:linear-gradient(#20392b,#11291e);border-top:1px solid #7795644d}.skill-bar{display:flex;gap:6px;flex:1;justify-content:center}.skill{height:68px;flex:1;max-width:100px;min-width:45px;position:relative;background:#0c241b;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border-radius:8px}.skill.selected{border-color:var(--gold);background:#4a5431;box-shadow:inset 0 0 0 1px #e6bd7840}.skill svg{width:26px;height:26px;color:#cdddab}.skill.selected svg{color:#f5d395}.skill span{font-size:9px;white-space:nowrap}.skill b{position:absolute;right:5px;top:3px;font-size:10px;color:var(--gold)}.skill.empty{opacity:.45}.release-control{width:120px;font-size:9px;display:flex;flex-direction:column;align-items:center;gap:4px;color:#c2d2af}.release-control label{font-size:8px;letter-spacing:1.5px}.release-control input{width:100%;accent-color:var(--gold)}.finish{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);background:#e6bd78;color:#173222;padding:9px 15px;font-size:12px;font-weight:700}#pauseBanner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;font:32px Georgia,serif;letter-spacing:5px;background:#122c22e0;padding:18px 30px;border:1px solid #e6bd7850;border-radius:12px;pointer-events:none}#pauseBanner small{display:block;font:11px system-ui;letter-spacing:0;margin-top:10px;color:var(--muted)}.modal{position:fixed;inset:0;z-index:70;background:#05130fc9;backdrop-filter:blur(8px);display:flex;align-items:center;justify-content:center;padding:18px 18px 46px}.modal-card{position:relative;background:linear-gradient(145deg,#294333,#142d23);border:1px solid #b5c18b66;border-radius:20px;max-width:600px;width:100%;max-height:100%;overflow:auto;padding:30px;box-shadow:0 30px 80px #0008}.modal-card h2{font:34px Georgia,serif;margin:12px 30px 15px 0;color:#f2d297}.modal-card p{font-size:14px;color:#d1ddc4;line-height:1.7;margin:10px 0}.modal-card .close{position:absolute;top:14px;right:14px;background:none;border:0}.modal-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:22px}.modal-actions button{padding:12px 18px}.help-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.help-grid div{font-size:12px;line-height:1.5;border-top:1px solid var(--line);padding-top:10px;color:var(--muted)}.help-grid b{color:var(--ink);display:block;margin-bottom:4px}.result-stars{font-size:40px;letter-spacing:12px;color:var(--gold);margin:20px 0}.result-numbers{display:flex;gap:30px;margin:18px 0}.result-numbers b{font:36px Georgia,serif;color:var(--gold)}.result-numbers small{display:block;font-size:10px;color:var(--muted);margin-top:5px}.toast{position:fixed;bottom:130px;left:50%;transform:translateX(-50%);padding:12px 20px;background:#e9d4a4;color:#183424;border-radius:10px;z-index:90;max-width:85%;text-align:center;font-size:13px;box-shadow:0 10px 30px #0005}#rotate{display:none;position:fixed;inset:0 0 28px;z-index:80;background:#112b23;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:30px}#rotate h2{font:30px Georgia,serif;color:var(--gold);margin:20px 0}#rotate p{color:var(--muted);margin-bottom:24px}.rotate-icon{font-size:85px;color:var(--gold)}.dwarf-choice{display:flex;gap:8px;overflow:auto;margin-top:12px}.dwarf-choice button{min-width:72px;padding:8px}.mini-dwarf{height:95px;width:60px;display:block;background-image:url('assets/dwarves.webp');background-size:500% 100%;background-repeat:no-repeat;margin:auto}.dwarf-choice small{display:block;margin-top:5px;font-size:10px}.install-steps{padding-left:20px;font-size:14px;line-height:1.9;color:#d1ddc4}
@media(min-width:1600px){.hero{padding-top:8vh}.home-dwarves{height:28%}}
@media(max-height:600px) and (orientation:landscape){.topline{padding:10px 4%}.hero{padding:1vh 6% 0}.hero .eyebrow{font-size:8px}h1{font-size:clamp(54px,13vh,86px);margin:9px 0 12px;letter-spacing:-3px}.hero p{font-size:12px;line-height:1.6}.hero-buttons{margin-top:14px}.primary,.secondary{padding:10px 16px;font-size:12px}.hero-links{margin-top:9px}.hero-links button{font-size:11px}.home-facts{margin-top:13px;font-size:9px;gap:10px}.home-facts b{font-size:12px}.home-dwarves{height:35%;bottom:8%}.forest-caption{font-size:12px}.topline .badge{font-size:9px;padding:6px 10px}.game-header{height:52px;gap:8px;padding-top:4px;padding-bottom:4px}.level-heading h2{font-size:16px}.level-heading .eyebrow{font-size:7px;letter-spacing:1.5px}.game-stats{gap:12px}.game-stats small{font-size:7px}.game-stats b{font-size:13px}.icon-button{width:36px;height:36px;font-size:18px}.toolbar{padding:5px 8px;gap:8px}.skill{height:54px;gap:2px}.skill svg{width:22px;height:22px}.skill span{font-size:8px}.release-control{width:80px}.stage-label{font-size:9px;top:6px;left:8px;padding:5px 7px}.modal-card{padding:22px}.modal-card h2{font-size:27px}.modal-card p{font-size:12px}.help-grid{gap:8px}.help-grid div{font-size:11px}.section-header{padding-bottom:15px}.section-header h2{font-size:27px}.level-grid{gap:10px}.level-card{min-height:130px}.level-card .landscape{height:52px}.level-card h3{font-size:16px}}
@media(max-width:650px) and (orientation:portrait){.topline{padding:18px 5%}.topline .badge{display:none}.hero{padding-top:8vh}.hero h1{font-size:86px}.hero p{font-size:13px}.hero-buttons{flex-direction:column;align-items:flex-start}.home-dwarves{width:90%;height:19%;bottom:4%}.forest-caption{display:none}.home-facts{gap:10px;font-size:8px}.home{background-position:60% center}.level-grid{grid-template-columns:1fr 1fr}.section-header{flex-wrap:wrap}.section-header h2{font-size:27px}.section-header .badge{display:none}body.playing #rotate{display:flex}}
@media(max-width:760px) and (orientation:landscape){.game-stats span:nth-child(2){display:none}.game-actions{gap:3px}.game-header{gap:6px}.game-stats{gap:8px}.release-control{width:60px}.skill-bar{gap:3px}.skill{min-width:40px}.game-actions .audioToggle{display:none}.home-facts{display:none}}
@media(prefers-reduced-motion:reduce){button{transition:none}}
/* Keep the level readable while planning, including on short landscape screens. */
#pauseBanner{top:auto;bottom:12px;left:12px;transform:none;font:13px system-ui;letter-spacing:2px;padding:8px 12px;border-radius:8px;background:#122c22e8}
#pauseBanner small{font-size:10px;margin-top:4px;letter-spacing:0}
@media(max-height:600px) and (orientation:landscape){#pauseBanner{bottom:8px;font-size:11px;padding:6px 10px}#pauseBanner small{font-size:9px}.toast{font-size:11px;max-width:65%;bottom:100px;padding:8px 14px}}
/* Version 2: campaign navigation, language and the ten-second countdown. */
footer #language{position:absolute;right:max(8px,env(safe-area-inset-right));font-size:11px;padding:3px 8px;border-radius:5px;background:#183b2c;min-width:58px}
.map-filter{max-width:1200px;margin:0 auto 20px;display:flex;gap:12px;align-items:center;color:var(--muted);font-size:12px}.map-filter select{background:#17382b;color:var(--ink);border:1px solid var(--line);border-radius:8px;padding:10px;font:inherit}.difficulty{font-size:9px;color:#c5ac79;margin-top:8px}
.evacuate{min-width:58px;height:42px;border-color:#bc815f;background:#58352b;color:#ffdbad;font-weight:650;font-size:13px}.evacuate:disabled{opacity:.8;background:#723e2d}.countdown{position:absolute;top:50px;left:50%;transform:translateX(-50%);background:#752e22e8;color:#ffe2b2;border:1px solid #e6aa79;border-radius:8px;padding:9px 18px;font-size:12px;letter-spacing:1px;pointer-events:none}.toast{pointer-events:none}
@media(max-height:600px) and (orientation:landscape){.game-header{gap:7px;padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}.game-actions{gap:4px}.evacuate{height:36px;min-width:48px;font-size:11px}.game-stats{gap:10px}.level-heading h2{font-size:15px}.game-stats small{font-size:7px}.countdown{top:37px;font-size:10px;padding:6px 10px}.map-filter{margin-bottom:12px}.map-filter span{display:none}}
@media(max-width:500px){footer{justify-content:flex-start}footer a{padding-left:12px;font-size:10px}}
