/* Combat hierarchy: life left, navigation right, actions at the hands. */
#hurt-vignette,#critical-vignette{position:absolute;inset:0;pointer-events:none;z-index:2;opacity:0;background:radial-gradient(ellipse at center,transparent 38%,#701e1814 55%,#982921a6 82%,#b73526 100%);box-shadow:inset 0 0 55px #a02d235c}body:not(.playing) #hurt-vignette,body:not(.playing) #critical-vignette{visibility:hidden}
body.low-health #critical-vignette{animation:critical-pulse 1.6s ease-in-out infinite}body.game-paused #critical-vignette{animation-play-state:paused}
@keyframes critical-pulse{0%,100%{opacity:.18}35%{opacity:.58}72%{opacity:.22}}
@media(prefers-reduced-motion:reduce){body.low-health #critical-vignette{animation:none;opacity:.3}}
.header{inset:22px 25px auto auto;padding:0;left:auto;width:auto}.brand{display:none}.header-actions{gap:10px}.icon-button,#sound{height:32px;width:36px;border:0;border-radius:0;background:#111619a8;box-shadow:none;color:#b6b7b1}#sound{width:52px}#sound-label{font-size:8px}
.hud{inset:25px 28px auto;align-items:flex-start}.health-group{display:flex;align-items:center;gap:12px;padding:0;background:none;border:0;box-shadow:none;border-radius:0}.life-emblem{width:34px;height:56px;filter:drop-shadow(0 2px 7px #000)}.life-content{width:clamp(145px,19vw,230px)}.life-label{display:flex;justify-content:space-between;align-items:baseline;color:#c0b09c;font-size:10px;letter-spacing:.16em;margin-bottom:7px;text-shadow:0 2px 4px #000}.life-label b{font:500 11px Georgia,serif;color:#e2ceb0;letter-spacing:.04em}
#health{display:flex;gap:3px;width:100%;padding:3px;background:#100e0bd9;box-shadow:0 0 0 1px #8d72504d,inset 0 1px 4px #000;overflow:visible}#health span{flex:1;width:auto;height:8px;clip-path:none;border-radius:0;background:linear-gradient(#f5bd7c,#be6b43);box-shadow:inset 0 1px #ffe0a5;transition:background .16s}#health span.empty{background:#342523;box-shadow:inset 0 1px #0006}.health-group #boss-seals{display:flex;gap:13px;margin:9px 0 0;padding:0}.health-group #boss-seals i{width:5px;height:5px;opacity:.7}.health-group #boss-seals i.defeated{background:#edbd78;box-shadow:0 0 7px #edac5c;opacity:1}
.time-group{top:-3px;left:50%;right:auto;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:4px;padding:0;background:none;border:0;box-shadow:none;white-space:nowrap}#chapter-label{font-size:9px;font-weight:400;letter-spacing:.24em;color:#a99c88}#timer{font:600 18px 'Noto Sans KR',sans-serif;letter-spacing:.08em;color:#e3d9c7;text-shadow:0 2px 7px #000}
#dungeon-map,body.has-boss #dungeon-map{top:76px;right:28px;padding:10px;opacity:.8;background:linear-gradient(135deg,#0f1417c9,#12151644);border:0;border-top:1px solid #a18d5d66;box-shadow:none;gap:3px;--cell:8px;grid-template-columns:repeat(var(--map-columns),var(--cell));grid-template-rows:repeat(var(--map-rows),var(--cell));width:max-content;max-width:135px}.map-room{width:var(--cell);height:var(--cell);border-radius:1px}.map-room.current{background:#e2be7e;box-shadow:0 0 10px #f2bf6560}.map-room.next{outline-color:#d9bc87}
#exit-hint{top:83px;left:28px;right:auto;transform:none;font-size:10px;letter-spacing:.08em;color:#cbb384}.footer{display:none}
#boss-hud,body.has-boss #boss-hud{top:auto;bottom:25px;left:50%;right:auto;width:min(42vw,480px);transform:translateX(-50%);padding:0;background:none;border:0;box-shadow:none}#boss-name{display:block;font-size:13px;font-weight:500;letter-spacing:.12em;margin-bottom:9px;color:#e9d6b5;text-align:center;text-shadow:0 2px 4px #000}.boss-track{height:7px;border-radius:0;border:1px solid #b68b535e;background:#160f0de0;overflow:hidden;box-shadow:0 2px 5px #0008}#boss-health{background:linear-gradient(90deg,#713930,#c28a57);box-shadow:0 0 12px #c77e4580}#boss-echo{background:#efd9ab}
#callout,body.has-boss #callout{top:20%;font-size:21px;font-weight:600;letter-spacing:.16em;text-shadow:0 2px 12px #000}#ready-tip,body.has-boss #ready-tip{top:auto;bottom:147px;left:auto;right:28px;transform:none;padding:7px 13px;background:linear-gradient(90deg,#291d13e8,#181b1df0);color:#ffd497;border:0;border-left:2px solid #eea352;font-size:11px;box-shadow:0 3px 14px #0007}#ready-tip strong{font:italic 20px Georgia,serif}
.combo,body.has-boss .combo{left:29px;right:auto;top:auto;bottom:163px;transform:none;padding:0;background:none;border:0;box-shadow:none;gap:10px}#combo-count{font:italic 52px Georgia,serif;line-height:1;color:#eab67d;text-shadow:0 2px 12px #000}.combo>div{font-size:9px;letter-spacing:.25em;color:#a59b8e}
#pickup-feed{top:123px;left:28px;max-width:245px;gap:7px}#pickup-feed>div{padding:9px 13px;background:linear-gradient(90deg,#141a20ee,#141a20c0,transparent);border:0;border-left:2px solid #cd9859;border-radius:0;box-shadow:none;animation:loot-arrival 4.2s both}#pickup-feed strong{font-size:12px;font-weight:600}#pickup-feed span{font-size:10px;color:#aeb9b7}
#touch-controls{bottom:max(25px,env(safe-area-inset-bottom));padding:0 max(28px,env(safe-area-inset-right)) 0 max(28px,env(safe-area-inset-left))}.action-buttons{gap:14px;align-items:flex-end}.action-buttons button{border-radius:3px;border:1px solid #b393606b;background:linear-gradient(145deg,#34322ae8,#151d23ed);box-shadow:inset 0 1px #eed8b738,0 5px 18px #0008}.attack-button{width:84px;height:104px;margin-bottom:14px;clip-path:polygon(18% 0,100% 0,100% 82%,82% 100%,0 100%,0 18%)}.dodge-button{width:62px;height:65px;margin-bottom:0;border-radius:50%!important}.action-buttons svg{width:37px;height:37px}.dodge-button svg{width:24px;height:24px}.action-buttons strong{font-size:11px;font-weight:500;letter-spacing:.18em;line-height:25px}.attack-button.charged{background:linear-gradient(145deg,#a7713ee8,#38241aed);border-color:#f1bc73;box-shadow:inset 0 0 18px #e7a85755,0 0 18px #e7a85755}.dodge-button.cooldown{opacity:.5}#joystick{width:104px;height:104px;background:radial-gradient(circle,#141a2140 42%,#070a1022 44%,transparent 65%);border:1px solid #cab99535;box-shadow:inset 0 0 0 9px #10182033}#stick{width:38px;height:38px;background:radial-gradient(circle at 35% 25%,#b5b4a76b,#54616c8a);border:1px solid #d9ceac66;box-shadow:0 4px 12px #0005}
.start-screen{bottom:18%;width:min(500px,calc(100% - 40px));padding:25px 20px;background:radial-gradient(ellipse,#0d1115dc,transparent 72%)}.start-screen h1{font:500 clamp(34px,5vw,58px) 'Batang','Noto Serif KR',serif;letter-spacing:.06em;margin:14px 0 19px;color:#ecdfc5;text-shadow:0 2px 18px #000}.title-kicker{font-size:10px;letter-spacing:.35em;color:#bd9e70}.title-rule{width:100px;height:1px;margin:0 auto 18px;background:linear-gradient(90deg,transparent,#b4925e,transparent)}.oath-line{font-size:12px;color:#b9b1a1;margin-bottom:23px}.primary-button{border-radius:0;min-height:49px;font-size:17px;font-weight:600;letter-spacing:.13em;background:linear-gradient(115deg,#d4b784,#b89059);border:1px solid #ead2a188;box-shadow:inset 0 1px #ffe6b877,0 4px 25px #0006}.campaign-goal{color:#a59f91;font-size:10px}.intro-controls,.touch-intro{font-size:10px;color:#a7aaa2}
body:not(.playing) .hud,body:not(.playing) #dungeon-map,body:not(.playing) #exit-hint,body:not(.playing) #pickup-feed,body:not(.playing) .combo{visibility:hidden}
#pause-screen,#end-screen{background:linear-gradient(135deg,#1b2329f7,#10171bf7);border:1px solid #a98e5f66;border-top:2px solid #b49865;border-radius:2px;box-shadow:0 20px 80px #000c;color:#d4c6ae}#pause-screen h2,#end-screen h2{font-weight:500;letter-spacing:.12em}.gear-choice{border-radius:0;background:#1d262c;border-color:#b5a07122}.gear-choice[aria-pressed=true]{background:linear-gradient(100deg,#433421,#252821);border-color:#b39057}.icon-button:active{color:#f6d69b}
@keyframes loot-arrival{0%{opacity:0;transform:translateX(-15px)}8%{opacity:1;transform:translateX(2px)}13%,87%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateY(-5px)}}
@media(max-width:650px){.header{top:17px;right:17px}.hud{top:19px;left:17px;right:17px}.life-emblem{width:23px;height:43px}.health-group{gap:8px}.life-content{width:139px}.life-label{font-size:8px;margin-bottom:6px}.life-label b{font-size:10px}#health span{height:6px}.time-group{top:58px;left:0;transform:none;align-items:flex-start;gap:3px}#chapter-label{font-size:8px}#timer{font-size:13px;letter-spacing:.04em}#exit-hint{top:117px;left:17px;right:auto;font-size:9px}#dungeon-map,body.has-boss #dungeon-map{top:62px;right:17px;--cell:6px;gap:2px;padding:7px;max-width:105px}#pickup-feed{top:160px;left:17px;max-width:190px}#touch-controls{padding-left:max(19px,env(safe-area-inset-left));padding-right:max(19px,env(safe-area-inset-right));bottom:max(23px,env(safe-area-inset-bottom))}.attack-button{width:76px;height:93px}.dodge-button{width:58px;height:61px}.action-buttons{gap:11px}#joystick{width:94px;height:94px}#stick{width:36px;height:36px}.combo,body.has-boss .combo{left:20px;bottom:143px}#combo-count{font-size:40px}#ready-tip,body.has-boss #ready-tip{right:19px;bottom:143px;font-size:10px}#callout,body.has-boss #callout{top:26%;font-size:17px}#boss-hud,body.has-boss #boss-hud{top:137px;bottom:auto;width:65vw}#boss-name{font-size:10px;margin-bottom:6px}.boss-track{height:5px}body.has-boss #pickup-feed{top:175px}.start-screen{bottom:22%;padding:15px 0}.start-screen h1{font-size:37px}.title-kicker{font-size:9px}.oath-line{font-size:11px}.primary-button{min-height:48px;font-size:16px}}
@media(max-height:450px){.header{top:12px;right:max(17px,env(safe-area-inset-right))}.hud{top:13px;left:max(17px,env(safe-area-inset-left));right:17px}.life-emblem{width:25px;height:40px}.life-content{width:145px}.life-label{font-size:8px;margin-bottom:4px}#health span{height:6px}.time-group{top:0;left:50%;transform:translateX(-50%);align-items:center}#timer{font-size:13px}#chapter-label{font-size:8px}#dungeon-map,body.has-boss #dungeon-map{top:58px;right:17px;--cell:5px;gap:2px;padding:5px;opacity:.55}#exit-hint{top:69px;left:17px;right:auto;transform:none;font-size:9px}#touch-controls{bottom:max(14px,env(safe-area-inset-bottom));padding-left:22px;padding-right:22px}.attack-button{width:64px;height:75px;margin-bottom:8px}.dodge-button{width:51px;height:51px}#joystick{width:78px;height:78px}#stick{width:31px;height:31px}.action-buttons svg{width:27px;height:27px}.dodge-button svg{width:21px;height:21px}.action-buttons strong{font-size:10px;line-height:20px}#ready-tip,body.has-boss #ready-tip{bottom:105px;right:22px;font-size:9px;padding:4px 8px}.combo,body.has-boss .combo{left:24px;bottom:102px}#combo-count{font-size:31px}#boss-hud,body.has-boss #boss-hud{top:auto;bottom:16px;width:38vw}#boss-name{font-size:10px;margin-bottom:5px}.boss-track{height:5px}#pickup-feed,body.has-boss #pickup-feed{top:88px;left:17px;max-width:170px}#pickup-feed>div{padding:5px 9px}#pickup-feed strong{font-size:10px}#pickup-feed span{font-size:9px}#callout,body.has-boss #callout{top:23%;font-size:16px}.start-screen{bottom:14%;padding:0}.start-screen h1{font-size:30px;margin:7px 0 12px}.title-kicker{font-size:8px}.title-rule{margin-bottom:12px}.oath-line{display:none}.start-screen .primary-button{min-height:40px;font-size:15px}.intro-controls,.touch-intro{margin-top:7px}.start-screen .campaign-goal{margin:7px 0;font-size:9px}}
@media(prefers-reduced-motion:reduce){#pickup-feed>div{animation:none}#health span{transition:none}}
#pause-screen{width:min(320px,calc(100% - 40px));padding:30px 24px;gap:14px}#pause-screen h2{margin:0 0 8px;font-size:24px}#pause-screen .text-button{font-size:11px;margin:0}#pause-screen .primary-button{width:100%;max-width:none}
#equipment-screen{display:flex;flex-direction:column;width:min(680px,calc(100% - 36px));max-width:none;max-height:calc(100dvh - 44px);overflow:hidden;padding:24px;background:linear-gradient(135deg,#1b2329f7,#10171bf7);border:1px solid #a98e5f66;border-top:2px solid #b49865;border-radius:2px;color:#d4c6ae;box-shadow:0 20px 80px #000c}#equipment-screen>:not(#equipment){flex-shrink:0}#equipment-screen h2{font-size:24px;font-weight:500;letter-spacing:.1em;margin:8px 0 20px}#equipment-screen .primary-button{min-height:43px;font-size:15px;padding:7px 15px}#equipment-screen .equipment-empty{display:block;font-size:11px;color:#8a969b;padding:25px 5px;line-height:1.8}
.attack-button.rest-action{border-color:#b6c2af;background:linear-gradient(145deg,#41504b,#18252a)}.attack-button.rest-action svg{opacity:.55}
@media(max-width:500px){#equipment-screen{padding:18px 12px}#equipment-screen h2{font-size:21px;margin-bottom:14px}}
@media(max-height:400px){#pause-screen{padding:18px;gap:9px}#pause-screen h2{display:block;font-size:19px;margin:0}#equipment-screen{max-height:calc(100dvh - 24px);padding:10px 15px}#equipment-screen .title-kicker{display:none}#equipment-screen h2{font-size:17px;margin:0 0 8px}#equipment-screen .primary-button{min-height:34px;padding:5px 15px;font-size:13px}#equipment-screen #scrap-count{margin-bottom:6px}}
/* The title is a separate opaque surface, never a view into the running arena. */
.menu-backdrop{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 72%,#35261b55,transparent 50%),radial-gradient(ellipse at 50% 10%,#24303766,transparent 60%),#090d10;overflow:hidden;pointer-events:none}.menu-backdrop:after{content:'';position:absolute;inset:20px;border:1px solid #a78a5222;mask-image:linear-gradient(#000,transparent 30%,transparent 70%,#000)}.menu-blade{position:absolute;left:50%;top:50%;height:min(92vh,760px);width:auto;transform:translate(-50%,-54%);opacity:.43;filter:drop-shadow(0 0 30px #cdb07a16)}.menu-edition{position:absolute;bottom:34px;left:0;right:0;text-align:center;font-size:9px;letter-spacing:.2em;color:#6d716c}body.playing .menu-backdrop{display:none}body:not(.playing) #arena,body:not(.playing) #touch-controls,body:not(.playing) #pause,body:not(.playing) .vignette{visibility:hidden}body:not(.playing) #boss-hud,body:not(.playing) #callout,body:not(.playing) #ready-tip{visibility:hidden}
.start-screen{top:50%;bottom:auto;transform:translate(-50%,-24%);width:min(650px,calc(100% - 40px));padding:0;background:none}.start-screen .title-kicker{font-size:10px;letter-spacing:.5em;color:#b5a17e}.start-screen h1{font-family:'Batang','Noto Serif KR',serif;font-size:clamp(39px,7vw,74px);font-weight:400;letter-spacing:.06em;color:#e4d7b9;margin:19px 0 27px;text-shadow:0 2px 35px #000,0 1px #978469}.title-rule{width:145px;margin-bottom:38px}.start-screen .primary-button{width:205px;max-width:none;min-height:48px;color:#dfc99e;background:linear-gradient(90deg,transparent,#aa855518,transparent);border:0;border-top:1px solid #b9996266;border-bottom:1px solid #b9996266;box-shadow:none;font-size:15px;font-weight:500;letter-spacing:.3em}.start-screen .primary-button:hover{background:linear-gradient(90deg,transparent,#ba955632,transparent);color:#fff0c8}.start-screen .primary-button:disabled{opacity:.4}
@media(max-width:650px){.start-screen{top:48%;transform:translate(-50%,-20%)}.start-screen h1{font-size:42px;letter-spacing:.01em}.start-screen .title-kicker{font-size:9px}.menu-blade{height:76vh;top:45%}.menu-edition{bottom:30px;font-size:8px}.menu-backdrop:after{inset:14px}}
@media(max-height:450px){.start-screen{top:42%;transform:translate(-50%,-20%)}.start-screen h1{font-size:37px;margin:10px 0 17px}.start-screen .title-kicker{font-size:8px}.title-rule{margin-bottom:18px}.start-screen .primary-button{min-height:37px;font-size:13px}.menu-blade{height:120vh;top:50%}.menu-edition{bottom:17px;font-size:8px}}

/* Floating movement control: the canvas owns the touch pointer. */
#joystick{position:fixed;left:0;top:0;bottom:auto;right:auto;transform:translate(-50%,-50%);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .08s}
#joystick.active{opacity:1;visibility:visible}

#touch-controls .action-buttons{margin-left:auto}
