/* UI4_7: keep one compact navigation dock on non-battle main screens. No opaque dark strip. */
.shared-dock{display:flex;flex:none;align-items:center;justify-content:center;gap:clamp(4px,1.1vw,14px);width:100%;height:clamp(52px,9dvh,88px);padding:2px 5px 3px;background:linear-gradient(0deg,#e9dfbd,#fff1cf);border-top:1px solid #c4a46d;z-index:6;color:#3e4333;box-sizing:border-box}
.shared-dock .dock-button{position:relative;display:flex;flex:0 1 92px;min-width:0;max-width:92px;height:100%;align-items:center;justify-content:center;flex-direction:column;gap:0;background:transparent;color:#423c2e;border:0;padding:0 2px;font-size:clamp(10px,1.3vw,13px);line-height:1.1;font-weight:900;white-space:nowrap;box-shadow:none}
.shared-dock .dock-art{width:clamp(33px,6dvh,58px);height:clamp(33px,6dvh,58px);background-position:center;background-size:contain;background-repeat:no-repeat;display:grid;place-items:center;flex:none}
.shared-dock .dock-home{font-size:clamp(32px,6dvh,56px);line-height:1;color:#27665e;text-shadow:0 1px #fff; background:var(--reg-secondary) center/100% 100% no-repeat;color:#fff2c7}
.shared-dock .dock-button[aria-current=page]{color:#956021;background:linear-gradient(0deg,#edc26a70,transparent);border-bottom:3px solid #b77f25;border-radius:8px}.shared-dock .dock-button[aria-current=page] .dock-art{filter:drop-shadow(0 0 3px #ffca4e)}
.dock-badge{position:absolute;right:5%;top:1px;color:#fff;background:#ad4430;border:1px solid #ffe7af;border-radius:99px;font-size:10px;padding:1px 4px;line-height:1.1}
#home .home-nav{display:none!important}#home.camp-mode .home-head{padding:0!important;min-height:0;background:none;box-shadow:none;border:0}
#home.camp-mode .welcome{top:clamp(40px,7dvh,65px)}
#heroDetails>.shared-dock,#missionDialog>.shared-dock,#bookDialog>.shared-dock{margin-top:auto}
#heroDetails .detail-body,#bookDialog .book-scroll,#missionDialog #missionList{min-height:0;flex:1 1 0;overflow:auto}
/* Same label and location for screen return; result return is local to the summon screen. */
#stageSelect .stage-head,#scout .scout-head,#partySelect .party-head,#heroDetails .detail-header,#bookDialog .book-head,#missionDialog .mission-header{position:relative;justify-content:center;min-height:36px;padding-left:90px!important;padding-right:90px!important}
#stageBack,#scoutBack,#partyBack,#detailClose,#bookClose,#missionClose{position:absolute;left:6px;top:50%;transform:translateY(-50%);min-width:72px;max-width:84px;white-space:nowrap;background:var(--reg-secondary) center/100% 100% no-repeat!important;color:#fff3d5!important;text-shadow:0 1px 2px #17423e;min-height:30px;padding:4px 9px!important}
#stageSelect .stage-head #guideGo{position:absolute;right:5px;top:50%;transform:translateY(-50%);min-width:65px;padding:4px 8px!important}#scout .scout-head .wallet{max-width:100%;flex-wrap:wrap;justify-content:center}
/* Favorite viewer: one compact central column, not oversized panels or a side split. */
#home:not(.camp-mode){display:flex;flex-direction:column;align-items:center;gap:5px;min-height:0;padding:5px 10px 10px;overflow:auto!important}
#home:not(.camp-mode) .home-head{width:min(100%,850px);display:flex;justify-content:center;min-height:0;padding:0}
#home:not(.camp-mode) .welcome{padding:4px 10px;background:#fff3d7eb;border:1px solid #c8a774;border-radius:8px;min-height:0;max-width:100%;box-shadow:none}#home:not(.camp-mode) .welcome h1,#home:not(.camp-mode) .welcome .eyebrow,#home:not(.camp-mode) .welcome>p:not(#saveNotice){display:none}
#home:not(.camp-mode) .showcase{display:flex;flex-direction:column;align-items:center;min-height:0;flex:none;width:min(100%,700px);margin:0;gap:4px}
#home:not(.camp-mode) .hero-stage{position:relative;display:grid;place-items:center;height:clamp(95px,23dvh,220px);width:100%;min-height:0;overflow:visible}
#home:not(.camp-mode) .hero-stage:before{display:none}#home:not(.camp-mode) .hero-stage #hero{position:static;width:auto;height:100%;max-width:100%;max-height:100%;object-fit:contain;min-height:0}
#home:not(.camp-mode) #wachaGo{position:absolute;top:0;left:0;bottom:auto;right:auto;width:auto;min-height:30px;padding:4px 12px;transform:none}
#home:not(.camp-mode) .info{width:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px 8px;padding:7px 10px;background:#fff3dbe8;border:1px solid #bd9e69;border-radius:8px;box-shadow:none}
#home:not(.camp-mode) .info h2{font-size:clamp(16px,2.2vw,23px);margin:0}#home:not(.camp-mode) .info .skillbox{flex:1 1 100%;text-align:center;margin:0;padding:4px 6px}#home:not(.camp-mode) .info .eyebrow{display:none}#home:not(.camp-mode) .info .motions{justify-content:center;flex:1 1 100%}#home:not(.camp-mode) .info .home-options{justify-content:center;flex:1 1 100%;gap:6px}
#home:not(.camp-mode) .roster-wrap{width:min(100%,850px);padding:5px 8px;margin:0;flex:none;background:#fff3dbe8;border:1px solid #c2a576;border-radius:8px;box-shadow:none}#home:not(.camp-mode) #roster{display:flex;flex-wrap:nowrap;overflow:auto;justify-content:safe center;gap:4px}#home:not(.camp-mode) #roster button{flex:0 0 clamp(64px,8vw,96px);padding:2px 4px 4px}#home:not(.camp-mode) #roster img{height:clamp(40px,8dvh,75px)}
/* Three complete cards at a time, compact World tabs retained. */
#stageSelect .stage-carousel{width:min(100%,1080px);max-width:1080px;flex:0 1 auto;min-height:0;height:auto;grid-template-columns:clamp(28px,4vw,48px) minmax(0,1fr) clamp(28px,4vw,48px)}
#stageSelect .stage-grid{display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;min-height:0;height:auto;width:100%;gap:8px;padding:0;scroll-padding:0;scroll-snap-type:x mandatory;--stage-width:calc((100% - 16px)/3);align-items:stretch}
#stageSelect .stage-grid:before,#stageSelect .stage-grid:after{display:none!important}#stageSelect .stage-grid .stage-card{flex:0 0 var(--stage-width);width:var(--stage-width);min-width:0;max-width:none;scroll-snap-align:start;filter:none;align-self:stretch;justify-content:flex-start;box-sizing:border-box;height:auto;max-height:none;padding:8px}
#stageSelect .stage-thumb{aspect-ratio:16/9;max-height:clamp(65px,20dvh,190px);width:100%;object-fit:cover}#stageSelect .stage-body{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:3px 2px;white-space:normal}#stageSelect .stage-body strong{white-space:normal;overflow:visible;text-overflow:clip;font-size:clamp(11px,1.5vw,17px);line-height:1.15}#stageSelect .stage-body .stage-meta,#stageSelect .stage-body .stage-status{font-size:clamp(9px,1vw,12px);margin:0;text-align:left;white-space:normal;line-height:1.15}#stageSelect .stage-dots{gap:3px}#stageSelect .stage-dot{height:17px}
/* Result cards: one reward gets a prominent portrait, ten rewards use a scrollable five-column grid. */
#scout:has(#scoutResults:not([hidden])) .scout-results{width:min(100%,850px);max-width:850px;height:100%;align-self:stretch;justify-content:center;gap:3px;overflow:hidden;padding:2px 4px}
#scout .result-cards{display:grid;flex:1 1 0;min-height:0;max-height:none;overflow:auto;justify-content:center;align-content:start;align-items:start;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;padding:3px}
#scout .result-cards:has(.scout-card:only-child){grid-template-columns:minmax(0,clamp(150px,25vw,245px));align-content:center;justify-content:center}
#scout .scout-card .reward-portrait{width:100%;height:auto;aspect-ratio:2/3;max-width:140px;max-height:none}#scout .result-cards:has(.scout-card:only-child) .reward-portrait{width:auto;height:clamp(105px,36dvh,340px);max-width:100%;max-height:none;aspect-ratio:2/3}
#scout .scout-card b{font-size:clamp(13px,1.7vw,19px);line-height:1.15}#scout .scout-card small{font-size:clamp(10px,1.2vw,14px);line-height:1.1;color:#fff2d2}#scout #resultDone{width:min(100%,210px);align-self:center;min-height:32px}
#partySelect .party-actions button{min-width:0;white-space:nowrap;padding-inline:12px}#partySelect .party-actions #partyConfirm{min-width:110px}
@media(max-height:450px){.shared-dock{height:46px;padding:1px 4px 2px}.shared-dock .dock-art{width:29px;height:29px}.shared-dock .dock-button{font-size:10px}.shared-dock .dock-home{font-size:28px}#stageSelect .stage-head,#scout .scout-head{min-height:32px;gap:4px}#stageSelect .stage-thumb{max-height:18dvh}#stageSelect .stage-grid .stage-card{padding:5px}#stageSelect .stage-body{gap:1px;padding:1px 2px}#scout .scout-result-heading{max-height:37px;margin:0 auto!important}#scout .result-cards:has(.scout-card:only-child) .reward-portrait{height:clamp(65px,29dvh,135px)}#scout .result-cards:not(:has(.scout-card:only-child)) .reward-portrait{max-width:75px}#scout .scout-card{padding:2px}#scout #resultDone{min-height:28px;padding:3px 12px}#home:not(.camp-mode) .hero-stage{height:clamp(80px,23dvh,120px)}#home:not(.camp-mode) .info .motions button{min-height:24px;padding:3px 9px;font-size:10px}#home:not(.camp-mode) .info{padding:4px 7px}#home:not(.camp-mode) .info .skillbox{font-size:11px}}

.dock-adventure{background-image:url('../assets/ui/game/nav_adventure.png')}
.dock-heroes{background-image:url('../assets/ui/game/nav_heroes.png')}
.dock-summon{background-image:url('../assets/ui/game/nav_summon.png')}
.dock-archive{background-image:url('../assets/ui/game/nav_archive.png')}
.dock-missions{background-image:url('../assets/ui/game/nav_missions.png')}
/* Reset legacy viewer flex direction and percentage height bases. */
#home:not(.camp-mode) .info{flex-direction:row;align-items:center;justify-content:center;align-content:center;height:auto;max-height:none;flex:0 0 auto;border-image:none!important;overflow:visible}
#home:not(.camp-mode) .info>*{order:0!important;min-width:0;max-width:100%}#home:not(.camp-mode) .info .motions{display:flex;flex:0 0 100%;flex-direction:row;align-items:center;justify-content:center;align-content:center;gap:3px;margin:0;min-height:0;height:auto}
#home:not(.camp-mode) .info .motions button{flex:0 0 auto;height:auto;min-height:28px;padding:4px 11px;font-size:11px;line-height:1.1;white-space:nowrap}
#home:not(.camp-mode) .info .skillbox{flex:0 1 auto;margin:0;padding:2px 6px;font-size:11px;line-height:1.15}#home:not(.camp-mode) .info .skillbox small{font-size:10px}#home:not(.camp-mode) .info .skillbox strong{display:inline;font-size:11px;margin:0 3px}
#home:not(.camp-mode) .info .home-options{flex:0 0 100%;justify-content:center;align-items:center;margin:0;gap:6px}#home:not(.camp-mode) .info .home-options button,#home:not(.camp-mode) .info #heroDetail{min-height:28px;padding:4px 10px;font-size:11px;line-height:1.1}
#home:not(.camp-mode) .roster-wrap .sectionline{padding:0 0 2px}#home:not(.camp-mode) .roster-wrap .sectionline b{padding:3px 9px;background:none;color:#49361c;text-shadow:none}#home:not(.camp-mode) .roster-wrap .sectionline b span{color:#9b752e!important}
#scout .scout-card,#scout .scout-card.new{background:none;border:0;box-shadow:none;padding:2px;color:#fff4d9;text-shadow:var(--legible-shadow)}
#scout .scout-card .reward-portrait{background:transparent;border-radius:0}#scout .result-cards:has(.scout-card:only-child) .reward-portrait{height:clamp(110px,39dvh,355px);max-width:100%;max-height:none}
#scout:has(#scoutResults:not([hidden])) .scout-head h1{visibility:hidden}#scout:has(#scoutResults:not([hidden])) .scout-result-heading{max-height:clamp(36px,7dvh,76px)}
@media(max-height:450px){#home:not(.camp-mode) .info .motions button{min-height:24px;padding:3px 8px;font-size:10px}#home:not(.camp-mode) .info .home-options button,#home:not(.camp-mode) .info #heroDetail{min-height:24px;padding:3px 7px;font-size:10px}#home:not(.camp-mode) .info .skillbox{font-size:10px}#home:not(.camp-mode) .info #heroDesc{font-size:10px!important}#scout .result-cards:has(.scout-card:only-child) .reward-portrait{height:clamp(90px,35dvh,155px)}}
/* Five visible reward cards per page; the pager keeps all ten rewards accessible. */
#scout .scout-result-top{display:flex;align-items:center;justify-content:center;gap:7px;flex:none;min-height:32px;width:100%;position:relative}
#scout .scout-result-top .scout-result-heading{width:min(50%,300px);margin:0!important;min-height:32px;max-height:48px;background:var(--reg-heading) center/100% 100% no-repeat;aspect-ratio:auto;padding:7px 20px;text-shadow:0 1px 3px #2d1b0e}
#scout .scout-result-top .scout-result-heading img,#scout .scout-result-top .scout-result-heading::before{display:none}
#scout .scout-result-top button{min-width:35px;min-height:32px;padding:1px 8px;font-size:25px;line-height:1;background:var(--reg-secondary) center/100% 100% no-repeat;color:#fff4d7}
#scout #summonPage{min-width:58px;text-align:center;font-size:12px;font-weight:900;white-space:nowrap}
#scout .result-cards{grid-auto-rows:max-content;align-content:center;align-items:start;grid-template-columns:repeat(5,minmax(0,1fr));padding:3px 6px;gap:5px}
#scout .result-cards:has(.scout-card:only-child){grid-template-columns:minmax(0,clamp(145px,25vw,260px))}
#scout .scout-card{display:flex;flex-direction:column;align-items:center;min-height:0;height:auto;max-height:none;gap:2px;overflow:visible;min-width:0}
#scout .scout-card .reward-portrait{width:auto;height:clamp(86px,33dvh,260px);max-width:100%;max-height:none;flex:none;margin:0;aspect-ratio:2/3;overflow:visible}
#scout .scout-card .reward-portrait .reward-hero{left:3%;top:13%;width:94%;height:72%;object-fit:contain}
#scout .scout-card small{color:#fff9e7;font-weight:700;white-space:normal;overflow:visible;line-height:1.2}
#scout .scout-card b{line-height:1.2;white-space:normal;overflow:visible}
@media(max-height:450px){#scout .scout-result-top .scout-result-heading{min-height:28px;max-height:30px;padding:3px 18px}#scout .scout-result-top .scout-result-heading span{font-size:15px}#scout .scout-result-top button{min-height:28px}#scout .scout-card .reward-portrait{height:clamp(72px,26dvh,120px);max-width:100%}#scout .result-cards:has(.scout-card:only-child) .reward-portrait{height:clamp(75px,28dvh,125px)}#scout .scout-card b{font-size:13px}#scout .scout-card small{font-size:10px}#scout .result-cards{padding:2px 3px;gap:3px}}
/* A compact favorite viewer must keep the roster immediately reachable. */
@media(max-height:450px){#home:not(.camp-mode) .home-head .welcome{padding:0 7px}#home:not(.camp-mode) .hero-stage{height:clamp(66px,20dvh,90px)}#home:not(.camp-mode) .info{padding:3px 6px;gap:2px 5px}#home:not(.camp-mode) .info .home-options{gap:4px}#home:not(.camp-mode) .info .home-options select{max-width:115px;min-height:24px;padding:2px;font-size:11px}#home:not(.camp-mode) .info .skillbox{padding:2px 4px}#home:not(.camp-mode) .roster-wrap{padding:3px 5px}}
/* Result: compact central summary and separate growth tab. */
#modal .paper.battle-result{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:3px}
#modal .battle-result .br-header{width:min(100%,780px);flex:none;max-width:none;overflow:visible;padding:2px 8px;gap:2px}
#modal .battle-result .br-banner{height:clamp(76px,15dvh,148px);width:min(75vw,400px)}
#modal .battle-result .br-stage-caption{background:#1c4c46d9;border-radius:6px;width:auto;padding:2px 10px;max-width:100%;line-height:1.2}
#modal .battle-result .br-tabs{display:flex;justify-content:center;gap:5px;width:100%;flex:none}
#modal .battle-result .br-tabs button{min-height:34px;width:clamp(120px,20vw,175px);background:var(--reg-secondary) center/100% 100% no-repeat;color:#fff6d7;padding:4px 13px;text-shadow:0 1px 2px #1a3734}
#modal .battle-result .br-tabs button[aria-pressed=true]{background-image:var(--reg-primary)}
#modal .battle-result .br-body{display:flex;flex-direction:column;width:min(100%,740px);max-width:740px;flex:0 1 auto;min-height:0;gap:5px;padding:2px 8px;align-items:stretch;justify-content:flex-start;overflow:auto}
#modal .battle-result .br-overview{background:transparent;border:0;box-shadow:none;padding:0;flex:none;overflow:visible}
#modal .battle-result .br-overview:before,#modal .battle-result .br-stage-art,#modal .battle-result .br-crest{display:none}
#modal .battle-result .br-lineup{min-height:0;padding:0 5px;gap:4px;flex-wrap:nowrap}
#modal .battle-result .br-unit{flex:0 1 19%;max-width:110px;min-width:0;gap:1px}
#modal .battle-result .br-sprite{height:clamp(60px,12dvh,120px)}
#modal .battle-result .br-unit-name,#modal .battle-result .br-unit-status{white-space:nowrap;font-size:clamp(10px,1.5vw,14px);line-height:1.15;padding:1px 4px;background:#1c4c46e6;color:#fff9e5}
#modal .battle-result .br-metrics{grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;min-height:0;background:transparent;padding:2px 0;margin:3px 0 0;border:0}
#modal .battle-result .br-metrics>div{background:#fff0cfef;border:1px solid #c5a268;border-radius:5px;padding:3px 4px;align-items:center;justify-content:center;white-space:nowrap}
#modal .battle-result .br-metrics strong{font-size:clamp(13px,2vw,20px)!important;line-height:1.1}
#modal .battle-result .br-rating-rule{font-size:10px;color:#fff5dc;text-shadow:0 1px 3px #19302f;margin:1px 0;line-height:1.15}
#modal .battle-result .br-rewards{width:100%;flex:none;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px 10px;padding:4px 9px;border:0;border-radius:8px;background:#fff0cfef;color:#493319;box-shadow:inset 0 0 0 1px #c5a268}
#modal .battle-result .br-reward-heading{width:auto;min-width:95px;margin:0;padding:4px 13px;font-size:12px}
#modal .battle-result .br-gem{width:auto;min-width:145px;min-height:37px;margin:0;padding:4px 12px;gap:5px}
#modal .battle-result .br-reward-slot{width:30px;height:30px}#modal .battle-result .br-gem-number{font-size:23px}
#modal .battle-result .br-record{margin:0!important;font-size:12px;line-height:1.2}
#modal .battle-result .br-note,#modal .battle-result .br-save-warning,#modal .battle-result .bond-result-milestone{flex:0 0 100%;margin:0;font-size:12px}
#modal .battle-result .br-growth-pane{flex:none;width:100%;background:#fff0cfee;border:1px solid #c5a268;border-radius:8px;padding:8px;color:#493319}
#modal .battle-result .br-growth{margin:0}#modal .battle-result .br-growth h3{margin:0 0 5px;text-align:center;font-size:15px}
#modal .battle-result .br-growth-grid{grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:5px}
#modal .battle-result .br-growth-card{padding:6px 7px}#modal .battle-result .br-growth-head{font-size:12px;line-height:1.2}
#modal .battle-result .br-actions{width:min(100%,740px);max-width:740px;flex:none;flex-wrap:nowrap;gap:4px;padding:3px 6px;justify-content:center}
#modal .battle-result .br-actions button,#modal .battle-result .br-actions button.primary{flex:0 1 auto;min-width:0;min-height:34px;white-space:nowrap;padding:4px 12px;font-size:clamp(11px,1.4vw,15px);line-height:1.15}
@media(max-height:450px){#modal .battle-result .br-banner{height:55px;width:230px}#modal .battle-result .br-header{padding:0 4px;gap:1px}#modal .battle-result .br-stage-caption{padding:1px 6px;gap:3px}#modal .battle-result .br-tabs button{min-height:26px;font-size:11px;padding:3px 12px}#modal .battle-result .br-body{gap:3px;padding:1px 6px}#modal .battle-result .br-sprite{height:43px}#modal .battle-result .br-unit-name,#modal .battle-result .br-unit-status{font-size:10px;padding:0 3px}#modal .battle-result .br-metrics>div{padding:2px 3px}#modal .battle-result .br-metrics strong{font-size:13px!important}#modal .battle-result .br-rating-rule{font-size:9px}#modal .battle-result .br-rewards{padding:3px 5px;gap:3px 7px}#modal .battle-result .br-reward-heading{min-width:85px;padding:3px 9px;font-size:11px}#modal .battle-result .br-gem{min-width:115px;min-height:30px;padding:3px 8px}#modal .battle-result .br-reward-slot{width:23px;height:23px}#modal .battle-result .br-gem-number{font-size:19px}#modal .battle-result .br-record{font-size:10px}#modal .battle-result .br-new{width:40px;height:18px}#modal .battle-result .br-actions button,#modal .battle-result .br-actions button.primary{min-height:30px;padding:3px 10px;font-size:11px}}
@media(max-width:520px){#modal .battle-result .br-actions{gap:2px;padding-inline:3px}#modal .battle-result .br-actions button,#modal .battle-result .br-actions button.primary{padding-inline:6px;font-size:10px}}
/* Stable header and footer across result tabs. */
#modal .paper.battle-result{justify-content:flex-start}
#modal .battle-result .br-body{flex:1 1 0;justify-content:safe center}
#modal .battle-result .br-rating-rule{width:max-content;max-width:100%;margin:2px auto;padding:2px 6px;background:#1c4c46e6;border-radius:4px;color:#fff8e2;text-shadow:none}
/* Stage captions use the inner frame area; rewards remain readable over the plaza. */
#stageSelect .stage-body{padding:4px 10px 7px;min-width:0}
#stageSelect .future{color:#fff7e1;background:#1c4c46db;border-radius:6px;padding:3px 8px;text-shadow:none;width:max-content;max-width:95%;margin:2px auto}
@media(max-height:450px){#stageSelect .stage-body{padding:2px 8px 5px}#scout .result-cards:not(:has(.scout-card:only-child)) .reward-portrait{height:clamp(78px,31dvh,145px)}}
/* Do not let the carousel shrink below its contents and overlap the World tabs. */
#stageSelect .stage-head,#stageSelect .stage-mode-row,#stageSelect .stage-dots,#stageSelect .future{flex:none}
#stageSelect .stage-carousel{flex:0 0 auto;align-items:center}
#stageSelect .stage-grid{flex:none;align-items:stretch}
#stageSelect .stage-body strong{min-height:0}
@media(max-height:450px){#stageSelect{gap:3px!important;padding:3px 8px!important}#stageSelect .stage-head{min-height:29px}#stageSelect .stage-mode-row{min-height:26px}#stageSelect .world-tab,#stageSelect #stageMode{min-height:26px;padding-block:3px}#stageSelect .stage-thumb{max-height:clamp(40px,16dvh,64px)}#stageSelect .stage-grid .stage-card{padding:4px}#stageSelect .stage-body{padding:2px 8px 3px;gap:1px}#stageSelect .stage-dots{height:12px}#stageSelect .stage-dot{height:11px}#stageSelect .future{padding:2px 6px;margin:0 auto;font-size:10px}}

/* UI4_8: restore UI4_6 camp dock skin; preserve the shared navigation. */
.shared-dock{
 --dock-icon:clamp(52px,10dvh,88px);
 --dock-height:calc(var(--dock-icon) + 24px);
 height:var(--dock-height);gap:clamp(4px,.8vw,10px);padding:4px 8px 6px;
 background-image:linear-gradient(0deg,#163f40 4%,#1d4a4be6 100%),url('../assets/backgrounds/bg_02_town_square.png');
 background-size:100% 100%,max(100vw,calc((100dvh - 48px)*1.777778)) auto;
 background-position:center,center calc(50% - (100dvh - 48px - var(--dock-height))/2);
 background-repeat:no-repeat;border:0;box-shadow:0 -2px 0 #c9a96b;color:#fff4d1;
}
.shared-dock .dock-button{flex:0 1 clamp(65px,10vw,105px);width:clamp(65px,10vw,105px);max-width:105px;min-width:0;color:#fff4d1;font-size:clamp(10px,1.4vw,15px);text-shadow:0 2px 3px #101e29;padding:0 2px;gap:0}
.shared-dock .dock-art{width:var(--dock-icon);height:var(--dock-icon);filter:drop-shadow(0 3px 2px #09161d99)}
.shared-dock .dock-home{font-size:clamp(30px,6dvh,54px);color:#fff2c7;text-shadow:0 2px 3px #101e29}
.shared-dock .dock-button[aria-current=page]{color:#ffe59d;background:none;border:0;border-radius:0}
.shared-dock .dock-button[aria-current=page] .dock-art{filter:drop-shadow(0 0 5px #ffd35b88) drop-shadow(0 3px 2px #09161d99)}
@media(max-width:700px){.shared-dock .dock-button{flex:0 1 74px;width:74px}}
@media(max-height:350px){.shared-dock{--dock-icon:44px;--dock-height:64px;padding:3px 5px 4px}.shared-dock .dock-button{font-size:10px}}

/* UI4_9: no separate footer skin. Keep the layout reserve and the original scene art. */
.shared-dock{background:none!important;border:0!important;box-shadow:none!important}
.shared-dock .dock-home{background:url('../assets/ui/game/nav_home.png') center/contain no-repeat;color:inherit;text-shadow:none}
.shared-dock .dock-button{background:none!important;text-shadow:0 1px 2px #132822,0 0 4px #132822,0 0 2px #132822}
/* One continuous backdrop for main scenes and their reserved navigation area. */
#gameApp:has(>#home:not([hidden])){background:var(--dock-home-scene,var(--town-scene)) center/cover no-repeat}
#gameApp:has(>#stageSelect:not([hidden])){background:var(--town-scene) center/cover no-repeat}
#gameApp:has(>#scout:not([hidden])){background:url('../assets/backgrounds/bg_09_demon_castle.png') center/cover no-repeat}
#gameApp>#home:not([hidden]),#gameApp>#stageSelect:not([hidden]),#gameApp>#scout:not([hidden]){background:transparent!important}
#home.camp-mode #wachaDialog,#home.camp-mode #wachaDialog #wachaField{background:transparent!important}
#home.camp-mode #wachaBackground{visibility:hidden}
#home.camp-mode #wachaField::after,#gameApp>#home::before{display:none}

/* v0.9.7: eight fixed-size navigation buttons, swipe overflow without a backing strip. */
.shared-dock{justify-content:safe center;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;overscroll-behavior-x:contain;touch-action:pan-x;position:relative;flex-wrap:nowrap}
.shared-dock::-webkit-scrollbar{display:none}
.shared-dock .dock-button,#expeditionScreen .shared-dock .dock-button{flex:0 0 max(78px, var(--dock-icon));min-width:max(78px,var(--dock-icon));width:max(78px,var(--dock-icon));max-width:none;background:none!important;border:0!important;padding:0 2px!important;box-shadow:none;color:#fff4d1;font-size:clamp(10px,1.4vw,15px);line-height:1.1}
.shared-dock .dock-recipe{background-image:url('../assets/ui/icons/recipe_view.png')}
.shared-dock .dock-expedition{background-image:url('../assets/ui/game/nav_expedition.png')}
#recipeBook>.shared-dock,#expeditionScreen>.shared-dock{margin-top:auto}
#recipeBook .recipe-empty{grid-column:1/-1;align-self:center;text-align:center;padding:16px;color:#fff1d2;text-shadow:0 1px 3px #173b34}
.battle-material-cell .recipe-composite{width:clamp(24px,8dvh,48px)}
