/* 레이지 수동 조작 HUD v2 — 오른손 엄지 부채꼴 배치. 기존 css 뒤에 로드해서 위치·크기만 덮어씀. */
body.hud2{--ring:#e9e1cb73;--disc:radial-gradient(circle at 40% 30%,#2a3a3fcc,#0a1418e0 70%);--hot:#e0694d}
/* 테스트용 표시 숨김 (?debug=1 이면 보임) */
body.hud2:not(.hud-debug) #frameMonitor,body.hud2:not(.hud-debug) #break,body.hud2:not(.hud-debug) #aiPlay,body.hud2:not(.hud-debug) #sequenceStatus,body.hud2:not(.hud-debug) header #title,body.hud2:not(.hud-debug) header .brand{display:none!important}
/* 공통 버튼 모양: 보이는 원 + 아이콘 + 한글 라벨 */
body.hud2 #combatControls #attackPad,body.hud2 #combatControls #dash,body.hud2 #reloadGun,body.hud2 #weaponSwap,body.hud2 #combatControls #rage{position:fixed!important;display:grid!important;place-items:center;border-radius:50%!important;border:1.5px solid var(--ring)!important;background:var(--disc)!important;box-shadow:0 4px 14px #000a!important;color:#efe7d0!important;padding:0!important;touch-action:none;-webkit-tap-highlight-color:transparent;left:auto!important;top:auto!important;z-index:16}
body.hud2 .hud-label{position:absolute;bottom:-17px;left:50%;transform:translateX(-50%);font:700 11px/1 system-ui,sans-serif;letter-spacing:.5px;color:#e9e1cbcc;white-space:nowrap;text-shadow:0 1px 3px #000;pointer-events:none}
/* 1 공격 — 모서리, 제일 큼 */
body.hud2 #combatControls #attackPad{width:var(--atk);height:var(--atk);right:calc(var(--edge) + env(safe-area-inset-right))!important;bottom:calc(var(--edge) + 6px + env(safe-area-inset-bottom))!important;border-width:2px!important}
body.hud2 #combatControls #attackPad svg{width:56%!important;height:56%!important}
body.hud2 #attackPad .pad-chevron{top:7px!important;width:10px!important;height:10px!important;opacity:.9!important;border-color:#f0b48a!important}
body.hud2 #attackPad.up{border-color:#ffc98f!important;background:radial-gradient(circle,#8a4527dd,#160f0ee6 75%)!important}
body.hud2 #attackPad.held{border-color:#fff!important}
/* 2 회피 — 공격 왼쪽, 두 번째로 큼, 붉은 테 */
body.hud2 #combatControls #dash{width:var(--dash);height:var(--dash);right:calc(var(--edge) + var(--atk) + 14px + env(safe-area-inset-right))!important;bottom:calc(var(--edge) + env(safe-area-inset-bottom))!important;border-color:#d97a62aa!important}
body.hud2 #dash svg{width:52%!important;height:52%!important}
/* 3 무기 전환 — 공격 바로 위 */
body.hud2 #weaponSwap{width:var(--sub);height:var(--sub);right:calc(var(--edge) + (var(--atk) - var(--sub))/2 + env(safe-area-inset-right))!important;bottom:calc(var(--edge) + var(--atk) + 30px + env(safe-area-inset-bottom))!important}
body.hud2 #weaponSwap svg{width:62%;height:62%;pointer-events:none}
body.hud2 #weaponSwap .swap-arrows{position:absolute;top:-6px;right:-6px;width:20px;height:20px;border-radius:50%;background:#1a262b;border:1px solid var(--ring);font:12px/18px system-ui;text-align:center;color:#e9e1cb}
body.hud2 #weaponSwap.flash{border-color:#fff!important;transform:scale(1.08)}
/* 4 장전 — 공격과 회피 사이 위쪽 대각 */
body.hud2 #reloadGun{width:var(--sm);height:var(--sm);right:calc(var(--edge) + var(--atk) + 8px + env(safe-area-inset-right))!important;bottom:calc(var(--edge) + var(--dash) + 26px + env(safe-area-inset-bottom))!important}
body.hud2 #reloadGun svg{width:56%!important;height:56%!important;margin-top:-6px!important}
body.hud2 #reloadGun .ammo-numbers{bottom:6px!important;font:700 10px/1 monospace!important;color:#efe7d0!important}
body.hud2.weapon-sword #reloadGun{opacity:.28;pointer-events:none}
body.hud2 #reloadGun.reloading{border-color:var(--hot)!important}
/* 5 레이지 — 부채꼴 맨 위, 충전량 원형 게이지 */
body.hud2 #combatControls #rage{width:var(--sub);height:var(--sub);right:calc(var(--edge) + var(--atk) + 10px + env(safe-area-inset-right))!important;bottom:calc(var(--edge) + var(--dash) + var(--sm) + 52px + env(safe-area-inset-bottom))!important;background:conic-gradient(#d4503a99 var(--charge,0%),#0000 0),var(--disc)!important;overflow:visible!important}
body.hud2 #rage .rage-katana{position:absolute!important;width:96%!important;height:96%!important;left:2%!important;top:2%!important;opacity:.9;border-radius:50%}
body.hud2 #rage .rage-charge-line{display:none!important}
body.hud2 #rage.charged{border-color:#ff7a5c!important;box-shadow:0 0 18px #e0442caa!important;animation:rageReady 1s ease-in-out infinite alternate}
@keyframes rageReady{to{box-shadow:0 0 30px #ff5a3ccc}}
/* 기존 작은 무기 3칸은 숨기고 전환 버튼 하나로 */
body.hud2 #weaponChoice{display:none!important}
/* 이동 스틱 — 조금 크게, 잡기 쉬운 위치 */
body.hud2 #stick{width:var(--stick)!important;height:var(--stick)!important;left:calc(var(--edge) + 4px + env(safe-area-inset-left))!important;bottom:calc(var(--edge) + 6px + env(safe-area-inset-bottom))!important;background:radial-gradient(circle,#0a141855 0 60%,#e9e1cb1a 61% 62%,#0000 63%)!important}
body.hud2 #stick .stick-cross{width:calc(var(--stick) - 34px)!important;height:calc(var(--stick) - 34px)!important;left:17px!important;top:17px!important}
body.hud2 #knob{width:54px!important;height:54px!important;margin-left:-27px!important;margin-top:-27px!important;background:#e9e1cb30!important;border:1.5px solid #e9e1cbaa!important}
/* 눌림 */
body.hud2 #combatControls .action:active,body.hud2 #reloadGun:active,body.hud2 #weaponSwap:active{transform:scale(.94);border-color:#fff!important}
body.hud2 #combatControls .action:disabled,body.hud2 #reloadGun:disabled{opacity:.45}
/* 크기: 세로(기본) */
body.hud2{--edge:16px;--atk:100px;--dash:74px;--sub:62px;--sm:54px;--stick:136px}
/* 아주 좁은 폰 */
@media (max-width:370px) and (orientation:portrait){body.hud2{--atk:90px;--dash:66px;--sub:56px;--sm:50px;--stick:120px;--edge:12px}}
/* 가로: 높이가 낮으니 약간 작게, 가장자리 여유 크게 */
@media (orientation:landscape){body.hud2{--edge:22px;--atk:96px;--dash:70px;--sub:58px;--sm:50px;--stick:132px}}
@media (orientation:landscape) and (max-height:380px){body.hud2{--atk:84px;--dash:62px;--sub:50px;--sm:44px;--stick:116px;--edge:16px}}

body.hud2 .hud-label{color:#f3ecd6;font-size:12px}
body.hud2 #dash .evade-icon svg{width:46px;height:46px}

/* v2.1 — 처음의 차분한 무테 스타일로 복귀 (배치·크기는 유지) */
body.hud2{--ring:transparent;--disc:radial-gradient(circle,#070d1066 0,#070d1033 45%,transparent 70%)}
body.hud2 #combatControls #attackPad,body.hud2 #combatControls #dash,body.hud2 #reloadGun,body.hud2 #weaponSwap,body.hud2 #combatControls #rage{border:0!important;box-shadow:none!important;filter:drop-shadow(0 2px 3px #000b)}
body.hud2 #combatControls #attackPad{border:1px solid #e9e1cb38!important}
body.hud2 .hud-label{display:none}
body.hud2 #weaponSwap .hud-label{display:block;bottom:-12px;font:600 10px/1 system-ui;letter-spacing:2px;color:#e9e1cb99}
body.hud2 #weaponSwap .swap-arrows{background:none;border:0;top:-2px;right:-2px;color:#e9e1cb88;font-size:11px}
body.hud2 #dash{color:#f1d2c6!important}
body.hud2 #combatControls #rage{background:conic-gradient(#c8503a88 var(--charge,0%),#0000 0)!important;-webkit-mask:radial-gradient(circle,#000 0 100%);border-radius:50%}
body.hud2 #rage.charged{box-shadow:0 0 16px #d4442c88!important}
body.hud2 #combatControls .action:active,body.hud2 #reloadGun:active,body.hud2 #weaponSwap:active{color:#d87961!important;transform:scale(.94)}
/* 바닥 균열 표시 (지상에서만) */
#crackMeter{position:fixed;left:50%;top:calc(env(safe-area-inset-top) + 64px);transform:translateX(-50%);display:flex;gap:6px;align-items:center;font:600 10px/1 system-ui;letter-spacing:2px;color:#e9e1cb99;pointer-events:none;z-index:14;text-shadow:0 1px 2px #000;transition:opacity .3s}
#crackMeter i{width:18px;height:3px;background:#e9e1cb26}
#crackMeter i.on{background:#d0613f;box-shadow:0 0 6px #d0613f}
#crackMeter.hide{opacity:0}
#crackMeter.collapse{color:#ff8a6a;animation:crackShake .12s linear infinite}
@keyframes crackShake{50%{transform:translateX(calc(-50% + 2px))}}

/* v2.2 레이지 버튼: 공격 버튼 왼쪽 위에 붙은 작은 배지. 충전 전엔 어둡고, 다 차면 불붙음 */
body.hud2 #combatControls #rage{width:50px!important;height:50px!important;right:calc(var(--edge) + var(--atk) - 22px + env(safe-area-inset-right))!important;bottom:calc(var(--edge) + var(--atk) - 8px + env(safe-area-inset-bottom))!important;opacity:.55;z-index:17}
body.hud2 #rage .rage-katana{display:none!important}
body.hud2 #rage .rage-bolt{width:30px;height:30px;pointer-events:none}
body.hud2 #rage.charged{opacity:1;color:#ffd2b0!important;animation:rageReady .7s ease-in-out infinite alternate}
/* 무기 전환은 레이지 배지와 겹치지 않게 살짝 위로 */
body.hud2 #weaponSwap{bottom:calc(var(--edge) + var(--atk) + 44px + env(safe-area-inset-bottom))!important}
#crackMeter{white-space:nowrap}
