.game[data-view="explore"] { background:#263638; }
.exploration-screen { position:absolute; inset:0; z-index:8; overflow:hidden; color:#eae1cb; background:#263638; font:14px/1.4 "Microsoft YaHei","PingFang SC",sans-serif; }
.exploration-screen[hidden] { display:none; }
.exploration-map-layer { position:absolute; inset:0; }
.exploration-map-layer[inert] { opacity:.25; }
.exploration-screen, .exploration-screen * { -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; -webkit-tap-highlight-color:transparent; }
.dungeon-ground { position:absolute; inset:0; pointer-events:none; background:radial-gradient(ellipse at 50% 40%,#72908440,transparent 65%),linear-gradient(#243739a0,#233131a0),url('./assets/exploration/cards/empty.webp') center / 340px 340px; opacity:.75; filter:blur(2px); }
.exploration-screen::after { content:''; position:absolute; inset:0; pointer-events:none; box-shadow:inset 0 0 70px #101f2660; }
.exploration-heading { position:absolute; z-index:4; top:max(16px,env(safe-area-inset-top)); left:5%; right:5%; display:flex; align-items:center; justify-content:space-between; }
.exploration-heading p { margin:0 0 3px; color:#c0cdbf; font-size:11px; letter-spacing:2px; }
.exploration-heading h1 { margin:0; font:700 23px/1.4 Georgia,"Songti SC",serif; letter-spacing:3px; color:#f5e7bd; }
.exploration-heading button, .map-footer button { padding:8px 11px; border:1px solid #b4a176; border-radius:9px; background:linear-gradient(#fff3d5,#e6d4b1); color:#3e5554; white-space:nowrap; }
.exploration-hero-state { position:absolute; z-index:4; top:max(82px,calc(env(safe-area-inset-top) + 66px)); left:5%; right:5%; height:53px; display:flex; align-items:center; gap:9px; padding:5px 11px 5px 5px; border:1px solid #9b9775; border-radius:12px; background:linear-gradient(110deg,#fff7e7f5,#e7e3cff5); color:#30545a; box-shadow:0 3px 12px #11252955; text-align:left; }
.exploration-hero-state > img { width:44px; height:44px; object-fit:contain; }
.exploration-hero-state > span { flex:1; }
.exploration-hero-state strong { display:block; font-size:13px; }
.exploration-hero-state small { color:#77988a; }
.exploration-hero-state b { font-size:12px; font-weight:500; }
.exploration-hp-track { display:block; overflow:hidden; height:5px; margin-top:7px; border-radius:6px; background:#cbd9ca; }
#exploration-hp-fill { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#73ac8b,#b0c979); }
.map-viewport { position:absolute; inset:147px 0 58px; overflow:hidden; touch-action:none; cursor:grab; mask-image:linear-gradient(transparent,#000 3%,#000 97%,transparent); }
.map-viewport:active { cursor:grabbing; }
.card-world { position:absolute; width:0; height:0; will-change:transform; }
.card-world.following { transition:transform 440ms ease-in-out; }
.map-route { position:absolute; left:0; top:-32px; z-index:2; width:1px; height:1px; overflow:visible; pointer-events:none; filter:drop-shadow(0 1px 2px #102627); }
.map-route[hidden] { display:none; }
#route-line { fill:none; stroke:#f0dca3; stroke-width:3; stroke-dasharray:3 9; stroke-linecap:round; stroke-linejoin:round; opacity:.85; }
#route-end { fill:#e9d39433; stroke:#f0dca3; stroke-width:2; }
.room-card { position:absolute; width:var(--tile-size); height:var(--tile-size); perspective:600px; border-radius:8px; box-shadow:0 6px 0 #142a2c,0 9px 12px #0b161e88; }
.room-card.revealing { z-index:2; background:radial-gradient(ellipse at center,#bed9a8,#466c61); }
.room-card.revealing::before { content:''; position:absolute; inset:-4px; border:2px solid #deefb3; border-radius:10px; box-shadow:0 0 14px #c2e5a9b0,inset 0 0 15px #c2e5a970; pointer-events:none; animation:room-glow 1400ms ease-out both; }
.card-scene { width:100%; height:100%; border:2px solid #a89c79; border-radius:7px; overflow:hidden; background:#676659; }
.card-scene img { display:block; width:100%; height:100%; object-fit:cover; }
.card-scene.mirrored img { transform:scaleX(-1); }
.card-scene.warm img { filter:sepia(.08) saturate(1.08); }
.unknown .card-scene img { filter:saturate(.7) brightness(.85); }
.tile-hit { position:absolute; inset:0; width:100%; height:100%; border:0; border-radius:7px; padding:0; outline:none; appearance:none; -webkit-appearance:none; background:transparent; cursor:pointer; touch-action:none; }
.tile-hit:focus-visible { outline:none; background:transparent; }
.room-card.selected, .room-card:has(.tile-hit:focus-visible) { box-shadow:0 0 0 3px #f7d87f,0 0 19px #edb74999,0 6px 0 #263a39; }
.room-card.current .card-scene { border-color:#a4d9ba; }
.boss-card .card-scene { border-color:#c6a0d0; box-shadow:0 0 12px #be86b850; }
.tile-state { position:absolute; right:5px; bottom:5px; color:#fff8df; font:bold 11px/18px sans-serif; text-align:center; width:18px; border-radius:50%; background:#4b8d77; pointer-events:none; }
.tile-state:empty { display:none; }
.boss-label { display:none; position:absolute; left:50%; top:3px; transform:translateX(-50%); color:#fff2d8; background:#503d63db; border:1px solid #c2a4aa; border-radius:5px; padding:2px 9px; font-size:10px; pointer-events:none; }
.boss-card .boss-label { display:block; }
.entrance-card .boss-label { display:block; background:#456459db; border-color:#a7baa0; }
.map-hero { position:absolute; z-index:3; width:46px; height:51px; transform:translate(-50%,-100%); pointer-events:none; }
.map-hero img { position:relative; z-index:2; width:100%; height:100%; object-fit:contain; filter:drop-shadow(0 3px 2px #1b3b4266); }
.hero-shadow { position:absolute; bottom:-3px; left:15%; width:70%; height:9px; background:#243d4370; border-radius:50%; }
.hero-marker { position:absolute; z-index:3; top:-14px; left:17px; color:#ffd97c; font-size:13px; text-shadow:0 1px #344f50; }
.facing-left img { scale:-1 1; }
.walking img { animation:hero-step 160ms ease-in-out infinite alternate; }
.map-footer { position:absolute; z-index:5; left:5%; right:5%; bottom:max(13px,calc(env(safe-area-inset-bottom) + 9px)); display:flex; align-items:center; gap:7px; font-size:10px; }
.map-footer > span { flex:1; color:#d4e0ca; }
.map-footer button { padding:7px 9px; font-size:11px; }
.has-selection .map-footer { bottom:max(255px,calc(env(safe-area-inset-bottom) + 245px)); }
.room-panel { position:absolute; z-index:6; left:4%; right:4%; bottom:max(12px,env(safe-area-inset-bottom)); height:230px; padding:12px; border:2px solid #bfa171; border-radius:12px; background:linear-gradient(110deg,#fff6df,#e9e1cd); color:#3a5855; box-shadow:inset 0 0 0 2px #fff9e4,0 7px 25px #142c3670; transform:translateY(calc(100% + 40px)); visibility:hidden; transition:transform 200ms ease,visibility 200ms; display:grid; grid-template-columns:76px 1fr; grid-template-rows:130px 17px 38px; gap:5px 10px; }
.has-selection .room-panel { visibility:visible; transform:translateY(0); }
#room-preview { width:76px; height:76px; border-radius:7px; align-self:center; object-fit:cover; }
.room-panel-close { position:absolute; top:4px; right:6px; width:29px; height:29px; padding:0; border:0; background:transparent; color:#647e70; font-size:23px; }
.room-panel-copy { padding-top:2px; padding-right:12px; }
.room-panel-copy small { font-size:10px; color:#788d70; }
.room-panel-copy h2 { font-size:16px; margin:3px 0 5px; color:#335b56; }
.room-panel-copy p { font-size:11px; line-height:1.5; margin:0; color:#617369; }
.room-condition { grid-column:1/-1; margin:0; color:#6a8168; font-size:10px; }
.room-panel-actions { grid-column:1/-1; display:flex; gap:8px; }
.room-panel-actions > button { flex:1; }
.room-panel-actions > button[hidden] { display:none; }
.room-action { border:1px solid #be984c; border-radius:7px; background:linear-gradient(#ffe8a9,#efc66b); box-shadow:inset 0 0 0 2px #fff4c760; color:#5a5136; font-weight:700; font-size:15px; }
.room-leave { border:1px solid #a6b496; border-radius:7px; background:#e1e6d5; color:#516b5f; font-size:14px; }
.room-story { position:absolute; inset:0; z-index:7; display:grid; place-items:center; overflow-y:auto; padding:max(38px,env(safe-area-inset-top)) 9% max(38px,env(safe-area-inset-bottom)); background:linear-gradient(180deg,#101e21e8,#0a171ced 70%,#0b171bf5); animation:story-veil 450ms ease-out both; }
.room-story[hidden] { display:none; }
.room-story::before { content:''; position:absolute; inset:0; pointer-events:none; background:var(--story-art) center / cover; filter:blur(6px) saturate(.45); opacity:.11; }
.story-copy { position:relative; width:100%; max-width:340px; margin:auto; color:#d9dfd3; font-family:Georgia,"Songti SC","SimSun",serif; }
.story-floor { margin:0 0 22px; color:#829d97; font:11px/1.5 "Microsoft YaHei",sans-serif; letter-spacing:3px; animation:story-title 650ms ease-out both; }
#story-name { margin:0 0 34px; color:#efe1bb; font-size:30px; font-weight:500; letter-spacing:4px; animation:story-title 650ms 100ms ease-out both; }
.story-description { font-size:16px; line-height:1.95; letter-spacing:1px; }
.story-description p { margin:0 0 22px; }
.story-letter { animation:story-letter 420ms ease-out both; }
.story-actions { display:flex; gap:12px; margin-top:28px; animation:story-title 450ms ease-out both; }
.story-result { margin:28px 0 0; padding:14px 16px; border-left:2px solid #b4a479; background:#b4a47912; color:#efe1bb; font:14px/1.8 "Microsoft YaHei",sans-serif; white-space:pre-line; }
.story-rewards { display:grid; gap:10px; margin-top:18px; }
.story-rewards button { padding:14px; border:1px solid #6c8981; border-radius:4px; background:#18312ddd; color:#d9dfd3; text-align:left; font:13px/1.6 "Microsoft YaHei",sans-serif; }
.story-rewards strong, .story-rewards span { display:block; }
.story-rewards strong { margin-bottom:4px; color:#efe1bb; font-size:15px; }
.story-rewards button:disabled { opacity:.45; }
.story-result[hidden], .story-rewards[hidden] { display:none; }
.story-actions[hidden], .story-actions button[hidden] { display:none; }
.story-actions button { flex:1; min-height:46px; padding:10px; border:1px solid #b4a479; border-radius:4px; background:#d9c99d; color:#263d3b; font:14px "Microsoft YaHei",sans-serif; letter-spacing:2px; }
#story-leave { background:transparent; color:#c9d6cb; border-color:#6c8981; }
@keyframes story-veil { from { opacity:0; } to { opacity:1; } }
@keyframes story-title { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes story-letter { from { opacity:0; } to { opacity:1; } }
.room-action:disabled { background:#dde3d3; border-color:#c6d1bc; color:#83937e; }
.die.enchanted strong::after,.hero-face.enchanted strong::after { content:' ✦'; color:#a47724; }
@keyframes hero-step { to { translate:0 -3px; rotate:2deg; } }
@keyframes room-glow { 0% { opacity:0; } 18%,70% { opacity:1; } 100% { opacity:.3; } }
@media (max-height:650px) { .exploration-heading { top:max(10px,env(safe-area-inset-top)); } .exploration-heading h1 { font-size:20px; } .exploration-hero-state { top:69px; height:46px; } .map-viewport { top:126px; } .room-panel { height:216px; grid-template-columns:62px 1fr; grid-template-rows:116px 17px 36px; padding:10px; gap:4px 8px; } #room-preview { width:62px; height:62px; } .has-selection .map-footer { bottom:241px; } .room-panel-copy p { font-size:10px; } .room-panel-copy h2 { font-size:14px; margin-bottom:3px; } }
@media (prefers-reduced-motion:reduce) { .card-world.following,.room-panel,.map-viewport { transition:none; } .walking img { animation:none; } }
@media (prefers-reduced-motion:reduce) { .room-story,.story-floor,#story-name,.story-letter,.story-actions { animation:none; } }

.map-footer > span { overflow-wrap:anywhere; }
.end-screen { overflow-y:auto; justify-content:safe center; padding:max(22px,env(safe-area-inset-top)) 6% max(22px,env(safe-area-inset-bottom)); background:linear-gradient(#203c3cf5,#142c33f5); }
.end-screen h1 { font-size:clamp(24px,8cqw,36px); }
.adventure-result { width:100%; padding:12px 14px; border:1px solid #a99970; border-radius:10px; background:#fff3d7; color:#395752; text-align:left; }
.adventure-result p { display:flex; flex-direction:column; gap:3px; margin:0 0 10px; color:#395752; font-size:12px; overflow-wrap:anywhere; }
.adventure-result p:last-child { margin:0; }
.adventure-result b { color:#758163; font-size:10px; }
.end-screen .record-status { font-size:11px; margin:3px 0 7px; }
.floor-actions { display:flex; gap:10px; width:100%; }
.floor-actions[hidden] { display:none; }
.floor-actions button { flex:1; min-height:46px; padding:10px; border:1px solid #c3a76c; border-radius:9px; color:#405653; background:#f0e4c7; font-weight:700; }
#continue-deeper { background:linear-gradient(#ffe3a0,#dfbc6e); }
.end-screen .execute { min-height:46px; flex-shrink:0; }
@media(max-height:650px) { .end-screen { justify-content:flex-start; gap:6px; padding-block:16px; } .end-screen > p { font-size:12px; margin-bottom:4px; } .adventure-result { padding:10px; } .adventure-result p { margin-bottom:6px; font-size:11px; } }
