:root{color-scheme:dark;font-family:Inter,'Segoe UI','Microsoft YaHei',sans-serif;background:#0b1321;color:#e1ecf7;--line:#2e435e;--cyan:#84dfff;--muted:#a4b6cb}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 50% 15%,#23344b 0,#111d30 48%,#080f1b 100%);min-height:100vh}button{font:inherit;cursor:pointer;touch-action:manipulation}button:disabled{opacity:.42;cursor:default}button:focus-visible,canvas:focus-visible{outline:2px solid var(--cyan);outline-offset:-2px}button:active:not(:disabled){filter:brightness(1.25)}[hidden]{display:none!important}.app{width:min(100%,500px);margin:auto;padding:12px 10px 16px}.masthead{display:flex;align-items:center;justify-content:space-between;gap:5px;margin:0 0 10px}.masthead>div{display:flex;align-items:center;gap:7px}.brand-symbol{font-size:23px;color:var(--cyan)}.masthead b{font-size:12px;letter-spacing:1px}.version{font-size:10px;color:#a4b6cb;border:1px solid #334960;padding:2px 4px}.masthead nav{display:flex;gap:5px}.masthead button{font-size:12px;color:#bdcddd;background:#18273b;border:1px solid #3a4d65;padding:6px 8px}.game-shell{border:1px solid #415674;box-shadow:0 20px 80px #0005;background:#132136}.statusbar{display:flex;justify-content:space-between;align-items:center;gap:10px;height:40px;padding:0 12px;font-size:12px;background:#152237}.statusbar>span:first-child{color:var(--cyan)}.statusbar b{font-size:16px;font-variant-numeric:tabular-nums}.statusbar small{font-size:11px;color:var(--muted)}.viewport{position:relative;aspect-ratio:2/3;overflow:hidden;background:#14243c}canvas{display:block;width:100%;height:100%;image-rendering:pixelated;touch-action:none}.scene-meta{position:absolute;top:12px;left:12px;right:12px;display:flex;justify-content:space-between;pointer-events:none}.scene-meta span{background:#0d1c31c9;border:1px solid #789bc144;color:#d0e4f7;padding:4px 7px;font-size:11px}.resources{position:absolute;top:45px;left:12px;right:12px;display:flex;justify-content:space-between;pointer-events:none;font-size:14px;text-shadow:0 1px 3px #000}.resources span:first-child{color:#ffc981}.resources small{font-size:11px;color:#d1dded}.hull-bar{display:flex;align-items:center;gap:9px;padding:10px 12px;border-top:1px solid var(--line);font-size:12px}.health-track{flex:1;height:5px;background:#2d3e54}.health-track>div{height:100%;width:100%;background:var(--cyan);transition:width .15s}.hull-bar>b{min-width:34px;font-size:12px}.hull-bar>span:last-child{color:var(--muted);font-size:11px;min-width:40px;text-align:right}.station-nav{display:grid;grid-template-columns:1fr 1fr 1fr;border-top:1px solid var(--line)}.station-nav button{background:#192a40;border:0;border-right:1px solid var(--line);padding:10px 4px;font-size:13px;color:#d8e7f5}.station-nav button:last-child{border-right:0}.station-nav span{margin-right:6px;color:var(--cyan)}.station-nav button.active{background:#24465d;color:#fff}.touch-controls{display:none;align-items:center;justify-content:space-between;gap:8px;padding:12px;background:#0f1d30;border-top:1px solid var(--line)}.dpad{display:grid;grid-template-columns:repeat(3,42px);grid-template-rows:34px 34px;gap:4px;touch-action:none}.dpad button{background:#243951;border:1px solid #54708d;color:#daefff;font-size:16px;touch-action:none}.dpad button:first-child{grid-column:2}.dpad button:nth-child(2){grid-row:2;grid-column:1}.dpad button:nth-child(3){grid-row:2;grid-column:2}.dpad button:nth-child(4){grid-row:2;grid-column:3}#touch-fire{width:66px;height:62px;background:#264e65;border:1px solid #78c8df;color:#e2f6ff;touch-action:none;font-size:15px}.control-help{font-size:12px;color:#c0d5e7;display:flex;flex-direction:column;gap:6px;text-align:center}.control-help small{font-size:10px;color:#7791ac}.keyboard-help{display:flex;justify-content:space-between;font-size:10px;line-height:1.8;color:#8eabc8;padding:9px 2px}.overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#08172b3b}.start-card{width:80%;padding:24px;background:#111f33ec;border:1px solid #7a9fbe;box-shadow:0 10px 50px #0005;text-align:center}.eyebrow{font-size:10px;letter-spacing:1.4px;color:#89b9d6}.start-card h1{font-size:32px;letter-spacing:5px;margin:15px 0}.start-card p{font-size:14px;line-height:1.9;color:#bfd1e4;margin:15px 0 22px}.primary{width:100%;padding:13px;background:#83d8ef;color:#153046;border:1px solid #b8f1fc;font-weight:600;font-size:16px}.start-card>small{display:block;color:#8aa8c2;font-size:11px;margin-top:14px}#toast{position:absolute;bottom:26%;left:50%;transform:translateX(-50%);width:max-content;max-width:92%;padding:10px 14px;background:#102239f0;border:1px solid #6d9dbc;color:#e3f2ff;font-size:13px;opacity:0;pointer-events:none;text-align:center;transition:opacity .15s}#toast.show{opacity:1}.battle-hint{position:absolute;bottom:8px;left:8px;right:8px;text-align:center;font-size:12px;padding:8px;color:#caf2ff;background:#0c2036df;border:1px solid #5887a0;pointer-events:none}.station-panel{position:absolute;left:10px;right:10px;bottom:10px;background:#15263bf5;border:1px solid #779bb9;padding:18px;box-shadow:0 0 100px #0009;max-height:calc(100% - 20px);overflow:auto}.station-panel header{display:flex;align-items:center;justify-content:space-between}.station-panel header small{font-size:10px;letter-spacing:2px;color:var(--cyan)}.station-panel h2{font-size:22px;margin:4px 0}.station-panel header button{height:38px;width:38px;background:#263e57;border:1px solid #658099;color:#daedff}.panel-note{font-size:13px;color:#acc3d8;line-height:1.6}.upgrade-list{display:grid;grid-template-columns:1fr 1fr;gap:8px}.upgrade{display:flex;align-items:center;justify-content:space-between;gap:5px;background:#20374e;border:1px solid #4b637b;color:#e3f0ff;padding:12px 8px;text-align:left;font-size:14px}.upgrade small{font-size:10px;color:#8dd7f0}.upgrade em{display:block;font-style:normal;font-size:11px;color:#a9bdd0;margin-top:6px}.upgrade b{color:#ffcc91;font-size:13px;white-space:nowrap}#greenhouse-content{text-align:center;padding:14px 0;line-height:1.8;font-size:14px;color:#bdd3df}#greenhouse-content small{color:#89aebe;font-size:12px}.crop-icon{font-size:40px;color:#b4ed95}@media(max-width:500px){.app{padding:0;width:100%}.masthead{padding:8px 10px;margin:0;height:44px}.game-shell{border-left:0;border-right:0}.masthead b{font-size:11px;letter-spacing:.6px}.version{font-size:9px}.touch-controls{display:flex}.keyboard-help{display:none}.hull-bar{padding:8px 10px}.station-nav button{padding:9px 3px}.start-card{padding:20px}.start-card h1{font-size:29px}.control-help{font-size:11px}}@media(pointer:coarse){.touch-controls{display:flex}.keyboard-help{display:none}}@media(max-width:360px){.masthead nav button{padding:5px;font-size:10px}.dpad{grid-template-columns:repeat(3,36px)}.control-help small{display:none}.upgrade-list{grid-template-columns:1fr}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}

.app{position:relative}.debug-panel{position:fixed;left:calc(50% + 265px);top:90px;width:282px;padding:16px;background:#142439f5;border:1px solid #7899b9;box-shadow:0 16px 50px #0008;z-index:10;max-height:calc(100dvh - 110px);overflow:auto}.debug-panel header{display:flex;align-items:center;justify-content:space-between}.debug-panel h2{margin:3px 0;font-size:20px}.debug-panel header small{font-size:12px;color:#86d9ee}.debug-panel button{background:#263d55;color:#def3ff;border:1px solid #56758e;padding:8px 12px;font-size:14px}.debug-panel header button{font-size:20px;line-height:20px}.debug-note{font-size:12px;line-height:1.5;color:#a5bfd2;margin:8px 0}.debug-color-row{display:flex;align-items:center;gap:8px;margin:16px 0;font-size:14px}.debug-color-row input[type=color]{width:38px;height:32px;border:1px solid #7394aa;padding:2px;background:#1a3047}.debug-color-row input[type=text]{width:90px;padding:6px;background:#0f1f32;color:#d8effb;border:1px solid #54778f;font-size:14px;font-family:monospace}.debug-color-row input[aria-invalid=true]{border-color:#ed8b79}.debug-range{display:block;margin:14px 0;font-size:14px}.debug-range span{display:flex;justify-content:space-between;margin-bottom:7px}.debug-range output{color:#94e3ff;font-variant-numeric:tabular-nums}.debug-range input{width:100%;accent-color:#82d5ee;touch-action:pan-y}.debug-actions{display:flex;gap:8px;margin-top:14px}.debug-actions button{flex:1}#debug-swatch{display:flex;justify-content:space-between;padding:10px;font-size:12px;border:1px solid #52768b;text-shadow:0 1px 4px #000}#debug-export{width:100%;min-height:130px;background:#0c1b2a;color:#d5effb;font-size:12px;margin-top:8px}#debug-toggle[aria-expanded=true]{background:#2c5369;color:#fff}@media(max-width:1120px){.debug-panel{left:auto;right:10px;top:auto;bottom:10px;width:min(310px,calc(100% - 20px));max-height:55dvh}}@media(max-width:500px){.masthead b{font-size:10px;letter-spacing:.2px}.masthead>div{gap:4px}.masthead nav{gap:4px}.masthead button{padding:6px}.debug-panel{padding:12px}.debug-color-row{margin:10px 0}.debug-range{margin:10px 0}}

.debug-check{display:flex;align-items:center;gap:8px;font-size:14px;padding:10px 0;border-bottom:1px solid #426077}.debug-check input{width:18px;height:18px;accent-color:#84dfff}

.viewport .touch-controls{position:absolute;left:12px;right:12px;bottom:14px;display:flex;justify-content:space-between;align-items:center;padding:0;border:0;background:none;z-index:3;pointer-events:none}.joystick-wrap{display:flex;flex-direction:column;align-items:center;gap:4px;pointer-events:auto;user-select:none}.joystick-wrap small{color:#d4edfb;text-shadow:0 1px 3px #000;font-size:11px;background:#12273dcc;padding:2px 8px;border-radius:8px}#joystick{position:relative;width:104px;height:104px;border-radius:50%;border:2px solid #8bd9ef99;background:radial-gradient(circle,#22435aa0,#102337b8);box-shadow:inset 0 0 18px #7bd5ff22;touch-action:none;cursor:grab}#joystick.held{border-color:#b8f4ff}.joystick-cross{position:absolute;inset:0;display:grid;place-items:center;font-size:62px;font-weight:200;color:#88cfe52b}#joystick-knob{position:absolute;left:50%;top:50%;width:42px;height:42px;transform:translate(-50%,-50%);border-radius:50%;background:radial-gradient(circle at 35% 25%,#b2eff9,#477f9b);border:2px solid #c3f7ff;box-shadow:0 3px 12px #0006;pointer-events:none}#touch-turret,.viewport #touch-fire{pointer-events:auto;width:82px;height:60px;border:1px solid #8dcbdf;background:#193c54e8;color:#e8f8ff;font-size:13px;border-radius:12px;touch-action:none}.viewport #touch-fire{background:#594024e8;border-color:#d3a76b}.viewport #touch-fire:disabled{opacity:.4}#touch-turret.active{background:#315d70}.battle-hint{bottom:148px}.viewport .touch-controls[hidden]{display:none!important}@media(max-width:360px){#joystick{width:90px;height:90px}#touch-turret,.viewport #touch-fire{width:70px;height:54px}}

.viewport .touch-controls{justify-content:center}#touch-turret{position:absolute;left:auto;right:0;top:22px}

#turret-arc{position:relative;width:180px;height:108px;touch-action:none;user-select:none}#turret-arc svg{width:100%;height:100%;pointer-events:none}#arc-knob{position:absolute;width:30px;height:30px;border:2px solid #d4fbff;border-radius:50%;background:radial-gradient(circle at 35% 25%,#bdffff,#3b819d);box-shadow:0 0 12px #82dcff66;transform:translate(-50%,-50%);pointer-events:none}
