*{box-sizing:border-box}body{margin:0;background:#0b1020;color:#eaf4ff;font-family:system-ui,Segoe UI,sans-serif}#gameShell{max-width:1120px;margin:auto;padding:14px}header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}header strong{display:block;letter-spacing:3px;font-size:20px;color:#9ceaff}header small{letter-spacing:4px;color:#8198b6;font-size:10px}.topActions{display:flex;gap:8px}button{cursor:pointer;border:1px solid #47617d;background:#182842;color:#eaf4ff;border-radius:8px;padding:9px 12px;font-weight:700}button:hover{background:#274365}kbd{background:#091321;border:1px solid #536b83;border-radius:4px;padding:2px 6px;color:#fff;font-size:11px}.hud{display:grid;grid-template-columns:1fr 1fr 1fr;gap:18px;align-items:center;margin-bottom:8px;font-size:12px;color:#b5c9df}.hud>div:nth-child(2){text-align:center}.hud span{display:block;margin-bottom:4px;letter-spacing:1px}.hud b{color:#f5d78c}.bar{height:12px;background:#27384c;border:1px solid #52677d;border-radius:10px;overflow:hidden}.bar i{display:block;height:100%;width:100%;background:linear-gradient(90deg,#35d58a,#b5ffb5);transition:width .15s}.bar.boss i{background:linear-gradient(90deg,#e4475b,#ff9c63)}canvas{width:100%;height:auto;display:block;border:2px solid #526d8b;border-radius:10px;background:#111d31;image-rendering:pixelated;box-shadow:0 12px 40px #0008}.under{display:flex;justify-content:space-between;gap:12px;padding:10px 2px 16px}.mission b,.skillHints span{display:block}.mission span{font-size:12px;color:#9cb2c9}.skillHints{display:flex;gap:12px;font-size:12px;color:#b7e9ff}.guide{background:#111d31;border:1px solid #304963;border-radius:12px;padding:14px 18px;margin-bottom:90px}.guide h2{font-size:15px;letter-spacing:2px;color:#a8eaff;margin:0 0 12px}.guideGrid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px 22px}.guide h3{font-size:11px;color:#f6d68b;letter-spacing:1.4px;margin:4px 0}.guide p{font-size:12px;color:#c1d2e5;margin:5px 0}.mobileNote{font-size:12px;color:#9fdcff;border-top:1px solid #304963;padding-top:9px}.modal{position:fixed;inset:0;background:#000b;display:grid;place-items:center;padding:15px;z-index:5}.hidden{display:none!important}.panel{position:relative;max-width:680px;width:100%;background:#14243a;border:2px solid #6c91b6;border-radius:14px;padding:24px;box-shadow:0 20px 70px #000}.panel h2{color:#a8eaff;letter-spacing:2px}.panel p{color:#b6c9df;font-size:13px}.close{position:absolute;right:15px;top:15px}.gearGrid{display:grid;grid-template-columns:1fr 1fr;gap:20px}.gearGrid h3{color:#f6d68b}.gear{display:block;width:100%;text-align:left;margin:8px 0;background:#1b304b}.gear small{display:block;color:#9eb7d1;font-weight:400;margin-top:4px}.gear.selected{border-color:#8ce9ff;background:#234b65}.mobileControls{display:none;position:fixed;bottom:max(10px,env(safe-area-inset-bottom));left:0;right:0;padding:0 14px;justify-content:space-between;pointer-events:none;z-index:3;touch-action:none}.mobileControls button{pointer-events:auto;width:48px;height:48px;font-size:19px;padding:0;background:#172e49dd;backdrop-filter:blur(4px);touch-action:none;user-select:none;-webkit-user-select:none}.moveKeys,.actionKeys{display:flex;gap:6px;align-items:end}@media(max-width:700px){#gameShell{padding:8px}.hud{gap:6px;font-size:9px}.hud b{font-size:9px}.under{display:block}.skillHints{margin-top:8px}.guideGrid{grid-template-columns:1fr}.mobileControls{display:flex}.guide{margin-bottom:90px}header strong{font-size:15px}.topActions button{font-size:10px;padding:7px}.gearGrid{grid-template-columns:1fr}.panel{max-height:85vh;overflow:auto}}
/* Responsive fixes */
html,body{min-height:100%;overflow-x:hidden}body{overscroll-behavior-y:contain}#gameShell{width:min(100%,1120px)}canvas{max-width:100%;aspect-ratio:16/9;object-fit:contain}.hud>div{min-width:0}.hud span,.hud b{overflow-wrap:anywhere}.under{align-items:flex-start}.mission{min-width:0}.skillHints{flex-wrap:wrap;justify-content:flex-end}.panel{max-height:min(85dvh,760px);overflow:auto}.gear{min-height:54px}@media(max-width:700px){#gameShell{padding:7px}.hud{grid-template-columns:1fr 1.15fr 1fr;gap:5px}.hud>div:nth-child(2){padding:0 2px}.hud span{letter-spacing:.3px}.skillHints{justify-content:flex-start}.guide{padding:12px;margin-bottom:100px}.mobileControls{padding:0 9px}.mobileControls button{width:43px;height:46px}.moveKeys,.actionKeys{gap:4px}}@media(max-width:390px){header strong{font-size:13px;letter-spacing:1.5px}.topActions{gap:4px}.topActions button{padding:6px 7px;font-size:9px}.hud{font-size:8px}.hud b{font-size:8px}.mobileControls button{width:38px;height:43px;font-size:16px}}

/* Game over menu */
.gameOverPanel{max-width:460px;text-align:center;padding:34px 28px}
.gameOverPanel .eyebrow{margin:0 0 8px;color:#8fcff0;font-size:10px;font-weight:800;letter-spacing:3px}
.gameOverPanel h2{margin:0 0 12px;color:#ffb4a7;font-size:clamp(27px,6vw,40px);letter-spacing:3px}
.gameOverPanel>p:not(.eyebrow){line-height:1.55}
.gameOverActions{display:grid;grid-template-columns:1fr;gap:10px;margin-top:22px}
.gameOverActions button{min-height:48px;letter-spacing:1px}
.gameOverActions .primaryAction{background:#245477;border-color:#8ce9ff;color:#f3fcff}
.gameOverActions button:focus-visible{outline:3px solid #b8efff;outline-offset:3px}

.volumeControl{display:flex;align-items:center;gap:6px;padding:0 7px;color:#9fc6e5;font-size:10px;font-weight:800;letter-spacing:1px;border:1px solid #304963;border-radius:8px;background:#111d31}
.volumeControl input{width:76px;accent-color:#8ce9ff;cursor:pointer}
@media(max-width:700px){.volumeControl{gap:3px;padding:0 4px;font-size:8px}.volumeControl input{width:48px}}
@media(max-width:390px){.volumeControl input{width:38px}.volumeControl{font-size:7px}}

.backHome{display:inline-block;margin-right:14px;color:#f3d68b;font-size:11px;letter-spacing:1px;text-decoration:none}.backHome:hover{color:#fff}

/* Mobile touch-control redesign: dedicated bottom dock, no overlap with guide */
.mobileControls{display:none}
@media(max-width:700px){
  #gameShell{padding:8px 8px calc(150px + env(safe-area-inset-bottom))}
  .mobileControls{
    display:flex;align-items:center;justify-content:space-between;gap:8px;
    position:fixed;left:0;right:0;bottom:0;z-index:20;
    padding:10px 10px calc(10px + env(safe-area-inset-bottom));
    background:linear-gradient(180deg,#0b1020e8,#080e1df7);
    border-top:1px solid #45617f;box-shadow:0 -8px 24px #0008;
    backdrop-filter:blur(10px);pointer-events:auto;touch-action:none;
  }
  .moveKeys{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;flex:0 0 43%;align-items:stretch}
  .actionKeys{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;flex:1;align-items:stretch}
  .mobileControls button{
    width:100%;height:58px;min-width:0;min-height:58px;padding:3px 1px;
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
    border:1px solid #6e91b3;border-radius:11px;
    background:linear-gradient(180deg,#233d5d,#14243c);
    color:#f1f8ff;font-size:21px;font-weight:800;
    box-shadow:0 3px 0 #080f1c, inset 0 1px #ffffff20;
    -webkit-tap-highlight-color:transparent;touch-action:none;
    user-select:none;-webkit-user-select:none;
  }
  .mobileControls button:active{transform:translateY(2px);background:#315778;box-shadow:0 1px 0 #080f1c}
  .mobileControls button small{font-size:8px;line-height:1;color:#b9d5ec;letter-spacing:.4px;font-weight:800}
  .guide{margin-bottom:18px}
}
@media(max-width:390px){
  #gameShell{padding-bottom:calc(142px + env(safe-area-inset-bottom))}
  .mobileControls{gap:6px;padding-left:7px;padding-right:7px}
  .moveKeys{flex-basis:42%;gap:4px}
  .actionKeys{gap:4px}
  .mobileControls button{height:54px;min-height:54px;border-radius:9px;font-size:19px}
  .mobileControls button small{font-size:7px}
}
@media(max-height:500px) and (max-width:900px){
  #gameShell{padding-bottom:calc(90px + env(safe-area-inset-bottom))}
  .mobileControls{padding-top:5px;padding-bottom:calc(5px + env(safe-area-inset-bottom))}
  .mobileControls button{height:46px;min-height:46px}
  .mobileControls button small{display:none}
}

/* Mobile ergonomics v2: movement left, combat center, jump isolated at far right */
@media(max-width:700px){
  .mobileControls{display:flex;align-items:center;justify-content:space-between;gap:7px}
  .moveKeys{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;flex:0 0 27%;min-width:0}
  .actionKeys{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,50px);gap:5px;flex:1;min-width:0}
  .jumpKey{display:flex;align-items:center;justify-content:center;flex:0 0 17%;min-width:0}
  .jumpKey button{height:68px;min-height:68px;font-size:25px;border-color:#9bdcff;background:linear-gradient(180deg,#315b80,#1b3555);box-shadow:0 4px 0 #080f1c,inset 0 1px #ffffff30}
  .mobileControls button{height:50px;min-height:50px}
  .actionKeys button{height:50px;min-height:50px}
  .moveKeys button{height:56px;min-height:56px}
  .jumpKey button small{font-size:9px}
}
@media(max-width:390px){
  .mobileControls{gap:5px;padding-left:6px;padding-right:6px}
  .moveKeys{flex-basis:26%;gap:4px}
  .actionKeys{grid-template-rows:repeat(2,46px);gap:4px}
  .jumpKey{flex-basis:17%}
  .mobileControls button,.actionKeys button{height:46px;min-height:46px;font-size:17px}
  .moveKeys button{height:52px;min-height:52px}
  .jumpKey button{height:64px;min-height:64px;font-size:23px}
  .mobileControls button small{font-size:6.5px}
  .jumpKey button small{font-size:8px}
}
@media(max-height:500px) and (max-width:900px){
  .jumpKey button{height:46px;min-height:46px}
  .moveKeys button{height:42px;min-height:42px}
}


/* ARCVEL — analog multitouch control dock */
@media(max-width:700px){
  .mobileControls{
    display:flex;align-items:center;justify-content:space-between;gap:clamp(8px,3vw,22px);
    position:fixed;left:0;right:0;bottom:0;z-index:30;
    min-height:136px;padding:10px max(12px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
    box-sizing:border-box;background:linear-gradient(180deg,#0a1426ed,#070d1cf8);
    border-top:1px solid #53769a;box-shadow:0 -8px 26px #0009;
    backdrop-filter:blur(9px);touch-action:none;user-select:none;-webkit-user-select:none;
  }
  .joystickWrap{flex:0 0 clamp(112px,31vw,148px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}
  .joystickBase{
    position:relative;width:clamp(96px,27vw,116px);height:clamp(96px,27vw,116px);border-radius:50%;
    border:3px solid #739fc4;background:radial-gradient(circle at 50% 45%,#284766,#142943 68%,#0b1729);
    box-shadow:inset 0 0 0 5px #071326,0 4px 0 #050a14,0 0 18px #6db9ef35;
    touch-action:none;overflow:hidden;
  }
  .joystickBase:after{content:"";position:absolute;inset:12px;border:1px dashed #8dbbe255;border-radius:50%;pointer-events:none}
  .joystickKnob{
    position:absolute;left:50%;top:50%;width:43%;height:43%;margin:-21.5% 0 0 -21.5%;border-radius:50%;
    border:2px solid #d8f4ff;background:linear-gradient(145deg,#9bdfff,#397eae 70%,#20496f);
    box-shadow:0 3px 0 #10263d,inset 0 2px 5px #fff9,0 0 14px #7ed4ff66;
    pointer-events:none;will-change:transform;
  }
  .joystickDirection{position:absolute;top:50%;transform:translateY(-50%);font-size:13px;color:#b9d9f2;opacity:.65;pointer-events:none}
  .joystickDirection.left{left:7px}.joystickDirection.right{right:7px}
  .stickLabel{font-size:8px;letter-spacing:2px;color:#a9cce8;font-weight:900}
  .actionKeys{display:flex;flex:1;min-width:0;flex-direction:column;gap:7px}
  .actionRow{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  .mobileControls button{
    min-width:0;width:100%;height:52px;min-height:52px;padding:3px 1px;
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
    border:1px solid #789cbd;border-radius:10px;
    background:linear-gradient(180deg,#294969,#142a45);
    color:#f2f9ff;font-size:21px;font-weight:900;
    box-shadow:0 3px 0 #070e1a,inset 0 1px #ffffff25;
    touch-action:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;
  }
  .mobileControls button small{font-size:clamp(7px,1.8vw,9px);line-height:1;color:#c4def2;letter-spacing:.35px;font-weight:900}
  .mobileControls button:active{transform:translateY(2px);background:linear-gradient(180deg,#3a668a,#1d3b5c);box-shadow:0 1px 0 #070e1a}
  .mobileControls button[data-key="KeyK"]{border-color:#9bdfff;background:linear-gradient(180deg,#315878,#193651)}
  .mobileControls button[data-key="Space"]{border-color:#e4c77d;background:linear-gradient(180deg,#806a3e,#443a2b)}
  #gameShell{padding-bottom:calc(154px + env(safe-area-inset-bottom))}
}
@media(max-width:380px){
 .mobileControls{gap:5px;padding-left:7px;padding-right:7px}
 .joystickWrap{flex-basis:102px}
 .joystickBase{width:94px;height:94px}
 .actionRow{gap:4px}
 .actionKeys{gap:5px}
 .mobileControls button{height:47px;min-height:47px;font-size:18px;border-radius:8px}
}
@media(max-height:500px) and (max-width:900px){
 .mobileControls{min-height:0;padding-top:5px;padding-bottom:calc(5px + env(safe-area-inset-bottom));gap:12px}
 .joystickWrap{flex-basis:96px;gap:1px}
 .joystickBase{width:78px;height:78px}
 .stickLabel{display:none}
 .actionKeys{gap:4px}
 .actionRow{gap:6px}
 .mobileControls button{height:38px;min-height:38px;font-size:17px}
 .mobileControls button small{font-size:7px}
 #gameShell{padding-bottom:calc(94px + env(safe-area-inset-bottom))}
}


/* Start menu and pre-game settings */
.startMenu{z-index:40;background:radial-gradient(ellipse at center,#142c49ed,#050b18f5)}
.startPanel{max-width:520px;text-align:center;padding:clamp(25px,5vw,48px);border:2px solid #8ac8e9;background:linear-gradient(160deg,#1b3553,#0b172a);box-shadow:0 0 0 5px #091323,0 24px 90px #000d}
.startPanel .eyebrow,.settingsPanel .eyebrow{color:#f1d18a;font-size:10px;font-weight:900;letter-spacing:3px}
.startPanel h1{margin:12px 0;color:#effaff;font-size:clamp(30px,7vw,54px);line-height:1.05;letter-spacing:2px;text-shadow:4px 4px 0 #244e72}
.startPanel h1 em{color:#8edcff;font-style:normal}
.startSubtitle{color:#a9c6df!important;letter-spacing:2px;font-size:11px!important}
.startMenuActions{display:grid;gap:11px;margin:28px auto 20px;max-width:310px}
.startMenuActions button{min-height:52px;font-size:14px;letter-spacing:1.5px;border:1px solid #739fc4;background:linear-gradient(180deg,#294969,#142a45);box-shadow:0 4px 0 #070e1a}
.startMenuActions .primaryAction,.primaryAction{border-color:#e4c77d;background:linear-gradient(180deg,#94794a,#5b472d);color:#fff8e8}
.menuFooter{display:block;color:#7897b6;font-size:9px;letter-spacing:.7px;line-height:1.8}
.settingsPanel{max-width:430px}
.settingRow{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:22px 0;color:#d9eaff;font-size:12px;font-weight:800}
.settingVolume{display:flex;align-items:center;gap:14px;color:#d9eaff;font-size:12px;font-weight:800}
.settingVolume input{flex:1;accent-color:#8ce9ff}
.settingsBack{width:100%;min-height:46px;margin-top:25px}
.mobileControls button.cooldown{opacity:.48;filter:saturate(.45);border-color:#718093}
@media(max-width:480px){.startPanel{padding:25px 18px}.startPanel h1{font-size:32px}.menuFooter{font-size:8px}.settingRow{align-items:flex-start;flex-direction:column}}


/* ARCVEL V6 — animated RPG presentation */
@keyframes panelRise{from{opacity:0;transform:translateY(18px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes hudGlow{0%,100%{box-shadow:0 0 0 #79dfff00}50%{box-shadow:0 0 18px #79dfff22}}
@keyframes shieldPulse{0%,100%{box-shadow:0 0 0 0 #8ce9ff22,inset 0 1px #ffffff25}50%{box-shadow:0 0 0 5px #8ce9ff18,0 0 18px #8ce9ff55,inset 0 1px #ffffff35}}
@keyframes gameAmbient{0%,100%{border-color:#526d8b}50%{border-color:#83c9e8}}
#gameShell>header{padding:10px 12px;border:1px solid #294661;border-radius:12px;background:linear-gradient(110deg,#13253d,#0e1a2d);box-shadow:0 8px 28px #0004}
canvas{border-color:#77a9ca;box-shadow:0 14px 42px #0009,0 0 26px #4aa5d522;animation:gameAmbient 7s ease-in-out infinite}
.hud{padding:10px 12px;border:1px solid #2e4b67;border-radius:10px;background:linear-gradient(100deg,#12243a,#0e1b2e);animation:hudGlow 5s ease-in-out infinite}
.hud>div:nth-child(2){display:flex;flex-direction:column;align-items:center;gap:3px}
.shieldStatus{display:inline-flex;align-items:center;gap:7px;padding:3px 9px;border:1px solid #65829b;border-radius:999px;background:#172e47;color:#bfeaff;font-size:10px;letter-spacing:1px}
.shieldStatus span{margin:0!important;color:#e6f6ff;font-variant-numeric:tabular-nums}
.shieldStatus[data-state="active"]{border-color:#8ce9ff;background:#1b4961;color:#fff;box-shadow:0 0 14px #8ce9ff66}
.shieldStatus[data-state="wait"]{border-color:#a98b57;background:#443923;color:#ffe4a6}
.shieldStatus[data-state="ready"]{border-color:#5d9b84;background:#173b37;color:#b8ffdc}
button{transition:transform .16s ease,background .2s ease,border-color .2s ease,box-shadow .2s ease}
button:hover{transform:translateY(-2px);box-shadow:0 5px 14px #0005}
button:active{transform:translateY(1px)}
.panel{animation:panelRise .28s cubic-bezier(.2,.8,.2,1) both;background:linear-gradient(155deg,#19324e,#101d31);border-color:#78b9dc;box-shadow:0 24px 90px #000c,0 0 35px #62caff20}
.startPanel{box-shadow:0 0 0 5px #091323,0 24px 90px #000d,0 0 48px #69cfff25}
.startMenu{background:radial-gradient(ellipse at 50% 42%,#1c4264ed,#050b18f7)}
.startMenuActions button{transition:transform .18s ease,filter .18s ease,box-shadow .18s ease}
.startMenuActions button:hover{transform:translateY(-3px);filter:brightness(1.18);box-shadow:0 7px 0 #070e1a,0 0 20px #8ce9ff25}
.tutorialPanel{max-width:760px}
.tutorialGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:20px 0}
.tutorialGrid section{padding:14px;border:1px solid #345570;border-radius:10px;background:#0e1d30}
.tutorialGrid h3{margin:0 0 10px;color:#f1d18a;font-size:12px;letter-spacing:1px}
.tutorialGrid p{margin:7px 0;line-height:1.5}
.tutorialCloseAction{width:100%;min-height:46px}
.mobileControls button.shieldActive{border-color:#c5f4ff;background:linear-gradient(180deg,#4d9dbd,#1d5576);animation:shieldPulse .9s ease-in-out infinite}
.mobileControls button.cooldown{opacity:.58}
@media(max-width:700px){#gameShell>header{padding:8px;gap:8px}.topActions{flex-wrap:wrap;justify-content:flex-end}.tutorialGrid{grid-template-columns:1fr}.shieldStatus{font-size:8px;padding:2px 6px}.hud{padding:7px 6px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

#tutorialMenu{z-index:55}


/* ==========================================================================
   ARCVEL V7 — RESPONSIVE ELEVATED MOBILE CONTROL DOCK
   ========================================================================== */
:root {
  --ctrl-lift: clamp(44px, 11dvh, 96px);
  --ctrl-pad-y: clamp(8px, 1.4dvh, 13px);
  --ctrl-pad-x: clamp(10px, 2.8vw, 18px);
  --ctrl-gap: clamp(8px, 2.6vw, 20px);
  --joy-size: clamp(74px, min(20vw, 11.8dvh), 98px);
  --joy-wrap-w: calc(var(--joy-size) + clamp(10px, 2.5vw, 18px));
  --btn-h: clamp(36px, min(10.5vw, 5.8dvh), 46px);
  --btn-gap: clamp(5px, min(1.4vw, 0.9dvh), 8px);
  --btn-font: clamp(14px, min(4vw, 2.2dvh), 19px);
  --btn-label: clamp(6.5px, min(1.75vw, 1.05dvh), 8.5px);
}

/* Portrait & standard mobile screens */
@media (max-width: 768px) and (orientation: portrait), (max-width: 700px) {
  html, body {
    min-height: 100dvh;
    background: #0b1020;
  }

  #gameShell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: clamp(6px, 1.2dvh, 10px) clamp(8px, 2vw, 12px);
    padding-bottom: calc(var(--ctrl-lift) + (var(--btn-h) * 2) + var(--btn-gap) + (var(--ctrl-pad-y) * 2) + env(safe-area-inset-bottom) + 14px);
  }

  #gameShell > header {
    margin-bottom: clamp(6px, 1dvh, 10px);
    padding: 7px 9px;
  }

  .hud {
    margin-bottom: clamp(6px, 1dvh, 8px);
    padding: 6px 8px;
  }

  .under {
    padding: clamp(6px, 1.1dvh, 10px) 2px 6px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
  }

  .skillHints {
    margin-top: 0;
    gap: 8px;
    font-size: 11px;
  }

  .mobileControls {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: var(--ctrl-gap);
    position: fixed;
    left: max(6px, env(safe-area-inset-left));
    right: max(6px, env(safe-area-inset-right));
    bottom: calc(var(--ctrl-lift) + env(safe-area-inset-bottom));
    z-index: 30;
    min-height: 0;
    padding: var(--ctrl-pad-y) var(--ctrl-pad-x);
    box-sizing: border-box;
    border-radius: 16px;
    border: 1px solid #4e7ca3;
    border-top: 1.5px solid #76b8e6;
    background: linear-gradient(180deg, rgba(13, 27, 48, 0.92), rgba(8, 17, 33, 0.96));
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65), 0 0 22px rgba(96, 196, 255, 0.16), inset 0 1px 0 rgba(182, 232, 255, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }

  /* Left: Analog Joystick */
  .joystickWrap {
    flex: 0 0 var(--joy-wrap-w);
    width: var(--joy-wrap-w);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
  }

  .joystickBase {
    position: relative;
    width: var(--joy-size);
    height: var(--joy-size);
    border-radius: 50%;
    border: 2.5px solid #74add6;
    background: radial-gradient(circle at 50% 45%, #274a6e, #132842 68%, #0a1628);
    box-shadow: inset 0 0 0 4px #071326, 0 3px 0 #050a14, 0 0 16px rgba(109, 185, 239, 0.32);
    touch-action: none;
    overflow: hidden;
  }

  .joystickBase:after {
    content: "";
    position: absolute;
    inset: clamp(8px, 14%, 13px);
    border: 1px dashed rgba(141, 187, 226, 0.4);
    border-radius: 50%;
    pointer-events: none;
  }

  .joystickKnob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 42%;
    height: 42%;
    margin: -21% 0 0 -21%;
    border-radius: 50%;
    border: 2px solid #dcf5ff;
    background: linear-gradient(145deg, #9fe1ff, #387eae 70%, #1f486e);
    box-shadow: 0 2px 0 #0f243b, inset 0 2px 4px rgba(255, 255, 255, 0.6), 0 0 12px rgba(126, 212, 255, 0.55);
    pointer-events: none;
    will-change: transform;
  }

  .joystickDirection {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: clamp(10px, 2.8vw, 12px);
    color: #b9d9f2;
    opacity: 0.7;
    pointer-events: none;
  }
  .joystickDirection.left { left: 6px; }
  .joystickDirection.right { right: 6px; }

  .stickLabel {
    font-size: 7.5px;
    letter-spacing: 1.8px;
    color: #9ecae8;
    font-weight: 900;
    line-height: 1;
  }

  /* Right: 2 rows x 3 columns Action Buttons */
  .actionKeys {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: var(--btn-gap);
  }

  .actionRow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--btn-gap);
  }

  .mobileControls button {
    min-width: 0;
    width: 100%;
    height: var(--btn-h);
    min-height: var(--btn-h);
    padding: 2px 1px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5px;
    border: 1px solid #6f9ec4;
    border-radius: 9px;
    background: linear-gradient(180deg, #26486b, #132842);
    color: #f2f9ff;
    font-size: var(--btn-font);
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 2.5px 0 #060d18, inset 0 1px rgba(255, 255, 255, 0.22), 0 0 10px rgba(114, 198, 255, 0.12);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobileControls button small {
    font-size: var(--btn-label);
    line-height: 1;
    color: #c6e2f7;
    letter-spacing: 0.3px;
    font-weight: 900;
  }

  .mobileControls button:active {
    transform: translateY(2px);
    background: linear-gradient(180deg, #36648b, #1b3959);
    box-shadow: 0 1px 0 #060d18, 0 0 14px rgba(140, 233, 255, 0.35);
  }

  .mobileControls button[data-key="KeyJ"] {
    border-color: #84c9f0;
    background: linear-gradient(180deg, #2b547a, #152e4b);
  }

  .mobileControls button[data-key="KeyK"] {
    border-color: #96e4ff;
    background: linear-gradient(180deg, #2d597a, #16334d);
  }

  .mobileControls button[data-key="Space"] {
    border-color: #e4c77d;
    background: linear-gradient(180deg, #7c663b, #413626);
  }

  .mobileControls button[data-key="KeyU"] {
    border-color: #e59b6d;
    background: linear-gradient(180deg, #5c3a38, #301f26);
  }

  .mobileControls button[data-key="KeyO"] {
    border-color: #8beeff;
    background: linear-gradient(180deg, #24536b, #132d3f);
  }
}

/* Compact / narrow phones (<= 380px width) */
@media (max-width: 380px) and (orientation: portrait) {
  :root {
    --ctrl-lift: clamp(36px, 9.5dvh, 76px);
    --ctrl-pad-y: 7px;
    --ctrl-pad-x: 8px;
    --ctrl-gap: 7px;
    --joy-size: clamp(72px, 21vw, 86px);
    --btn-h: clamp(35px, 10.5vw, 42px);
    --btn-gap: 4px;
    --btn-font: 15px;
    --btn-label: 6.5px;
  }
}

/* Short portrait screens (e.g., split-screen or compact viewport height < 660px) */
@media (max-width: 768px) and (max-height: 660px) and (orientation: portrait) {
  :root {
    --ctrl-lift: clamp(14px, 4dvh, 32px);
    --ctrl-pad-y: 6px;
    --joy-size: clamp(68px, 11dvh, 82px);
    --btn-h: clamp(33px, 5.4dvh, 40px);
    --btn-gap: 4px;
  }
  .stickLabel {
    display: none;
  }
}

/* Mobile Landscape Orientation (phones held horizontally) */
@media (max-height: 520px) and (max-width: 960px) and (orientation: landscape) {
  :root {
    --ctrl-lift: clamp(8px, 2.5dvh, 18px);
    --ctrl-pad-y: 6px;
    --ctrl-pad-x: 10px;
    --ctrl-gap: 10px;
    --joy-size: clamp(66px, 18dvh, 84px);
    --btn-h: clamp(32px, 8.6dvh, 40px);
    --btn-gap: 4px;
    --btn-font: 15px;
    --btn-label: 6.5px;
  }

  #gameShell {
    padding: 4px 8px calc(var(--ctrl-lift) + (var(--btn-h) * 2) + var(--btn-gap) + (var(--ctrl-pad-y) * 2) + env(safe-area-inset-bottom) + 6px);
  }

  #gameShell > header {
    padding: 4px 8px;
    margin-bottom: 4px;
  }

  .hud {
    padding: 4px 8px;
    margin-bottom: 4px;
    font-size: 9px;
  }

  canvas {
    max-height: calc(100dvh - 155px);
    width: auto;
    margin: 0 auto;
  }

  .under {
    padding: 4px 2px;
  }

  .mobileControls {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: var(--ctrl-gap);
    position: fixed;
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(var(--ctrl-lift) + env(safe-area-inset-bottom));
    z-index: 30;
    min-height: 0;
    padding: var(--ctrl-pad-y) var(--ctrl-pad-x);
    border-radius: 14px;
    border: 1px solid #4e7ca3;
    border-top: 1.5px solid #76b8e6;
    background: rgba(10, 22, 40, 0.86);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 18px rgba(96, 196, 255, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: auto;
    touch-action: none;
  }

  .joystickWrap {
    flex: 0 0 calc(var(--joy-size) + 8px);
    width: calc(var(--joy-size) + 8px);
    gap: 1px;
  }

  .joystickBase {
    width: var(--joy-size);
    height: var(--joy-size);
  }

  .stickLabel {
    display: none;
  }

  .actionKeys {
    flex: 0 1 clamp(185px, 34vw, 240px);
    gap: var(--btn-gap);
  }

  .actionRow {
    gap: var(--btn-gap);
  }

  .mobileControls button {
    height: var(--btn-h);
    min-height: var(--btn-h);
    font-size: var(--btn-font);
    border-radius: 8px;
  }

  .mobileControls button small {
    font-size: var(--btn-label);
  }
}

.chapterIntroPanel{text-align:center;max-width:590px;padding:clamp(22px,5vw,42px);border-color:#8bdcff;background:radial-gradient(ellipse at 50% 0%,#315779 0%,#172a43 55%,#101b2e 100%)}
.chapterIntroPanel .eyebrow{color:#f4d58d;letter-spacing:3px;font-weight:800}.chapterIntroPanel h2{font-size:clamp(27px,6vw,42px);margin:8px 0;color:#b7edff}.chapterIntroPanel h3{color:#f6d68b;letter-spacing:2px;margin:0 0 20px;font-size:clamp(16px,3vw,21px)}.chapterLore{font-size:clamp(14px,2.5vw,16px)!important;line-height:1.8;max-width:470px;margin:0 auto 18px!important}.chapterHint{color:#8de7b5!important;font-weight:700}.chapterIntroPanel .primaryAction{margin-top:10px;min-width:min(100%,250px);padding:13px 18px;background:linear-gradient(100deg,#176b8e,#247ca0);border-color:#8de5ff}

/* Pixel Fox Logo inside game.html header & start menu */
.headerBrand{display:flex;align-items:center;gap:10px}
.gameFoxLogo{position:relative;width:36px;height:36px;flex:0 0 36px;background:#132442;border:2px solid #7dd3fc;border-radius:6px;box-shadow:0 3px 0 #070e1a,inset 0 0 8px #38bdf844;image-rendering:pixelated;display:inline-block}
.gameFoxLogo i{position:absolute;display:block;font-style:normal}
.gameFoxLogo .ear-l{left:6px;top:3px;width:7px;height:10px;background:#f8fafc;border:1.5px solid #bae6fd}
.gameFoxLogo .ear-r{right:6px;top:3px;width:7px;height:10px;background:#f8fafc;border:1.5px solid #bae6fd}
.gameFoxLogo .ear-l:after,.gameFoxLogo .ear-r:after{content:"";position:absolute;inset:1.5px 1.5px 1px;background:#60a5fa}
.gameFoxLogo .face{left:6px;top:11px;width:20px;height:14px;background:#f8fafc;border:1.5px solid #bae6fd}
.gameFoxLogo .eye-l{left:3px;top:4px;width:2.5px;height:3.5px;background:#0f172a}
.gameFoxLogo .eye-r{right:3px;top:4px;width:2.5px;height:3.5px;background:#0f172a}
.gameFoxLogo .nose{left:8px;top:8px;width:2.5px;height:2px;background:#f472b6}
.gameFoxLogo .scarf{left:7px;top:25px;width:18px;height:6px;background:#38bdf8;border:1.5px solid #0284c7}
.startFoxCrest{display:flex;justify-content:center;margin-bottom:8px}
.gameFoxLogo.largeLogo{width:54px;height:54px;flex-basis:54px;border-radius:10px;border-width:2.5px}
.gameFoxLogo.largeLogo .ear-l{left:9px;top:4px;width:10px;height:15px}
.gameFoxLogo.largeLogo .ear-r{right:9px;top:4px;width:10px;height:15px}
.gameFoxLogo.largeLogo .face{left:9px;top:16px;width:31px;height:22px}
.gameFoxLogo.largeLogo .eye-l{left:5px;top:6px;width:4px;height:5px}
.gameFoxLogo.largeLogo .eye-r{right:5px;top:6px;width:4px;height:5px}
.gameFoxLogo.largeLogo .nose{left:12px;top:12px;width:4px;height:3px}
.gameFoxLogo.largeLogo .scarf{left:11px;top:38px;width:27px;height:9px}


/* ==========================================================================
   ARCVEL V8 — ENLARGED LEFT ANALOG + RIGHT 5-BUTTON DIAMOND CLUSTER
   ========================================================================== */
@media (max-width: 768px) and (orientation: portrait), (max-width: 700px) {
  #gameShell {
    min-height: 100dvh;
    padding: 8px 10px calc(225px + env(safe-area-inset-bottom));
  }

  .mobileControls {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: fixed;
    left: max(6px, env(safe-area-inset-left));
    right: max(6px, env(safe-area-inset-right));
    bottom: calc(clamp(16px, 4.5dvh, 42px) + env(safe-area-inset-bottom));
    z-index: 30;
    min-height: 0;
    padding: 12px 14px;
    border-radius: 20px;
    border: 1.5px solid #598bb5;
    border-top: 2px solid #86c9f7;
    background: linear-gradient(180deg, rgba(13, 28, 50, 0.94), rgba(7, 16, 32, 0.98));
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.72), 0 0 26px rgba(96, 196, 255, 0.2), inset 0 1px 0 rgba(190, 236, 255, 0.26);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  /* Left side: Dedicated Large Analog Stick */
  .joystickWrap {
    flex: 0 0 clamp(124px, 35vw, 152px);
    width: clamp(124px, 35vw, 152px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .joystickBase {
    width: clamp(114px, 32vw, 140px);
    height: clamp(114px, 32vw, 140px);
    border-width: 3px;
    border-color: #7eb8e2;
    box-shadow: inset 0 0 0 5px #071326, 0 4px 0 #050a14, 0 0 20px rgba(109, 185, 239, 0.36);
  }

  .joystickKnob {
    width: 44%;
    height: 44%;
    margin: -22% 0 0 -22%;
  }

  .joystickDirection {
    font-size: 14px;
  }

  .stickLabel {
    font-size: 9px;
    letter-spacing: 2.2px;
  }

  /* Right side: Large 5-Button Diamond / Cross Pad (3x3 grid) */
  .actionDiamond {
    display: grid;
    grid-template-columns: repeat(3, clamp(52px, 15.2vw, 66px));
    grid-template-rows: repeat(3, clamp(46px, 13.2vw, 58px));
    gap: clamp(5px, 1.4vw, 7px);
    align-items: stretch;
    justify-items: stretch;
    flex: 0 0 auto;
  }

  .actionDiamond .actTop    { grid-column: 2; grid-row: 1; }
  .actionDiamond .actLeft   { grid-column: 1; grid-row: 2; }
  .actionDiamond .actCenter { grid-column: 2; grid-row: 2; }
  .actionDiamond .actRight  { grid-column: 3; grid-row: 2; }
  .actionDiamond .actBottom { grid-column: 2; grid-row: 3; }

  .mobileControls .actionDiamond button {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 3px 2px;
    border-radius: 13px;
    font-size: clamp(18px, 5vw, 23px);
    gap: 2px;
    box-shadow: 0 3.5px 0 #060d18, inset 0 1px rgba(255, 255, 255, 0.26), 0 0 12px rgba(114, 198, 255, 0.16);
  }

  .mobileControls .actionDiamond button small {
    font-size: clamp(7.5px, 2vw, 9.5px);
    letter-spacing: 0.3px;
  }

  /* Distinct color coding for each position */
  .mobileControls .actionDiamond .actCenter {
    border: 2px solid #9be0ff;
    background: linear-gradient(180deg, #356794, #193759);
    box-shadow: 0 3.5px 0 #060d18, 0 0 16px rgba(125, 211, 252, 0.32), inset 0 1px rgba(255, 255, 255, 0.35);
  }

  .mobileControls .actionDiamond .actTop {
    border-color: #f4a261;
    background: linear-gradient(180deg, #6e3d38, #381e24);
  }

  .mobileControls .actionDiamond .actRight {
    border-color: #7dd3fc;
    background: linear-gradient(180deg, #255b78, #123147);
  }

  .mobileControls .actionDiamond .actBottom {
    border-color: #f3d68b;
    background: linear-gradient(180deg, #876f3f, #473b27);
  }

  .mobileControls .actionDiamond .actLeft {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #2d557d, #16304d);
  }
}

/* Compact narrow phones (<= 380px width) */
@media (max-width: 380px) and (orientation: portrait) {
  .mobileControls {
    padding: 10px 10px;
    gap: 6px;
  }
  .joystickWrap {
    flex-basis: clamp(106px, 32vw, 122px);
    width: clamp(106px, 32vw, 122px);
  }
  .joystickBase {
    width: clamp(98px, 30vw, 114px);
    height: clamp(98px, 30vw, 114px);
  }
  .actionDiamond {
    grid-template-columns: repeat(3, clamp(46px, 14.5vw, 54px));
    grid-template-rows: repeat(3, clamp(42px, 12.8vw, 48px));
    gap: 4px;
  }
  .mobileControls .actionDiamond button {
    font-size: 17px;
    border-radius: 10px;
  }
  .mobileControls .actionDiamond button small {
    font-size: 7px;
  }
}

/* Mobile Landscape Orientation */
@media (max-height: 520px) and (max-width: 960px) and (orientation: landscape) {
  #gameShell {
    padding-bottom: calc(135px + env(safe-area-inset-bottom));
  }
  .mobileControls {
    bottom: calc(8px + env(safe-area-inset-bottom));
    padding: 8px 14px;
    background: rgba(10, 22, 40, 0.88);
  }
  .joystickWrap {
    flex-basis: 96px;
    width: 96px;
  }
  .joystickBase {
    width: 88px;
    height: 88px;
  }
  .stickLabel {
    display: none;
  }
  .actionDiamond {
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(3, 36px);
    gap: 4px;
  }
  .mobileControls .actionDiamond button {
    font-size: 15px;
    border-radius: 8px;
  }
  .mobileControls .actionDiamond button small {
    font-size: 6.5px;
  }
}


/* ==========================================================================
   MODAL & PANEL SAFE CLEARANCE ABOVE MOBILE CONTROLS
   ========================================================================== */
.modal {
  z-index: 60 !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px;
}

.modal .panel {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: auto;
}

@media (max-width: 768px) and (orientation: portrait), (max-width: 700px) {
  .modal {
    align-items: flex-start !important;
    padding: 14px 12px calc(245px + env(safe-area-inset-bottom)) !important;
  }

  .modal .panel {
    width: min(500px, 100%) !important;
    max-height: none !important;
    padding: 18px 16px 20px !important;
    margin: 0 auto !important;
  }

  .chapterIntroPanel h2 {
    font-size: 20px !important;
    margin-bottom: 6px !important;
  }

  .chapterIntroPanel h3 {
    font-size: 13px !important;
    margin-bottom: 10px !important;
  }

  .chapterLore {
    font-size: 14px !important;
    line-height: 1.48 !important;
    margin-bottom: 10px !important;
  }

  .chapterHint {
    margin-bottom: 14px !important;
  }

  .modal .panel .primaryAction,
  .modal .panel button {
    min-height: 46px;
  }
}

@media (max-height: 520px) and (max-width: 960px) and (orientation: landscape) {
  .modal {
    align-items: flex-start !important;
    padding: 10px 12px calc(150px + env(safe-area-inset-bottom)) !important;
  }

  .modal .panel {
    max-height: none !important;
    padding: 14px 16px !important;
  }
}


/* ==========================================================================
   ARCVEL ARMORY — 3 CATEGORIES (WEAPON, ARMOR, SKILL) & RARITY TIERS
   ========================================================================== */
.armoryPanel{max-width:780px}
.armoryHead{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding-right:34px;margin-bottom:12px;flex-wrap:wrap}
.armoryHead h2{margin:0 0 4px}
.armoryHead p{margin:0}
.summonControls{display:flex;align-items:center;gap:8px;background:#0d1b2e;border:1px solid #3c5c7d;padding:6px 10px;border-radius:10px}
.soulBadge{font-size:12px;color:#bfeaff;font-weight:700}
.soulBadge b{color:#fde047;font-size:14px}
.summonGearBtn{padding:7px 11px;font-size:11px}
.summonResult{margin-bottom:10px;padding:9px 12px;border-radius:9px;border:1.5px solid #fde047;background:linear-gradient(90deg,#1a3150,#2b204c);text-align:center;font-size:12.5px;font-weight:700;color:#fff}
.armoryTabs{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:10px}
.armoryTab{padding:10px 8px;font-size:12px;letter-spacing:.8px;background:#102035;border:1px solid #355270;color:#9fc0de;border-radius:9px}
.armoryTab.active{background:linear-gradient(180deg,#274c70,#16304c);border-color:#8ce9ff;color:#fff;box-shadow:0 0 12px #7dd3fc33}
.skillSlotBar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:10px;padding:8px 10px;background:#0d1a2d;border:1px solid #355473;border-radius:9px;font-size:11px;color:#a8c7e2}
.slotToggle{padding:6px 10px;font-size:11px;background:#162b44;border-color:#4a6e91}
.slotToggle.active{border-color:#fde047;background:#2c3e59;color:#fff;box-shadow:0 0 10px #fde04733}
.armoryGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;max-height:320px;overflow-y:auto;padding-right:3px}
.gearCard{display:flex;flex-direction:column;justify-content:space-between;text-align:left;padding:10px 12px;border-radius:10px;background:#162942;border:1.5px solid #3b5878;min-height:74px}
.gearCard.locked{opacity:.52;filter:grayscale(.55);cursor:not-allowed}
.gearCard.selected{background:#204666;box-shadow:0 0 14px rgba(140,233,255,.25)}
.gearTop{display:flex;justify-content:space-between;align-items:center;gap:6px;margin-bottom:4px}
.gearName{font-size:13px;font-weight:800;color:#f3faff}
.gearDesc{font-size:11.5px;color:#a7c2dc;font-weight:400;line-height:1.35}
.gearMeta{display:flex;justify-content:space-between;align-items:center;margin-top:7px;font-size:10.5px;font-weight:800}
.gearStat{color:#fde047}
.gearState{padding:2px 8px;border-radius:999px;background:#0d1b2e;color:#9ec5e6;font-size:9.5px}
.gearCard.selected .gearState{background:#38bdf8;color:#061324}
.rarityBadge{font-size:9px;font-weight:900;padding:2px 6px;border-radius:5px;letter-spacing:.7px;text-transform:uppercase}
.rarity-mythic{border-color:#f43f5e!important;background:linear-gradient(135deg,#2a1428,#1a1333)!important;box-shadow:inset 0 0 18px rgba(244,63,94,.28)}
.rarity-mythic .rarityBadge{background:linear-gradient(90deg,#e11d48,#9333ea);color:#fff}
.rarity-legend{border-color:#f59e0b!important;background:linear-gradient(135deg,#2b2214,#1a1f36)!important;box-shadow:inset 0 0 16px rgba(245,158,11,.24)}
.rarity-legend .rarityBadge{background:#f59e0b;color:#161104}
.rarity-epic{border-color:#a855f7!important;background:linear-gradient(135deg,#24183b,#16223a)!important;box-shadow:inset 0 0 14px rgba(168,85,247,.2)}
.rarity-epic .rarityBadge{background:#9333ea;color:#f5e8ff}
.rarity-rare{border-color:#38bdf8!important;background:linear-gradient(135deg,#132c47,#162942)!important;box-shadow:inset 0 0 12px rgba(56,189,248,.16)}
.rarity-rare .rarityBadge{background:#0284c7;color:#e0f2fe}
.rarityBar{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;margin-top:11px;padding-top:8px;border-top:1px solid #2b4561;font-size:10px;font-weight:800;letter-spacing:.7px}
.r-mythic{color:#fb7185}.r-legend{color:#fbbf24}.r-epic{color:#c084fc}.r-rare{color:#7dd3fc}
@media(max-width:640px){.armoryGrid{grid-template-columns:1fr;max-height:270px}}


/* ==========================================================================
   SOUL GACHA SUMMON REVEAL & 3-SECOND COUNTDOWN OVERLAY
   ========================================================================== */
.r-locked{color:#64748b}
#gachaDiceModal{z-index:95!important;background:rgba(4,9,18,.93);backdrop-filter:blur(7px);display:flex;flex-direction:column;align-items:center;justify-content:center}
#gachaDiceModal.hidden{display:none!important}
.skipGachaBtn{position:fixed;top:20px;right:22px;z-index:105;padding:9px 18px;border-radius:999px;background:#162942;border:1.5px solid #7dd3fc;color:#f3faff;font-size:12px;font-weight:800;letter-spacing:1px;cursor:pointer;box-shadow:0 4px 16px rgba(0,0,0,.45)}
.skipGachaBtn:hover{background:#38bdf8;color:#061324}
.diceRollStage{display:flex;flex-direction:column;align-items:center;gap:24px;text-align:center;padding:20px}
.diceRollStage.hidden{display:none}
.diceCountdownRing{width:70px;height:70px;border-radius:50%;border:3px solid #fde047;display:flex;align-items:center;justify-content:center;box-shadow:0 0 24px rgba(253,224,71,.45);animation:dicePulse 1s infinite}
#diceCountdownNum{font-size:34px;font-weight:900;color:#fde047}
@keyframes dicePulse{0%,100%{transform:scale(.94)}50%{transform:scale(1.08)}}
.diceArena{perspective:800px;width:120px;height:120px;display:flex;flex-direction:column;align-items:center;justify-content:center}
.diceCube{width:82px;height:82px;position:relative;transform-style:preserve-3d;animation:diceThrowTumble 1s cubic-bezier(.25,.8,.3,1) infinite}
.diceFace{position:absolute;width:82px;height:82px;background:linear-gradient(145deg,#fef9c3,#fde047);border:3px solid #f59e0b;border-radius:16px;font-size:44px;color:#78350f;display:flex;align-items:center;justify-content:center;box-shadow:inset 0 0 12px rgba(217,119,6,.35)}
.diceFace.front{transform:rotateY(0deg) translateZ(41px)}
.diceFace.back{transform:rotateY(180deg) translateZ(41px)}
.diceFace.right{transform:rotateY(90deg) translateZ(41px)}
.diceFace.left{transform:rotateY(-90deg) translateZ(41px)}
.diceFace.top{transform:rotateX(90deg) translateZ(41px)}
.diceFace.bottom{transform:rotateX(-90deg) translateZ(41px)}
@keyframes diceThrowTumble{
  0%{transform:translateY(-86px) scale(.75) rotateX(0deg) rotateY(0deg) rotateZ(0deg)}
  35%{transform:translateY(20px) scale(1.05) rotateX(360deg) rotateY(240deg) rotateZ(120deg)}
  65%{transform:translateY(-26px) scale(.95) rotateX(540deg) rotateY(480deg) rotateZ(240deg)}
  100%{transform:translateY(0px) scale(1) rotateX(720deg) rotateY(720deg) rotateZ(360deg)}
}
.diceShadow{width:68px;height:13px;background:radial-gradient(ellipse at center,rgba(253,224,71,.45) 0%,transparent 70%);margin-top:11px;animation:diceShadowScale 1s infinite}
@keyframes diceShadowScale{0%,100%{transform:scale(.7);opacity:.4}35%{transform:scale(1.2);opacity:.9}}
.diceStatusText{font-size:15px;font-weight:800;color:#e0f2fe;letter-spacing:.4px}
.diceRevealStage{display:flex;align-items:center;justify-content:center;animation:cardPopIn .32s cubic-bezier(.175,.885,.32,1.275)}
.diceRevealStage.hidden{display:none}
@keyframes cardPopIn{0%{transform:scale(.45);opacity:0}100%{transform:scale(1);opacity:1}}
.diceRevealCard{width:min(320px,88vw);background:linear-gradient(180deg,#152942,#0c1829);border:2.5px solid #38bdf8;border-radius:18px;padding:24px 20px;text-align:center;box-shadow:0 0 40px rgba(56,189,248,.35)}
.diceRevealCard.rarity-mythic{border-color:#f43f5e;box-shadow:0 0 60px rgba(244,63,94,.65)}
.diceRevealCard.rarity-legend{border-color:#f59e0b;box-shadow:0 0 55px rgba(245,158,11,.6)}
.diceRevealCard.rarity-epic{border-color:#a855f7;box-shadow:0 0 45px rgba(168,85,247,.5)}
.diceRevealCard.rarity-rare{border-color:#38bdf8;box-shadow:0 0 40px rgba(56,189,248,.4)}
#revealItemIcon .weapon-preview-canvas{width:100%;height:100%;min-height:100px;display:block;}
.revealItemIcon{font-size:52px;margin:10px 0 6px}
.diceRevealCard h3{margin:0 0 4px;font-size:20px;color:#fff}
.revealItemCat{margin:0 0 8px;font-size:10.5px;font-weight:800;letter-spacing:1.2px;color:#93c5fd}
.revealItemDesc{margin:0 0 12px;font-size:12.5px;color:#cbd5e1;line-height:1.4}
.revealItemStat{font-size:14px;font-weight:900;color:#fde047;margin-bottom:8px}
.revealNewTag{display:inline-block;padding:3px 10px;border-radius:999px;background:rgba(56,189,248,.18);border:1px solid #38bdf8;color:#bae6fd;font-size:10.5px;font-weight:800;margin-bottom:14px}
.claimGachaBtn{width:100%;padding:11px;font-size:13px}


/* ==========================================================================
   V23 FLUID & TACTILE UI OVERHAUL — IN-GAME HUD, MENUS & BUTTONS
   ========================================================================== */
:root {
  --ui-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ui-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Global Tactile Button Physics & Light Sheen */
button {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  transition:
    transform 0.26s var(--ui-spring),
    background 0.2s var(--ui-smooth),
    border-color 0.2s var(--ui-smooth),
    box-shadow 0.24s var(--ui-smooth),
    filter 0.2s ease;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}
button::after {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 60%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.26), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s var(--ui-smooth);
  pointer-events: none;
}
button:hover:not(:disabled)::after {
  left: 145%;
}
button:hover:not(:disabled) {
  transform: translateY(-2.5px) scale(1.02);
  border-color: #8ce9ff;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.45), 0 0 14px rgba(125, 211, 252, 0.22);
}
button:active:not(:disabled) {
  transform: translateY(2px) scale(0.955) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6) !important;
  transition-duration: 0.07s;
}
button:focus-visible {
  outline: 2.5px solid #fde047;
  outline-offset: 2px;
}

/* Header & Top Action Bar Polish */
#gameShell > header {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: #365a7d;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(186, 230, 253, 0.14);
}
.backHome {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #355473;
  background: rgba(15, 29, 50, 0.85);
  font-weight: 800;
  transition: transform 0.24s var(--ui-spring), border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.backHome:hover {
  transform: translateX(-3px);
  border-color: #f3d68b;
  background: rgba(28, 49, 80, 0.95);
  color: #fff;
}
.topActions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topActions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 11.5px;
  letter-spacing: 0.4px;
  background: linear-gradient(180deg, #1f3959, #13253e);
  border-color: #4b7096;
}
.volumeControl {
  min-height: 35px;
  padding: 0 10px;
  border-radius: 10px;
  border-color: #3b5c7e;
  background: rgba(13, 25, 44, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.volumeControl:hover {
  border-color: #7dd3fc;
  box-shadow: 0 0 12px rgba(125, 211, 252, 0.18);
}

/* Smooth Modal Open & Closing Transitions */
.modal {
  opacity: 1;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transition: opacity 0.24s var(--ui-smooth), backdrop-filter 0.24s ease;
}
.modal.closing {
  opacity: 0 !important;
  pointer-events: auto !important; /* V65: swallow clicks while fading out (game.js click guard) instead of letting them fall through */
}
.modal.closing .panel {
  transform: translateY(14px) scale(0.95) !important;
  opacity: 0 !important;
  transition: transform 0.22s var(--ui-smooth), opacity 0.2s ease !important;
}
.panel {
  animation: panelSpringIn 0.34s var(--ui-spring) both;
}
@keyframes panelSpringIn {
  0% { opacity: 0; transform: translateY(22px) scale(0.93); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Close (X) Button Circular Spring */
.close {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  background: rgba(13, 26, 46, 0.9);
  border-color: #4c7094;
}
.close:hover:not(:disabled) {
  transform: rotate(90deg) scale(1.1) !important;
  border-color: #fb7185;
  color: #fecdd3;
  background: rgba(76, 20, 38, 0.85);
}
.close:active:not(:disabled) {
  transform: rotate(90deg) scale(0.92) !important;
}

/* Start Menu & Primary CTA Buttons */
.startMenuActions button {
  border-radius: 12px;
  transition: transform 0.28s var(--ui-spring), filter 0.2s ease, box-shadow 0.24s ease, border-color 0.2s ease;
}
.startMenuActions button:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.03);
  filter: brightness(1.14);
  box-shadow: 0 9px 0 #070e1a, 0 0 24px rgba(140, 233, 255, 0.32);
}
.startMenuActions .primaryAction:hover:not(:disabled),
.primaryAction:hover:not(:disabled) {
  border-color: #fef08a;
  box-shadow: 0 9px 0 #070e1a, 0 0 26px rgba(253, 224, 71, 0.42);
}

/* Armory Tabs, Slot Toggles & Gear Cards Fluid Interaction */
.armoryTab {
  position: relative;
  border-radius: 10px;
  font-weight: 800;
  transition: transform 0.26s var(--ui-spring), background 0.22s ease, border-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}
.armoryTab.active {
  transform: translateY(-2px);
}
.slotToggle {
  border-radius: 8px;
}
.gearCard {
  border-radius: 12px;
  transition: transform 0.28s var(--ui-spring), box-shadow 0.25s ease, border-color 0.22s ease, background 0.22s ease;
}
.gearCard:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.48), 0 0 16px rgba(125, 211, 252, 0.25);
}
.gearCard.selected {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 18px rgba(56, 189, 248, 0.35);
}
.gearState {
  transition: background 0.22s ease, color 0.22s ease, transform 0.22s var(--ui-spring);
}
.gearCard.selected .gearState {
  transform: scale(1.06);
  font-weight: 900;
}

/* Mobile Action Diamond & Joystick Tactile Touch Response */
.mobileControls button {
  transition: transform 0.14s var(--ui-spring), background 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.mobileControls button.pressed,
.mobileControls button:active {
  transform: translateY(3px) scale(0.92) !important;
  filter: brightness(1.22);
}
.joystickKnob {
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}
.joystickBase.active .joystickKnob {
  border-color: #ffffff;
  box-shadow: 0 2px 0 #0f243b, inset 0 2px 5px rgba(255, 255, 255, 0.8), 0 0 18px rgba(126, 212, 255, 0.9);
}

/* Button Ripple Effect */
.ui-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(224, 242, 254, 0.38);
  transform: scale(0);
  animation: uiRippleAnim 0.48s var(--ui-smooth) forwards;
  pointer-events: none;
}
@keyframes uiRippleAnim {
  to {
    transform: scale(2.8);
    opacity: 0;
  }
}


/* ARCVEL V27 — menu polish, layered onto the original V25 structure */
@keyframes v27MenuEnter {
  0% { opacity: 0; transform: translateY(16px) scale(.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes v27ButtonSheen {
  0% { transform: translateX(-150%) skewX(-18deg); opacity: 0; }
  18% { opacity: .5; }
  55%,100% { transform: translateX(250%) skewX(-18deg); opacity: 0; }
}
.startMenu:not(.hidden) .startPanel {
  animation: v27MenuEnter .48s cubic-bezier(.2,.8,.2,1) both;
}
.startMenu:not(.hidden) .startFoxCrest {
  animation: v27MenuEnter .55s .06s both;
}
.startMenu:not(.hidden) .startPanel .eyebrow,
.startMenu:not(.hidden) .startPanel h1,
.startMenu:not(.hidden) .startSubtitle {
  animation: v27MenuEnter .42s .1s both;
}
.startMenuActions button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform .18s cubic-bezier(.2,.8,.2,1),
              filter .18s ease, box-shadow .18s ease,
              border-color .18s ease;
}
.startMenu:not(.hidden) .startMenuActions button {
  animation: v27MenuEnter .38s both;
}
.startMenu:not(.hidden) .startMenuActions button:nth-child(1) { animation-delay: .12s; }
.startMenu:not(.hidden) .startMenuActions button:nth-child(2) { animation-delay: .19s; }
.startMenu:not(.hidden) .startMenuActions button:nth-child(3) { animation-delay: .26s; }
.startMenu:not(.hidden) .startMenuActions button:nth-child(4) { animation-delay: .33s; }
.startMenuActions button::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -30%;
  bottom: -30%;
  left: 0;
  width: 34%;
  background: linear-gradient(90deg,transparent,#fff8,transparent);
  transform: translateX(-150%) skewX(-18deg);
  pointer-events: none;
}
.startMenuActions button:hover,
.startMenuActions button:focus-visible {
  transform: translateY(-3px);
  filter: brightness(1.13);
  border-color: #d5efff;
  box-shadow: 0 7px 0 #070e1a, 0 0 18px #8bdcff35;
}
.startMenuActions button:hover::after,
.startMenuActions button:focus-visible::after {
  animation: v27ButtonSheen .8s ease-out;
}
.startMenuActions button:active {
  transform: translateY(2px) scale(.985);
  filter: brightness(.96);
  box-shadow: 0 1px 0 #070e1a;
}
.startMenuActions .primaryAction {
  border-color: #f5d88f;
  background: linear-gradient(180deg,#b18e51,#70552f);
  box-shadow: 0 4px 0 #3a2b1c, 0 0 16px #eacb7540;
}
.startMenuActions .primaryAction:hover,
.startMenuActions .primaryAction:focus-visible {
  border-color: #fff0bd;
  box-shadow: 0 7px 0 #3a2b1c, 0 0 24px #f3cf765c;
}
@media (prefers-reduced-motion: reduce) {
  .startMenu:not(.hidden) .startPanel,
  .startMenu:not(.hidden) .startFoxCrest,
  .startMenu:not(.hidden) .startPanel .eyebrow,
  .startMenu:not(.hidden) .startPanel h1,
  .startMenu:not(.hidden) .startSubtitle,
  .startMenu:not(.hidden) .startMenuActions button {
    animation: none !important;
  }
  .startMenuActions button,
  .startMenuActions button::after { transition: none !important; }
}


/* V28: place SKIP directly beneath the dice, centered and touch-friendly */
#diceRollStage .skipGachaBtn{
 position:relative;
 inset:auto;
 display:inline-flex;
 align-items:center;
 justify-content:center;
 align-self:center;
 min-width:112px;
 min-height:44px;
 margin:0 auto;
 padding:10px 22px;
 z-index:2;
 touch-action:manipulation;
}
#diceRollStage .diceArena{margin-bottom:0}
#diceRollStage .skipGachaBtn:hover{background:#38bdf8;color:#061324}
@media(max-width:480px){
 #diceRollStage{gap:16px;padding:16px 12px}
 #diceRollStage .skipGachaBtn{min-width:128px;min-height:48px;font-size:13px}
}


/* V29 — animated pixel-fantasy armory artwork */
.gearCard{min-height:190px;gap:0;padding:9px 11px;overflow:hidden;position:relative}
.gearCard .gearTop{width:100%;align-items:flex-start;min-height:30px}
.gearCard .gearName{line-height:1.25;min-width:0}
.gearArtStage{height:78px;min-height:78px;width:100%;margin:2px 0 5px;position:relative;display:grid;place-items:center;overflow:hidden;border-radius:8px;background:radial-gradient(ellipse at 50% 58%,rgba(125,211,252,.16),rgba(4,12,25,.12) 68%,transparent 100%);isolation:isolate}
.gearArtStage::before{content:"";position:absolute;inset:9px 22%;border:1px solid currentColor;border-radius:50%;opacity:.12;transform:scaleX(1.4);animation:artRing 5s ease-in-out infinite}
.gearArtStage svg{width:min(100%,190px);height:76px;overflow:visible;filter:drop-shadow(0 3px 5px rgba(0,0,0,.45));animation:artFloat 3.8s ease-in-out infinite;position:relative;z-index:1}
.art-glint{animation:artShine 3.4s ease-in-out infinite;transform:translateX(-100%)}
.art-spark{position:absolute;width:3px;height:3px;background:#e0f2fe;box-shadow:0 0 7px currentColor;opacity:0;z-index:2;animation:artSpark 2.8s ease-in-out infinite}
.spark-a{left:24%;top:27%;color:#bae6fd}.spark-b{right:23%;top:58%;animation-delay:1.25s;color:#fde68a}
.art-weapon{color:#7dd3fc}.art-armor{color:#c4b5fd}.art-skill{color:#f0abfc}
.art-forest_saber{color:#6ee7b7}.art-crimson_reaver{color:#fb923c}.art-glacier_blade{color:#7dd3fc}.art-dragon_fang{color:#fde047}.art-void_sovereign{color:#e879f9}
.art-ember_edge{color:#fb923c}.art-frostfang{color:#7dd3fc}.art-thunder_spark{color:#fde047}.art-gale_slash{color:#6ee7b7}.art-astral_nova{color:#d8b4fe}
.gearCard .gearDesc{min-height:29px;line-height:1.3}
.gearCard .gearMeta{width:100%;margin-top:6px}
.gearCard.locked .gearArtStage{filter:grayscale(.6);opacity:.7}
@keyframes artFloat{0%,100%{transform:translateY(1px)}50%{transform:translateY(-3px)}}
@keyframes artShine{0%,25%{transform:translateX(-100%);opacity:0}42%{opacity:.8}68%,100%{transform:translateX(100%);opacity:0}}
@keyframes artSpark{0%,15%,100%{opacity:0;transform:translateY(5px) scale(.5)}35%,55%{opacity:.9;transform:translateY(-5px) scale(1.2)}75%{opacity:0}}
@keyframes artRing{0%,100%{opacity:.08;transform:scaleX(1.2) scaleY(.9)}50%{opacity:.2;transform:scaleX(1.45) scaleY(1.08)}}
@media(max-width:640px){.armoryGrid{grid-template-columns:repeat(2,minmax(0,1fr));max-height:330px}.gearCard{min-height:184px;padding:8px}.gearCard .gearName{font-size:11px}.gearCard .rarityBadge{font-size:8px;padding:2px 4px}.gearArtStage{height:68px;min-height:68px}.gearArtStage svg{height:66px}.gearCard .gearDesc{font-size:10px;min-height:28px}.gearCard .gearMeta{font-size:9px}.gearCard .gearState{font-size:8px;padding:2px 5px}}
@media(max-width:360px){.armoryGrid{grid-template-columns:1fr}.gearCard{min-height:178px}.gearArtStage{height:70px;min-height:70px}}
@media(prefers-reduced-motion:reduce){.gearArtStage::before,.gearArtStage svg,.art-glint,.art-spark{animation:none!important}.gearArtStage svg{transform:none}}


/* Inventory sizing and alignment for the shared catalog illustrations. */
.gearCard .gear-art.inventory-gear-art{height:104px;min-height:104px;width:100%;margin:5px 0 7px;border-radius:9px;transform:none}
.gearCard .gear-art.inventory-gear-art>*{image-rendering:pixelated}
.gearCard .gear-art.inventory-gear-art .wep-blade.saber-curve{transform:none!important;rotate:0deg!important}
@media (max-width:600px){.gearCard .gear-art.inventory-gear-art{height:88px;min-height:88px}}
@media (prefers-reduced-motion:reduce){
 .gearCard .gear-art.inventory-gear-art *, .gearCard .gear-art.inventory-gear-art *::before,.gearCard .gear-art.inventory-gear-art *::after{animation:none!important;transition:none!important}
}

/* V32 FIX: load the website catalog's actual gear-art renderer on the game page.
   game.html intentionally loads style.css only, so these rules are scoped to
   inventory illustrations and mirror the catalog geometry/effects. */
:is(#armoryGrid,#heroGearGrid) .weapon-preview-canvas{width:100%;height:100px;display:block;image-rendering:auto;}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art{
 position:relative;display:flex;align-items:center;justify-content:center;
 width:100%;height:78px;min-height:78px;margin:5px 0 7px;padding:0;
 border:1px solid rgba(148,163,184,.25);border-radius:9px;overflow:hidden;
 background:radial-gradient(circle at 50% 55%,rgba(125,211,252,.18),rgba(7,14,28,.88) 75%);
 image-rendering:pixelated;isolation:isolate;flex:none;
}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-hilt{position:absolute;left:22px;top:35px;width:12px;height:8px;border-radius:2px}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-guard{position:absolute;left:33px;top:29px;width:5px;height:20px;border-radius:2px}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-blade{position:absolute;left:38px;top:34px;width:62px;height:10px;clip-path:polygon(0 18%,82% 18%,100% 50%,82% 82%,0 82%);animation:invWepGleam 2.6s ease-in-out infinite}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-blade.broadsword-thick{height:14px;top:32px}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-blade.saber-curve{transform:none!important;transform-origin:left center;rotate:0deg!important;clip-path:polygon(0 20%,84% 20%,100% 50%,84% 80%,0 80%)}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-blade.ice-edged{clip-path:polygon(0 20%,65% 0,85% 22%,100% 50%,85% 78%,65% 100%,0 80%)}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-blade.flame-edged{clip-path:polygon(0 15%,40% 0,65% 20%,85% 5%,100% 50%,85% 95%,65% 80%,40% 100%,0 85%)}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-blade.dragon-serrated{height:12px;top:33px;clip-path:polygon(0 15%,35% 0,55% 22%,78% 4%,100% 50%,78% 96%,55% 78%,35% 100%,0 85%)}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-split-top,:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-split-bot{position:absolute;left:38px;width:64px;height:5px;clip-path:polygon(0 0,88% 0,100% 100%,0 100%)}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-split-top{top:31px}:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-split-bot{top:42px}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-split-core{position:absolute;left:42px;top:37px;width:54px;height:4px;background:#fae8ff;box-shadow:0 0 8px #e879f9;animation:invPulse 1.4s ease-in-out infinite}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-star-tip{position:absolute;right:16px;top:34px;width:10px;height:10px;transform:rotate(45deg);animation:invSpin 4s linear infinite}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-fang-tip{position:absolute;right:15px;top:32px;width:0;height:0;border-top:7px solid transparent;border-bottom:7px solid transparent;border-left:14px solid #fef08a}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-crystal-shard{position:absolute;right:24px;top:16px;width:8px;height:8px;background:#e0f2fe;transform:rotate(45deg);animation:invFloat 2s ease-in-out infinite}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-ember-dot{position:absolute;right:22px;top:18px;width:6px;height:6px;background:#fde047;border-radius:50%;box-shadow:0 0 8px #f97316;animation:invFloat 1.7s ease-in-out infinite}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-arc{position:absolute;right:14px;top:14px;width:30px;height:50px;border-right:3px solid rgba(186,230,253,.55);border-radius:0 100% 100% 0/0 50% 50% 0;opacity:.75;animation:invArc 2.4s ease-in-out infinite}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arc-gold{border-right-color:#fde047}:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arc-void{border-right-color:#e879f9;width:36px;height:56px;top:11px}:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arc-fire{border-right-color:#fb923c}:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arc-ice{border-right-color:#7dd3fc}:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arc-leaf{border-right-color:#6ee7b7}:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arc-bronze{border-right-color:#fbbf24}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .wep-glow{position:absolute;inset:8px;border-radius:999px;background:radial-gradient(circle,rgba(250,204,21,.16),transparent 70%);pointer-events:none}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-art{animation:invCardFloat 4.8s ease-in-out infinite}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-aura{position:absolute;width:54px;height:62px;border-radius:50%;border:2px dashed rgba(232,121,249,.65);animation:invSpin 9s linear infinite}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-crystals{position:absolute;inset:0;background:radial-gradient(circle at 26% 36%,#e879f9 2px,transparent 3px),radial-gradient(circle at 74% 36%,#e879f9 2px,transparent 3px);animation:invPulse 2s ease-in-out infinite}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-cape{position:absolute;top:28px;width:38px;height:36px;border-radius:6px;opacity:.75}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-crown{position:absolute;top:10px;width:16px;height:6px;border-radius:2px;box-shadow:0 0 8px currentColor}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-helmet{position:relative;top:-11px;width:24px;height:18px;border:2px solid #bae6fd;border-radius:3px;z-index:2}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-ear-l,:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-ear-r{position:absolute;top:-7px;width:7px;height:8px;border:1.5px solid #bae6fd}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-ear-l{left:1px;transform:rotate(-10deg)}:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-ear-r{right:1px;transform:rotate(10deg)}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-eye-l,:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-eye-r{position:absolute;top:6px;width:3px;height:4px;background:#0f172a}:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-eye-l{left:5px}:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-eye-r{right:5px}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-chest{position:absolute;bottom:14px;width:26px;height:20px;border:2px solid #0284c7;border-radius:3px;z-index:2}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-belt{position:absolute;left:0;right:0;bottom:3px;height:4px}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-pauldron-l,:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-pauldron-r{position:absolute;bottom:25px;width:9px;height:10px;border:1.5px solid #0284c7;border-radius:2px;z-index:3}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-pauldron-l{left:calc(50% - 21px)}:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-pauldron-r{right:calc(50% - 21px)}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-leg-l,:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-leg-r{position:absolute;bottom:5px;width:8px;height:10px;border-radius:1px;z-index:1}:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-leg-l{left:calc(50% - 10px)}:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .arm-leg-r{right:calc(50% - 10px)}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .skl-lance{width:56px;height:10px;clip-path:polygon(0 25%,78% 25%,100% 50%,78% 75%,0 75%);animation:invWepGleam 2s ease-in-out infinite}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .skl-shard{position:absolute;width:7px;height:7px;background:#e0f2fe;transform:rotate(45deg)}:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .skl-shard.s1{top:18px;right:26px;animation:invFloat 1.8s ease-in-out infinite}:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .skl-shard.s2{bottom:18px;right:32px;animation:invFloat 2.2s ease-in-out infinite reverse}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .skl-flame-outer{width:34px;height:34px;border-radius:50% 50% 50% 15%;transform:rotate(-45deg);animation:invPulse 1.5s ease-in-out infinite}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .skl-flame-inner{position:absolute;width:16px;height:16px;border-radius:50% 50% 50% 15%;transform:rotate(-45deg)}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .skl-bolt{width:54px;height:8px;clip-path:polygon(0 45%,30% 0,55% 38%,100% 25%,65% 100%,42% 62%);animation:invPulse 1.1s ease-in-out infinite}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .skl-wind-arc{position:absolute;width:30px;height:44px;border-right:3px solid;border-radius:0 100% 100% 0/0 50% 50% 0;animation:invArc 2s ease-in-out infinite}:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .skl-wind-arc.w1{left:calc(50% - 10px)}:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .skl-wind-arc.w2{left:calc(50% + 2px);width:24px;height:34px;animation-delay:.35s}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .skl-ring{position:absolute;width:44px;height:44px;border:2.5px dashed;border-radius:50%;animation:invSpin 5s linear infinite}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art .skl-star{width:18px;height:18px;clip-path:polygon(50% 0%,63% 35%,100% 50%,63% 65%,50% 100%,37% 65%,0% 50%,37% 35%);animation:invSpin 3.5s linear infinite}
@keyframes invWepGleam{0%,100%{filter:brightness(1)}50%{filter:brightness(1.28)}}
@keyframes invArc{0%,100%{transform:translateX(0);opacity:.45}50%{transform:translateX(5px);opacity:1}}
@keyframes invFloat{0%,100%{translate:0 0}50%{translate:0 -5px}}
@keyframes invPulse{0%,100%{scale:.95;opacity:.85}50%{scale:1.08;opacity:1}}
@keyframes invSpin{from{rotate:0deg}to{rotate:360deg}}
@keyframes invCardFloat{0%,100%{translate:0 0}50%{translate:0 -3px}}
@media(max-width:600px){:is(#armoryGrid,#heroGearGrid) .weapon-preview-canvas{width:100%;height:100px;display:block;image-rendering:auto;}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art{height:78px;min-height:78px}}
@media(prefers-reduced-motion:reduce){:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art *,:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art *::before,:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art *::after{animation:none!important;transition:none!important}}



/* ==========================================================================
   ARCVEL — IN-GAME DARK FANTASY UI REDESIGN
   Visual-only skin; existing IDs, events, canvas and game state are retained.
   ========================================================================== */
:root{
 --bf-ink:#050b10;--bf-deep:#08151b;--bf-panel:#0c2026;--bf-panel2:#112b30;
 --bf-line:#31564d;--bf-mint:#83dfbf;--bf-cyan:#8fe4e8;--bf-gold:#e9c879;
 --bf-muted:#9db8b0;--bf-red:#d66b70;--bf-purple:#b18ae7;
}
body{background:radial-gradient(ellipse at 50% -15%,#1b4038 0,transparent 48%),linear-gradient(180deg,#071219,#050b10 80%);color:#e9f6ed}
#gameShell{max-width:1320px;padding:18px clamp(10px,2vw,28px) 30px}
#gameShell>header{padding:12px 16px;background:linear-gradient(110deg,#0c2228,#09161d);border:1px solid #31564d;border-bottom:3px solid #4b8069;box-shadow:0 12px 35px #0008}
header strong{color:#b5f1dc;text-shadow:0 0 16px #6ad6b455;letter-spacing:2px}
header small{color:#91b2a6}
.gameFoxLogo{filter:drop-shadow(0 0 8px #66c9b655)}
.topActions{flex-wrap:wrap;align-items:center}
button{border-radius:2px;border:1px solid #42685b;background:linear-gradient(180deg,#17343a,#0d2229);color:#e4f5e9;box-shadow:2px 2px #03090d;transition:transform .16s ease,border-color .16s ease,filter .16s ease}
button:hover:not(:disabled){background:linear-gradient(180deg,#245047,#14352f);border-color:#8cdbb8;filter:brightness(1.08)}
button:active:not(:disabled){transform:translate(1px,2px);box-shadow:none}
button:disabled{opacity:.45;cursor:not-allowed}
kbd{background:#071219;border:1px solid #47685d;border-radius:2px;color:#e8d39a}
.hud{padding:13px 15px;background:linear-gradient(90deg,#0c2026,#102b2d,#0c2026);border:1px solid #34594f;border-bottom:2px solid #527d66;box-shadow:0 8px 20px #0006;color:#c1d7cc}
.hud span{color:#9ebdb0;letter-spacing:1.5px;font-weight:800}
.hud b{color:#f0d18a}
.bar{height:14px;background:#071318;border:1px solid #527466;border-radius:1px;box-shadow:inset 0 2px 5px #000}
.bar i{background:linear-gradient(90deg,#278d64,#8de5a9);box-shadow:0 0 10px #62dca777}
.bar.boss i{background:linear-gradient(90deg,#8f273e,#f07c65);box-shadow:0 0 10px #ed5a5a77}
#shieldStatus{color:#a7e9d0}
canvas{border:3px solid #456d5c;border-radius:2px;background:#101e25;box-shadow:0 18px 48px #000b,0 0 0 1px #142c2b;image-rendering:pixelated}
.under{padding:12px 15px 18px;background:linear-gradient(90deg,#0b1d22,#0e272a,#0b1d22);border:1px solid #294d45;border-top:0}
.mission b{color:#e7d39d;letter-spacing:.5px}
.mission span{color:#a8c2b6}
.skillHints{color:#b7ead8}
.guide{background:#0c2026;border:1px solid #34594f;border-radius:2px;box-shadow:5px 5px #03090d}
.guide h2{color:#9ee5c5}.guide h3{color:#e9ca87}.guide p{color:#bed0c6}
.mobileControls{z-index:8}
.mobileControls button{border-radius:2px;border:2px solid #4b7567;background:linear-gradient(145deg,#173c3d,#0a2028);box-shadow:3px 3px #02080c, inset 0 0 12px #7ce0c122;color:#e9f9ed;backdrop-filter:blur(8px)}
.mobileControls button small{color:#a9d9c4}
.joystickBase{border:2px solid #4b7567!important;background:radial-gradient(circle,#1b403b,#09171d 72%)!important;box-shadow:0 0 0 5px #0a171b99,0 8px 20px #0009!important}
.joystickKnob{background:linear-gradient(145deg,#b5efd4,#438d76)!important;border:2px solid #e4ffe9!important;box-shadow:0 0 16px #72d6b788!important}
.modal{background:rgba(1,7,10,.88);backdrop-filter:blur(9px)}
.panel{max-width:760px;background:linear-gradient(145deg,#10272d,#09171e);border:2px solid #527d68;border-radius:2px;padding:clamp(18px,3vw,30px);box-shadow:8px 8px #02070b,0 0 55px #000c,inset 0 0 35px #67d5a00b}
.panel:before{content:"";position:absolute;inset:7px;border:1px solid #31574b;pointer-events:none}
.panel h2{color:#a9ecd0;text-shadow:2px 2px #071217;letter-spacing:2px}
.panel h3{color:#e8ce91}
.panel p{color:#b8cec2}
.panel .eyebrow{color:#e2c47f;letter-spacing:2px}
.panel button{position:relative;z-index:1}
.close{border-color:#6d5146;background:#3b2024;color:#ffd9c4}
.primaryAction{background:linear-gradient(180deg,#f0d99b,#bf914b)!important;color:#18211b!important;border:2px solid #fff0c6!important;box-shadow:4px 4px #523b24!important;text-shadow:none!important}
.primaryAction:hover:not(:disabled){background:linear-gradient(180deg,#fff0b9,#d6aa62)!important}
.startPanel{text-align:center;max-width:700px;background:radial-gradient(ellipse at 50% 15%,#235447,#10282b 45%,#08151c 100%);padding:38px 28px}
.startFoxCrest{filter:drop-shadow(0 0 22px #73d8b877)}
.startPanel h1{font-size:clamp(28px,5vw,48px);letter-spacing:2px;color:#f3efda;text-shadow:4px 4px #071217}
.startPanel h1 em{color:#83e1c4;font-style:normal}
.startSubtitle{color:#d8c38e!important;letter-spacing:2px}
.startMenuActions{max-width:390px;margin:24px auto 0;display:grid;gap:10px}
.startMenuActions button{min-height:48px;letter-spacing:1px}
.menuFooter{display:block;margin-top:24px;color:#9cb6aa;line-height:1.8}
.settingsPanel,.tutorialPanel,.chapterIntroPanel,.gameOverPanel{background:linear-gradient(145deg,#112c30,#09171d)}
.settingRow,.settingVolume{border-bottom:1px solid #294b43;padding:12px 0;color:#c5d9ce}
input[type=range]{accent-color:#8ad9b5}
.tutorialGrid{gap:14px}
.tutorialGrid section{background:#0a1b21;border:1px solid #31564d;padding:12px}
.tutorialGrid h3{color:#e8cb8a}
#inventory .armoryPanel{width:min(1080px,100%);max-width:1080px;max-height:min(92vh,900px);overflow:auto;background:linear-gradient(145deg,#10292c,#09171d)}
.armoryHead{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:0 0 15px;border-bottom:1px solid #365c4e}
.armoryHead h2{color:#a8e8c8}
.armoryHead p{max-width:480px}
.soulBadge{display:inline-flex;gap:6px;padding:9px 12px;background:#152f2b;border:1px solid #8c7444;color:#e9d291}
.armoryTabs{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}
.armoryTab.active,.slotToggle.active{background:linear-gradient(180deg,#2a624f,#174237);border-color:#9ce3b9;color:#f2ffed;box-shadow:0 0 16px #69d7a033}
.skillSlotBar{background:#0a1b20;border:1px solid #34594f;padding:10px;margin-bottom:12px}
:is(#armoryGrid,#heroGearGrid){grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;max-height:48vh;padding:4px 8px 10px 2px}
.gearCard{position:relative;min-height:235px;padding:12px;background:linear-gradient(150deg,#153039,#0a1b22)!important;border:1px solid #42685b!important;border-radius:2px!important;box-shadow:3px 3px #03090d,inset 0 0 22px #69d6a00a}
.gearCard:before{content:"";position:absolute;inset:4px;border:1px solid #315347;pointer-events:none}
.gearCard:hover:not(:disabled){transform:translateY(-3px);box-shadow:4px 7px 18px #0009,0 0 16px #79dcb333}
.gearCard.selected{background:linear-gradient(150deg,#1d4b42,#102a2c)!important;border-color:#a2e6b8!important;box-shadow:0 0 0 1px #a2e6b8,0 0 18px #75dca044}
.gearCard.locked{filter:grayscale(.6);opacity:.56}
.gearName{color:#edf8eb}
.gearDesc{color:#abc6b9;line-height:1.45}
.gearStat{color:#efd18c}
.gearState{background:#18372f;color:#b8e8ce;border:1px solid #4b8069;border-radius:1px}
.gearCard.selected .gearState{background:#d7c18a;color:#17221b}
.gearCard .rarityBadge{border-radius:1px;letter-spacing:1px}
.gear-art.inventory-gear-art{height:116px;min-height:116px;margin:8px 0;background:radial-gradient(circle at 50% 50%,#1c5146,#08171d 75%)!important;border:1px solid #426c5a!important;border-radius:2px!important;overflow:hidden;display:flex!important;visibility:visible!important;opacity:1!important}
:is(#armoryGrid,#heroGearGrid) .gear-art.inventory-gear-art>*{visibility:visible;opacity:1}
#rarityBar{display:flex;gap:8px;flex-wrap:wrap;padding:12px;background:#091a1f;border:1px solid #31564d}
#rarityBar span{padding:6px 9px;background:#122a2d;border:1px solid #365d50;border-radius:1px}
#gachaDiceModal{background:radial-gradient(ellipse at 50% 40%,#173e37,#03090d 75%)!important}
.diceRollStage,.diceRevealStage{color:#e8f8eb}
.diceCountdownRing{border-color:#e8cf8e!important;box-shadow:0 0 32px #e8cf8e55}
.diceRevealCard{background:linear-gradient(145deg,#17352f,#09181d)!important;border:2px solid #7ccba6!important;border-radius:2px!important;box-shadow:8px 8px #02070b,0 0 45px #69d9a033!important}
#revealItemIcon .weapon-preview-canvas{width:100%;height:100%;min-height:100px;display:block;}
.revealItemIcon{background:radial-gradient(circle,#285f50,#0b1c21)!important;border:1px solid #77c6a1}
.rarityBadge{border-radius:1px}
.gameOverPanel{text-align:center}
.gameOverPanel h2{color:#ef9b8e}
#chapterIntro{z-index:12}
#inventory{z-index:30}
#gachaDiceModal{z-index:95}
@media(max-width:900px){
 :is(#armoryGrid,#heroGearGrid){grid-template-columns:repeat(2,minmax(0,1fr))}
 .armoryHead{align-items:flex-start;flex-direction:column}
}
@media(max-width:600px){
 #gameShell{padding:6px 7px 130px}
 #gameShell>header{align-items:flex-start;gap:10px;flex-direction:column;padding:10px}
 .topActions{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 .topActions button{font-size:10px;padding:8px 5px}
 .volumeControl{font-size:9px}
 .hud{grid-template-columns:1fr 1fr 1fr;padding:9px 7px;gap:6px}
 .hud>div:nth-child(2){font-size:8px}
 .hud span{font-size:8px}
 canvas{border-width:2px}
 .under{padding:9px 8px}
 #inventory .armoryPanel{padding:16px 12px;max-height:94vh}
 :is(#armoryGrid,#heroGearGrid){grid-template-columns:repeat(2,minmax(0,1fr));max-height:50vh;gap:8px}
 .gearCard{min-height:204px;padding:8px}
 .gearCard .gearName{font-size:11px}
 .gearCard .gearDesc{font-size:10px}
 .gear-art.inventory-gear-art{height:92px;min-height:92px}
 .armoryTabs button{flex:1;font-size:10px;padding:8px 5px}
 .summonControls{width:100%;display:flex;justify-content:space-between;gap:8px;align-items:center}
 .summonGearBtn{font-size:10px;padding:8px}
 .mobileControls{padding:0 12px;bottom:max(8px,env(safe-area-inset-bottom))}
 .mobileControls button{width:46px;height:46px}
}
@media(max-width:380px){
 :is(#armoryGrid,#heroGearGrid){grid-template-columns:1fr}
 .gearCard{min-height:190px}
 .gear-art.inventory-gear-art{height:100px;min-height:100px}
 .skillHints{font-size:10px;gap:6px}
}
@media(prefers-reduced-motion:reduce){
 *,*:before,*:after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}


.chapterRewardToast{
 position:fixed;left:50%;top:18%;z-index:80;display:grid;gap:5px;min-width:min(340px,calc(100vw - 36px));
 padding:17px 24px;text-align:center;pointer-events:none;opacity:0;transform:translate(-50%,-18px) scale(.88);
 background:linear-gradient(145deg,#173b35f5,#08171df5);border:2px solid #d7bd79;
 box-shadow:5px 5px #02070b,0 0 34px #79dfb344,inset 0 0 22px #d7bd7918;
 clip-path:polygon(0 0,calc(100% - 12px) 0,100% 12px,100% 100%,12px 100%,0 calc(100% - 12px));
}
.chapterRewardToast.show{animation:chapterRewardReveal 3.6s cubic-bezier(.2,.8,.2,1) both}
.rewardToastKicker{font-size:9px;letter-spacing:3px;color:#9fe4c2}
.chapterRewardToast strong{font:16px 'Jersey 10','Courier New',monospace;color:#f5e4b2;text-shadow:2px 2px #091319}
.rewardToastSoul{font-size:25px;color:#f4d27f;text-shadow:0 0 15px #e9c87999}
.chapterRewardToast small{font-size:10px;letter-spacing:2px;color:#b8d2c5}
.chapterRewardToast small b{color:#f4d27f;font-size:14px}
@keyframes chapterRewardReveal{
 0%{opacity:0;transform:translate(-50%,-18px) scale(.88)}
 12%,76%{opacity:1;transform:translate(-50%,0) scale(1)}
 100%{opacity:0;transform:translate(-50%,-8px) scale(.98)}
}
@media(max-width:600px){.chapterRewardToast{top:13%;min-width:0;width:calc(100vw - 40px);padding:14px 12px}.chapterRewardToast strong{font-size:12px}}
@media(prefers-reduced-motion:reduce){.chapterRewardToast.show{animation:none;opacity:1;transform:translate(-50%,0)}}


/* === V3 PATCH: CLOSE BUTTON & REALM VILLAGE BACKGROUND === */
.panel {
  position: relative !important;
}

.panel > .close {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  left: auto !important;
  z-index: 30 !important;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #3b2024;
  border: 1.5px solid #e06c75;
  color: #ffd9c4;
}

.armoryHead {
  padding-right: 48px !important;
}

body {
  background-color: #071219 !important;
  background-image:
    radial-gradient(ellipse at 50% 45%, rgba(7, 18, 25, 0.22) 0%, rgba(5, 11, 16, 0.62) 100%),
    url("assets/realm_village_bg.png") !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
  image-rendering: pixelated;
}

#gameShell {
  position: relative;
  z-index: 2;
}


/* === V4 & V5 PATCH: COMPACT TOP HEADER/HUD & ASPECT-PRESERVED MOBILE VIEWPORT === */
@media (max-width: 768px) {
  #gameShell {
    width: 100% !important;
    max-width: 100% !important;
    padding: max(2px, env(safe-area-inset-top)) 0 calc(200px + env(safe-area-inset-bottom)) !important;
    margin: 0 !important;
  }

  /* 1 & 2. Move top header upward and make it ultra-compact on mobile */
  #gameShell > header {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin: 0 4px 2px !important;
    padding: 3px 6px !important;
    gap: 4px !important;
    min-height: 30px !important;
    border-radius: 4px !important;
  }

  .headerBrand {
    gap: 5px !important;
    flex: 0 0 auto !important;
  }

  .headerBrand .backHome {
    margin-right: 2px !important;
    padding: 3px 5px !important;
    font-size: 8.5px !important;
    letter-spacing: 0.4px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  /* Hide redundant small title/logo in top bar on narrow mobile to keep header 1 compact row */
  .headerBrand .gameFoxLogo,
  .headerBrand > div {
    display: none !important;
  }

  .topActions {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: auto !important;
    flex: 1 1 auto !important;
    gap: 3px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
  }
  .topActions::-webkit-scrollbar {
    display: none !important;
  }

  .topActions button,
  .topActions .volumeControl {
    padding: 3px 5px !important;
    min-height: 24px !important;
    height: 24px !important;
    font-size: 8.5px !important;
    letter-spacing: 0.2px !important;
    border-radius: 4px !important;
    white-space: nowrap !important;
    gap: 3px !important;
    flex: 0 0 auto !important;
  }

  .topActions button kbd {
    display: none !important;
  }

  .topActions .volumeControl {
    padding: 0 4px !important;
    gap: 3px !important;
  }

  .topActions .volumeControl input[type="range"] {
    width: 30px !important;
    height: 12px !important;
    margin: 0 !important;
  }

  /* 2, 3 & 4. Compact HUD bar & tighter spacing between HUD and game canvas */
  .hud {
    grid-template-columns: 1fr 1.15fr 1fr !important;
    gap: 5px !important;
    margin: 0 4px 2px !important;
    padding: 3px 6px !important;
    border-radius: 4px !important;
    font-size: 8.5px !important;
    line-height: 1.15 !important;
  }

  .hud > div:nth-child(2) {
    gap: 1px !important;
    padding: 0 2px !important;
  }

  .hud span {
    margin-bottom: 2px !important;
    font-size: 8px !important;
    letter-spacing: 0.4px !important;
    line-height: 1.1 !important;
  }

  .hud b {
    font-size: 8.5px !important;
    line-height: 1.1 !important;
  }

  .hud .bar {
    height: 7px !important;
    border-radius: 2px !important;
  }

  .hud .shieldStatus {
    padding: 1px 5px !important;
    gap: 4px !important;
    font-size: 7.5px !important;
    line-height: 1.1 !important;
  }

  /* 3 & Visual Requirements: Prominent gameplay canvas with preserved 16:9 pixel-art aspect ratio (no stretching/squashing) */
  canvas#game {
    width: 100% !important;
    max-width: 100vw !important;
    height: auto !important;
    aspect-ratio: auto !important; /* use the canvas' own width/height attributes (JS grows height on tall phones) */
    object-fit: fill !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-top-width: 2px !important;
    border-bottom-width: 2px !important;
    border-radius: 0 !important;
    margin: 0 auto !important;
    display: block !important;
  }

  .under {
    margin: 2px 4px 0 !important;
    padding: 4px 7px !important;
    border-radius: 4px !important;
    gap: 4px !important;
  }

  .mission b {
    font-size: 10.5px !important;
    line-height: 1.2 !important;
  }

  .mission span,
  .skillHints {
    font-size: 9px !important;
    line-height: 1.2 !important;
  }

  /* 5. Keep mobile controls and skill buttons comfortable and responsive */
  .mobileControls {
    left: 4px !important;
    right: 4px !important;
    bottom: calc(6px + env(safe-area-inset-bottom)) !important;
    padding: 8px 10px !important;
  }
}

@media (max-width: 400px) {
  #gameShell > header {
    padding: 2px 4px !important;
    gap: 2px !important;
  }

  .headerBrand .backHome {
    padding: 2px 4px !important;
    font-size: 8px !important;
  }

  .topActions {
    gap: 2px !important;
  }

  .topActions button,
  .topActions .volumeControl {
    padding: 2px 4px !important;
    min-height: 22px !important;
    height: 22px !important;
    font-size: 7.8px !important;
  }

  .topActions .volumeControl input[type="range"] {
    width: 22px !important;
  }
}


/* === V6 PATCH: RAISE MOBILE CONTROLS (portrait) — canvas untouched, 16:9 preserved ===
   --ctrl-bottom / --ctrl-pad are set by a tiny script in game.html so the controls sit
   just under the OBJECTIVE panel instead of being pinned to the very bottom. */
@media (max-width: 768px) and (orientation: portrait) {
  #gameShell {
    padding-bottom: var(--ctrl-pad, calc(200px + env(safe-area-inset-bottom))) !important;
  }
  .mobileControls {
    bottom: var(--ctrl-bottom, calc(6px + env(safe-area-inset-bottom))) !important;
  }
}


/* === V6: gacha reveal uses the same animated catalog artwork as the armory/website === */
#revealItemIcon .gear-art.inventory-gear-art{
 position:relative;display:flex;align-items:center;justify-content:center;
 width:100%;height:78px;min-height:78px;margin:5px 0 7px;padding:0;
 border:1px solid rgba(148,163,184,.25);border-radius:9px;overflow:hidden;
 background:radial-gradient(circle at 50% 55%,rgba(125,211,252,.18),rgba(7,14,28,.88) 75%);
 image-rendering:pixelated;isolation:isolate;flex:none;
}
#revealItemIcon .gear-art.inventory-gear-art .wep-hilt{position:absolute;left:22px;top:35px;width:12px;height:8px;border-radius:2px}
#revealItemIcon .gear-art.inventory-gear-art .wep-guard{position:absolute;left:33px;top:29px;width:5px;height:20px;border-radius:2px}
#revealItemIcon .gear-art.inventory-gear-art .wep-blade{position:absolute;left:38px;top:34px;width:62px;height:10px;clip-path:polygon(0 18%,82% 18%,100% 50%,82% 82%,0 82%);animation:invWepGleam 2.6s ease-in-out infinite}
#revealItemIcon .gear-art.inventory-gear-art .wep-blade.broadsword-thick{height:14px;top:32px}
#revealItemIcon .gear-art.inventory-gear-art .wep-blade.saber-curve{transform:none!important;transform-origin:left center;rotate:0deg!important;clip-path:polygon(0 20%,84% 20%,100% 50%,84% 80%,0 80%)}
#revealItemIcon .gear-art.inventory-gear-art .wep-blade.ice-edged{clip-path:polygon(0 20%,65% 0,85% 22%,100% 50%,85% 78%,65% 100%,0 80%)}
#revealItemIcon .gear-art.inventory-gear-art .wep-blade.flame-edged{clip-path:polygon(0 15%,40% 0,65% 20%,85% 5%,100% 50%,85% 95%,65% 80%,40% 100%,0 85%)}
#revealItemIcon .gear-art.inventory-gear-art .wep-blade.dragon-serrated{height:12px;top:33px;clip-path:polygon(0 15%,35% 0,55% 22%,78% 4%,100% 50%,78% 96%,55% 78%,35% 100%,0 85%)}
#revealItemIcon .gear-art.inventory-gear-art .wep-split-top,#revealItemIcon .gear-art.inventory-gear-art .wep-split-bot{position:absolute;left:38px;width:64px;height:5px;clip-path:polygon(0 0,88% 0,100% 100%,0 100%)}
#revealItemIcon .gear-art.inventory-gear-art .wep-split-top{top:31px}#revealItemIcon .gear-art.inventory-gear-art .wep-split-bot{top:42px}
#revealItemIcon .gear-art.inventory-gear-art .wep-split-core{position:absolute;left:42px;top:37px;width:54px;height:4px;background:#fae8ff;box-shadow:0 0 8px #e879f9;animation:invPulse 1.4s ease-in-out infinite}
#revealItemIcon .gear-art.inventory-gear-art .wep-star-tip{position:absolute;right:16px;top:34px;width:10px;height:10px;transform:rotate(45deg);animation:invSpin 4s linear infinite}
#revealItemIcon .gear-art.inventory-gear-art .wep-fang-tip{position:absolute;right:15px;top:32px;width:0;height:0;border-top:7px solid transparent;border-bottom:7px solid transparent;border-left:14px solid #fef08a}
#revealItemIcon .gear-art.inventory-gear-art .wep-crystal-shard{position:absolute;right:24px;top:16px;width:8px;height:8px;background:#e0f2fe;transform:rotate(45deg);animation:invFloat 2s ease-in-out infinite}
#revealItemIcon .gear-art.inventory-gear-art .wep-ember-dot{position:absolute;right:22px;top:18px;width:6px;height:6px;background:#fde047;border-radius:50%;box-shadow:0 0 8px #f97316;animation:invFloat 1.7s ease-in-out infinite}
#revealItemIcon .gear-art.inventory-gear-art .wep-arc{position:absolute;right:14px;top:14px;width:30px;height:50px;border-right:3px solid rgba(186,230,253,.55);border-radius:0 100% 100% 0/0 50% 50% 0;opacity:.75;animation:invArc 2.4s ease-in-out infinite}
#revealItemIcon .gear-art.inventory-gear-art .arc-gold{border-right-color:#fde047}#revealItemIcon .gear-art.inventory-gear-art .arc-void{border-right-color:#e879f9;width:36px;height:56px;top:11px}#revealItemIcon .gear-art.inventory-gear-art .arc-fire{border-right-color:#fb923c}#revealItemIcon .gear-art.inventory-gear-art .arc-ice{border-right-color:#7dd3fc}#revealItemIcon .gear-art.inventory-gear-art .arc-leaf{border-right-color:#6ee7b7}#revealItemIcon .gear-art.inventory-gear-art .arc-bronze{border-right-color:#fbbf24}
#revealItemIcon .gear-art.inventory-gear-art .wep-glow{position:absolute;inset:8px;border-radius:999px;background:radial-gradient(circle,rgba(250,204,21,.16),transparent 70%);pointer-events:none}
#revealItemIcon .gear-art.inventory-gear-art .arm-art{animation:invCardFloat 4.8s ease-in-out infinite}
#revealItemIcon .gear-art.inventory-gear-art .arm-aura{position:absolute;width:54px;height:62px;border-radius:50%;border:2px dashed rgba(232,121,249,.65);animation:invSpin 9s linear infinite}
#revealItemIcon .gear-art.inventory-gear-art .arm-crystals{position:absolute;inset:0;background:radial-gradient(circle at 26% 36%,#e879f9 2px,transparent 3px),radial-gradient(circle at 74% 36%,#e879f9 2px,transparent 3px);animation:invPulse 2s ease-in-out infinite}
#revealItemIcon .gear-art.inventory-gear-art .arm-cape{position:absolute;top:28px;width:38px;height:36px;border-radius:6px;opacity:.75}
#revealItemIcon .gear-art.inventory-gear-art .arm-crown{position:absolute;top:10px;width:16px;height:6px;border-radius:2px;box-shadow:0 0 8px currentColor}
#revealItemIcon .gear-art.inventory-gear-art .arm-helmet{position:relative;top:-11px;width:24px;height:18px;border:2px solid #bae6fd;border-radius:3px;z-index:2}
#revealItemIcon .gear-art.inventory-gear-art .arm-ear-l,#revealItemIcon .gear-art.inventory-gear-art .arm-ear-r{position:absolute;top:-7px;width:7px;height:8px;border:1.5px solid #bae6fd}
#revealItemIcon .gear-art.inventory-gear-art .arm-ear-l{left:1px;transform:rotate(-10deg)}#revealItemIcon .gear-art.inventory-gear-art .arm-ear-r{right:1px;transform:rotate(10deg)}
#revealItemIcon .gear-art.inventory-gear-art .arm-eye-l,#revealItemIcon .gear-art.inventory-gear-art .arm-eye-r{position:absolute;top:6px;width:3px;height:4px;background:#0f172a}#revealItemIcon .gear-art.inventory-gear-art .arm-eye-l{left:5px}#revealItemIcon .gear-art.inventory-gear-art .arm-eye-r{right:5px}
#revealItemIcon .gear-art.inventory-gear-art .arm-chest{position:absolute;bottom:14px;width:26px;height:20px;border:2px solid #0284c7;border-radius:3px;z-index:2}
#revealItemIcon .gear-art.inventory-gear-art .arm-belt{position:absolute;left:0;right:0;bottom:3px;height:4px}
#revealItemIcon .gear-art.inventory-gear-art .arm-pauldron-l,#revealItemIcon .gear-art.inventory-gear-art .arm-pauldron-r{position:absolute;bottom:25px;width:9px;height:10px;border:1.5px solid #0284c7;border-radius:2px;z-index:3}
#revealItemIcon .gear-art.inventory-gear-art .arm-pauldron-l{left:calc(50% - 21px)}#revealItemIcon .gear-art.inventory-gear-art .arm-pauldron-r{right:calc(50% - 21px)}
#revealItemIcon .gear-art.inventory-gear-art .arm-leg-l,#revealItemIcon .gear-art.inventory-gear-art .arm-leg-r{position:absolute;bottom:5px;width:8px;height:10px;border-radius:1px;z-index:1}#revealItemIcon .gear-art.inventory-gear-art .arm-leg-l{left:calc(50% - 10px)}#revealItemIcon .gear-art.inventory-gear-art .arm-leg-r{right:calc(50% - 10px)}
#revealItemIcon .gear-art.inventory-gear-art .skl-lance{width:56px;height:10px;clip-path:polygon(0 25%,78% 25%,100% 50%,78% 75%,0 75%);animation:invWepGleam 2s ease-in-out infinite}
#revealItemIcon .gear-art.inventory-gear-art .skl-shard{position:absolute;width:7px;height:7px;background:#e0f2fe;transform:rotate(45deg)}#revealItemIcon .gear-art.inventory-gear-art .skl-shard.s1{top:18px;right:26px;animation:invFloat 1.8s ease-in-out infinite}#revealItemIcon .gear-art.inventory-gear-art .skl-shard.s2{bottom:18px;right:32px;animation:invFloat 2.2s ease-in-out infinite reverse}
#revealItemIcon .gear-art.inventory-gear-art .skl-flame-outer{width:34px;height:34px;border-radius:50% 50% 50% 15%;transform:rotate(-45deg);animation:invPulse 1.5s ease-in-out infinite}
#revealItemIcon .gear-art.inventory-gear-art .skl-flame-inner{position:absolute;width:16px;height:16px;border-radius:50% 50% 50% 15%;transform:rotate(-45deg)}
#revealItemIcon .gear-art.inventory-gear-art .skl-bolt{width:54px;height:8px;clip-path:polygon(0 45%,30% 0,55% 38%,100% 25%,65% 100%,42% 62%);animation:invPulse 1.1s ease-in-out infinite}
#revealItemIcon .gear-art.inventory-gear-art .skl-wind-arc{position:absolute;width:30px;height:44px;border-right:3px solid;border-radius:0 100% 100% 0/0 50% 50% 0;animation:invArc 2s ease-in-out infinite}#revealItemIcon .gear-art.inventory-gear-art .skl-wind-arc.w1{left:calc(50% - 10px)}#revealItemIcon .gear-art.inventory-gear-art .skl-wind-arc.w2{left:calc(50% + 2px);width:24px;height:34px;animation-delay:.35s}
#revealItemIcon .gear-art.inventory-gear-art .skl-ring{position:absolute;width:44px;height:44px;border:2.5px dashed;border-radius:50%;animation:invSpin 5s linear infinite}
#revealItemIcon .gear-art.inventory-gear-art .skl-star{width:18px;height:18px;clip-path:polygon(50% 0%,63% 35%,100% 50%,63% 65%,50% 100%,37% 65%,0% 50%,37% 35%);animation:invSpin 3.5s linear infinite}
@media(max-width:600px){#revealItemIcon .gear-art.inventory-gear-art{height:78px;min-height:78px}}
@media(prefers-reduced-motion:reduce){#revealItemIcon .gear-art.inventory-gear-art *,#revealItemIcon .gear-art.inventory-gear-art *::before,#revealItemIcon .gear-art.inventory-gear-art *::after{animation:none!important;transition:none!important}}
#revealItemIcon .gear-art.inventory-gear-art>*{visibility:visible;opacity:1}

/* V6: enlarge + center the reveal artwork (uniform scale, never stretched) */
#revealItemIcon{background:none!important;border:0!important;margin:6px 0 4px!important;padding:0!important;font-size:0;line-height:0}
#revealItemIcon .revealArtFrame{display:flex;align-items:center;justify-content:center;width:100%;height:138px}
#revealItemIcon .gear-art.inventory-gear-art{
 flex:none;width:124px!important;min-width:124px!important;height:78px!important;min-height:78px!important;
 margin:0!important;transform:scale(1.7)!important;transform-origin:center center}
@media(max-width:340px){#revealItemIcon .revealArtFrame{height:120px}#revealItemIcon .gear-art.inventory-gear-art{transform:scale(1.5)!important}}

/* Armor reward preview: clothing only, never a replacement hero */
.armoutfit-art{position:relative;overflow:hidden;background:radial-gradient(ellipse at 50% 60%,#183b39,#07151d 75%)!important}
.armoutfit-art *{position:absolute;box-sizing:border-box}
.armoutfit-art .outfit-cape{left:calc(50% - 20px);top:35px;width:40px;height:49px;clip-path:polygon(10% 0,90% 0,100% 100%,50% 83%,0 100%);opacity:.8}
.armoutfit-art .outfit-leg{top:68px;width:15px;height:29px;border:2px solid rgba(255,255,255,.35)}
.armoutfit-art .outfit-leg.left{left:calc(50% - 17px)}.armoutfit-art .outfit-leg.right{left:calc(50% + 2px)}
.armoutfit-art .outfit-sleeve{top:39px;width:15px;height:29px;transform:rotate(14deg)}
.armoutfit-art .outfit-sleeve.left{left:calc(50% - 31px)}.armoutfit-art .outfit-sleeve.right{left:calc(50% + 16px);transform:rotate(-14deg)}
.armoutfit-art .outfit-body{left:calc(50% - 20px);top:30px;width:40px;height:43px;background:var(--cloth);border:3px solid var(--trim);clip-path:polygon(18% 0,82% 0,100% 100%,0 100%)}
.armoutfit-art .outfit-body:after{content:"";position:absolute;inset:5px 7px;background:repeating-linear-gradient(0deg,transparent 0 7px,rgba(255,255,255,.16) 7px 9px)}
.armoutfit-art .outfit-belt{left:calc(50% - 20px);top:61px;width:40px;height:5px;background:#422c22;border-top:2px solid #fbbf24}
.armoutfit-art .outfit-buckle{left:calc(50% - 3px);top:59px;width:6px;height:8px;background:#fde68a;border:1px solid #92400e}
.armoutfit-art .outfit-shoulder{top:32px;width:17px;height:14px;border:2px solid rgba(255,255,255,.55);border-radius:4px}
.armoutfit-art .outfit-shoulder.left{left:calc(50% - 30px)}.armoutfit-art .outfit-shoulder.right{left:calc(50% + 13px)}
.armoutfit-art .outfit-glint{left:calc(50% - 2px);top:39px;width:4px;height:4px;background:#fff7ae;box-shadow:0 0 10px #fff}

/* Hero signature skills: animated identity art and a distinct DEFAULT tag. */
:is(#armoryGrid,#heroGearGrid) .gearCard .rarityBadge.default-rarity{background:linear-gradient(100deg,#fbbf24,#fde68a);color:#241600;border:1px solid #fff0a6;box-shadow:0 0 10px rgba(251,191,36,.45)}
:is(#armoryGrid,#heroGearGrid) .gearCard.rarity-default{border-color:#fbbf24!important;background:linear-gradient(135deg,#292653,#20234f)!important;box-shadow:inset 0 0 16px rgba(251,191,36,.12)}
:is(#armoryGrid,#heroGearGrid) .default-skill-art{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;background:radial-gradient(ellipse at center,rgba(129,140,248,.32),rgba(10,15,45,.92) 70%)}
:is(#armoryGrid,#heroGearGrid) .default-skill-art .default-core{position:relative;z-index:2;font-size:32px;filter:drop-shadow(0 0 10px #c4b5fd);animation:defaultSkillPulse 1.8s ease-in-out infinite}
:is(#armoryGrid,#heroGearGrid) .default-skill-art i{position:absolute;width:12px;height:12px;border:2px solid #c4b5fd;border-radius:50%;opacity:0;animation:defaultSkillOrbit 2.4s ease-out infinite}
:is(#armoryGrid,#heroGearGrid) .default-skill-art i:nth-of-type(2){animation-delay:.8s}
:is(#armoryGrid,#heroGearGrid) .default-skill-art i:nth-of-type(3){animation-delay:1.6s}
:is(#armoryGrid,#heroGearGrid) .default-rain .default-core{filter:drop-shadow(0 0 12px #86efac)}
:is(#armoryGrid,#heroGearGrid) .default-rain i{border-color:#86efac;border-radius:2px;transform:rotate(45deg)}
@keyframes defaultSkillPulse{0%,100%{transform:scale(.88);filter:drop-shadow(0 0 5px #a78bfa)}50%{transform:scale(1.16);filter:drop-shadow(0 0 16px #c4b5fd)}}
@keyframes defaultSkillOrbit{0%{transform:scale(.25) translateY(0);opacity:0}25%{opacity:.9}100%{transform:scale(2.5) translateY(-16px);opacity:0}}


/* V26 FIX — make armor outfit silhouettes visible in the Armory grid. */
:is(#armoryGrid,#heroGearGrid) .armoutfit-art{display:block!important;position:relative!important;width:100%;height:78px;min-height:78px;overflow:hidden!important;border:1px solid rgba(148,163,184,.22);border-radius:7px;background:radial-gradient(ellipse at 50% 58%,#274b67 0%,#101a35 72%)!important;isolation:isolate}
:is(#armoryGrid,#heroGearGrid) .armoutfit-art .outfit-cape{z-index:0;opacity:.95}
:is(#armoryGrid,#heroGearGrid) .armoutfit-art .outfit-leg{z-index:1}:is(#armoryGrid,#heroGearGrid) .armoutfit-art .outfit-sleeve{z-index:2}
:is(#armoryGrid,#heroGearGrid) .armoutfit-art .outfit-body{z-index:3;box-shadow:inset 0 0 0 1px #ffffff22}
:is(#armoryGrid,#heroGearGrid) .armoutfit-art .outfit-belt{z-index:5}:is(#armoryGrid,#heroGearGrid) .armoutfit-art .outfit-buckle{z-index:6}
:is(#armoryGrid,#heroGearGrid) .armoutfit-art .outfit-shoulder{z-index:4}
:is(#armoryGrid,#heroGearGrid) .armoutfit-art:before{content:"";position:absolute;z-index:7;left:calc(50% - 12px);top:7px;width:24px;height:22px;border:3px solid #cbd5e1;border-radius:8px 8px 5px 5px;background:linear-gradient(135deg,#e2e8f0 0 24%,#64748b 25% 70%,#334155 71%);clip-path:polygon(18% 0,82% 0,100% 35%,88% 100%,12% 100%,0 35%);filter:drop-shadow(0 2px 3px #0009)}
:is(#armoryGrid,#heroGearGrid) .armoutfit-art:after{content:"";position:absolute;z-index:8;left:calc(50% - 7px);top:18px;width:14px;height:4px;background:#0f172a;border:1px solid #f8fafc88;border-radius:2px}
:is(#armoryGrid,#heroGearGrid) .armoutfit-art.tier-epic{box-shadow:inset 0 0 14px #fb718533}:is(#armoryGrid,#heroGearGrid) .armoutfit-art.tier-legend{box-shadow:inset 0 0 14px #fde04744}:is(#armoryGrid,#heroGearGrid) .armoutfit-art.tier-mythic{box-shadow:inset 0 0 16px #c084fc55}

/* ======================================================================
   ARCVEL V30.22 — LAPTOP / DESKTOP UI POLISH
   Visual/layout only. No gameplay IDs, controls, equipment, or combat logic.
   ====================================================================== */
@media (min-width: 701px) and (max-width: 1400px) {
  #gameShell {
    width: min(100%, 1240px);
    max-width: 1240px;
    padding: 18px 22px 28px;
  }

  #gameShell > header {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(620px, 780px);
    align-items: center;
    gap: 22px;
    padding: 14px 18px !important;
    margin-bottom: 12px;
  }

  .headerBrand {
    min-width: 0;
    gap: 12px;
  }

  .headerBrand .gameFoxLogo {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .headerBrand .gameFoxLogo .ear-l { left: 7px; top: 4px; width: 8px; height: 12px; }
  .headerBrand .gameFoxLogo .ear-r { right: 7px; top: 4px; width: 8px; height: 12px; }
  .headerBrand .gameFoxLogo .face { left: 7px; top: 13px; width: 25px; height: 17px; }
  .headerBrand .gameFoxLogo .eye-l { left: 4px; top: 5px; }
  .headerBrand .gameFoxLogo .eye-r { right: 4px; top: 5px; }
  .headerBrand .gameFoxLogo .nose { left: 10px; top: 10px; }
  .headerBrand .gameFoxLogo .scarf { left: 8px; top: 30px; width: 22px; height: 7px; }

  .headerBrand > div {
    min-width: 0;
  }

  .headerBrand > div strong,
  header strong {
    font-size: 28px !important;
    line-height: 1 !important;
    letter-spacing: 2px !important;
  }

  .headerBrand > div small,
  header small {
    display: block;
    margin-top: 4px;
    font-size: 12px !important;
    line-height: 1 !important;
    letter-spacing: 2.5px !important;
  }

  .backHome {
    font-size: 13px !important;
    padding: 7px 10px !important;
    margin-right: 3px !important;
    white-space: nowrap;
  }

  .topActions {
    width: 100%;
    max-width: 780px;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px !important;
    align-items: stretch;
    justify-self: end;
  }

  .topActions button,
  .topActions .volumeControl {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    height: 40px;
    padding: 8px 10px !important;
    font-size: 12.5px !important;
    line-height: 1 !important;
    letter-spacing: .35px !important;
    justify-content: center;
  }

  .topActions .volumeControl {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
  }

  .topActions .volumeControl input[type="range"] {
    width: 78px;
    min-width: 55px;
  }

  .topActions button kbd {
    font-size: 10px;
    padding: 2px 5px;
  }

  .hud {
    padding: 12px 16px !important;
    gap: 22px !important;
    font-size: 13px !important;
  }

  .hud span {
    font-size: 13px !important;
    letter-spacing: 1px !important;
  }

  .hud b {
    font-size: 17px !important;
  }

  .hud .bar {
    height: 16px !important;
  }

  #shieldStatus {
    font-size: 13px !important;
    padding: 6px 12px !important;
  }

  .under {
    padding: 12px 14px 16px !important;
    gap: 24px !important;
  }

  .mission b {
    font-size: 16px !important;
    line-height: 1.25 !important;
  }

  .mission span,
  .skillHints {
    font-size: 13px !important;
    line-height: 1.35 !important;
  }

  .skillHints {
    gap: 18px !important;
  }
}

@media (min-width: 701px) and (max-width: 1100px) {
  #gameShell > header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .topActions {
    max-width: none;
    justify-self: stretch;
  }
}


/* Mobile HUD/header cleanup — desktop styles remain unchanged */
@media (max-width:700px){
  #gameShell>header{display:flex;flex-direction:column;align-items:stretch;gap:8px;margin-bottom:14px}
  #gameShell .headerBrand{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0}
  #gameShell .topActions{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;width:100%}
  #gameShell .topActions button{font-size:10px;line-height:1.2;min-height:32px;padding:7px 9px;white-space:nowrap}
  #gameShell .volumeControl{font-size:10px;min-height:32px;display:flex;align-items:center;gap:4px}
  #gameShell .volumeControl input{width:54px}
  #gameShell .hud{grid-template-columns:minmax(0,1fr) minmax(0,1.25fr) minmax(0,1fr);gap:8px;margin-bottom:10px;font-size:10px}
  #gameShell .hud>div{min-width:0}
  #gameShell .hud>div:nth-child(2){padding:0 3px;line-height:1.35}
  #gameShell .hud span{font-size:10px;letter-spacing:.2px;margin-bottom:5px}
  #gameShell .hud b{font-size:10px;display:inline-block;overflow-wrap:normal}
  #gameShell .bar{height:10px}
  #gameShell #shieldStatus{margin-top:4px}
  #gameShell .under{padding-top:10px}
}
@media(max-width:390px){
  #gameShell .topActions button{font-size:10px;padding:7px 8px}
  #gameShell .hud{font-size:9px;gap:5px}
  #gameShell .hud span,#gameShell .hud b{font-size:9px}
}

/* Mobile follow-up: isolate brand from action buttons and enlarge HP bars.
   Desktop layout is intentionally untouched. */
@media (max-width:700px){
  #gameShell>header{
    display:flex!important;flex-direction:column!important;align-items:stretch!important;
    gap:7px!important;margin-bottom:10px!important;padding:8px 8px 0!important;
  }
  #gameShell .headerBrand{width:100%;justify-content:flex-start!important;min-height:30px;}
  #gameShell .headerBrand .gameHeroLogo,
  #gameShell .headerBrand>div{display:none!important;}
  #gameShell .backHome{display:inline-flex;align-items:center;min-height:30px;padding:6px 10px;}
  #gameShell .topActions{
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    width:100%!important;gap:6px!important;justify-content:stretch!important;
  }
  #gameShell .topActions button{width:100%;min-width:0;min-height:34px;padding:6px 4px!important;font-size:9px!important;}
  #gameShell .topActions .volumeControl{min-width:0;justify-content:center;gap:3px;font-size:9px!important;}
  #gameShell .topActions .volumeControl input{width:38px;min-width:0;}
  #gameShell .hud{margin-top:8px!important;padding:10px 8px!important;gap:8px!important;}
  #gameShell .hud span{font-size:11px!important;letter-spacing:.3px!important;margin-bottom:6px!important;}
  #gameShell .hud b{font-size:11px!important;}
  #gameShell .bar{height:14px!important;}
  #gameShell .hud>div:nth-child(2){line-height:1.4!important;}
}
@media(max-width:390px){
  #gameShell .topActions button{font-size:8px!important;padding:5px 2px!important;}
  #gameShell .hud{gap:5px!important;padding:10px 6px!important;}
  #gameShell .hud span,#gameShell .hud b{font-size:10px!important;}
  #gameShell .bar{height:13px!important;}
}

/* Mobile brand row: restore the Arcvel pixel logo and wordmark in the reserved top area. */
@media (max-width:700px){
  #gameShell>header{gap:8px!important;padding:8px 8px 0!important;}
  #gameShell .headerBrand{
    position:relative;display:flex!important;align-items:center;justify-content:center!important;
    width:100%;min-height:66px;padding:4px 54px 4px 54px;gap:9px;
  }
  #gameShell .headerBrand .backHome{position:absolute;left:0;top:50%;transform:translateY(-50%);z-index:2;}
  #gameShell .headerBrand .gameHeroLogo{display:inline-flex!important;width:42px;height:42px;flex:0 0 42px;}
  #gameShell .headerBrand .gameHeroLogo img{width:42px;height:42px;image-rendering:pixelated;}
  #gameShell .headerBrand>div{display:block!important;text-align:left;min-width:0;}
  #gameShell .headerBrand .arcvelBrandName{
    font-family:'Jersey 10','Courier New',monospace!important;font-size:15px!important;
    font-weight:700;letter-spacing:2px!important;line-height:1.45!important;
    color:#ffe18a;text-shadow:2px 2px 0 #10172d,-1px 0 #10172d;
    -webkit-font-smoothing:none;text-rendering:geometricPrecision;
  }
  #gameShell .headerBrand small{display:block;font-size:9px!important;letter-spacing:2px!important;line-height:1.5;color:#9fc9ff;}
}
@media(max-width:390px){
  #gameShell .headerBrand{min-height:60px;padding-left:48px;padding-right:48px;gap:7px;}
  #gameShell .headerBrand .gameHeroLogo,#gameShell .headerBrand .gameHeroLogo img{width:36px;height:36px;}
  #gameShell .headerBrand .gameHeroLogo{flex-basis:36px;}
  #gameShell .headerBrand .arcvelBrandName{font-size:13px!important;letter-spacing:1.5px!important;}
}


/* ARCVEL SOUL GACHA — Arcane Gate / Soul Crystal summon ritual */
#gachaDiceModal{overflow:hidden;background:radial-gradient(ellipse at 50% 44%,#24365f 0%,#111a36 38%,#070d20 76%,#030711 100%)!important}
#gachaDiceModal:before{content:"";position:absolute;inset:0;pointer-events:none;background:repeating-radial-gradient(circle at 50% 47%,transparent 0 42px,rgba(146,164,255,.055) 43px 44px,transparent 45px 78px);animation:gate-breathe 5s ease-in-out infinite}
.diceRollStage{position:relative;z-index:1;gap:15px}
.diceCountdownRing{width:48px;height:48px;border-width:1px;border-color:#b9a8ff!important;color:#f4eaff;box-shadow:0 0 22px #9877ff77!important;background:#1b1b3caa}
#diceCountdownNum{font-size:23px;color:#f2eaff}
.soulRitual{position:relative;width:min(300px,72vw);height:270px;display:grid;place-items:center;isolation:isolate;filter:drop-shadow(0 0 24px #8b5cf655)}
.ritual-orbit{position:absolute;width:210px;height:210px;border:1px solid rgba(167,139,250,.65);border-radius:50%;box-shadow:0 0 22px #8b5cf633,inset 0 0 22px #8b5cf622}
.orbit-one{transform:rotateX(68deg);animation:ritual-spin 7s linear infinite}
.orbit-two{width:176px;height:176px;border-color:rgba(125,211,252,.5);transform:rotateY(68deg) rotateZ(20deg);animation:ritual-spin-reverse 9s linear infinite}
.ritual-rune{position:absolute;color:#d8c8ff;font-size:42px;text-shadow:0 0 18px #a78bfa;animation:rune-pulse 2s ease-in-out infinite}
.soul-crystal{position:relative;z-index:2;width:86px;height:104px;display:grid;place-items:center;clip-path:polygon(50% 0,91% 24%,100% 70%,50% 100%,0 70%,9% 24%);background:linear-gradient(145deg,#e9e4ff 0%,#a78bfa 18%,#5b4bc4 48%,#1b2454 76%,#c4b5fd 100%);box-shadow:0 0 45px #a78bfa;animation:crystal-awaken 1.7s ease-in-out infinite}
.soul-crystal:before{content:"";position:absolute;inset:8px;clip-path:inherit;background:linear-gradient(135deg,#ffffffbb,#a78bfa33 48%,#0b153d99)}
.soul-crystal span{z-index:1;color:#fff7d6;font-size:34px;text-shadow:0 0 18px #fff,0 0 30px #c4b5fd}
.ritual-ground{position:absolute;bottom:23px;width:224px;height:40px;border:1px solid #a78bfa88;border-radius:50%;transform:rotateX(68deg);box-shadow:0 0 22px #8b5cf677,inset 0 0 18px #8b5cf655;animation:ground-pulse 1.7s ease-in-out infinite}
.soul-particle{position:absolute;z-index:3;width:5px;height:5px;border-radius:50%;background:#e9ddff;box-shadow:0 0 12px 3px #a78bfa;animation:particle-rise 2.2s ease-in-out infinite}
.particle-one{left:25%;top:65%;animation-delay:-.4s}.particle-two{right:24%;top:58%;animation-delay:-1.1s}.particle-three{left:34%;top:30%;animation-delay:-1.6s}.particle-four{right:34%;top:27%;animation-delay:-.8s}
.diceStatusText{color:#d9d1ff;letter-spacing:2px;font-size:11px;text-transform:uppercase;text-shadow:0 0 12px #9b87ff}
#skipGachaBtn{background:#171c3a;border-color:#9d8aff;color:#f0eaff}
.diceRevealCard.rarity-mythic{background:radial-gradient(circle at 50% 0%,#48245d,#15132d 65%)!important;border-color:#e879f9!important;box-shadow:0 0 70px #d946ef88!important}
.diceRevealCard.rarity-legend{background:radial-gradient(circle at 50% 0%,#59411c,#17182b 65%)!important;border-color:#fbbf24!important;box-shadow:0 0 55px #f59e0b66!important}
.diceRevealCard.rarity-epic{background:radial-gradient(circle at 50% 0%,#3b2868,#121a32 65%)!important;border-color:#a78bfa!important;box-shadow:0 0 50px #8b5cf666!important}
.diceRevealCard.rarity-rare{background:radial-gradient(circle at 50% 0%,#19476a,#101a31 65%)!important;border-color:#38bdf8!important}
@keyframes ritual-spin{to{transform:rotateX(68deg) rotateZ(360deg)}}
@keyframes ritual-spin-reverse{to{transform:rotateY(68deg) rotateZ(-340deg)}}
@keyframes crystal-awaken{0%,100%{transform:translateY(5px) scale(.96);filter:brightness(.9) drop-shadow(0 0 10px #8b5cf6)}50%{transform:translateY(-9px) scale(1.07);filter:brightness(1.3) drop-shadow(0 0 28px #c4b5fd)}}
@keyframes rune-pulse{0%,100%{opacity:.45;transform:scale(.9) rotate(-8deg)}50%{opacity:1;transform:scale(1.12) rotate(8deg)}}
@keyframes ground-pulse{0%,100%{opacity:.4;transform:rotateX(68deg) scale(.88)}50%{opacity:1;transform:rotateX(68deg) scale(1.08)}}
@keyframes particle-rise{0%{transform:translateY(25px) scale(.4);opacity:0}35%{opacity:1}100%{transform:translateY(-45px) scale(1.25);opacity:0}}
@keyframes gate-breathe{0%,100%{opacity:.35}50%{opacity:.9}}
@media(prefers-reduced-motion:reduce){.soulRitual *{animation:none!important}}
