/* Z98 split from index.html — order matters: files are linked in this sequence. */
  /* =================== Z84 · CLARITY & POLISH PASS =================== */
  /* thin themed scrollbars everywhere (no more white system bars) */
  *{scrollbar-width:thin;scrollbar-color:rgba(231,181,74,.55) rgba(255,255,255,.04);}
  *::-webkit-scrollbar{width:6px;height:6px;} *::-webkit-scrollbar-track{background:rgba(255,255,255,.04);}
  *::-webkit-scrollbar-thumb{background:linear-gradient(180deg,rgba(231,181,74,.75),rgba(140,191,63,.6));border-radius:6px;}
  /* start screen: keep the logo in frame, never scroll on a phone */
  #start{background-position:0 0,20% 0%;overflow:hidden;}
  @media (max-height:460px){
    #start{gap:6px;padding-top:6px;padding-bottom:max(8px,env(safe-area-inset-bottom));}
    #start .help{display:none;}
    #start .start-id{gap:6px;}
    #start .panel{gap:7px !important;}
    #start .btn-primary,body.touch #start .btn-primary{font-size:17px;padding:10px 40px;}

  }
  /* guide: two columns on wide screens so it fits at a glance */
  @media (min-width:900px) and (min-height:600px){ .guide{display:grid !important;grid-template-columns:1fr 1fr;max-width:920px;} }
  .guide-row{border-radius:4px;clip-path:polygon(10px 0,100% 0,100% calc(100% - 10px),calc(100% - 10px) 100%,0 100%,0 10px);}
  /* briefing: operation header reads first; compact on short phones */
  #briefing .br-op{order:0}
  @media (max-height:460px){
    #briefing .title{display:none;}
    #briefing .br-op{font-size:15px;letter-spacing:.24em;}
    #briefing .br-brief{font-size:11.5px;margin:2px auto;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;max-width:86vw;}
    #briefing .br-obj{font-size:11px;margin:2px auto 6px;padding:3px 9px;}
    #briefing .br-hint{display:none;}
  }
  /* ---- the MISSION CARD (stage transition): letterbox · operation name resolves out of a blur · objective underline ---- */
  #stagewipe{background:radial-gradient(120% 90% at 50% 50%,rgba(4,6,3,.25),rgba(2,3,1,.88));transition:opacity .45s ease;}
  #stagewipe .sw-bar{position:absolute;left:0;right:0;height:13vh;background:#020301;transition:transform .55s cubic-bezier(.2,.8,.2,1);z-index:1;}
  #stagewipe .sw-top{top:0;transform:translateY(-100%);border-bottom:1px solid rgba(231,181,74,.25);}
  #stagewipe .sw-bot{bottom:0;transform:translateY(100%);border-top:1px solid rgba(231,181,74,.25);}
  #stagewipe.show .sw-bar{transform:none;}
  #stagewipe .sw-inner{position:relative;z-index:2;transform:none;font-family:'Saira Condensed',Rajdhani,system-ui,sans-serif;display:flex;flex-direction:column;align-items:center;}
  #stagewipe .sw-clear{font-size:12px;letter-spacing:.5em;color:#8cdc6e;margin-bottom:12px;font-weight:700;}
  #stagewipe .sw-kick{display:flex;align-items:center;gap:12px;font-size:clamp(11px,1.6vw,14px);letter-spacing:.42em;font-weight:700;color:rgba(255,236,200,.75);
    opacity:0;transform:translateY(8px);transition:opacity .45s ease .15s,transform .45s ease .15s;}
  #stagewipe .sw-kick i{width:6px;height:6px;background:var(--swaccent,#ffce4a);transform:rotate(45deg);box-shadow:0 0 10px var(--swaccent,#ffce4a);}
  #stagewipe .sw-kick #sw-biome{color:var(--swaccent,#ffce4a);}
  #stagewipe.show .sw-kick{opacity:1;transform:none;}
  #stagewipe .sw-op{position:relative;margin-top:10px;font-size:clamp(28px,6.4vw,74px);font-weight:700;line-height:1;letter-spacing:.6em;text-transform:uppercase;white-space:nowrap;
    background:linear-gradient(180deg,#fff6dc 0%,#ffd98a 45%,#c98a2a 100%);-webkit-background-clip:text;background-clip:text;color:transparent;
    filter:blur(10px) drop-shadow(0 4px 24px rgba(0,0,0,.8));opacity:0;animation:none;}
  #stagewipe.show .sw-op{animation:swOp 1.1s cubic-bezier(.16,.84,.24,1) .25s forwards;}
  @keyframes swOp{0%{opacity:0;letter-spacing:.6em;filter:blur(10px) drop-shadow(0 4px 24px rgba(0,0,0,.8));}
    100%{opacity:1;letter-spacing:.08em;filter:blur(0) drop-shadow(0 4px 24px rgba(0,0,0,.8));}}
  #stagewipe .sw-op::after{content:"";position:absolute;inset:-10% -4%;background:linear-gradient(100deg,transparent 35%,rgba(255,255,255,.55) 50%,transparent 65%);
    mix-blend-mode:overlay;transform:translateX(-120%);}
  #stagewipe.show .sw-op::after{animation:swShine 1.2s ease 1.05s;}
  @keyframes swShine{to{transform:translateX(120%);}}
  #stagewipe .sw-line{height:2px;width:0;margin:16px 0 12px;background:linear-gradient(90deg,transparent,var(--swaccent,#ffce4a),transparent);box-shadow:0 0 14px var(--swaccent,#ffce4a);}
  #stagewipe.show .sw-line{animation:swLine .8s cubic-bezier(.2,.8,.2,1) .7s forwards;}
  @keyframes swLine{to{width:min(560px,72vw);}}
  #stagewipe .sw-obj{display:flex;align-items:center;gap:9px;font-size:clamp(11px,1.7vw,15px);letter-spacing:.24em;font-weight:700;color:#ffe2a0;opacity:0;transition:opacity .5s ease 1.1s;}
  #stagewipe .sw-obj .ob-dot{width:7px;height:7px;background:#ffc440;transform:rotate(45deg);box-shadow:0 0 8px #ffc440;}
  #stagewipe.show .sw-obj{opacity:1;}
  #stagewipe.show .sw-scan{animation:swScan 2.2s ease-in-out;}
  body.touch #stagewipe .sw-bar{height:9vh;}
  @media (max-height:460px){ #stagewipe .sw-op{font-size:clamp(24px,5.4vw,44px);} #stagewipe .sw-line{margin:10px 0 8px;} }
  @media (prefers-reduced-motion:reduce){ #stagewipe.show .sw-op{animation:none;opacity:1;filter:none;letter-spacing:.08em;} #stagewipe.show .sw-line{animation:none;width:min(560px,72vw);} }

  /* Z96 · boss phase pips + status */
  #bossbar .bst{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:4px;font-family:var(--hud);font-size:11px;letter-spacing:.12em;color:#e8d8c0;text-shadow:0 1px 4px #000;min-height:14px;}
  #bossbar .bst .pp{display:inline-flex;gap:3px;} #bossbar .bst .pp i{width:14px;height:4px;background:rgba(255,255,255,.18);transform:skewX(-20deg);}
  #bossbar .bst .pp i.done{background:#7a4a3a;} #bossbar .bst .pp i.on{background:#ff6a3a;box-shadow:0 0 6px #ff6a3a;}
  #bossbar .bst b{padding:1px 7px;font-weight:700;letter-spacing:.14em;background:rgba(255,200,90,.16);color:#ffe08a;animation:bstPulse .6s ease-in-out infinite alternate;}
  #bossbar .bst b.sh{background:rgba(127,216,255,.16);color:#9fe4ff;} @keyframes bstPulse{to{opacity:.55;}}
  /* Z94 · first-time tip card (pauses the battle) */
  #tipCard{position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;background:radial-gradient(80% 70% at 50% 50%,rgba(0,0,0,.35),rgba(0,0,0,.7));pointer-events:auto;}
  #tipCard.hidden{display:none;}
  #tipCard .tc-box{width:min(480px,88vw);padding:16px 18px 14px;font-family:var(--hud);color:#eef3e2;background:linear-gradient(180deg,rgba(18,24,12,.97),rgba(8,12,6,.97));
    border:1px solid rgba(190,230,110,.45);border-top:3px solid #bfe66a;box-shadow:0 18px 60px rgba(0,0,0,.6),0 0 30px rgba(140,191,63,.18);
    clip-path:polygon(0 0,calc(100% - 14px) 0,100% 14px,100% 100%,14px 100%,0 calc(100% - 14px));animation:tipIn .35s cubic-bezier(.2,.9,.2,1);}
  @keyframes tipIn{from{opacity:0;transform:translateY(14px) scale(.97);}to{opacity:1;transform:none;}}
  #tipCard .tc-head{display:flex;gap:12px;align-items:center;margin-bottom:8px;}
  #tipCard .tc-ic{width:44px;height:44px;flex:none;color:#bfe66a;background:rgba(140,191,63,.14);border-radius:10px;padding:8px;display:flex;} #tipCard .tc-ic svg{width:100%;height:100%;}
  #tipCard .tc-kick{font-size:10px;letter-spacing:.24em;color:#9fb47a;font-weight:700;} #tipCard .tc-ttl{font-size:21px;font-weight:700;letter-spacing:.04em;line-height:1.15;}
  #tipCard .tc-body{font-size:15px;line-height:1.5;color:#d6dfc4;} #tipCard .tc-body b{color:#ffe08a;font-weight:700;}
  #tipCard .tc-foot{display:flex;justify-content:space-between;align-items:center;margin-top:12px;} #tipCard .tc-n{font-size:11px;color:#8a9a72;letter-spacing:.1em;}
  #tipCard .tc-ok{padding:9px 18px;font-weight:700;letter-spacing:.12em;color:#10140a;background:linear-gradient(180deg,#d8f08a,#8cbf3f);cursor:pointer;clip-path:polygon(8px 0,100% 0,calc(100% - 8px) 100%,0 100%);}
  body.touch #tipCard .tc-box{width:min(520px,80vw);padding:11px 14px 10px;} body.touch #tipCard .tc-body{font-size:13px;line-height:1.4;} body.touch #tipCard .tc-ttl{font-size:17px;} body.touch #tipCard .tc-ic{width:34px;height:34px;}
  /* Z97 · soft keyboard: the nickname card pins itself to the VISIBLE strip above the keyboard, compact, nothing else reflows */
  body.typing #nick{top:var(--vvTop,0px);height:var(--vvH,100%);justify-content:flex-start;padding-top:max(6px,env(safe-area-inset-top));gap:4px;overflow:hidden;}
  body.typing #nick .title{font-size:18px !important;margin:0 0 2px;letter-spacing:.12em;}
  body.typing #nick .subtitle{display:none;}
  body.typing #nick .panel{margin-top:2px;} body.typing #nick #nickSave{margin-top:6px !important;padding:9px 18px;}
  body.typing #nickInput{font-size:16px;padding:8px 12px;}
  body.typing #hud, body.typing #touch{display:none !important;}
  /* Z93 · loot reward card */
  #lootToast{position:fixed;right:14px;top:34%;z-index:40;display:flex;gap:10px;align-items:center;min-width:220px;max-width:300px;padding:9px 12px 9px 9px;pointer-events:none;
    background:linear-gradient(100deg,rgba(10,14,8,.9),rgba(10,14,8,.72));border:1px solid color-mix(in srgb,var(--lc,#9fe07a) 55%,transparent);border-left:3px solid var(--lc,#9fe07a);
    box-shadow:0 8px 26px rgba(0,0,0,.5),0 0 18px color-mix(in srgb,var(--lc,#9fe07a) 25%,transparent);clip-path:polygon(0 0,100% 0,100% calc(100% - 10px),calc(100% - 10px) 100%,0 100%);
    opacity:0;transform:translateX(30px);transition:opacity .25s ease,transform .35s cubic-bezier(.2,.9,.2,1);font-family:var(--hud);}
  #lootToast.on{opacity:1;transform:none;}
  #lootToast .lt-ic{width:38px;height:38px;flex:none;display:flex;align-items:center;justify-content:center;color:var(--lc);background:color-mix(in srgb,var(--lc) 16%,transparent);border-radius:8px;padding:7px;}
  #lootToast .lt-ic svg{width:100%;height:100%;}
  #lootToast .lt-tp{display:flex;align-items:baseline;gap:8px;} #lootToast .lt-nm{font-weight:700;font-size:15px;letter-spacing:.06em;color:#fff;}
  #lootToast .lt-tr{font-size:9px;letter-spacing:.2em;font-weight:700;color:var(--lc);} #lootToast .lt-ds{font-size:12px;color:#d8e2c4;line-height:1.25;margin-top:2px;}
  #lootToast .lt-nt{font-size:11px;color:var(--lc);margin-top:2px;letter-spacing:.04em;}
  #lootToast.lt-2 .lt-nm{color:#e6d0ff;} body.touch #lootToast{top:166px;right:10px;min-width:180px;max-width:230px;padding:6px 9px 6px 7px;gap:8px;} body.touch #lootToast .lt-ds{font-size:11px;} body.touch #lootToast .lt-nm{font-size:13px;} body.touch #lootToast .lt-ic{width:30px;height:30px;}
  .buffchip{--bc:var(--green);} .buffchip .bic{color:var(--bc)!important;} .buffchip .t{color:var(--bc)!important;}
  /* Z84 · skill switching + names */
  .msp-next{position:absolute;right:calc(100% + 6px);bottom:14px;width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;
    font:700 18px/1 'Saira Condensed',Rajdhani,system-ui,sans-serif;color:#10140a;background:linear-gradient(180deg,#d8f08a,#8cbf3f);box-shadow:0 2px 8px rgba(0,0,0,.45);pointer-events:auto;}
  .msp-next:active{transform:scale(.9);}
  body:not(.touch) .msp-next{display:none;}
  .m-crew{position:absolute;right:calc(100% + 4px);bottom:58px;width:40px;height:40px;border-radius:12px;display:none;flex-direction:column;align-items:center;justify-content:center;gap:1px;
    color:#eaf5c8;background:linear-gradient(180deg,rgba(60,78,34,.92),rgba(30,40,18,.92));border:1px solid rgba(190,230,110,.55);box-shadow:0 2px 10px rgba(0,0,0,.5);pointer-events:auto;}
  .m-crew .mc-ar{font:700 16px/1 'Saira Condensed',Rajdhani,system-ui,sans-serif;} .m-crew .mc-tx{font:700 8px/1 'Saira Condensed',Rajdhani,system-ui,sans-serif;letter-spacing:.12em;}
  .m-crew:active{transform:scale(.92);} .m-crew.up{border-color:#ffd27a;color:#ffe6a8;}
  body.touch #mSpell .mbtag{font-size:7.5px;letter-spacing:.06em;white-space:nowrap;}
  #abilities{flex-wrap:wrap;max-width:160px;}
  #abilities .ab-nm{flex-basis:100%;text-align:center;white-space:nowrap;font:700 10px/1 'Saira Condensed',Rajdhani,system-ui,sans-serif;letter-spacing:.14em;color:rgba(255,232,190,.78);text-shadow:0 1px 4px #000;pointer-events:none;}
  body.touch #abilities .ab-nm{display:none;}
  .br-pick{font:700 11px/1 'Saira Condensed',Rajdhani,system-ui,sans-serif;letter-spacing:.34em;color:rgba(255,232,190,.6);margin:2px 0 -4px;}
  @media (max-height:460px){ .br-pick{font-size:9.5px;margin:0 0 -2px;} }

  /* Z84 · desktop HUD stacking: score bar → contract → banner; objective card on the left under the skills; HQ radio above the gun bar */
  body:not(.touch) #contractChip{top:76px;}
  body:not(.touch) #objChip{left:14px;top:86px;transform:none;min-width:230px;}
  body:not(.touch) #radio{top:auto;bottom:118px;}
  #abilities .ab-nm{background:rgba(6,9,4,.72);padding:3px 7px;font-size:10.5px;}
  /* banner: compact dark-glass plate, long lines wrap cleanly at a smaller size */
  #combo{top:112px;max-width:min(760px,82vw);padding:7px 18px;text-align:center;line-height:1.2;text-wrap:balance;
    font-family:'Saira Condensed',Rajdhani,system-ui,sans-serif;font-weight:700;font-size:24px;letter-spacing:.08em;
    background:linear-gradient(180deg,rgba(10,12,8,.8),rgba(6,8,5,.66));text-shadow:0 0 18px currentColor,0 2px 4px #000;
    clip-path:polygon(12px 0,calc(100% - 12px) 0,100% 50%,calc(100% - 12px) 100%,12px 100%,0 50%);}
  #combo.long{font-size:15px;letter-spacing:.1em;text-shadow:0 2px 4px #000;}
  body.touch #combo{top:calc(max(8px,env(safe-area-inset-top)) + 100px);font-size:17px;padding:5px 14px;} body.touch #combo.long{font-size:11.5px;}

  /* Z100 · crew button: on foot → 'GIỮ: GOM'; recalling → pulses */
  .m-crew .mc-tx{white-space:nowrap;font-size:7px;} .m-crew.rec{border-color:#bfe66a;box-shadow:0 0 14px rgba(191,230,106,.55);animation:crewRec .5s ease-in-out infinite alternate;} @keyframes crewRec{to{transform:scale(1.08);}}
  .m-crew{width:auto;min-width:40px;padding:0 5px;}
