:root {
  color-scheme:dark; --ivory:#fff0cd; --pale:#e3d3b7; --gold:#ffc56c; --coal:#171310;
  --hair:#8e725895; --glass:#201a17eb; --mint:#9fd6c5;
  --serif:"STIX Two Text","PT Serif",Georgia,serif; --body:"DM Sans","Segoe UI",Arial,sans-serif;
  --mono:"IBM Plex Mono",Consolas,monospace;
}
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none;background:#120f10;color:var(--ivory);font-family:var(--body)}
button,a{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent}
button{cursor:pointer}a{text-decoration:none}
button:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline:3px solid #ffe39a;outline-offset:3px}
[hidden]{display:none!important}
.bank,.sr{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.icon{display:block;width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
.mine{position:relative;isolation:isolate;width:100%;height:100%;height:100dvh;overflow:hidden;--edge:clamp(12px,2.15vmin,30px);--left:max(var(--edge),env(safe-area-inset-left));--right:max(var(--edge),env(safe-area-inset-right));--top:max(var(--edge),env(safe-area-inset-top));--bottom:max(var(--edge),env(safe-area-inset-bottom))}
#world{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:var(--camera-x,50%) var(--camera-y,50%);image-rendering:pixelated;touch-action:none;background:#191419}
#world:focus-visible{outline-offset:-3px}
.rim{z-index:5;position:absolute;left:var(--left);right:var(--right);top:var(--top);display:flex;justify-content:space-between;align-items:flex-start;pointer-events:none}
.rim>*{pointer-events:auto}
.tools,.tool,.actions,.gold,.secondary,.minor-actions,.minor-actions button,.eyebrow,.inventory,.inventory span,.key-strip,.key-strip span,.pad-group,.touch-controls{display:flex;align-items:center}
.tools{gap:7px}
.tool,.touch-controls button,.secondary{border:1px solid var(--hair);background:var(--glass);border-radius:4px}
.tool{min-height:43px;padding:7px 12px;justify-content:center;gap:7px;font-size:.88rem;font-weight:650;white-space:nowrap}
.tool.icon-btn{width:44px;padding:7px}.tool .icon{width:19px;height:19px}
#sound[aria-pressed=true] .sound-mute,#sound[aria-pressed=false] .sound-waves{display:none}
.explore-only,.play-layer{display:none}
[data-view=play] .explore-only,[data-view=play] .location,[data-view=play] .inventory,[data-view=play] .key-strip{display:flex}
.location,.inventory,.event-log,.use-hint,.key-strip,.touch-controls{position:absolute;z-index:2}
.location{left:var(--left);top:calc(var(--top) + 52px);align-items:flex-start;flex-direction:column;gap:3px;max-width:45%;text-shadow:0 1px 4px #080808,0 0 9px #080808}
.biome{color:var(--gold);font:700 .75rem/1.2 var(--mono);letter-spacing:.055em;text-transform:uppercase}
.location strong{font:700 clamp(1.15rem,2.2vw,1.85rem)/1.03 var(--serif)}
.inventory{top:calc(var(--top) + 52px);right:var(--right);gap:5px}
.inventory span{height:28px;padding:0 6px;justify-content:center;gap:5px;background:#15110ed9;border:1px solid #78634f;border-radius:3px;color:#ffe5a1;font:700 .83rem/1 var(--mono)}
.inventory .icon{width:16px;height:16px}.inventory .ability{color:var(--mint)}
.event-log,.use-hint{left:50%;transform:translateX(-50%);width:max-content;max-width:min(590px,calc(100% - 28px));margin:0;text-align:center;pointer-events:none;padding:7px 12px;border-radius:4px;background:#161311ed;border:1px solid var(--hair);font-size:.88rem;line-height:1.25}
.event-log{top:var(--top);color:#fff2ca}
.use-hint{bottom:calc(var(--bottom) + 40px);font-weight:650;color:#ffdda3}
.key-strip{bottom:var(--bottom);right:var(--right);gap:10px;font-size:.78rem;color:#f1e5ce;pointer-events:none;padding:5px 9px;background:#19140fe0;border:1px solid #79635180;border-radius:3px}
.key-strip span{gap:4px}kbd{padding:1px 4px;border:1px solid #937f69a0;border-radius:2px;background:#332c26;font:600 .74rem/1.3 var(--mono);color:var(--ivory)}
.touch-controls{left:var(--left);right:var(--right);bottom:var(--bottom);justify-content:space-between;gap:6px;pointer-events:none}
.pad-group{gap:6px}
.touch-controls button{width:48px;height:48px;display:grid;place-items:center;pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;box-shadow:inset 0 -2px 0 #aa896133}
.touch-controls .jump-button{width:58px;background:#ffd18b;color:#231503;border-color:#e8a450}
.touch-controls [data-input=use][aria-disabled=true]{color:#d4c6b3;background:#211b16cc}
.touch-controls button.is-held{border-color:#ffc979;background:#c79252;color:#111}
.curtain{position:absolute;z-index:3;inset:0;display:grid;align-content:center;justify-items:start;padding:max(68px,calc(var(--top) + 52px)) max(6.4vw,var(--right)) max(26px,var(--bottom)) max(6.4vw,var(--left));background:linear-gradient(90deg,#100e10f0 0%,#161015d4 21%,#180f1476 48%,transparent 75%),linear-gradient(0deg,#160f15a3,transparent 43%);overflow:hidden}
.sheet{width:min(100%,610px);min-width:0}
.eyebrow{margin:0 0 19px;gap:9px;color:var(--gold);text-transform:uppercase;letter-spacing:.105em;font:700 .79rem/1.25 var(--mono)}
.eyebrow .icon{width:22px;height:22px}
h1,h2,h3,p{margin:0}
h1,h2{font-family:var(--serif);font-weight:700;letter-spacing:-.065em;text-shadow:0 2px 1px #160c0966}
h1{font-size:clamp(3.6rem,7.95vw,8.7rem);line-height:.86}
h1 em{display:block;color:var(--gold);font-weight:600;line-height:.87}
h2{font-size:clamp(2.5rem,5.2vw,5.1rem);line-height:1}
.deck{max-width:40ch;font-size:clamp(1rem,1.35vw,1.23rem);line-height:1.48;color:#f3e7d2;margin:22px 0 23px;text-wrap:pretty}
.actions{flex-wrap:wrap;gap:9px}
.gold,.secondary{justify-content:center;gap:9px;min-height:44px;padding:10px 16px;font-weight:750;font-size:.96rem;line-height:1.23}
.gold{color:#23180b;background:var(--gold);border:1px solid #f5bd6c;border-radius:4px;box-shadow:inset 0 -2px 0 #c88b46}
.gold .icon{width:17px;height:17px}
.minor-actions{gap:20px;margin-top:17px;flex-wrap:wrap}
.minor-actions button{gap:7px;background:transparent;border:0;border-bottom:1px solid #ccb38b76;padding:5px 0;font-size:.88rem;color:#f1dfbe}
.minor-actions .icon{width:16px;height:16px}
.result{margin:0 0 18px;color:#ffe0a0;font:600 .91rem/1.45 var(--mono)}
[data-view=guide] .curtain,[data-view=awards] .curtain,[data-view=map] .curtain{justify-items:center;background:#110e10df;padding-inline:var(--left);padding-block:max(62px,calc(var(--top) + 48px)) var(--bottom)}
.utility,.map-sheet{width:min(100%,870px);max-height:100%;overflow:auto;overscroll-behavior:contain;scrollbar-color:#876b4a #201b17;padding:clamp(12px,2.5vw,33px);border:1px solid #80684b80;color:var(--pale);background:linear-gradient(140deg,#28221c,#171516);border-radius:5px}
.utility h2,.map-sheet h2{font-size:clamp(1.85rem,4.5vmin,3.3rem);color:var(--ivory)}
.utility .eyebrow,.map-sheet .eyebrow{margin-bottom:8px}
.field-notes,.award-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px 21px;margin:18px 0}
.field-notes p,.award-entry{font-size:.94rem;line-height:1.42;border-left:2px solid #6d5946;padding-left:11px}
.field-notes b,.award-entry strong{display:block;color:var(--ivory);margin-bottom:3px}
.award-entry[data-earned=true]{border-color:var(--gold)}.award-entry[data-earned=true] strong{color:var(--gold)}
.map-title{display:flex;align-items:center;justify-content:space-between;gap:9px;margin-bottom:12px}
.utility-title{position:sticky;top:0;display:flex;justify-content:space-between;align-items:center;gap:7px;padding-bottom:6px;background:#26211d}
#cave-map{min-width:0}
noscript{position:absolute;inset:35% 10% auto;z-index:7;padding:14px;background:#1c1715}
@media(hover:hover){.tool:hover,.secondary:hover,.touch-controls button:hover{border-color:var(--gold)}.gold:hover{background:#ffda99}.minor-actions button:hover{color:var(--gold);border-color:var(--gold)}}
@media(pointer:coarse),(max-width:760px){
  [data-view=play] .touch-controls{display:flex}
  [data-view=play] .key-strip{display:none}
  .use-hint{bottom:calc(var(--bottom) + 58px)}
  .event-log{top:auto;bottom:calc(var(--bottom) + 98px)}
}
@media(max-width:540px) and (orientation:portrait){
  .curtain{align-content:end;padding:76px max(20px,var(--right)) max(34px,var(--bottom)) max(20px,var(--left));background:linear-gradient(0deg,#130f12fa 0%,#171115e8 27%,#170f15b3 49%,transparent 81%)}
  h1{font-size:clamp(3.45rem,14.6vw,5.5rem)}h2{font-size:clamp(2.5rem,11vw,3.4rem)}
  .eyebrow{margin-bottom:14px}
  .deck{font-size:1rem;line-height:1.38;margin:16px 0 18px}
  .minor-actions{gap:14px;margin-top:12px}
  .location{max-width:67%}.location strong{font-size:1.16rem}
  .use-hint{top:calc(var(--top) + 96px);bottom:auto}
  .event-log{top:calc(var(--top) + 136px);bottom:auto}
  .tool{min-height:42px;padding:6px 9px}
  .field-notes,.award-list{grid-template-columns:1fr;gap:11px;margin:14px 0}
  .field-notes p,.award-entry{font-size:.88rem}
  [data-view=guide] .curtain,[data-view=awards] .curtain,[data-view=map] .curtain{align-content:center}
}
@media(max-width:390px){#map-open span{display:none}#map-open{width:43px}.utility-title h2{font-size:1.65rem}.utility-title .secondary{font-size:.82rem;padding-inline:9px}}
@media(max-height:490px) and (orientation:landscape){
  .mine{--edge:8px}.tool,.tool.icon-btn{min-height:35px;height:35px}.tool.icon-btn{width:37px}
  .curtain{padding:48px max(4vw,var(--right)) 13px max(4vw,var(--left))}
  h1{font-size:clamp(2.85rem,12vh,4.2rem)}h1 em{display:inline}
  h2{font-size:2.3rem}
  .eyebrow{margin-bottom:6px;font-size:.71rem}.eyebrow .icon{width:17px;height:17px}
  .deck{font-size:.94rem;line-height:1.32;margin:9px 0 12px}
  .gold,.secondary{min-height:38px;padding:7px 12px}
  .minor-actions{margin-top:6px}.location{top:calc(var(--top) + 40px)}.location strong{font-size:1.08rem}
  .inventory{top:calc(var(--top) + 40px)}
  .touch-controls button{width:39px;height:39px}.touch-controls .jump-button{width:45px}
  .use-hint{bottom:var(--bottom);max-width:38%;font-size:.75rem}.event-log{bottom:calc(var(--bottom) + 47px);font-size:.77rem}
  [data-view=guide] .curtain,[data-view=awards] .curtain,[data-view=map] .curtain{padding-top:47px}
  .utility,.map-sheet{padding:8px 14px}.map-title{margin-bottom:4px}
  .utility .eyebrow,.map-sheet .eyebrow{display:none}
  .field-notes,.award-list{gap:6px 12px;margin:7px 0}.field-notes p,.award-entry{font-size:.78rem;line-height:1.28}
  .result{margin-bottom:8px}
}
@media(max-width:350px){.touch-controls button{width:43px;height:46px}.pad-group{gap:4px}.touch-controls .jump-button{width:51px}.actions{gap:6px}.gold,.secondary{padding-inline:10px}.field-notes p,.award-entry{line-height:1.32}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
.mine-language:empty,html:lang(en) .title-space{display:none}
.mine-language{display:inline-flex;align-items:center}
@media(max-width:540px) and (orientation:portrait){
  html:is(:lang(es),:lang(pt)) h1{font-size:clamp(2.3rem,11.3vw,3.9rem)}
  [data-view=play] .home span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
}

.mine[data-view="title"] .curtain {
  align-content: end; padding-bottom: clamp(30px,10vh,120px);
  background: linear-gradient(0deg,#17100df7 0%,#1a0f10c4 24%,transparent 66%),
              linear-gradient(90deg,#160b1194,transparent 67%),url("../../launcher-art/emberdeep.webp") center 45%/cover;
}
.title-sheet h1 { color: #fff0df; text-shadow: 0 4px 26px #180b08; }
.title-sheet h1 em { color: #ff9a67; }
.title-sheet .actions { margin-top: clamp(16px,3vh,35px); }
.title-sheet .gold { background: #ffb17d; border-color: #ffc09b; border-radius: 0; box-shadow: inset 4px 0 #f26a43; }
.title-sheet .minor-actions button { border: 0; }
.mine[data-view=play] .key-strip { display: none; }
@media (max-width: 620px) {
  .mine[data-view="title"] .curtain { background-position: center,center,45% 45%; padding-bottom: max(42px,8dvh); }
}
@media (max-height: 445px) { .mine[data-view="title"] .curtain { padding-bottom: 12px; } }

#pause-sheet, #end-sheet { border-inline-start: 3px solid #ed9c59; padding: 4px 0 4px clamp(14px,2vw,28px); }
#pause-sheet .gold, #end-sheet .gold { border-radius: 0; box-shadow: none; }
