@import url("./fonts.css");
@import url("./navigation.css");
* { box-sizing: border-box; }
html { margin: 0; background: #303b42; scrollbar-color: #87917a #303b42; }
body { position: relative; margin: 0; overflow-x: hidden; color: #f2e5b9; font-family: "GNF", monospace; }
#volcano { position: absolute; top: 0; left: 0; display: block; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
#descent { position: relative; width: 100%; }
#forest-sign { position: absolute; z-index: 1; display: flex; flex-direction: column; justify-content: center; gap: .14em; margin: 0; padding: 0; color: #343322; font-family: "GNF", monospace; font-weight: 800; line-height: 1.18; -webkit-text-stroke: var(--sign-ink-width, .4px) currentColor; text-align: center; text-shadow: 1px 1px #dfcd80; pointer-events: none; }
#forest-sign span { display: block; white-space: nowrap; }
.photo-stack { position: absolute; z-index: 1; display: block; border: 0; padding: 0; background: transparent; cursor: pointer; isolation: isolate; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.photo-card { position: absolute; top: 50%; left: 0; width: 100%; padding: clamp(3px, .4vw, 7px); border: 1px solid #d6c8a1; border-radius: 6px; background: #f2e5b9; box-shadow: 2px 5px 12px #17202466; will-change: transform; pointer-events: auto; }
.photo-card img { display: block; width: 100%; height: auto; border-radius: 3px; image-rendering: auto; user-select: none; pointer-events: none; }
.photo-stack:focus-visible { outline: 3px dashed #ffe2a0; outline-offset: 14px; border-radius: 6px; }
.photo-stack:hover .photo-card { box-shadow: 3px 7px 17px #17202488; }
.photo-stack.is-shuffling { z-index: 2; }
#stone-creature { position: absolute; z-index: 1; border: 0; padding: 0; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#stone-creature:focus-visible { outline: 2px dashed #a8b399; outline-offset: 5px; }
#creature-speech { position: absolute; z-index: 2; width: max-content; max-width: min(320px, calc(100vw - 32px)); margin: 0; padding: 14px 17px; transform: translate(-50%, -100%); border: 3px solid #253b32; box-shadow: 4px 4px #202a30; background: #f2e5b9; color: #253b32; font-size: clamp(14px, 1.6vw, 18px); line-height: 1.5; text-align: center; pointer-events: none; }
#creature-speech::after { content: ""; position: absolute; top: 100%; left: 50%; width: 13px; height: 13px; border-right: 3px solid #253b32; border-bottom: 3px solid #253b32; background: #f2e5b9; transform: translate(-50%, -5px) rotate(45deg); }
.exit { position: fixed; z-index: 3; top: clamp(23px, 3.5vh, 40px); left: clamp(22px, 3.5vw, 55px); color: #f7e9bd; text-decoration: underline; text-underline-offset: 5px; text-shadow: 2px 2px #394b3c; }
.exit:focus-visible { outline: 2px dashed #ffe2a0; outline-offset: 7px; }
.volcano-title { position: fixed; z-index: 2; top: clamp(75px, 12vh, 132px); left: 50%; width: calc(100% - 36px); transform: translateX(-50%); text-align: center; color: #384b3d; pointer-events: none; }
.volcano-title h1 { margin: 0; font-family: "GNF", monospace; font-size: clamp(30px, 4.5vw, 58px); line-height: 1.2; font-weight: 400; text-shadow: 3px 3px #eee1b8; }
.descent-hud { position: fixed; z-index: 2; bottom: 24px; left: clamp(20px, 3.5vw, 55px); right: clamp(20px, 3.5vw, 55px); display: flex; align-items: end; justify-content: flex-end; gap: 16px; pointer-events: none; color: #f2e5b9; font-size: 10px; line-height: 1.6; text-shadow: 2px 2px #263b32; }
#descent-depth { white-space: nowrap; text-align: right; }
.descent-hint { position: fixed; z-index: 2; left: 50%; bottom: 57px; transform: translateX(-50%); margin: 0; font-size: 10px; color: #f7e7b8; text-shadow: 2px 2px #263b32; white-space: nowrap; pointer-events: none; }
.descent-hint span { display: inline-block; margin-left: 9px; }
.photo-viewer-open { overflow: hidden; }
#volcano-gallery { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; overflow: hidden; background: transparent; color: #f5e6b8; font-family: "GNF", monospace; }
#volcano-gallery::backdrop { background: rgb(30 24 17 / 76%); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.gallery-shell { width: 100%; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: clamp(18px, 3.5vh, 40px) 0 max(22px, env(safe-area-inset-bottom)); animation: gallery-appear 220ms ease-out; }
.gallery-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 clamp(20px, 5vw, 80px); }
.gallery-header h2 { margin: 0; font-size: clamp(15px, 2vw, 23px); font-weight: 400; line-height: 1.5; text-shadow: 2px 2px #302417; }
.gallery-orbit { position: relative; min-height: 0; container-type: size; isolation: isolate; perspective: 1400px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.gallery-orbit.is-dragging { cursor: grabbing; }
.gallery-photo { position: absolute; top: 50%; left: 50%; width: min(76vw, 1180px); width: min(76vw, 1180px, calc((100cqh - 40px) * var(--photo-ratio, 1.5))); aspect-ratio: var(--photo-ratio, 1.5); margin: 0; padding: 4px; background: #e9dcb9; box-shadow: 0 0 0 2px #8b6941, 6px 6px 0 2px rgb(24 17 10 / 65%); will-change: transform; pointer-events: none; transform-origin: center; }
.gallery-photo img { display: block; width: 100%; height: 100%; object-fit: contain; background: #2c251b; pointer-events: none; }
.gallery-footer { position: relative; z-index: 20; display: grid; justify-items: center; gap: 18px; padding-top: 4px; }
.gallery-controls { display: flex; align-items: center; gap: clamp(24px, 4vw, 60px); }
.wood-button { display: grid; place-items: center; flex: 0 0 auto; width: 48px; height: 44px; border: 0; border-radius: 0; padding: 13px; color: #ffe5a9; background: repeating-linear-gradient(0deg, #79542f 0 7px, #825d36 7px 9px, #79542f 9px 15px); box-shadow: inset 0 2px #bc9259, inset 0 -3px #50371f, 0 -3px #ac8350, 3px 0 #ac8350, 0 3px #49321e, -3px 0 #ac8350, 3px 6px #241a12; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wood-button svg { display: block; width: 100%; height: 100%; fill: currentColor; shape-rendering: crispEdges; filter: drop-shadow(1px 2px #3c2a1a); }
.wood-button:hover { color: #fff5cd; background: repeating-linear-gradient(0deg, #956c3d 0 7px, #a47a47 7px 9px, #956c3d 9px 15px); }
.wood-button:active { transform: translateY(3px); box-shadow: 0 -3px #ac8350, 3px 0 #ac8350, 0 3px #49321e, -3px 0 #ac8350; }
.wood-button:focus-visible { outline: 2px dashed #ffe5a9; outline-offset: 8px; }
.gallery-close { width: 38px; height: 36px; padding: 11px; }
.gallery-count { min-width: 92px; margin: 0; text-align: center; font-size: 16px; font-variant-numeric: tabular-nums; }
#volcano-gallery-help { margin: 0; color: #d4c3a0; font-size: 10px; line-height: 1.6; letter-spacing: 1px; text-align: center; }
@keyframes gallery-appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .gallery-shell { animation: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 600px) {
  .volcano-title { top: 13vh; }
  .volcano-title h1 { font-size: 30px; }
  .descent-hud { bottom: max(19px, env(safe-area-inset-bottom)); font-size: 8px; }
  .descent-hint { font-size: 9px; }
  .gallery-photo { width: 84vw; width: min(84vw, calc((100cqh - 40px) * var(--photo-ratio, 1.5))); padding: 3px; }
  .gallery-header h2 { max-width: 220px; font-size: 14px; }
  .gallery-footer { gap: 17px; }
  #volcano-gallery-help { max-width: calc(100vw - 32px); font-size: 9px; letter-spacing: 0; }
}
