*{box-sizing:border-box;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#080e14;color:#e3e5d4;font:14px system-ui,sans-serif;touch-action:none}button{font:inherit;color:inherit;cursor:pointer;border:1px solid #a9b79c40;background:#18252ae8;border-radius:5px;min-width:44px;min-height:44px;touch-action:none}button:hover{background:#38463d}button:focus-visible{outline:2px solid #c6dda1}canvas{display:block;width:100%;height:100%}header{position:absolute;top:max(22px,env(safe-area-inset-top));left:24px;right:24px;display:flex;align-items:center;justify-content:space-between;pointer-events:none}header>*{pointer-events:auto}#depth{font-size:24px;letter-spacing:3px;text-shadow:0 2px 6px black}#depth span{font-size:11px;letter-spacing:2px;display:block;margin-top:3px;color:#bac1b8}#menu{font-size:23px}#stats{position:absolute;top:104px;left:24px;display:flex;gap:6px;align-items:center;text-shadow:0 2px 4px black}#health{color:#e99b87;letter-spacing:2px;margin-right:14px;font-size:16px}.coal-icon{color:#c4d1d6}.muted{opacity:.5}#fuel{position:absolute;left:0;top:29px;height:2px;width:100%;background:#48504b}#fuel i{display:block;background:#e9b56a;height:100%}#tools{position:absolute;bottom:max(26px,env(safe-area-inset-bottom));right:26px;display:flex;gap:8px}#tools button{width:51px;height:51px;background:#101e24dc;box-shadow:0 5px 20px #0008}#tools button.active{border-color:#eab573;background:#443b2f}svg{width:30px;height:30px;fill:none;stroke:currentColor;stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}#hint{position:absolute;bottom:30px;left:24px;font-size:11px;color:#b6c2b4;letter-spacing:.3px;pointer-events:none}em{padding:0 6px;opacity:.4}#chapter{position:absolute;top:25%;left:0;width:100%;text-align:center;pointer-events:none;transition:opacity 1s;text-shadow:0 3px 15px #000;opacity:0}#chapter.show{opacity:1}#chapter small{letter-spacing:6px;font-size:10px;color:#bfd6c2}#chapter h1{font:34px Georgia,serif;margin:10px 0}#chapter p{font-size:12px;color:#bdc9c5}#notice{position:absolute;bottom:95px;width:100%;text-align:center;color:#e3d4ad;font-size:13px;pointer-events:none;opacity:0;transition:opacity .3s;text-shadow:0 2px 6px black}#notice.show{opacity:1}#target-label{position:absolute;pointer-events:none;font-size:11px;color:#ecdfc2;text-shadow:0 2px 4px black;transform:translate(-50%,-160%)}#mining{position:absolute;width:56px;height:4px;background:#0c161c;pointer-events:none;display:none;transform:translate(-50%,-50%)}#mining i{display:block;height:100%;background:#e9c47b}#overlay,#confirm{position:absolute;inset:0;background:#03090dc9;display:grid;place-items:center;backdrop-filter:blur(5px)}[hidden]{display:none!important}section{position:relative;width:min(340px,90vw);padding:28px;background:#152126;border:1px solid #75857655;box-shadow:0 20px 100px #0008}section small{font-size:9px;letter-spacing:4px;color:#a6b7a5}section h2{font:26px Georgia,serif}section>button:not(#close){display:block;width:100%;text-align:left;margin:8px 0;padding:12px 16px}section button span{margin-left:10px}section p{font-size:11px;line-height:1.9;color:#a5b3af}.credit{font-size:9px!important;opacity:.6}#close{position:absolute;right:10px;top:10px;border:0;background:none;font-size:25px}#stick{display:none;position:absolute;left:24px;bottom:28px;width:106px;height:106px;border:1px solid #bbcebb55;border-radius:50%;background:#0a15194d;touch-action:none}#stick i{position:absolute;left:32px;top:32px;width:40px;height:40px;border-radius:50%;background:#b8c9ac40;border:1px solid #c7d7b955;pointer-events:none}@media(pointer:coarse){#stick{display:block}#hint{display:none}#tools{right:18px;bottom:30px;display:grid;grid-template-columns:repeat(2,48px)}#tools button{width:48px;height:48px}}@media(max-height:500px){header{top:12px}#stats{top:76px}#chapter{top:20%}section{padding:14px 24px}section p{line-height:1.5}section h2{margin:8px 0}section>button:not(#close){padding:5px 12px;margin:4px 0;min-height:35px}#hint{max-width:50%;line-height:1.8}}

#stats{top:max(24px,env(safe-area-inset-top));left:24px}#depth{position:absolute;left:0;top:64px;font-size:12px;letter-spacing:1px}#depth span{font-size:10px}header{justify-content:flex-end}#health{color:#ef7669;font-size:19px}.coal-icon{width:26px;height:26px;filter:drop-shadow(0 2px 1px #000)}#tools #rope{width:68px;border:2px solid #ddc69b;color:#fff0cf}#rope strong{display:block;font-size:16px;letter-spacing:1px}#rope small{display:block;font-size:8px;margin-top:3px}#rope.active{box-shadow:0 0 20px #eab57380}@media(pointer:coarse){#tools{grid-template-columns:68px 48px}}

#equipment{position:absolute;left:24px;top:62px;font-size:10px;color:#c7cfcc;text-shadow:0 2px 3px black;max-width:calc(100vw - 35px)}#tools small{display:block;font-size:10px}#hint{max-width:45%;bottom:12px}@media(pointer:coarse){#tools{grid-template-columns:68px 48px;gap:6px}#equipment{font-size:9px}}

#notice,#target-label{display:none}
#chapter{top:max(90px,calc(env(safe-area-inset-top) + 70px));opacity:0;transition:none;transform:translateY(-16px)}
#chapter h1{font:clamp(21px,4vw,32px) Georgia,serif;margin:0 16px}
#chapter.show{animation:area-title 1.7s both}
@keyframes area-title{0%{opacity:0;transform:translateY(-16px)}29%{opacity:1;transform:translateY(0)}70%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(18px)}}
#chapter.show{animation-timing-function:cubic-bezier(.22,.61,.36,1)}
@media(prefers-reduced-motion:reduce){#chapter.show{animation-name:area-title-fade}@keyframes area-title-fade{0%,100%{opacity:0}29%,70%{opacity:1}}}

#compass-arrow{position:absolute;width:0;height:0;border-top:10px solid transparent;border-bottom:10px solid transparent;border-left:24px solid #ff493e;filter:drop-shadow(0 0 4px #160000);pointer-events:none;animation:compass-flash .55s ease-in-out infinite alternate;transform-origin:center}@keyframes compass-flash{to{opacity:.25}}

#overlay section{width:min(340px,90vw);padding:24px}
.menu-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:22px}
.menu-title h2{margin:0;font:24px Georgia,serif;text-align:left}
#sound{width:44px;height:44px;padding:0;flex:none;font-size:20px}
#sound[aria-pressed="false"]{opacity:.5}
#overlay section>button{margin:8px 0;min-height:48px}
#tools button{position:relative}
#tools button.selected{outline:2px solid #fff0cf;outline-offset:3px}
@media(pointer:fine){#tools button::after{content:attr(data-slot);position:absolute;top:2px;left:5px;font-size:10px;opacity:.7}#pick{order:1}#sword{order:2}#bow{order:3}#tnt{order:4}#rope{order:5}#compass{order:6}#torch{order:7}}
/* Keep closed native menus out of the playfield despite the shared panel display rule. */
html[data-menu-game="minecraft"] dialog.standard-menu-panel:not([open]){display:none!important}

/* Desktop status and item actions share one lower-left corner. */
@media(pointer:fine){
 #stats{top:auto;bottom:max(104px,calc(env(safe-area-inset-bottom) + 78px));left:24px}
 #tools{left:24px;right:auto;bottom:max(26px,env(safe-area-inset-bottom))}
}

/* Brief rewards stay attached to the opened chest, above the world. */
#loot-bubble{position:absolute;display:flex;align-items:center;gap:12px;padding:7px 10px;border:2px solid #b9a885;border-radius:6px;background:#241c16f2;box-shadow:0 3px 10px #0008;color:#fff1d5;pointer-events:none;transform:translate(-50%,-100%);font-weight:700;white-space:nowrap}
#loot-bubble::after{content:"";position:absolute;left:calc(50% - 5px);bottom:-7px;width:10px;height:10px;background:#241c16; border-right:2px solid #b9a885;border-bottom:2px solid #b9a885;transform:rotate(45deg)}
#loot-bubble span{display:flex;align-items:center;gap:4px}
#loot-bubble img{width:28px;height:28px;image-rendering:pixelated;filter:drop-shadow(0 1px 1px #000)}
