/* v661: three scenic cards and a persistent action row; no gameplay changes. */
body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2){position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;max-width:none!important;max-height:none!important;margin:0!important;transform:none!important;border:0!important;border-radius:0!important;background:var(--tp-surface)!important;overflow:hidden!important;color:var(--tp-ink)!important;}
body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2)>.sheet-head{position:absolute!important;inset:8px 12px auto!important;height:52px!important;min-height:0!important;padding:6px 12px!important;background:var(--tp-surface)!important;border-radius:22px!important;display:flex!important;color:var(--tp-ink)!important;}
body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2) .sheet-head h2{background:var(--tp-surface)!important;color:var(--tp-ink)!important;padding:6px 16px!important;border-radius:24px!important;font-size:22px!important;}
body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2)>:is(.sheet-handle,.sheet-environment,.v4-system-rail){display:none!important;}
body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2)>.sheet-scroll{position:absolute!important;inset:68px 12px 10px!important;height:auto!important;padding:0!important;overflow:hidden!important;}
body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2) [data-home-panel="explore"]{position:relative!important;inset:auto!important;width:100%!important;height:100%!important;padding:0!important;margin:0!important;overflow:hidden!important;background:none!important;}
body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2) .ex-panel{display:flex!important;flex-direction:column!important;height:100%!important;min-height:0!important;gap:6px!important;padding:0!important;overflow:hidden!important;}
body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2) .ex-panel>:is(.ex-status,.staff-msg:empty){display:none!important;}
body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2) button{background:var(--tp-surface)!important;color:var(--tp-ink)!important;border:1px solid var(--tp-edge)!important;box-shadow:none!important;text-shadow:none!important;}
body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2) .ex-idle-tabs{flex:none!important;margin:0!important;padding:0!important;}
body[data-ui-version="3"] #app .cave-template-v2{display:flex!important;flex:1!important;flex-direction:column!important;min-height:0!important;height:auto!important;gap:8px!important;padding:12px!important;border-radius:24px!important;overflow:hidden!important;background:linear-gradient(#e8effa44,#e8effa77),url("../img/mining-park/mining-park-overview-v1.webp") center/cover!important;font-size:15px!important;}
body[data-ui-version="3"] #app .cave-template-v2 *{box-sizing:border-box!important;text-shadow:none!important;}
body[data-ui-version="3"] #app .cave-template-v2 :is(b,strong,small,em,p,span,h3,summary){color:var(--tp-ink)!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-board-heading{flex:none!important;gap:8px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-board-heading h3{background:var(--tp-surface)!important;color:var(--tp-ink)!important;border:1px solid var(--tp-edge)!important;box-shadow:none!important;font-size:20px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-board-heading>span{background:var(--tp-surface)!important;color:var(--tp-ink)!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-browse{display:flex!important;gap:6px!important;margin-left:auto!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-browse button{width:40px!important;height:36px!important;min-height:36px!important;border-radius:12px!important;font-size:24px!important;padding:0!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-strip{flex:1!important;min-height:0!important;display:grid!important;grid-auto-flow:column!important;grid-auto-columns:calc((100% - 24px)/3)!important;gap:12px!important;align-items:stretch!important;padding:4px!important;overflow-x:auto!important;overflow-y:hidden!important;scrollbar-width:thin!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-strip::before{display:none!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-card{--cave-accent:#dcd7fa!important;display:flex!important;flex-direction:column!important;align-items:center!important;gap:4px!important;min-height:0!important;height:100%!important;padding:0 8px 8px!important;background:var(--tp-surface)!important;color:var(--tp-ink)!important;border:1px solid var(--tp-edge)!important;border-radius:22px!important;overflow:hidden!important;opacity:1!important;box-shadow:var(--tp-shadow)!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-card:is(.is-on,[aria-pressed="true"]){background:var(--tp-blue)!important;border-color:var(--tp-edge)!important;box-shadow:var(--tp-shadow)!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-scene{position:static!important;width:calc(100% + 16px)!important;margin:0 -8px!important;height:0!important;flex:1!important;min-height:40px!important;aspect-ratio:auto!important;object-fit:cover!important;border-radius:18px 18px 0 0!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-level{position:relative!important;margin-top:-15px!important;padding:3px 20px!important;background:var(--tp-surface)!important;color:var(--tp-ink)!important;border:1px solid var(--tp-edge)!important;border-radius:18px!important;font-size:15px!important;box-shadow:none!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-card>strong{font-size:21px!important;line-height:1.2!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-card>small{font-size:12px!important;line-height:1.2!important;color:var(--tp-ink)!important;padding:0!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-gain{font-size:12px!important;font-style:normal!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-materials{display:flex!important;flex:none!important;gap:8px!important;margin:0!important;padding:0!important;flex-wrap:nowrap!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-materials>span{background:var(--tp-surface)!important;padding:5px!important;border-radius:12px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-materials .inv-art{width:40px!important;height:40px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-selection{position:relative!important;display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr) 150px!important;flex:none!important;max-height:none!important;overflow:visible!important;gap:10px!important;padding:10px!important;background:var(--tp-surface)!important;border-radius:18px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-selection-copy{min-width:0!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-selection-copy p{font-size:12px!important;margin:2px 0!important;}
body[data-ui-version="3"] #app .cave-template-v2 details[open]{position:absolute!important;bottom:100%!important;left:0!important;z-index:5!important;width:min(500px,100%)!important;max-height:180px!important;overflow:auto!important;padding:12px!important;background:var(--tp-surface)!important;border:1px solid var(--tp-edge)!important;border-radius:16px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .ex-stage-chips{display:flex!important;flex-wrap:wrap!important;gap:4px!important;margin:0!important;}
body[data-ui-version="3"] #app .cave-template-v2 .ex-stage-chip{min-height:36px!important;padding:4px 8px!important;font-size:12px!important;background:var(--tp-surface)!important;color:var(--tp-ink)!important;border:1px solid var(--tp-edge)!important;border-radius:10px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .ex-stage-chip:is(.is-on,[aria-pressed="true"]){background:var(--tp-blue)!important;color:#10324f!important;border-color:var(--tp-edge)!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-selection>.ex-enter{width:100%!important;min-width:0!important;min-height:48px!important;padding:6px 12px!important;background:var(--tp-primary)!important;color:#10324f!important;border:1px solid var(--tp-edge)!important;border-radius:18px!important;font-size:16px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .ex-enter b{color:var(--tp-ink)!important;}
body[data-ui-version="3"] #app .cave-template-v2 button:disabled{opacity:1!important;color:var(--tp-muted)!important;cursor:not-allowed!important;}
body[data-ui-version="3"] #app .cave-template-v2 .ex-enter:disabled{background:var(--tp-disabled)!important;border-color:var(--tp-edge)!important;color:var(--tp-muted)!important;}
body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2) .ex-idle-tabs button[aria-selected="true"]{background:var(--tp-blue)!important;color:#10324f!important;border-color:var(--tp-edge)!important;}
@media(max-height:500px){
body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2)>.sheet-head{inset:4px 8px auto!important;height:40px!important;padding:2px 8px!important;}
body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2) .sheet-head h2{font-size:17px!important;padding:3px 12px!important;}
body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2)>.sheet-scroll{inset:48px 8px 6px!important;}
body[data-ui-version="3"] #app .cave-template-v2{padding:6px!important;gap:4px!important;border-radius:16px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-board-heading h3{font-size:15px!important;padding:2px 12px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-board-badge{width:22px!important;height:22px!important;font-size:16px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-card{gap:2px!important;border-radius:14px!important;padding-bottom:4px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-level{font-size:11px!important;padding:1px 12px!important;margin-top:-11px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-card>strong{font-size:15px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-card>small{font-size:10px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-gain{font-size:10px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-materials .inv-art{width:24px!important;height:24px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-materials>span{padding:2px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-selection{padding:6px!important;gap:6px!important;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr) 126px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-selection-copy{font-size:12px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .cave-selection-copy p{font-size:10px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .ex-stage-chip{font-size:10px!important;min-height:28px!important;padding:3px 5px!important;}
body[data-ui-version="3"] #app .cave-template-v2 .ex-enter{font-size:13px!important;}
}

