#dungeon{position:absolute;inset:0;z-index:4;background:#0b0c1a;overflow:hidden}#dungeon-canvas{display:block;width:100%;height:100%;image-rendering:pixelated}.dungeon-hud{position:absolute;top:15px;left:16px;right:16px;display:flex;gap:12px;align-items:flex-start;justify-content:space-between;pointer-events:none}.dungeon-hud>div{min-width:120px;padding:9px 12px;background:#191b2de8;border:1px solid #c6a67888;border-radius:8px;box-shadow:inset 0 0 0 2px #e4c99012}.dungeon-hud strong{display:block;font:24px/1 'Jacquard 12',serif;color:#f2dbac}.dungeon-hud small{font:11px system-ui;color:#e8d9c0}.health-track{height:8px;margin:5px 0 3px;border:1px solid #b98d75;background:#392d40}.health-track span{display:block;height:100%;width:100%;background:#d78583;box-shadow:0 0 8px #ec8b82}#dungeon-buffs{display:flex;flex-wrap:wrap;gap:4px;margin-top:5px;max-width:240px}#dungeon-buffs span{font:10px system-ui;color:var(--meal,#c6bdb6);border:1px solid currentColor;padding:2px 5px;border-radius:4px}.dungeon-hud button{pointer-events:auto;min-height:42px;background:#1e2033e8;border-color:#c6a67888;border-radius:8px;font:20px 'Jacquard 12',serif}#dungeon-menu{display:none}body.in-dungeon .walk-header,body.in-dungeon .action-area,body.in-dungeon #trail-hint,body.in-dungeon #target-label,body.in-dungeon #catch-card,body.in-dungeon #toast{visibility:hidden}body.in-dungeon #joystick{z-index:6;background:#181927d9;border-color:#d4b579}body.dungeon-pack-open #joystick{visibility:hidden}#dungeon-food{position:absolute;z-index:8;top:50%;left:50%;transform:translate(-50%,-50%);width:min(570px,calc(100vw - 24px));max-height:calc(100dvh - 26px);overflow:auto;overscroll-behavior:contain;touch-action:pan-y;background:#1b1d2cf7;border:1px solid #c7a774;border-radius:10px;padding:20px;box-shadow:0 20px 80px #080811e8,inset 0 0 0 2px #e6c98e12;color:#f0dfc0}#dungeon-food h2,#dungeon-result h2{margin:4px 0 8px;font:36px/1 'Jacquard 12',serif;color:#f3d59c}#dungeon-food h3{margin:17px 0 7px;font:23px/1 'Jacquard 12',serif;color:#e5c890}#dungeon-food p,#dungeon-result p{font:12px/1.45 system-ui;color:#d2c9bf}.dungeon-food-head{position:relative;padding-right:145px}.dungeon-food-head button{position:absolute;right:0;top:0;font:18px 'Jacquard 12',serif;border-radius:7px;background:#25283b}#dungeon-food-slots{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:14px 0}#dungeon-food-slots span{min-height:42px;display:flex;align-items:center;justify-content:center;text-align:center;border:1px solid var(--meal);color:var(--meal);border-radius:6px;padding:5px;font:17px/1 'Jacquard 12',serif;background:#242638}#dungeon-food-list{display:grid;grid-template-columns:1fr 1fr;gap:6px;max-height:190px;overflow:auto}#dungeon-food-list button,#dungeon-upgrades button{display:flex;align-items:center;gap:8px;text-align:left;min-width:0;min-height:52px;border:1px solid #b69b7066;background:#242638;border-radius:7px;padding:7px}#dungeon-food-list img{width:44px;height:39px;object-fit:contain;image-rendering:pixelated}#dungeon-food-list strong,#dungeon-upgrades strong{display:block;font:20px/1 'Jacquard 12',serif;color:#efddb6}#dungeon-food-list small,#dungeon-upgrades small{display:block;font:10px/1.3 system-ui;color:#c8c0b8;margin-top:3px}.food-mushroom{font-size:28px;width:44px;text-align:center}#dungeon-upgrades{display:grid;grid-template-columns:1fr 1fr;gap:7px}#dungeon-upgrades button{display:block}#dungeon-go{width:100%;margin-top:15px;min-height:50px;background:#dabf89;color:#262038;border-color:#f0d99f;font:26px 'Jacquard 12',serif;border-radius:7px}#dungeon-result{position:absolute;z-index:5;left:50%;top:50%;transform:translate(-50%,-50%);width:min(320px,calc(100vw - 30px));padding:22px;text-align:center;border:1px solid #c7a774;background:#1c1d2eee;box-shadow:0 12px 60px #070712d9}#dungeon-result button{background:#dabe88;color:#28213b;font:24px 'Jacquard 12',serif;border-radius:7px}@media(max-width:650px){.dungeon-hud{top:10px;left:9px;right:9px;gap:5px}.dungeon-hud>div{min-width:0;padding:5px 7px}.dungeon-hud strong{font-size:17px}.dungeon-hud small{font-size:9px}#dungeon-buffs{max-width:105px}#dungeon-buffs span{font-size:8px}.dungeon-hud button{display:none}#dungeon-menu{display:block;position:absolute;z-index:6;right:18px;bottom:max(28px,env(safe-area-inset-bottom));width:72px;height:58px;background:#c9ab78;color:#282033;border-color:#f3d79d;border-radius:8px;font:30px 'Jacquard 12',serif}#dungeon-food{padding:14px}.dungeon-food-head{padding-right:100px}.dungeon-food-head button{font-size:14px;padding:5px;max-width:100px}#dungeon-food-list{max-height:155px}#dungeon-food-list strong,#dungeon-upgrades strong{font-size:17px}}@media(max-height:500px){#dungeon-food{max-height:calc(100dvh - 10px);padding:10px 15px}#dungeon-food h2{font-size:26px}#dungeon-food h3{margin:9px 0 4px}#dungeon-food-list{max-height:92px}#dungeon-food-slots{margin:6px 0}#dungeon-food-slots span{min-height:30px}#dungeon-go{margin-top:7px;min-height:40px}#dungeon-buffs{display:none}}@media(prefers-reduced-motion:reduce){#dungeon-canvas{scroll-behavior:auto}}
#dungeon-pack-retreat{width:100%;margin-top:9px;border-color:#a98772;background:#302736;color:#e9c4ae;border-radius:7px;font:22px 'Jacquard 12',serif}body.dungeon-pack-open:not(.in-dungeon) .walk-header,body.dungeon-pack-open:not(.in-dungeon) .action-area{visibility:hidden}
#dungeon-bank{display:inline-block;margin-left:7px;font:11px system-ui;color:#e5c886;vertical-align:middle}

