:root{color-scheme:dark;--lime:#dfff70;--muted:#9ba594;--border:#313a2f;font:14px system-ui,sans-serif;background:#121713;color:#edf2e4}
*{box-sizing:border-box}body{margin:0}header,main,footer{width:min(1440px,calc(100% - 72px));margin:auto}header{height:74px;display:flex;justify-content:space-between;align-items:center}.brand,.version,.eyebrow,small,nav,footer,.location,.map span,.meter-label,.counter span{font:700 10px ui-monospace,monospace;letter-spacing:.11em}.brand{display:flex;align-items:center;gap:7px;font-size:14px;letter-spacing:.07em}.brand>span:last-child{color:#99a393}.logo{color:var(--lime);font-size:26px;margin-right:5px}.version,.location{color:#c1cbb8}.version i,.location i{display:inline-block;width:6px;height:6px;background:var(--lime);border-radius:50%;margin-right:7px;box-shadow:0 0 9px #deff7088}
.stage{position:relative;height:clamp(490px,75svh,900px);overflow:hidden;border:1px solid #4a5343;border-radius:12px;background:#344a36;isolation:isolate;touch-action:none}#world,.vignette{position:absolute;inset:0;width:100%;height:100%}.vignette{pointer-events:none;background:linear-gradient(90deg,#121913e8 1%,#141d16b0 25%,transparent 65%),linear-gradient(0deg,#11191080,transparent 23%)}.stage.playing .vignette{background:linear-gradient(0deg,#11191055,transparent 17%)}
.brief{position:absolute;left:5%;top:50%;transform:translateY(-50%);max-width:390px}.eyebrow{color:var(--lime);letter-spacing:.17em}h1{font-size:clamp(3.9rem,7.5vw,8.1rem);letter-spacing:-.095em;line-height:.79;margin:24px 0 25px;font-weight:900}h1 em{color:var(--lime);font-style:normal}.brief p{color:#d1d9cb;max-width:290px;line-height:1.6;margin:0 0 26px}button{font:800 11px ui-monospace,monospace;letter-spacing:.09em;cursor:pointer}#start{background:var(--lime);color:#1c2511;border:none;border-radius:6px;padding:15px 17px;width:219px;text-align:left}#start:hover{background:#edffb5}#start span{float:right}small{display:block;margin-top:15px;color:#bac5b4;font-size:9px}.hud,.map,.location,.hint{position:absolute;background:#151e17e8;border:1px solid #b2c8a24a;border-radius:7px}.hud{top:20px;right:20px;padding:15px;width:179px}.objective{font-weight:750;margin:6px 0 10px}.counter{font:13px ui-monospace,monospace;color:#b0bcaa}.counter strong{color:#fff;font-size:26px}.counter span{float:right;margin-top:10px;font-size:8px}.meter-label{display:flex;justify-content:space-between;color:#a7b69f;margin:10px 0 5px;font-size:8px}.meter{height:4px;background:#3b4736;border-radius:4px;overflow:hidden}.meter>div{height:100%;background:var(--lime)}.map{bottom:18px;right:20px;padding:6px;display:grid;text-align:center;gap:4px;color:#bcc8b7}.map span{font-size:8px}.location{bottom:18px;left:20px;padding:10px 12px}.crosshair{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);color:white;font:24px monospace;text-shadow:0 1px 4px #000;pointer-events:none}.hint{bottom:55px;left:50%;transform:translateX(-50%);padding:10px 15px;color:var(--lime);text-align:center;width:max-content;max-width:75%;font-weight:700}.touch{display:none}nav{display:flex;justify-content:center;gap:24px;flex-wrap:wrap;border-bottom:1px solid var(--border);padding:18px 0;color:#b4bfb0}kbd{display:inline-block;border:1px solid #414d3e;border-radius:4px;padding:3px 5px;color:#e9eee4;background:#212a22;margin-right:3px;font:inherit}footer{display:flex;justify-content:space-between;padding:16px 0;color:#7e8b7c;font-size:9px}[hidden]{display:none!important}
@media(max-width:720px){header,main,footer{width:calc(100% - 24px)}header{height:54px}.stage{height:67svh;min-height:380px}.brief{left:6%;top:53%}.brief p{max-width:215px}.hud{top:10px;right:10px;width:126px;padding:8px}.objective{font-size:11px}.map{right:10px;bottom:10px}.map canvas{width:82px;height:66px}.location{bottom:10px;left:10px}nav{gap:10px;font-size:8px}footer{gap:10px}}
.shop-toggle,.shop-close,.shop-item button{background:#252e23;color:#edf2e4;border:1px solid #536349;border-radius:6px;padding:9px}
.shop-toggle span,.shop-balance{color:#f8d378}.shop-toggle span{margin-left:9px}.shop-toggle:hover,.shop-item button:hover{border-color:var(--lime)}
:is(#shop,#mutations){width:min(540px,calc(100% - 24px));max-height:90dvh;padding:26px;background:#19221a;color:#edf2e4;border:1px solid #536349;border-radius:12px}
:is(#shop,#mutations)::backdrop{background:#101711b8}:is(#shop,#mutations) h2{font-size:clamp(23px,6vw,34px);margin:8px 0}:is(#shop,#mutations) h3{font-size:13px;margin:19px 0 8px}:is(#shop,#mutations) p{color:#bac7b6;margin:8px 0 12px}:is(#shop,#mutations) .shop-close{float:right;margin-left:7px}
.shop-balance{font:700 12px ui-monospace,monospace}.shop-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;border-top:1px solid #313a2f}.shop-item strong,.shop-item span{display:block}.shop-item span{color:#bac7b6;font-size:11px;margin-top:2px}.shop-item button{flex:none}.shop-item button:disabled{opacity:.58;cursor:default}#shop-status:empty{display:none}
@media(max-width:480px){.shop-toggle{font-size:9px;padding:7px}.shop-toggle span{margin-left:3px}.brand{gap:3px;font-size:11px}.logo{font-size:19px;margin-right:1px}:is(#shop,#mutations){padding:16px}}
.touch-device + nav{display:none}
body:has(.touch-device.playing){overflow:hidden;overscroll-behavior:none}
.touch-device.playing{
  --game-top:max(10px,env(safe-area-inset-top));
  --game-right:max(12px,env(safe-area-inset-right));
  --game-bottom:max(10px,env(safe-area-inset-bottom));
  --game-left:max(12px,env(safe-area-inset-left));
  position:fixed;inset:0;z-index:5;width:100%;height:100vh;height:100dvh;min-height:0;border:0;border-radius:0;
}
.touch-device.playing .hud{top:var(--game-top);right:var(--game-right);pointer-events:none}
.touch-device.playing .map{top:var(--game-top);left:var(--game-left);right:auto;bottom:auto;pointer-events:none}
.touch-device.playing .map canvas{width:82px;height:66px}
.touch-device.playing .location{left:50%;bottom:var(--game-bottom);transform:translateX(-50%);max-width:calc(100% - 24px);white-space:nowrap;pointer-events:none}
.touch-device.playing .hint{bottom:calc(var(--game-bottom) + 128px);pointer-events:none}
.touch-device .touch{display:flex;position:absolute;inset:auto var(--game-right) calc(var(--game-bottom) + 20px) var(--game-left);align-items:flex-end;justify-content:space-between;pointer-events:none}
#joystick,.touch-actions button{pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none}
#joystick{position:relative;width:104px;height:104px;border:1px solid #e2f0d37a;border-radius:50%;background:#151e17b8}
.joystick-guide{position:absolute;left:50%;top:5px;transform:translateX(-50%);color:#c1cbb8;font-size:10px;pointer-events:none}
.joystick-thumb{position:absolute;left:50%;top:50%;width:40px;height:40px;border:1px solid #e4ff96;border-radius:50%;background:#dfff7090;transform:translate(calc(-50% + var(--stick-x,0px)),calc(-50% + var(--stick-y,0px)));pointer-events:none}
.touch-actions{display:grid;justify-items:end;gap:8px}.touch-actions button{min-height:44px;padding:8px 12px;border:1px solid #b2c8a26b;border-radius:7px;background:#151e17ed;color:#edf2e4}
#touch-bite{min-width:76px;background:var(--lime);color:#1c2511;border-color:var(--lime)}

.touch-layout{
  --menu-header:46px;
  --menu-top:env(safe-area-inset-top,0px);
  --menu-bottom:env(safe-area-inset-bottom,0px);
  --menu-left:max(14px,env(safe-area-inset-left,0px));
  --menu-right:max(14px,env(safe-area-inset-right,0px));
}
.touch-layout header{
  width:100%;height:calc(var(--menu-header) + var(--menu-top));
  padding:var(--menu-top) var(--menu-right) 0 var(--menu-left);
}
.touch-layout main{width:100%}
.touch-layout footer{display:none}
.touch-device:not(.playing){
  display:flex;align-items:center;height:auto;
  min-height:calc(100vh - var(--menu-header) - var(--menu-top) - var(--menu-bottom));
  min-height:calc(100dvh - var(--menu-header) - var(--menu-top) - var(--menu-bottom));
  padding:10px var(--menu-right) 10px var(--menu-left);
  border:0;border-radius:0;touch-action:pan-y;
}
.touch-device:not(.playing) .brief{
  position:relative;inset:auto;width:100%;max-width:560px;transform:none;
}
.touch-device:not(.playing) .vignette{
  background:linear-gradient(90deg,#121913f2,#121913c4 56%,#12191344 86%,transparent);
}
.touch-device .brief h1{font-size:clamp(24px,10dvh,44px);margin:7px 0;line-height:1}
.touch-device .brief h1 br{display:none}
.touch-device .brief h1 em{display:inline-block;margin-inline-start:.18em}
.touch-device .brief p{max-width:420px;margin-bottom:8px;font-size:13px;line-height:1.3}
.touch-device .menu-actions{display:flex;align-items:flex-start;gap:7px;flex-wrap:wrap}
.touch-device #start{width:auto;max-width:100%;min-height:44px;padding:9px 12px}
.touch-device #start span{margin-left:10px}
.touch-device .brief small{margin-top:6px}
.touch-device #save-controls{margin-top:0}
.touch-device #save-controls button{min-height:44px}
.touch-device #save-status:not(:empty){flex-basis:100%}
.touch-device:not(.playing) :is(.hud,.map,.location){display:none}
@media (orientation:landscape) and (max-height:540px){
  .touch-device.playing .hud{width:135px;padding:8px}
  .touch-device.playing .objective{margin:4px 0;font-size:12px}
  .touch-device.playing .counter strong{font-size:20px}
  .touch-device.playing .meter-label{margin-top:5px}
  .touch-device.playing .map canvas{width:66px;height:53px}
  .touch-device.playing .touch{bottom:var(--game-bottom)}
  .touch-device.playing #joystick{width:88px;height:88px}
  .touch-device.playing .joystick-thumb{width:34px;height:34px}
  .touch-device.playing .hint{bottom:calc(var(--game-bottom) + 34px);max-width:calc(100% - var(--game-left) - var(--game-right) - 200px);font-size:12px;padding:7px 10px}
}
#game-clock{margin-bottom:6px;color:#dce6d1;font:700 11px ui-monospace,monospace}
#save-controls{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-top:9px}
#save-controls button{min-height:38px;padding:6px 10px;background:#252e23;color:#edf2e4;border:1px solid #536349;border-radius:6px}
#save-controls button:disabled{opacity:.55;cursor:default}
#save-status{font-size:11px;color:var(--lime)}
#rotate-device{display:none}
@media (orientation:portrait){
  .touch-device #rotate-device{position:fixed;inset:0;z-index:10;display:grid;place-items:center;padding:24px;background:#151e17f5;text-align:center}
  #rotate-device strong{font-size:24px;color:var(--lime)}
  #rotate-device p{max-width:260px;color:#dce6d1}
}

.xp-label{display:flex;justify-content:space-between;gap:4px;margin-top:8px;color:#e0c3ff;font:700 9px ui-monospace,monospace}
#xp-bar{display:block;width:100%;height:5px;margin-top:4px;border:0;border-radius:4px;overflow:hidden;background:#3d3150;color:#c890ff;accent-color:#c890ff}
#xp-bar::-webkit-progress-bar{background:#3d3150}
#xp-bar::-webkit-progress-value{background:#c890ff}
#xp-bar::-moz-progress-bar{background:#c890ff}
#open-mutations{min-height:44px;margin-bottom:4px}
#pending-mutations{color:#e0c3ff}
#mutation-status:empty{display:none}

#xp-available{margin-top:4px;color:#e0c3ff;font-size:10px}
