:root{font-family:'PingFang SC','Microsoft YaHei',sans-serif;color:#f1f1df;color-scheme:dark;background:#101819;--amber:#e5b46e;--amber-2:#d7b375;--gold-deep:#b98d4a;--gold-soft:#f0cd8a;--panel:#142724;--line:#c0ccb42d;--line-gold:rgba(217,180,110,.38);--shadow-panel:0 12px 32px rgba(0,0,0,.45);--radius-panel:12px;--radius-btn:8px}*{box-sizing:border-box}body{margin:0;overflow:hidden}button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:disabled{opacity:.4;cursor:default}#start:disabled{background:linear-gradient(180deg,#26332f,#1d2926);color:#93a89e;opacity:.8;border-color:rgba(160,180,168,.25);box-shadow:none}#start:disabled:hover{transform:none;box-shadow:none}button:focus-visible{outline:2px solid var(--amber);outline-offset:3px}#game{height:100dvh;position:relative;min-height:min(480px,100dvh);overflow:hidden}#viewport{position:absolute;inset:0;touch-action:none}canvas{display:block}.vignette{position:absolute;inset:0;pointer-events:none;background:linear-gradient(#071619b3,transparent 22%,transparent 62%,#0b1515e8),linear-gradient(90deg,#0b171943,transparent 30%)}header{position:absolute;top:0;left:0;right:0;padding:20px 28px 26px;display:flex;align-items:center;gap:12px;background:linear-gradient(#0a1413f2,#0a1413a6 62%,transparent)}.brand{font:30px Impact,'Arial Narrow',sans-serif;letter-spacing:4px;text-shadow:0 2px 14px #000d,0 1px 0 #0009}.brand>b{font-weight:normal;background:linear-gradient(180deg,#f6dd9a,#d7a95c);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.brand>small{font:8px monospace;display:block;letter-spacing:3px;margin-top:6px;color:#d8c49a;text-shadow:0 1px 6px #000c}.view-switch{display:flex;padding:4px;border:1px solid var(--line-gold);background:#101f1cd9;border-radius:10px;margin-left:auto;box-shadow:0 6px 18px rgba(0,0,0,.35)}.view-switch button{padding:9px 15px;background:none;border:0;font-size:11px;color:#b4c1b9;border-radius:7px}.view-switch button:hover{color:#f3e4bb}.view-switch .on{background:linear-gradient(180deg,#f0cd8a,#d7a95c);color:#182222;border-radius:7px;font-weight:bold;box-shadow:0 2px 10px rgba(215,169,92,.35)}.square{height:37px;width:37px;border:1px solid var(--line-gold);background:#142525d9;border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,.3)}.square:hover{border-color:var(--amber);color:#f3e4bb}.mission{position:absolute;left:28px;top:108px;width:252px;pointer-events:none;background:linear-gradient(180deg,rgba(15,31,27,.88),rgba(15,31,27,.68));border:1px solid var(--line-gold);border-left:3px solid var(--amber);border-radius:var(--radius-panel);padding:11px 16px 10px;box-shadow:var(--shadow-panel);backdrop-filter:blur(6px)}.mission>small{font:8px monospace;color:#e9c693;letter-spacing:2px}h1{font-size:23px;letter-spacing:2px;margin:8px 0 14px;color:#f6ead0;text-shadow:0 2px 8px #0008}.wave{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap}.wave strong{font:42px monospace;color:#f6e3ac;text-shadow:0 2px 10px #0009}.wave span{font-size:10px;color:#c6cbb9;white-space:nowrap}.wave i{font-size:9px;font-style:normal;background:#2a2113d9;border:1px solid rgba(217,180,110,.4);padding:3px 7px;border-radius:6px;color:#f0cd8a;margin-left:auto;white-space:nowrap}.base{font-size:10px;margin-top:13px;border-top:1px solid rgba(217,180,110,.22);padding-top:12px;color:#ccd5c7}.base b{float:right;font:11px monospace;color:#eef1d8}.base>div{height:5px;margin-top:8px;background:#0d1a16;border-radius:3px;overflow:hidden}.base i{height:100%;background:linear-gradient(90deg,#9db88a,#cfe3b0);display:block;width:100%;border-radius:3px}.xp-run{font-size:10px;margin-top:11px;color:#ccd5c7}.xp-run b{float:right;font:11px monospace;color:#e8c96a}.xp-run>div{height:5px;margin-top:7px;background:#0d1a16;border-radius:3px;overflow:hidden}.xp-run i{height:100%;background:linear-gradient(90deg,#d7a95c,#f0cd8a);display:block;width:0%;border-radius:3px}#mode-label{font:8px monospace;color:#bfc7b2;opacity:.75;margin-top:10px}.resources{position:absolute;right:28px;top:110px;display:flex;gap:0;align-items:center;background:linear-gradient(180deg,rgba(20,38,32,.92),rgba(16,30,26,.85));padding:12px 8px;border:1px solid var(--line-gold);border-radius:12px;box-shadow:var(--shadow-panel);backdrop-filter:blur(6px)}.resources>span{font:13px monospace;color:#dec28c;padding:0 16px}.resources>span+span{border-left:1px solid rgba(255,255,255,.09)}.resources b{font:20px monospace;color:#f6e3ac;text-shadow:0 1px 6px #0008}.resources small{font-size:8px;display:block;color:#a6b6a9;text-align:right;margin-top:4px;letter-spacing:1px}#crosshair{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:none;text-align:center}#crosshair b{font:24px monospace;color:#f6e8c2;text-shadow:0 0 6px #000,0 0 2px #000}#aimhint{position:absolute;top:38px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:9px;color:#e1e8d8;opacity:.8;text-shadow:0 1px 4px #000}#toast{position:absolute;left:50%;top:31%;transform:translate(-50%,-50%);background:linear-gradient(180deg,#1a2f29,#142724);border:1px solid rgba(217,177,124,.55);padding:13px 20px;font-size:12px;opacity:0;pointer-events:none;border-radius:10px;max-width:85%;width:max-content;transition:opacity .2s;box-shadow:0 10px 28px rgba(0,0,0,.5);color:#f3e4bb}#toast.show{opacity:1}
/* v7 横屏提示：竖屏窄屏时显示的可关闭提示，不锁屏、不拦截操作 */
#rotate-hint{display:none;position:absolute;left:50%;top:24%;transform:translateX(-50%);z-index:40;align-items:center;gap:12px;background:#142724f2;border:1px solid #d9b17c88;border-radius:8px;padding:12px 16px;max-width:92%;box-shadow:0 10px 40px #0008}
#rotate-hint.show{display:flex}
#rotate-hint .rotate-icon{display:inline-block;font-size:26px;animation:rotate-hint-turn 2.4s ease-in-out infinite}
@keyframes rotate-hint-turn{0%,100%{transform:rotate(0)}30%,60%{transform:rotate(-90deg)}}
#rotate-hint p{margin:0;font-size:13px;color:#f3e4bb;white-space:nowrap}
#rotate-hint small{display:block;font-size:10px;color:#aebea8;margin-top:3px;white-space:nowrap}
#rotate-hint button{flex-shrink:0;background:#d7b375;color:#19271f;border:0;border-radius:4px;padding:8px 12px;font-size:11px;font-weight:bold;white-space:nowrap}#respawn{position:absolute;left:50%;top:43%;transform:translate(-50%,-50%);font-size:22px;color:#ffd3a3;text-shadow:0 2px 5px #000;pointer-events:none}.slot{position:absolute;transform:translate(-50%,-50%);border:1px solid #c3dcc088;width:40px;height:34px;border-radius:5px;background:#143c39a8;color:#dff1d1;font-size:21px}.slot.built{font-size:10px;height:28px;background:#373726b0;border-color:#d7b579}.slot small{display:none}#joystick{position:absolute;left:38px;bottom:155px;width:112px;height:112px;border-radius:50%;border:2px solid rgba(238,244,221,.4);background:radial-gradient(circle at 50% 40%,rgba(20,42,36,.55),rgba(20,42,36,.25));touch-action:none;box-shadow:inset 0 0 35px #a8c8aa1c,0 8px 24px rgba(0,0,0,.35)}#stick{position:absolute;left:35px;top:35px;width:42px;height:42px;background:radial-gradient(circle at 35% 30%,#f2f6e8,#b9c4ae);border:1px solid #eff8de;border-radius:50%;pointer-events:none;box-shadow:0 4px 12px rgba(0,0,0,.45)}#joystick>span{position:absolute;bottom:-22px;text-align:center;width:100%;font-size:9px;color:#d6ddcc;text-shadow:0 1px 4px #000}#combat{position:absolute;right:34px;bottom:145px;display:flex;align-items:end;gap:12px;touch-action:none}#fire{width:88px;height:88px;border-radius:50%;background:radial-gradient(circle at 35% 30%,rgba(240,205,138,.55),rgba(180,156,108,.35));border:2px solid #e4bf80;font:36px monospace;box-shadow:0 0 0 7px #172a1b2e,0 0 26px rgba(215,169,92,.3),0 8px 20px rgba(0,0,0,.4)}#fire:active{background:radial-gradient(circle at 35% 30%,rgba(240,205,138,.85),rgba(213,166,82,.6))}#fire small{display:block;font:9px sans-serif;margin-top:2px;color:#f3e4bb}#nuke{height:56px;width:56px;border-radius:50%;background:linear-gradient(180deg,#243a31,#1b3029);border:1px solid rgba(201,197,154,.55);font-size:25px;box-shadow:0 6px 16px rgba(0,0,0,.4)}#nuke small{display:block;font-size:7px}#dodge{height:56px;width:56px;border-radius:50%;background:linear-gradient(180deg,#243a31,#1b3029);border:1px solid rgba(201,197,154,.55);font-size:25px;box-shadow:0 6px 16px rgba(0,0,0,.4)}#dodge small{display:block;font-size:7px}.bottom-actions button.armed{border-color:#f1cb84;background:#c4a267;color:#152220}#auto{position:absolute;top:-36px;right:0;white-space:nowrap;background:#172a25d9;border:1px solid rgba(217,221,188,.4);border-radius:7px;padding:7px 10px;font-size:9px;box-shadow:0 4px 12px rgba(0,0,0,.3)}#keyboard{position:absolute;bottom:117px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:9px;letter-spacing:1px;color:#dbe2d0c9;text-shadow:0 1px 4px #000}footer{position:absolute;bottom:20px;left:28px;right:28px;display:flex;align-items:stretch;gap:14px}#hero-status{min-width:245px;background:linear-gradient(180deg,rgba(21,39,37,.95),rgba(17,31,28,.92));border:1px solid var(--line-gold);border-left:3px solid var(--amber);display:flex;text-align:left;align-items:center;gap:13px;padding:10px 12px;border-radius:12px;box-shadow:var(--shadow-panel)}#hero-status:hover{border-color:var(--amber)}#portrait{height:60px;width:60px;border-radius:8px;background:#3a4d45;display:block;border:1px solid rgba(217,180,110,.35);box-shadow:inset 0 0 12px rgba(0,0,0,.35)}svg{width:100%;height:100%}#hero-status small{display:block;font:7px monospace;color:#9fb4a4;letter-spacing:1px}#hero-status b{font-size:13px;display:inline-block;margin:5px 3px 6px 0;color:#f6ead0}#hero-status em{font:9px monospace;color:#e0bc7b}.health{display:block;width:140px;height:5px;background:#081f1b;margin-bottom:6px;border-radius:3px;overflow:hidden}.health i{display:block;width:100%;height:100%;background:linear-gradient(90deg,#9db88a,#cfe3b0)}.bottom-actions{display:flex;gap:8px;margin-left:auto}.bottom-actions button{min-width:96px;background:linear-gradient(180deg,#20342d,#16241f);border:1px solid rgba(156,186,165,.4);border-radius:10px;font-size:22px;padding:10px;box-shadow:0 6px 16px rgba(0,0,0,.35);transition:transform .12s,border-color .12s}.bottom-actions button:hover{border-color:var(--amber);transform:translateY(-1px)}.bottom-actions span{display:block;font-size:10px;margin-top:7px;color:#d8e0cd}#start{min-width:185px;border:1px solid #f6dd9a;background:linear-gradient(180deg,#f0cd8a,#d7a95c);color:#1c2415;border-radius:12px;padding:0 18px;font-weight:bold;display:flex;align-items:center;justify-content:space-between;gap:15px;font-size:15px;box-shadow:0 10px 26px rgba(215,169,92,.38),inset 0 1px 0 #ffe9b8;transition:transform .12s,box-shadow .12s}#start:hover{transform:translateY(-1px);box-shadow:0 14px 30px rgba(215,169,92,.45),inset 0 1px 0 #ffe9b8}#start b{font-size:26px}#saved{position:absolute;bottom:5px;right:29px;font:7px monospace;color:#a8b9a180}dialog{width:min(880px,94vw);max-height:88dvh;overflow:auto;border:1px solid var(--line-gold);border-radius:16px;background:linear-gradient(180deg,#16261f,#101c18);color:#e2e9d6;padding:30px;box-shadow:0 24px 90px rgba(0,0,0,.65)}dialog::backdrop{background:#061413d9;backdrop-filter:blur(8px)}dialog h2{font-size:27px;margin:8px 0 10px;color:#f6ead0;letter-spacing:1px}dialog h2::after{content:'';display:block;width:56px;height:3px;background:linear-gradient(90deg,#e5b46e,transparent);margin-top:12px;border-radius:2px}dialog p{font-size:12px;line-height:1.8;color:#a9bda9}.eyebrow{font:9px monospace;letter-spacing:3px;color:#dab680}.close{float:right;border:1px solid #607462;background:#273e32;border-radius:8px;width:30px;height:30px}.close:hover{border-color:var(--amber);color:#f3e4bb}.tabs{display:flex;gap:8px;margin:18px 0}.tabs button,.secondary{padding:9px 13px;border:1px solid #596e5a;background:#253a2e;font-size:11px;border-radius:8px}.tabs button:hover,.secondary:hover{border-color:var(--amber);color:#f3e4bb}.tabs button.on{border-color:var(--amber);color:#f3e4bb;background:linear-gradient(180deg,#3a2f1a,#2a2113);box-shadow:inset 0 -2px 0 var(--amber)}.primary{padding:12px 18px;background:linear-gradient(180deg,#f0cd8a,#d7a95c);color:#19271f;border:0;border-radius:8px;font-weight:bold;font-size:12px;box-shadow:0 6px 16px rgba(215,169,92,.28),inset 0 1px 0 #ffe9b8}.primary:hover{filter:brightness(1.06)}.hero-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.hero-tile{background:linear-gradient(180deg,#243a30,#1b2c24);border:1px solid rgba(96,115,84,.7);padding:12px;border-radius:12px;box-shadow:0 6px 16px rgba(0,0,0,.25)}.hero-tile:hover{border-color:var(--amber)}.hero-tile .avatar{height:112px;border-radius:8px;background:radial-gradient(#5c7564,#243a30);border:1px solid rgba(217,180,110,.18)}.hero-tile h3{font-size:12px;margin:9px 0;color:#f0e8cf}.hero-tile p{font-size:10px;min-height:36px;line-height:1.6}.hero-tile button{width:100%;padding:8px 4px;font-size:10px;margin-top:5px}.hero-tile.selected{border-color:#deb97e;box-shadow:0 0 0 1px #deb97e,0 8px 22px rgba(215,169,92,.22)}.xp{height:4px;background:#12281d;margin:8px 0;border-radius:2px;overflow:hidden}.xp i{height:100%;display:block;background:linear-gradient(90deg,#d7a95c,#f0cd8a)}.skin-row{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.skin-item{background:linear-gradient(180deg,#253f32,#1c2f26);border:1px solid rgba(108,127,91,.7);border-radius:12px;padding:14px;text-align:center;box-shadow:0 6px 16px rgba(0,0,0,.25)}.skin-item:hover{border-color:var(--amber)}.skin-item .avatar{height:130px}.skin-item h3{font-size:13px;color:#f0e8cf}.gear-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.gear{border:1px solid rgba(93,119,94,.7);background:linear-gradient(180deg,#233d2f,#1a2d23);padding:18px;border-radius:12px;box-shadow:0 6px 16px rgba(0,0,0,.25)}.gear:hover{border-color:var(--amber)}.gear .symbol{font:35px monospace;color:#d8c188}.gear h3{font-size:16px;color:#f0e8cf}.gear p{font-size:11px}.gear button{margin-top:9px}.skill-option{width:100%;padding:18px;text-align:left;background:linear-gradient(180deg,#273d30,#1e2f26);border:1px solid rgba(119,132,102,.7);margin:6px 0;border-radius:10px;box-shadow:0 4px 12px rgba(0,0,0,.25)}.skill-option:hover{border-color:var(--amber)}.skill-option b{display:block;font-size:15px;color:#e0bd82}.skill-option small{display:block;margin-top:7px;color:#aebea8}.setting-row{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0}.skin-choice{display:flex;gap:8px;align-items:center;margin:16px 0}select{background:#294331;border:1px solid #6e8060;padding:8px;color:#dfebd4}.credits{font-size:10px;color:#a7b898}.credits a{color:#d4bb8e}@media(max-width:700px){header{padding:12px 12px 18px;gap:6px;flex-wrap:wrap}.brand{font-size:20px;letter-spacing:2px}.brand small{font-size:6px}.square{width:28px;height:28px}.view-switch{order:4;margin:0;position:absolute;right:12px;top:57px}.view-switch button{padding:7px 9px;font-size:9px}header>.square:first-of-type{margin-left:auto}.mission{left:14px;top:94px;width:176px;padding:10px 12px}.mission>small{font-size:6px;letter-spacing:1px}.mission h1{font-size:16px;margin:4px 0 6px}.wave strong{font-size:28px}.wave span,.wave i{font-size:8px}.base{margin-top:6px;padding-top:6px;font-size:8px}.resources{top:106px;right:12px;gap:8px;padding:8px}.resources>span{font-size:9px;padding:0 8px}.resources b{font-size:13px}.resources small{font-size:6px}#mode-label{font-size:6px}#joystick{left:24px;bottom:160px;width:92px;height:92px}#stick{left:26px;top:26px;width:40px;height:40px}#combat{right:22px;bottom:158px;gap:10px}#fire{width:70px;height:70px;font-size:28px}#fire small{font-size:8px}#nuke,#dodge{width:48px;height:48px;font-size:22px}#auto{font-size:8px;top:-32px;padding:6px}#keyboard{display:none}footer{left:12px;right:12px;bottom:20px;display:grid;grid-template-columns:1fr 1fr;gap:8px}#hero-status{min-width:0;gap:7px;grid-column:1;padding:6px}#portrait{width:39px;height:44px}#hero-status b{font-size:9px;margin:3px 0}#hero-status small{font-size:5px;letter-spacing:0}#hero-status em{font-size:8px}.health{width:92px;height:3px;margin:3px 0}.bottom-actions{grid-column:1/3;grid-row:2;margin:0;display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.bottom-actions button{min-width:0;padding:8px;font-size:14px}.bottom-actions span{display:inline;font-size:9px;margin-left:5px}#start{grid-column:2;grid-row:1;min-width:0;padding:8px;font-size:11px;gap:4px}#saved{font-size:6px;right:13px;bottom:6px}dialog{padding:18px;max-height:90dvh}dialog h2{font-size:22px}.hero-grid{grid-template-columns:repeat(2,1fr)}.hero-tile .avatar{height:98px}.skin-row{grid-template-columns:repeat(2,1fr)}.skin-item .avatar{height:100px}.gear-grid{grid-template-columns:1fr 1fr;gap:8px}.gear{padding:12px}.gear h3{font-size:13px}.gear p{font-size:9px}.gear button{font-size:10px;padding:9px}.slot{width:35px;height:30px}.mission .wave i{display:none}#aimhint{font-size:8px}}@media(max-height:580px){.mission{top:80px}.mission .base,.mission #mode-label{display:none}#joystick,#combat{bottom:120px}.resources{top:83px}footer{bottom:8px}#keyboard{bottom:103px}#saved{display:none}.hero-grid{grid-template-columns:repeat(4,1fr)}}
/* Expedition 3: region, armory and outfits */
.region-switch{display:inline-block;background:#2a2113d9;color:#f0cd8a;border:1px solid rgba(217,180,110,.45);border-radius:7px;padding:6px 11px;cursor:pointer;font-size:11px;pointer-events:auto;margin-top:10px}.region-switch:hover{background:#3a2d17;border-color:var(--amber)}#batch-label{display:block;color:#b9c8ae;font-size:10px;margin-top:8px}.map-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.weapon-grid,.tower-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.map-card,.weapon-card{background:linear-gradient(180deg,#1a2822,#141f1a);border:1px solid rgba(64,80,67,.9);border-radius:14px;padding:14px;overflow:hidden;box-shadow:0 8px 20px rgba(0,0,0,.3)}.map-card:hover,.weapon-card:hover{border-color:var(--amber)}.map-card img{width:100%;height:150px;object-fit:cover;border-radius:10px;border:1px solid rgba(217,180,110,.22)}.map-card img[src*="zone9"]{object-fit:contain;background:#111a17}.map-card h3{font-size:16px;margin:12px 0 6px;color:#f0e8cf}.map-card p{font-size:11px;line-height:1.7;color:#a9bda9}.weapon-card svg{width:100%;height:95px;background:radial-gradient(ellipse,#344238,transparent);border-radius:8px}.weapon-card button{margin:5px 3px 0 0}.weapon-stats{display:grid;grid-template-columns:1fr 1fr;gap:8px;font-size:11px;color:#c6cbb9;margin:14px 0}.tabs{flex-wrap:wrap}#weapon-hud{display:flex;flex-direction:column;align-items:flex-end;max-width:190px;gap:5px}#weapon-hud button{background:linear-gradient(180deg,rgba(26,38,32,.95),rgba(20,30,25,.92));color:#dedec4;border:1px solid rgba(100,113,91,.7);border-radius:10px;padding:9px 12px;cursor:pointer;box-shadow:0 6px 16px rgba(0,0,0,.35)}#weapon-hud button:hover{border-color:var(--amber)}#weapon-hud b,#weapon-hud small{display:block}#weapon-hud b{color:#f0cd8a}#weapon-hud small{font-size:10px;color:#b8c5aa;margin-top:4px}#crosshair.scoped{width:230px;height:230px;border:2px solid #c6d0bc;border-radius:50%;box-shadow:0 0 0 100vmax #0009}#crosshair.scoped span{display:none}@media(max-width:700px){.map-grid,.weapon-grid{grid-template-columns:1fr}.tower-grid{grid-template-columns:1fr 1fr}.mission{max-width:53%}.mission h1{font-size:15px}.region-switch{font-size:10px}#batch-label{font-size:9px}#weapon-hud{max-width:135px}#weapon-hud button{font-size:10px;padding:6px}.skin-row{grid-template-columns:repeat(2,1fr)}}
/* v7 横屏主方向：矮视口（横屏手机 / 矮窗口）紧凑布局，替代 max-height:580 的粗放规则。
   目标：页眉、任务面板、资源条、摇杆/战斗键、页脚全部落在视口内，互不遮挡。 */
@media(max-height:430px){
header{padding:8px 16px;gap:8px}
.brand{font-size:19px;letter-spacing:2px}.brand>small{font-size:6px;margin-top:3px}
.square{width:30px;height:30px}
.view-switch button{padding:6px 10px;font-size:10px}
.mission{left:16px;top:56px;width:200px;padding:10px 12px}
.mission>small{font-size:6px;letter-spacing:1px}
.mission h1{font-size:15px;margin:4px 0 6px}
.wave strong{font-size:26px}.wave span,.wave i{font-size:8px}
.mission .xp-run,.mission #batch-label{display:none}
.region-switch{font-size:10px;padding:3px 0}
.resources{top:56px;right:16px;gap:10px;padding:8px 12px}
.resources>span{font-size:10px}.resources b{font-size:15px}.resources small{font-size:6px}
#mode-label{display:none}
#joystick{left:20px;bottom:100px;width:92px;height:92px}
#stick{left:26px;top:26px;width:40px;height:40px}
#combat{right:20px;bottom:100px;gap:10px}
#fire{width:70px;height:70px;font-size:28px}
#nuke,#dodge{width:48px;height:48px;font-size:22px}
#auto{font-size:8px;top:-32px;padding:6px}
#weapon-hud{max-width:140px}#weapon-hud button{font-size:10px;padding:6px}
#keyboard{display:none}
footer{left:16px;right:16px;bottom:8px;gap:10px}
#hero-status{min-width:200px;gap:8px;padding:8px}
#portrait{width:40px;height:44px}
#hero-status b{font-size:10px}
.health{width:110px}
.bottom-actions button{min-width:0;padding:8px;font-size:15px}
.bottom-actions span{font-size:9px}
#start{min-width:150px;padding:0 12px;font-size:12px;gap:8px}
#start b{font-size:20px}
#saved{display:none}
#crosshair b{font-size:20px}
#aimhint{font-size:8px;top:32px}
}
/* v7.2 操作设置：自由按键布局。custom-controls 下战斗按钮组脱离 flex 容器，
   各按钮按 localStorage 里的中心点百分比绝对定位；editing-layout 为拖拽态。 */
#game.custom-controls #combat{display:contents}
#game.custom-controls #fire,#game.custom-controls #nuke,#game.custom-controls #dodge,#game.custom-controls #auto,#game.custom-controls #weapon-hud{position:absolute;transform:translate(-50%,-50%)}
#game.custom-controls #joystick{transform:translate(-50%,-50%)}
#layout-bar{position:absolute;left:50%;top:86px;transform:translateX(-50%);z-index:60;display:flex;align-items:center;gap:10px;background:#142724f2;border:1px solid #d9b17c88;border-radius:8px;padding:10px 14px;box-shadow:0 10px 40px #0008;max-width:94%;white-space:nowrap}
#layout-bar[hidden]{display:none}
#layout-bar span{font-size:12px;color:#f3e4bb}
#layout-bar button{padding:9px 14px;font-size:12px}
#game.editing-layout #joystick,#game.editing-layout #fire,#game.editing-layout #nuke,#game.editing-layout #dodge,#game.editing-layout #auto,#game.editing-layout #weapon-hud{outline:2px dashed #f1cb84;outline-offset:5px;cursor:grab;touch-action:none;z-index:30}
#game.editing-layout #joystick:active,#game.editing-layout #fire:active{cursor:grabbing}
@media(max-width:700px){#layout-bar{top:100px;flex-wrap:wrap;justify-content:center;white-space:normal;text-align:center}#layout-bar span{font-size:11px}}

/* v7.5 hero speech bubble: bottom-centre above the footer, fades after ~3.5s */
#hero-speech{position:absolute;left:50%;bottom:150px;transform:translate(-50%,8px);background:#142724ed;border:1px solid #d9b17c88;padding:10px 16px;font-size:13px;color:#f3e4bb;border-radius:18px;max-width:85%;width:max-content;opacity:0;pointer-events:none;transition:opacity .25s,transform .25s;text-align:center}
#hero-speech.show{opacity:1;transform:translate(-50%,0)}
#hero-speech small{display:block;font-size:9px;color:#aebea8;margin-top:3px}
/* v7.5 no-WebGL message screen: full overlay, not a fake game */
#no-webgl{position:absolute;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;background:#101819f2;padding:20px}
#no-webgl[hidden]{display:none}
.no-webgl-card{max-width:520px;background:#152420f5;border:1px solid #869b7d70;border-radius:12px;padding:28px;text-align:center}
.no-webgl-card h2{font-size:22px;margin:8px 0 10px}
.no-webgl-card p{font-size:12px;line-height:1.8;color:#a2b5a3}
.no-webgl-card .primary{margin-top:14px}
/* v7.5 sound settings row */
.sound-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:12px 0;font-size:11px;color:#aebea8}
.sound-row input[type=range]{flex:1;min-width:140px;accent-color:#d7b375}
.sound-row .vol-val{font:12px monospace;color:#e8c96a;min-width:36px;text-align:right}
@media(max-width:700px){#hero-speech{bottom:210px;font-size:12px}}
/* v7.5 hero tile catchphrase quote */
.hero-line{font-size:10px;color:#e8c96a;min-height:14px}

/* v7.6 Boss 血条：屏幕上方常驻，醒目；超级 Boss 5 格分段，当前格高亮脉冲 */
/* v9.3 改小改淡（用户：太大挡画面）：高约 65px → 约 35px，宽 560px → 360px，背景更透、阴影更轻；名字/格数/血条信息不变 */
#boss-bar{position:absolute;top:64px;left:50%;transform:translateX(-50%);width:min(360px,72%);z-index:30;
  background:rgba(20,14,18,.62);border:1px solid rgba(164,85,63,.65);border-radius:8px;padding:4px 12px 5px;
  box-shadow:0 4px 18px rgba(0,0,0,.45);opacity:.94;pointer-events:none;backdrop-filter:blur(4px)}
#boss-bar.super{border-color:#b46bff;box-shadow:0 2px 14px rgba(150,90,255,.22)}
#boss-bar.ultimate{border-color:#e8b23a;box-shadow:0 2px 14px rgba(232,120,60,.28)}
#boss-bar.ultimate .boss-name{color:#ffd76a}
#boss-bar.ultimate .boss-segments i.on{background:linear-gradient(180deg,#ffd76a,#e0783c);border-color:#ffe9a8}
#boss-bar.ultimate .boss-track i{background:linear-gradient(90deg,#e0783c,#ffd76a)}
#boss-bar.spider{border-color:#c23a4e;box-shadow:0 2px 14px rgba(200,60,90,.22)}
#boss-bar.spider .boss-name{color:#f0a8b8}
#boss-bar.spider .boss-segments i.on{background:linear-gradient(180deg,#e86a7e,#b32a40);border-color:#f0a8b8}
#boss-bar.spider .boss-track i{background:linear-gradient(90deg,#b32a40,#e86a7e)}
#boss-bar.bear{border-color:#a8763e;box-shadow:0 2px 14px rgba(190,130,60,.22)}
#boss-bar.bear .boss-name{color:#e8c88a}
#boss-bar.bear .boss-segments i.on{background:linear-gradient(180deg,#d9a45c,#8a5a28);border-color:#e8c88a}
#boss-bar.bear .boss-track i{background:linear-gradient(90deg,#8a5a28,#d9a45c)}
#boss-bar.dragon{border-color:#c23a2a;box-shadow:0 2px 14px rgba(220,70,40,.22)}
#boss-bar.dragon .boss-name{color:#ffb03a}
#boss-bar.dragon .boss-segments i.on{background:linear-gradient(180deg,#ff7c29,#8a2f2f);border-color:#ffb03a}
#boss-bar.dragon .boss-track i{background:linear-gradient(90deg,#8a2f2f,#ff7c29)}
#boss-bar.ice{border-color:#3a7ac2;box-shadow:0 2px 14px rgba(80,160,255,.22)}
#boss-bar.ice .boss-name{color:#9fd4ff}
#boss-bar.ice .boss-segments i.on{background:linear-gradient(180deg,#7fd4ff,#2f6bb8);border-color:#9fd4ff}
#boss-bar.ice .boss-track i{background:linear-gradient(90deg,#2f6bb8,#7fd4ff)}
#boss-bar .boss-name{display:flex;justify-content:space-between;align-items:baseline;
  font-size:11px;letter-spacing:.5px;color:#ffb59a}
#boss-bar.super .boss-name{color:#d9b8ff}
#boss-bar .boss-name span{font:11px monospace;color:#e8d6aa}
#boss-bar .boss-segments{display:flex;gap:3px;margin:3px 0 2px}
#boss-bar .boss-segments i{flex:1;height:5px;background:#3a2a26;border:1px solid #6b453a;border-radius:2px}
#boss-bar .boss-segments i.on{background:linear-gradient(180deg,#ff9d6b,#e58158);border-color:#ffb59a}
#boss-bar.super .boss-segments i.on{background:linear-gradient(180deg,#c99aff,#9a5cff);border-color:#d9b8ff}
#boss-bar .boss-segments i.on.current{animation:bossSegPulse 1s ease-in-out infinite}
@keyframes bossSegPulse{0%,100%{filter:brightness(1)}50%{filter:brightness(1.45)}}
#boss-bar .boss-track{height:4px;background:#3a2a26;border-radius:3px;overflow:hidden}
#boss-bar .boss-track i{display:block;height:100%;background:linear-gradient(90deg,#e58158,#ff9d6b);width:100%;transition:width .15s linear}
#boss-bar.super .boss-track i{background:linear-gradient(90deg,#9a5cff,#c99aff)}

/* UI icons (CraftPix free assets; see assets/ui/README.md). Glyph fallback
   renders identically until the PNGs are dropped into assets/ui/. */
.ui-ico{font-style:normal}
img.ui-ico{object-fit:contain;image-rendering:pixelated;vertical-align:-.14em}
.resources img.ui-ico{width:16px;height:16px}
.bottom-actions img.ui-ico{width:22px;height:22px}
#fire img.ui-ico{width:34px;height:34px}
#nuke img.ui-ico,#dodge img.ui-ico{width:24px;height:24px}
.gear .symbol img.ui-ico{width:44px;height:44px}
.skill-option b img.ui-ico{width:22px;height:22px;vertical-align:-5px;margin-right:5px}
.skill-option .tower-ico img.ui-ico{width:34px;height:34px;float:left;margin:2px 12px 0 0}
@media(max-width:700px){.bottom-actions img.ui-ico{width:15px;height:15px}#fire img.ui-ico{width:28px;height:28px}#nuke img.ui-ico,#dodge img.ui-ico{width:21px;height:21px}.gear .symbol img.ui-ico{width:36px;height:36px}.skill-option .tower-ico img.ui-ico{width:28px;height:28px}}
/* v9.12 UI art (6 张参考图风格):鎏金 chrome、屏风底图、右上小地图、开场屏。
   玩法不动:HUD 仍是 10 分钟倒计时,不改波次;底图是裁掉内置 UI 文字/
   编造 Boss 后的纯插画,地区面板不出现编造 Boss 名。 */
/* 开场屏 (start.jpg:两只猫 + 营地插画,左侧暗角压字) */
#start-screen{position:absolute;inset:0;z-index:70;display:flex;align-items:center;background:url(assets/screens/start.jpg) 72% center/cover no-repeat,#0d1a16}
#start-screen[hidden]{display:none}
#start-screen::before{content:'';position:absolute;inset:0;background:linear-gradient(90deg,rgba(6,14,12,.9) 0%,rgba(6,14,12,.62) 40%,rgba(6,14,12,.15) 68%,rgba(6,14,12,.3) 100%)}
#start-screen .start-inner{position:relative;max-width:520px;padding:0 48px}
#start-screen h1{font-size:52px;line-height:1.15;color:#f6ead0;letter-spacing:2px;margin:14px 0 12px;text-shadow:0 3px 18px rgba(0,0,0,.7)}
#start-screen p{font-size:14px;line-height:1.7;color:#c9d6c2;text-shadow:0 1px 6px rgba(0,0,0,.8)}
#start-screen .start-actions{display:flex;gap:12px;margin-top:26px;flex-wrap:wrap}
#start-screen .start-actions .primary{font-size:15px;padding:15px 26px}
#start-screen .start-actions .secondary{padding:15px 18px}
#start-screen .start-meta{display:flex;gap:14px;align-items:center;margin-top:22px;font-size:11px;color:#a9bda9;flex-wrap:wrap}
#start-screen .start-meta button{font-size:10px;padding:8px 12px}
/* 右上小地图 (圆形描金,纯展示,不拦截点击) */
#minimap{position:absolute;right:28px;top:188px;width:140px;height:140px;border-radius:50%;border:2px solid rgba(215,169,92,.65);background:#12231c;box-shadow:0 8px 24px rgba(0,0,0,.5),inset 0 0 20px rgba(0,0,0,.5);z-index:20;pointer-events:none}
/* 金色 Boss 血条:描金边 + BOSS 徽章 (分段条逻辑与 Boss 名不变,各 Boss 本体配色仍优先) */
#boss-bar{border-color:rgba(217,180,110,.75);box-shadow:0 4px 18px rgba(0,0,0,.45),0 0 16px rgba(215,169,92,.18)}
.boss-badge{display:inline-block;font:8px monospace;letter-spacing:1px;color:#ffd76a;background:linear-gradient(180deg,#7a2a1e,#5a1d14);border:1px solid #e8b23a;border-radius:4px;padding:2px 6px;margin-right:6px}
/* 弹窗底图 (ui-art.js 按弹窗内容挂 data-art;无对应底图的弹窗保持原样式) */
dialog[data-art]{background-size:cover;background-position:center 30%;border-color:rgba(217,180,110,.8);box-shadow:0 24px 70px rgba(0,0,0,.65),0 0 0 1px rgba(217,180,110,.25),0 0 34px rgba(215,169,92,.16)}
dialog[data-art="map"]{background-image:linear-gradient(rgba(8,16,13,.62),rgba(8,16,13,.82)),url(assets/screens/map.jpg)}
dialog[data-art="armory"]{background-image:linear-gradient(rgba(8,16,13,.66),rgba(8,16,13,.86)),url(assets/screens/armory.jpg)}
dialog[data-art="heroes"]{background-image:linear-gradient(rgba(8,16,13,.66),rgba(8,16,13,.86)),url(assets/screens/heroes.jpg)}
dialog[data-art="victory"]{background-image:linear-gradient(rgba(8,16,13,.55),rgba(8,16,13,.78)),url(assets/screens/victory.jpg)}
/* 鎏金主按钮 (只在弹窗与开场屏内加描金;页脚 #start 的 disabled 中性态不受影响) */
dialog .primary,#start-screen .primary{border:1px solid #f6dd9a;box-shadow:0 6px 16px rgba(215,169,92,.32),inset 0 1px 0 #ffe9b8,inset 0 0 0 1px rgba(120,84,30,.35)}
/* 防线部署改鎏金 CTA (armed 态另给亮圈,不丢) */
.bottom-actions #build{background:linear-gradient(180deg,#f0cd8a,#c99a4e);border:1px solid #f6dd9a;color:#1c2415;box-shadow:0 8px 20px rgba(215,169,92,.35),inset 0 1px 0 #ffe9b8}
.bottom-actions #build span{color:#1c2415}
.bottom-actions #build:hover{border-color:#ffe9b8}
.bottom-actions #build.armed{box-shadow:0 0 0 2px #ffe9b8,0 8px 20px rgba(215,169,92,.5);filter:brightness(1.12)}
/* 开火键金光加强 (尺寸不动) */
#fire{box-shadow:0 0 0 7px #172a1b2e,0 0 34px rgba(215,169,92,.45),0 8px 20px rgba(0,0,0,.4)}
/* 武器 HUD 描金边 */
#weapon-hud button{border-color:rgba(217,180,110,.6)}
@media(max-width:700px){
#start-screen{background-position:78% center}
#start-screen .start-inner{padding:0 22px;max-width:420px}
#start-screen h1{font-size:32px}
#start-screen p{font-size:12px}
#start-screen .start-actions .primary{font-size:13px;padding:13px 20px}
#minimap{width:84px;height:84px;right:12px;top:170px}
}