body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2)>.sheet-head{transform:none!important;top:6px!important;bottom:auto!important;overflow:visible!important}
body[data-ui-version="3"] #app .cave-template-v2 .cave-selection>.cave-selection-copy{grid-column:1!important;grid-row:1!important;background:none!important}
body[data-ui-version="3"] #app .cave-template-v2 .cave-selection>.ex-stage-chips{grid-column:2!important;grid-row:1!important}
body[data-ui-version="3"] #app .cave-template-v2 .cave-selection>.ex-enter{grid-column:3!important;grid-row:1!important}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-card>.cave-zone-materials{min-height:50px!important}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-card>:not(.cave-zone-scene){flex-shrink:0!important}
@media(max-height:500px){
body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2) .ex-idle-tabs button{min-height:32px!important;height:32px!important;padding:3px!important;font-size:12px!important}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-card>.cave-zone-materials{min-height:28px!important}
body[data-ui-version="3"] #app .cave-template-v2 .cave-board-heading>span{max-width:none!important;font-size:10px!important}
}

body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2)>.sheet-head{margin:0!important;min-height:0!important;align-items:center!important}

body[data-ui-version="3"] #app .player-sheet:has([data-home-panel="explore"]:not([hidden]) .cave-template-v2) .sheet-head #sheet-title::before{display:none!important}

/* 11-07 老闆：礦洞左右滑動，手機直式一次看大半張 */
body[data-ui-version="3"] #app#app#app#app .cave-template-v2 .cave-zone-card{scroll-snap-align:start!important}
@media(max-width:600px){body[data-ui-version="3"] #app#app#app#app .cave-template-v2 .cave-zone-strip{grid-auto-columns:78%!important}}
/* 跑馬燈已由外框讓位，面板不再往下推，否則上下各少一段高度，卡片會被壓扁 */
html body.has-marquee[data-ui-version="3"] #app#app#app#app .player-sheet .cave-template-v2.cave-template-v2.cave-template-v2.cave-template-v2{top:0!important}
/* 手機橫向：卡片圖片保留高度，省掉說明小字，關卡排成一行 */
@media(max-height:500px){
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-gain{display:none!important}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-card>small{display:none!important}
body[data-ui-version="3"] #app .cave-template-v2 .cave-zone-scene{min-height:64px!important}
body[data-ui-version="3"] #app .cave-template-v2 .ex-stage-chips{flex-wrap:nowrap!important;overflow-x:auto!important}
body[data-ui-version="3"] #app .cave-template-v2 .ex-stage-chip{flex:none!important;white-space:nowrap!important}
}