/* Combat remains on the spherical world canvas. This layer is HUD only. */
#dungeon{background:transparent;pointer-events:none;z-index:3;overflow:visible}
#dungeon .dungeon-hud button,#dungeon #dungeon-menu,#dungeon #dungeon-result{pointer-events:auto}
body.in-dungeon .action-area,body.in-dungeon #toast{visibility:visible}
body.in-dungeon .walk-header{visibility:hidden}
body.in-dungeon .walk-header .pocket{display:none}
body.in-dungeon #action-note{color:#e7c2f0}
body.in-dungeon #action{background:#3d294f;color:#f9d7f8;border-color:#d8a8e4}
body.in-dungeon #globe{filter:none}
body.in-dungeon #magic{pointer-events:none}
#dungeon-result{pointer-events:auto}
body.dungeon-pack-open .action-area,body.dungeon-pack-open #dungeon-menu{visibility:hidden;pointer-events:none}
body.dungeon-pack-open #dungeon .dungeon-hud button{pointer-events:none}
body.dungeon-defeated .action-area,body.dungeon-defeated #joystick,body.dungeon-defeated #dungeon-menu,body.dungeon-defeated #dungeon .dungeon-hud button{visibility:hidden;pointer-events:none}
#dungeon-food-list>p{grid-column:1/-1;margin:4px 0}
@media(max-width:650px){.dungeon-hud{left:8px;right:8px;top:62px}.dungeon-hud>div{background:#181126da}.dungeon-hud strong{font-size:17px}#dungeon-menu{bottom:max(112px,env(safe-area-inset-bottom))}}
@media(max-height:500px){.dungeon-hud{top:8px;left:105px;right:8px}.dungeon-hud strong{font-size:16px}#dungeon-menu{bottom:10px}}

/* Surface expeditions share the world's canvas and reserve the overlay for controls. */
body.in-dungeon .action-area{visibility:hidden;pointer-events:none}
.mana-track{height:7px;margin:5px 0 3px;border:1px solid #7da4c2;background:#253648}
.mana-track span{display:block;height:100%;width:100%;background:#7dc8ee;box-shadow:0 0 8px #87dcf7}
#dungeon-dodge,#dungeon-special{color:#e9e5d5}
#dungeon-special{border-color:#92bad4}.dungeon-hud button:disabled{opacity:.53}
#dungeon-food-slots button{min-width:0;min-height:64px;padding:6px;border:1px solid #bda47c;background:#252c36;text-align:left;border-radius:7px;color:#efe2c4}
#dungeon-food-slots button small,#dungeon-food-slots button em{display:block;font:10px/1.2 system-ui;color:#b9c9cb;font-style:normal}
#dungeon-food-slots button strong{display:block;font:19px/1 'Jacquard 12',serif;color:#f3dbab}
#dungeon-food-list{display:block;max-height:none;overflow:visible}
.tackle-grid{position:relative;width:min(100%,384px);height:300px;margin:0 auto;border:2px solid #bba372;border-radius:7px;background-color:#202a31;background-image:linear-gradient(to right,#bba37244 1px,transparent 1px),linear-gradient(to bottom,#bba37244 1px,transparent 1px);background-size:calc(100% / 6) calc(100% / 5)}
.tackle-cell,.tackle-item{position:absolute;left:calc(var(--x) * 100% / 6);top:calc(var(--y) * 100% / 5);width:calc(var(--w,1) * 100% / 6);height:calc(var(--h,1) * 100% / 5);border-radius:4px}
.tackle-cell{padding:0;border:0;background:transparent}.tackle-cell:hover{background:#b6d4d622}
.tackle-item{z-index:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:4px;border:2px solid #e9c78c;background:#344b4a;color:#fff0c7;overflow:hidden;touch-action:manipulation}
.tackle-item[data-item]:hover,.tackle-item.selected{border-color:#fff8dc;background:#536962;box-shadow:inset 0 0 0 2px #e9e6b766}
.tackle-item strong{font:18px/1 'Jacquard 12',serif}.tackle-item small{font:9px/1.15 system-ui;color:#d2e5d7}
#dungeon-food-list .tackle-item[data-kind="mushroom"] strong{font:12px/1.1 'Jacquard 12',serif;white-space:nowrap}#dungeon-food-list .tackle-item[data-kind="mushroom"] small{display:none}
#dungeon-food-list .tackle-item[data-kind="mushroom"]::after{content:"×" attr(data-count);position:absolute;right:2px;bottom:2px;padding:1px 3px;border-radius:3px;background:#f3dfab;color:#203339;font:700 11px/1 system-ui}
#tackle-upgrades{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}#tackle-upgrades button{min-height:45px;text-align:left;padding:6px 9px;border:1px solid #b69b7066;border-radius:7px;background:#242638}#tackle-upgrades strong{display:block;font:18px/1 'Jacquard 12',serif;color:#efddb6}#tackle-upgrades small{display:block;margin-top:3px;font:10px/1.2 system-ui;color:#c8c0b8}#tackle-upgrades button:disabled{opacity:.5}
.tackle-item img{display:block;max-width:78%;max-height:46%;object-fit:contain;image-rendering:pixelated;pointer-events:none}
.tackle-help{margin:6px 0 0!important;color:#d4d1bd!important}
.tackle-compare{min-height:25px;margin:5px 0 0!important;color:#f0d99e!important}
#tackle-store,#tackle-use{width:100%;min-height:35px;margin-top:8px;border-color:#aec3b1;background:#2d4544;color:#e2efd5;border-radius:6px}
body.in-dungeon.lake-action .action-area{visibility:visible;pointer-events:auto;z-index:7}
@media(max-width:650px){body.in-dungeon.lake-action #dungeon-menu,body.in-dungeon.lake-action #dungeon-dodge,body.in-dungeon.lake-action #dungeon-special{visibility:hidden}}
#dungeon-upgrades{display:block;max-height:135px;overflow:auto}.storage-item{display:flex;align-items:center;gap:6px;padding:4px 0;border-bottom:1px solid #ffffff20}.storage-item span{flex:1}.storage-item button{min-height:30px!important;padding:3px 8px!important;display:block!important;flex:none;font:13px system-ui!important;color:#f0ddba!important}
@media(max-width:650px){.dungeon-hud{top:9px}.dungeon-hud>div:nth-child(2){margin-left:auto}#dungeon-dodge,#dungeon-special{display:block;position:fixed;z-index:6;right:18px;min-width:76px;min-height:46px;font:17px 'Jacquard 12',serif}#dungeon-dodge{bottom:91px}#dungeon-special{bottom:144px}#dungeon-menu{bottom:28px}#dungeon-food-slots button strong{font-size:15px}.tackle-grid{height:250px}}
@media(max-height:500px){#dungeon-dodge,#dungeon-special{display:block;position:fixed;z-index:6;min-width:72px;font-size:15px;right:8px;bottom:66px}#dungeon-special{right:87px}#dungeon-menu{bottom:8px}.tackle-grid{height:210px}}
/* Combat and exploration now share one HUD. The home is safe without a mode switch. */
body.in-dungeon .walk-header{visibility:visible;z-index:7}
body.in-dungeon .walk-header .pocket{display:flex}
body.in-dungeon #trail-hint,body.in-dungeon #target-label{visibility:visible}
body.in-dungeon .action-area{visibility:hidden;pointer-events:none}
body.in-dungeon.lake-action .action-area{visibility:visible;pointer-events:auto}
body.in-dungeon #toast{z-index:5;top:180px}
body.in-dungeon.panel-open #toast{visibility:hidden}
#dungeon .dungeon-hud{top:66px}
#dungeon-retreat{display:none!important}
@media(max-width:650px){#dungeon .dungeon-hud{top:100px}}
@media(max-height:500px){#dungeon .dungeon-hud{top:54px}}
@media(max-width:650px) and (min-height:501px){body.in-dungeon #toast{top:202px}}
@media(max-height:500px){body.in-dungeon #toast{top:160px}}
#dungeon.boss-opening #dungeon-special{color:#d7ffe0;border-color:#9bffc5;background:#285640e8;box-shadow:0 0 18px #9bffc577}
#tackle-stash{width:100%;min-height:39px;margin:0 0 8px;border:1px solid #aec3b1;border-radius:6px;background:#2d4544;color:#e2efd5;font:19px 'Jacquard 12',serif}
.storage-item span{min-width:0}.storage-item small{display:block;margin-top:3px;font:10px/1.25 system-ui;color:#c8c0b8}
