:root{--bg: #0e0f14;--panel: #1a1c26;--panel-2: #242736;--text: #e6e6ea;--muted: #9a9db0;--accent: #7ee787;--danger: #ff6b6b;--warn: #ffd166;--radius: 10px;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;font-size:16px}*{box-sizing:border-box}html,body{margin:0;height:100%;background:var(--bg);color:var(--text);overflow:hidden}#app{height:100%}button,input,select{font:inherit}button{background:var(--panel-2);color:var(--text);border:1px solid #3a3e52;border-radius:var(--radius);padding:.5rem .9rem;cursor:pointer;min-height:44px}button:hover{border-color:var(--accent)}button.primary{background:var(--accent);color:#0b1a0d;border-color:var(--accent);font-weight:600}button.danger{color:var(--danger)}button:disabled{opacity:.5;cursor:default}button.primary:disabled{background:var(--panel-2);color:var(--muted);border-color:#3a3e52}input,select{background:var(--bg);color:var(--text);border:1px solid #3a3e52;border-radius:var(--radius);padding:.5rem .7rem;min-height:44px;width:100%}.menu-bg{position:fixed;inset:0;width:100%;height:100%;z-index:0;image-rendering:pixelated}.menu{position:relative;z-index:1;height:100%;overflow:auto;padding:16px;display:flex;flex-direction:column;align-items:center;gap:1rem}.menu .brand{display:flex;flex-direction:column;align-items:center;gap:.6rem;margin-top:2.5vh}.menu canvas.title{image-rendering:pixelated;width:min(90vw,520px);height:auto;filter:drop-shadow(0 0 18px rgba(126,231,135,.55)) drop-shadow(0 4px 0 #0b1a0d);animation:titleGlow 3s ease-in-out infinite}@keyframes titleGlow{50%{filter:drop-shadow(0 0 28px rgba(126,231,135,.9)) drop-shadow(0 4px 0 #0b1a0d)}}.menu .sub{color:#d8e6c8;margin:0;background:#0a0c1299;padding:.3rem .9rem;border-radius:999px;font-size:.95rem;text-align:center}.menu .foot{color:var(--muted);font-size:.8rem;text-shadow:0 1px 4px #000;margin-top:auto;text-align:center}.slots{width:min(100%,760px);display:grid;gap:.8rem;grid-template-columns:repeat(auto-fill,minmax(340px,1fr))}.slot{background:linear-gradient(180deg,#1e2230eb,#12141ef0);border:2px solid #3a4a3a;border-radius:6px;box-shadow:0 6px #0a0c12,0 10px 24px #0009,inset 0 1px #ffffff0f;padding:.8rem 1rem;display:flex;flex-direction:column;gap:.5rem;transition:transform .12s,border-color .12s}.slot:hover{transform:translateY(-3px);border-color:var(--accent)}.slot.lost{border-color:#5a3a3a}.slot .ico{width:28px;height:28px;image-rendering:pixelated;flex:none}.slot .title{display:flex;align-items:center;gap:.6rem}.slot .name{font-weight:700;flex:1;letter-spacing:.02em}.slot .num{color:var(--muted);font-size:.8rem;text-transform:uppercase;letter-spacing:.08em}.slot .meta{color:var(--muted);font-size:.85rem;line-height:1.5}.slot .meta .failed{color:var(--warn)}.slot .actions{display:flex;gap:.5rem;flex-wrap:wrap}.slot.empty{border-style:dashed;background:#0e0f1499;justify-content:center;align-items:center;min-height:150px;gap:.4rem}.slot.empty .ico{opacity:.6;width:36px;height:36px}.menu button{border-radius:4px;border-width:2px;box-shadow:0 3px #0a0c12}.menu button:active{transform:translateY(2px);box-shadow:0 1px #0a0c12}.menu button.primary{background:linear-gradient(180deg,#9af3a0,#5fcf6a);border-color:#3f9a4a}.modal-backdrop{position:fixed;inset:0;z-index:50;background:#0009;display:flex;align-items:center;justify-content:center;padding:16px}.modal{background:var(--panel);border-radius:var(--radius);padding:1.2rem;width:min(100%,480px);display:flex;flex-direction:column;gap:.8rem;max-height:100%;overflow:auto}.modal h2{margin:0}.field{display:flex;flex-direction:column;gap:.3rem}.field label{color:var(--muted);font-size:.9rem}.field .row{display:flex;gap:.5rem}.field .row input{flex:1}.field.check{flex-direction:row;align-items:center;gap:.6rem}.field.check input{width:auto;min-height:0}.modal .actions{display:flex;justify-content:flex-end;gap:.5rem}.error{color:var(--danger)}.game{position:relative;height:100%}.game canvas{display:block}.hud{position:absolute;top:0;left:0;right:0;display:flex;justify-content:space-between;align-items:flex-start;padding:10px;gap:8px;pointer-events:none}.hud>*{pointer-events:auto}.hud .stats{background:#0e0f14bf;border-radius:var(--radius);padding:.5rem .8rem;font-variant-numeric:tabular-nums;font-size:.9rem;line-height:1.5}.hud .stats .failed{color:var(--warn)}.hud .buttons{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.hud .buttons button{min-height:40px;padding:.4rem .7rem;background:#1a1c26e6}.toast{position:absolute;bottom:110px;left:50%;transform:translate(-50%);background:#1a1c26f2;padding:.5rem 1rem;border-radius:var(--radius);opacity:0;transition:opacity .3s;pointer-events:none}.toast.show{opacity:1}.tutorial{position:absolute;left:16px;bottom:110px;width:min(360px,60vw);background:#0e0f14d9;border:1px solid var(--accent);border-radius:var(--radius);padding:.6rem .8rem;font-size:.85rem;display:flex;flex-direction:column;gap:.4rem}.tutorial .ttl{color:var(--accent);font-weight:600}.tutorial .row{display:flex;gap:.5rem}.tutorial .row button{font-size:.8rem;padding:.2rem .6rem}.hud .buttons button.off{opacity:.45;text-decoration:line-through}.help{position:absolute;bottom:10px;left:16px;right:16px;text-align:center;color:var(--muted);font-size:.75rem;pointer-events:none}.pause-overlay{position:absolute;inset:0;background:#0000008c;display:flex;align-items:center;justify-content:center}.pause-overlay .modal{width:min(100%,360px);align-items:stretch;text-align:center}.pause-overlay .modal button{width:100%}.invbar{position:absolute;bottom:60px;left:50%;transform:translate(-50%);display:flex;gap:4px;padding:6px;border-radius:var(--radius);background:#0e0f14bf;width:max-content;max-width:calc(100vw - 32px);flex-wrap:wrap;justify-content:center}.invbar .cell{position:relative;width:64px;height:64px;border:2px solid #3a3e52;border-radius:6px;background:#1a1c26e6;cursor:pointer;display:flex;align-items:center;justify-content:center}.invbar .cell.sel{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}.invbar .cell img{width:48px;height:48px;image-rendering:pixelated;object-fit:contain}.invbar .cell .key{position:absolute;top:1px;left:4px;font-size:.7rem;color:var(--muted);z-index:1}.invbar .cell .count{position:absolute;bottom:1px;right:5px;font-size:.95rem;font-weight:700;text-shadow:0 0 3px #000,0 0 3px #000}.hud .stats .dim{color:var(--muted);font-size:.8rem}.hud .left{display:flex;flex-direction:column;gap:6px}.needs{background:#0e0f14bf;border-radius:var(--radius);padding:.4rem .8rem;display:grid;grid-template-columns:auto 1fr;gap:3px 8px;font-size:.75rem;min-width:190px}.needs .bar{display:contents}.needs .lbl{color:var(--muted)}.needs .track{display:block;height:8px;background:#2a2d3a;border-radius:4px;overflow:hidden;align-self:center}.needs .fill{display:block;height:100%;background:var(--accent);transition:width .3s}.needs .health .fill{background:#ff6b6b}.needs .hearts{grid-column:1 / -1;display:flex;align-items:center;gap:1px;font-size:1.15rem;line-height:1;padding-bottom:2px}.needs .heart{color:#3a2228;text-shadow:0 1px 0 #000}.needs .heart.full{color:#ff4d5a;text-shadow:0 0 6px rgba(255,77,90,.7),0 1px 0 #5a0a14}.needs .heart.half{background:linear-gradient(90deg,#ff4d5a 50%,#3a2228 50%);-webkit-background-clip:text;background-clip:text;color:transparent}.needs .hearts .hp{margin-left:6px;font-size:.8rem;color:var(--text);font-weight:700}.needs .hearts.low .heart.full,.needs .hearts.low .heart.half{animation:pulse 1s ease-in-out infinite}.needs .hearts.crit .heart.full,.needs .hearts.crit .heart.half{animation:blink .5s steps(2,start) infinite}@keyframes pulse{50%{transform:scale(1.18)}}.needs .dual .track{position:relative}.needs .dual .fill{position:absolute;top:0;height:100%}.needs .dual .fill.hunger{right:50%;background:#e0a040;border-radius:4px 0 0 4px}.needs .dual .fill.thirst{left:50%;background:#4a8ad0;border-radius:0 4px 4px 0}.needs .dual .track:after{content:"";position:absolute;left:50%;top:0;width:1px;height:100%;background:#0e0f14}.needs .hunger .fill{background:#e0a040}.needs .thirst .fill{background:#4a8ad0}.needs .fatigue .fill{background:#b08ad0}.needs .morale .fill{background:#ffd166}.needs .dose .fill{background:#7fff5a}.needs .warmth .fill{background:#ff9a5a}.needs .low .lbl{color:var(--danger);font-weight:600}.needs .low .track{height:12px}.needs .crit .lbl{color:var(--danger);font-weight:700;animation:blink .6s steps(2,start) infinite}.needs .crit .track{height:14px;box-shadow:0 0 6px var(--danger);animation:blink .6s steps(2,start) infinite}@keyframes blink{to{opacity:.35}}.drag-ghost{position:fixed;width:48px;height:48px;pointer-events:none;z-index:1000;opacity:.9}.drag-ghost img{width:48px;height:48px;image-rendering:pixelated}.sleep-hurt{color:var(--danger);font-size:1.1rem;min-height:1.4em}.sleep-overlay{position:absolute;inset:0;background:#00000a59;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;padding-bottom:130px;gap:.6rem;font-size:1.6rem;color:var(--muted);pointer-events:none}.sleep-overlay button{pointer-events:auto}.loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#0e0f14d9;font-size:1.2rem}.game{user-select:none;touch-action:none}.modal.wide{width:min(100%,640px);max-height:94vh;overflow:auto}.modal .head{display:flex;justify-content:space-between;align-items:center}.modal .head h2{margin:0}.modal h3{margin:.4rem 0 0;font-size:1rem;color:var(--muted)}.modal .dim{color:var(--muted);font-size:.85rem;margin:0}.icon{max-width:24px;max-height:24px;image-rendering:pixelated;vertical-align:middle;object-fit:contain}.modal.book{width:min(100%,820px);max-height:92vh;gap:.6rem}.modal.book .head input{flex:1;margin:0 .8rem;min-height:38px}.rgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));gap:.35rem;overflow:auto}.rtile{position:relative;display:flex;flex-direction:column;align-items:center;gap:.2rem;padding:.35rem .2rem;min-height:0;border-radius:6px;background:var(--panel-2);border:2px solid #3a3e52;opacity:.55}.rtile.ok{opacity:1;border-color:#4a6a4a}.rtile.nostation{border-style:dashed}.rtile.sel{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent);opacity:1}.rtile img{width:44px;height:44px;image-rendering:pixelated;object-fit:contain}.rtile .lbl{font-size:.68rem;line-height:1.1;text-align:center;color:var(--text);max-height:2.2em;overflow:hidden}.rtile .count{position:absolute;top:2px;right:5px;font-size:.7rem;color:var(--muted)}.rdetail{display:grid;grid-template-columns:1fr;gap:.4rem;background:var(--panel-2);border-radius:8px;padding:.6rem .8rem;align-items:center;min-height:64px}@media(min-width:560px){.rdetail{grid-template-columns:180px 1fr 90px auto}}.rdetail .out{display:flex;align-items:center;gap:.4rem;font-weight:600}.rdetail .ings{display:flex;flex-wrap:wrap;gap:.3rem .8rem;font-size:.85rem}.rdetail .ing.missing,.rdetail .station.missing{color:var(--danger)}.rdetail .station{font-size:.8rem;color:var(--muted)}.rdetail button{min-height:36px;padding:.3rem .7rem}.grid{display:grid;grid-template-columns:repeat(8,64px);gap:4px;justify-content:center}@media(max-width:640px){.grid{grid-template-columns:repeat(auto-fill,64px)}}.grid .cell{position:relative;width:64px;height:64px;border:2px solid #3a3e52;border-radius:6px;background:var(--bg);cursor:pointer;display:flex;align-items:center;justify-content:center}.grid .cell img{width:48px;height:48px;max-width:none;max-height:none;object-fit:contain;image-rendering:pixelated}.grid .cell .count{position:absolute;bottom:1px;right:5px;font-size:.95rem;font-weight:700;text-shadow:0 0 3px #000,0 0 3px #000}.grid.inv .cell{border-color:#4a5a4a}.invbar .cell.suit{border-style:dashed;border-color:#6a8a5a;margin-right:8px;background:#283c288c}.invbar .cell.suit.empty{opacity:.6}.invbar .cell.suit .key{left:4px;font-size:.65rem}.tip{position:fixed;z-index:2000;pointer-events:none;max-width:300px;padding:6px 10px;border-radius:6px;background:#14161e;border:1px solid #5a6a8a;color:#f0f2f8;font-size:.9rem;line-height:1.3;white-space:pre-line;box-shadow:0 4px 14px #00000080}.tip:first-line{font-weight:700}.suitrow{display:flex;align-items:center;gap:10px;min-height:0}.suitrow:empty{display:none}.suitrow .cell.suit.empty{opacity:.6;cursor:default}.suitrow .cell.suit .key{position:absolute;left:4px;top:2px;font-size:.65rem;color:var(--muted)}.suitrow .cell.suit{position:relative;flex:none;width:64px;height:64px;border:2px dashed #6a8a5a;border-radius:6px;background:#283c288c;cursor:pointer;display:flex;align-items:center;justify-content:center}.suitrow .cell.suit img{width:48px;height:48px;max-width:none;max-height:none;object-fit:contain;image-rendering:pixelated}.invbar .cell img,.grid .cell img,.suitrow .cell img{-webkit-user-drag:none;user-select:none;pointer-events:none}.cell.dragging img,.cell.dragging .count{opacity:.25}.invbar .cell,.grid .cell{touch-action:none}.cell .wear{position:absolute;left:6px;right:6px;bottom:4px;height:5px;border-radius:3px;background:#000000a6;overflow:hidden;pointer-events:none}.cell .wear i{display:block;height:100%}.cell:has(.wear) .count{display:none}.vignette{position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity .6s;box-shadow:inset 0 0 140px 50px #c81414cc,inset 0 0 40px 10px #ff282899}.vignette.pulse{animation:vignettePulse .9s ease-in-out infinite}@keyframes vignettePulse{0%,to{filter:brightness(.7)}50%{filter:brightness(1.5)}}.modal-backdrop.window{background:#0003}.modal-backdrop.window .modal{background:#1a1c26c7;backdrop-filter:blur(3px);border:1px solid rgb(255 255 255 / .12)}.modal-backdrop.window .grid .cell{background:#0e0f1499}.modal.mapwin{width:min(100%,1060px)}canvas.map{width:100%;image-rendering:pixelated;border-radius:6px;cursor:grab;touch-action:none;background:#0a0b10}.modal.mapwin .row{display:flex;gap:6px}.markers{display:flex;flex-wrap:wrap;gap:6px}.markers:empty{display:none}.chip{min-height:30px;padding:.15rem .6rem;font-size:.8rem;border-radius:999px}.modal.mapwin .row input{flex:1;min-height:36px}.goal{color:#ffd870}.goalbox{margin-bottom:8px;display:flex;flex-direction:column;gap:2px}.milestones{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:4px;margin-bottom:10px}.milestones .step{display:flex;gap:8px;padding:5px 8px;border-radius:6px;background:#0e0f1480;color:var(--muted)}.milestones .step.done{color:inherit}.milestones .step.done .tick{color:#ffd870}.milestones .step .day{margin-left:auto;color:var(--muted)}.segbar{display:inline-flex;gap:1px;vertical-align:middle;padding:1px;background:#0e0f14;border-radius:3px}.segbar i{width:5px;height:10px;background:#2a2d3a;border-radius:1px}.segbar i.on.g{background:#6fd84a}.segbar i.on.y{background:#e8c040}.segbar i.on.r{background:#ff4d4d;box-shadow:0 0 4px #ff4d4d}.instruments{display:flex;gap:6px;align-items:stretch}.forecast{background:#0e0f14bf;border-radius:var(--radius);padding:4px 8px;display:flex;gap:10px;font-size:.72rem}.forecast .fday{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}.forecast .lbl{color:var(--muted)}.forecast .fday.bad .lbl{color:var(--danger);font-weight:700}.forecast .icons{display:flex;gap:2px;font-size:1rem;line-height:1;min-height:1rem}.forecast .icons .far{opacity:.45}.geiger{background:#0e0f14bf;border-radius:var(--radius);padding:2px 8px 4px;width:max-content;display:flex;flex-direction:column;align-items:center}.geiger svg{display:block}.geiger .z{fill:none;stroke-width:7}.geiger .z.g{stroke:#3f8a2f}.geiger .z.y{stroke:#c8a030}.geiger .z.r{stroke:#c03030}.geiger .tk{stroke:#c8ccd8;stroke-width:1.5}.geiger .needle{stroke:#f4f4f8;stroke-width:2.5;stroke-linecap:round;transition:transform .12s linear}.geiger .hub{fill:#c8ccd8}.geiger .lbl{font-size:.7rem;color:var(--muted);margin-top:-4px}.geiger.hot .lbl{color:var(--danger);font-weight:700}.rdetail .desc{margin:4px 0 8px;color:var(--muted);font-size:.85rem;max-width:60ch}.drag-ghost .n{position:absolute;right:-2px;bottom:-4px;font-size:.8rem;font-weight:700;color:#fff;text-shadow:0 1px 2px #000,0 0 2px #000}.furnace{display:flex;align-items:flex-end;gap:14px;margin:6px 0 12px}.furnace .fslot{display:flex;flex-direction:column;align-items:center;gap:4px;font-size:.75rem}.grid.one{grid-template-columns:64px}.furnace .fprog{display:flex;flex-direction:column;gap:4px;min-width:190px;font-size:.75rem;padding-bottom:8px}.furnace .fprog .track{display:block;height:10px;background:#2a2d3a;border-radius:5px;overflow:hidden}.furnace .fprog .fill{display:block;height:100%;background:#e06a2a}.journal{display:flex;flex-direction:column;gap:4px;max-height:60vh;overflow:auto}.journal .entry{display:flex;gap:12px;padding:5px 8px;border-radius:6px;background:#0e0f1480}.journal .entry .day{color:var(--muted);min-width:64px}.nightfog{position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity 3s;background:radial-gradient(ellipse at center,#bec8d22e,#aab4c380 70%,#96a0afb3)}.gameover{background:#140000d1}.update-banner{position:fixed;top:64px;left:50%;transform:translate(-50%);z-index:1000;width:max-content;max-width:min(640px,92vw);display:flex;gap:.8rem;align-items:center;justify-content:center;flex-wrap:wrap;text-align:center;padding:.6rem 1rem;background:#1a1c26f7;border:1px solid var(--accent);border-radius:var(--radius);font-size:.9rem}.update-banner button{min-height:36px;padding:.3rem .8rem}
