/* Readable controls, painted tools, and a cinematic barn. */
#exploreViewToggle,body:not(.exploring-3d) #exploreViewToggle{position:absolute;top:18px;bottom:auto;right:22px;left:auto;display:flex;gap:4px;padding:5px;max-width:none;border:1px solid #d9bd79;border-radius:18px;background:#153b30ed;box-shadow:0 6px 22px #0a211d45;z-index:8;pointer-events:auto}
#exploreViewToggle[hidden]{display:none}#exploreViewToggle button{min-width:112px;min-height:54px;border:0;border-radius:13px;padding:8px 14px;background:transparent;color:#f4dfac;font:16px Georgia;text-align:left}#exploreViewToggle small{display:block;margin-top:4px;font:10px system-ui;opacity:.85}#exploreViewToggle button[aria-pressed=true]{color:#173629;background:#ead49a;box-shadow:0 2px 6px #0002}
body:not(.exploring-3d) #exploreViewToggle{top:78px;right:76px}
#farmWorldUI .farm-tools-bar{background:#173d32ef;border-color:#d2b77a;gap:6px;padding:7px 10px;border-radius:20px}#farmWorldUI .farm-tools-bar button{background:transparent;color:#f8e6be;border-color:transparent;box-shadow:none;width:72px;gap:1px}#farmWorldUI .farm-tools-bar img{object-fit:contain;width:43px;height:43px;filter:drop-shadow(0 2px 2px #0005)}#farmWorldUI .farm-tools-bar small{font-size:11px}#farmWorldUI .farm-tools-bar button[aria-pressed=true]{background:#e9d49d!important;color:#213e2e;border-color:#ffe8ad!important;box-shadow:none!important}
#farmWorldUI .farm-info{bottom:113px;max-width:650px;width:calc(100% - 460px);padding:12px 18px;font-size:14px;line-height:1.5;border:1px solid #efd79b;border-radius:13px;background:#f6e9c8f5;color:#243b2d;box-shadow:0 4px 24px #142b2433;font-weight:600;z-index:8}#farmWorldUI .farm-info[data-kind=notice]{border-left:5px solid #a16732}#farmWorldUI .farm-info[data-kind=success]{border-left:5px solid #4c7440}
.animal-voices{display:flex;flex-wrap:wrap;gap:5px;border-top:1px solid #9b9c6b55;margin-top:12px;padding-top:10px}.animal-voices small{width:100%;font-size:8px;letter-spacing:1.3px}.animal-voices button{font-size:10px;padding:5px 8px;min-height:32px}.farm-goals{max-height:calc(100% - 325px);overflow:auto}.animal-portrait img{width:100%;height:100%;object-fit:contain}
.context-reading{font:17px/1.65 Georgia;color:#eee0bd;margin:15px 0 20px}.context-source{font-size:10px;line-height:1.5;color:#beceb2}.context-source a{color:#d9c385}.context-journal{margin:18px 0;padding:18px;border:1px solid #9caa7855;border-radius:14px}.context-journal summary{cursor:pointer;color:#e6d091;font:19px Georgia}.context-journal p{font-size:14px;line-height:1.65}
body.barn.in-game .topbar,body.barn.in-game .sidebar,body.barn.in-game .controlbar,body.barn.in-game .location{display:none}body.barn.in-game #playShell{height:100svh;display:block;padding:0}body.barn.in-game .world-column,body.barn.in-game .world-frame{height:100%;width:100%;aspect-ratio:auto;max-height:none}body.barn.in-game #world{width:100%;height:100%;object-fit:cover}
body:has(.cinema-modal) .topbar{display:none}.overlay:has(.cinema-modal){position:fixed;inset:0;padding:0;background:#061109;z-index:100}.modal.cinema-modal{width:100vw;max-width:none;max-height:none;height:100svh;border:0;border-radius:0;padding:0;overflow:hidden;background:#07100a;display:flex;flex-direction:column}.cinema-stage{position:absolute;inset:0;aspect-ratio:auto}.cinema-stage video{object-fit:cover}.cinema-caption{bottom:122px;padding:70px 24px 28px}.cinema-caption blockquote{font-size:clamp(20px,2.2vw,31px);max-width:800px}.cinema-tools{position:absolute;bottom:30px;left:0;right:0;padding:18px 5vw;background:linear-gradient(transparent,#07100aff);z-index:2}.cinema-progress{position:absolute;bottom:0;left:0;right:0;z-index:3}.cinema-status{position:absolute;bottom:12px;left:5vw;right:5vw;font-size:9px;text-align:center}.cinema-tools button{background:#18372bba;backdrop-filter:blur(8px)}.cinema-tools .primary{background:#e2ca8e}.rhythm-pads button.ready{background:#d7c58a33;box-shadow:inset 0 0 0 2px #ead392}
body:has(#overlay:not([hidden])) #farmWorldUI{visibility:hidden}
@media(max-width:700px){#exploreViewToggle,body:not(.exploring-3d) #exploreViewToggle{top:auto;bottom:100px;right:12px;padding:4px;border-radius:14px}#exploreViewToggle button{min-width:92px;min-height:46px;padding:7px 9px;font-size:14px}#exploreViewToggle small{font-size:9px}body:not(.exploring-3d) #exploreViewToggle{top:12px;bottom:auto;right:12px}.farm-identity{max-width:40%}.map-controls{top:118px}.farm-resources{top:75px}.farm-goals{max-height:calc(100% - 390px)}#farmWorldUI .farm-tools-bar{padding:5px;gap:1px}#farmWorldUI .farm-tools-bar button{width:auto;min-height:57px}#farmWorldUI .farm-tools-bar img{width:34px;height:34px}#farmWorldUI .farm-tools-bar small{font-size:10px}#farmWorldUI .farm-info{bottom:89px;left:10px;right:10px;transform:none;width:auto;max-width:none;font-size:12px;padding:10px 12px}.field-batch{bottom:154px}.context-reading{font-size:15px;line-height:1.55}.cinema-caption{bottom:190px;padding:30px 20px 15px}.cinema-caption blockquote{font-size:21px}.cinema-tools{bottom:31px;gap:10px;justify-content:center;padding:12px}.cinema-tools .theme-links{justify-content:center}.cinema-actions{margin:auto}.cinema-status{font-size:8px}.keyboard-song-copy{display:none}.animal-voices button{min-height:36px}.animal-voices{gap:4px}}
@media(pointer:coarse){.keyboard-song-copy{display:none}}
@media(max-height:550px){.cinema-caption{bottom:105px;padding-top:35px}.cinema-caption blockquote{font-size:19px;margin:5px auto}.cinema-tools{bottom:20px;padding:8px 16px;flex-wrap:nowrap}.cinema-tools .theme-links{width:auto}.cinema-actions{margin:0}.cinema-status{bottom:7px;font-size:8px}#exploreViewToggle,body:not(.exploring-3d) #exploreViewToggle{top:12px;bottom:auto}.farm-goals{max-height:45%}}
#exploreViewToggle,body:not(.exploring-3d) #exploreViewToggle{z-index:12}

body.barn.in-game #overlay{inset:0}
.animal-voices{display:block}.animal-voices summary{cursor:pointer;font:12px Georgia;padding:5px 0;color:inherit}.animal-voices>div{display:flex;flex-wrap:wrap;gap:5px;padding-top:8px}
@media(max-width:700px){.farm-resources{top:12px;left:10px;right:auto;width:155px}.farm-goals{top:84px;max-height:230px}.map-controls{top:328px}.animal-voices summary{font-size:13px}#farmWorldUI .farm-resources>span{min-width:0;flex:1}body:not(.exploring-3d) #exploreViewToggle{top:12px;right:10px}#exploreViewToggle button{min-width:88px;padding:7px 8px}}

@media(max-width:700px){#exploreViewToggle{top:12px;bottom:auto;right:10px}.explore-identity{max-width:155px}.explore-identity b{font-size:18px}}
/* Chapter review and earned hauling rewards. */
.title-actions{flex-wrap:wrap}.title-actions #chooseStoryButton{border-color:#ddc28c;color:#f0ddb0;background:#17372acb}.story-picker{width:min(780px,94vw)!important}.review-intro{max-width:590px;line-height:1.55}.review-current{padding:10px 14px;border-left:3px solid #d4bc7c;background:#25433055}.checkpoint-chapters{display:grid;gap:10px;margin:22px 0}.checkpoint-chapters details{border:1px solid #b2b78645;border-radius:16px;background:#17372b66;overflow:hidden}.checkpoint-chapters summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:15px;padding:17px 19px}.checkpoint-chapters summary::-webkit-details-marker{display:none}.checkpoint-chapters summary>span{font:25px Georgia;color:#dfc588}.checkpoint-chapters summary>div{flex:1}.checkpoint-chapters summary:after{content:'+';color:#d8bf87;font:22px Georgia}.checkpoint-chapters details[open] summary:after{content:'−'}.checkpoint-chapters summary strong{font:19px Georgia;display:block}.checkpoint-chapters summary small{display:block;font:11px/1.5 system-ui;color:#b8c6ab;margin-top:5px}.checkpoint-list{padding:0 10px 10px;display:grid;grid-template-columns:1fr 1fr;gap:7px}.checkpoint-list button{position:relative;text-align:left;padding:14px 30px 14px 13px;min-height:75px;border-radius:11px;background:#244b3877;border-color:#cabc7e33;color:#f3e4bc}.checkpoint-list button:hover,.checkpoint-list button[aria-current=true]{background:#3a6044;border-color:#e3cc8c}.checkpoint-list strong{font:15px Georgia;display:block}.checkpoint-list small{display:block;font:10px/1.4 system-ui;color:#bacbb0;margin-top:5px}.checkpoint-list button>span{position:absolute;right:12px;top:15px;color:#e5cd8e}.review-actions{display:flex;flex-wrap:wrap;gap:8px;position:sticky;bottom:-28px;background:#152d23f2;padding:12px 0;z-index:2}#feedbackCategory{display:block;width:100%;margin:8px 0 20px;padding:12px;color:#f1e5c5;background:#183c2c;border:1px solid #aabb854d;border-radius:10px}#feedbackNote{margin-top:9px;min-height:140px}.feedback-location{font:19px Georgia;color:#e4ce93}.feedback-location small{display:block;font:11px system-ui;color:#b9c8af;margin-top:6px}#feedbackStatus{font:13px/1.5 system-ui;color:#e0d39e}#cinemaReview{display:none}body:has(.cinema-modal) #cinemaReview:not([hidden]),body.barn.review-mode #cinemaReview:not([hidden]){position:fixed;right:14px;top:14px;z-index:110;display:flex;gap:5px}#cinemaReview button{background:#183a2bd9;border:1px solid #dac08166;color:#f1dfac;border-radius:12px;padding:9px 12px;font:12px Georgia}.story-actions{flex-wrap:wrap}.story-actions #skipAudio{color:#ddcca3;background:transparent;border-color:#a8b88044}.story-actions kbd,.cinema-actions kbd,.song-bottom kbd{font:10px system-ui;margin-left:5px;opacity:.7}
.modal.haul-reward-modal{max-width:530px;width:94vw;background:radial-gradient(ellipse at 50% 34%,#47623acc,#183528f5 63%);border:1px solid #d9bd7f88;text-align:center;padding:28px 24px;overflow:auto;box-shadow:0 24px 90px #07120980}.haul-reward .eyebrow{font-size:9px;letter-spacing:2px}.haul-medal{display:block;width:230px;height:245px;object-fit:contain;margin:8px auto 4px;filter:drop-shadow(0 12px 22px #09170b66);animation:medal-arrive .65s cubic-bezier(.15,.8,.22,1) both}.haul-reward h2{font:40px Georgia;color:#f0d58e;margin:0 0 10px}.haul-reward.silver h2{color:#e0e8e5}.haul-reward.bronze h2{color:#e4b186}.haul-reward .reward-title{font:20px Georgia;color:#fff0d0;margin:10px 0}.haul-reward .reward-detail{font:13px/1.5 system-ui;color:#d6dec0}.haul-reward .small{font-size:10px;color:#b3c2a4}.haul-reward #haulRewardDone{display:block;min-width:200px;margin:20px auto 7px}.haul-reward #haulRewardSound{font-size:11px}.reduced-motion .haul-medal{animation:none}@keyframes medal-arrive{from{opacity:0;transform:translateY(20px) scale(.7)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:700px){.checkpoint-list{grid-template-columns:1fr}.checkpoint-chapters summary{padding:14px}.checkpoint-chapters summary strong{font-size:17px}.review-actions{bottom:-18px}.review-mode .topbar .brand{display:none}.review-mode .topbar nav{width:100%;justify-content:space-between}.review-mode .topbar nav button{font-size:11px;min-width:0;padding:8px}.haul-medal{width:190px;height:205px}.haul-reward h2{font-size:34px}.modal.haul-reward-modal{padding:22px 18px}.haul-reward .reward-title{font-size:18px}.story-actions{gap:5px}.story-actions button{font-size:12px;padding:10px}.story-actions kbd,.cinema-actions kbd,.song-bottom kbd{display:none}.cinema-tools{bottom:25px}.cinema-actions{flex-wrap:wrap;justify-content:center}.cinema-caption{bottom:207px}}
@media(max-height:550px){.haul-medal{width:120px;height:128px;margin:3px auto}.haul-reward h2{font-size:28px}.haul-reward .reward-title{font-size:17px;margin:6px 0}.haul-reward #haulRewardDone{margin:10px auto 4px}.modal.haul-reward-modal{padding:16px 22px}.haul-reward .small{margin:5px}.cinema-caption{bottom:120px}}
@media(prefers-reduced-motion:reduce){.haul-medal{animation:none}}

.cinema-status{z-index:4}.cinema-tools{bottom:36px}

/* Still illustrations turn as rigid pages, with a slow camera push on the new page. */
.storybook-stage{perspective:1800px;overflow:hidden}.storybook-page,.storybook-previous{position:absolute;inset:0;overflow:hidden}.storybook-page img,.storybook-previous img{display:block;width:100%;height:100%;object-fit:cover;will-change:transform}.storybook-previous{transform-origin:left center;backface-visibility:hidden;z-index:1;box-shadow:25px 0 50px #0008}.storybook-previous[hidden]{display:none}.storybook-stage .cinema-caption{z-index:2;pointer-events:none;bottom:135px;background:linear-gradient(transparent,#071009e8);padding:60px 24px 22px}.storybook-stage blockquote{font-size:clamp(19px,2vw,29px);max-width:760px;text-wrap:pretty}.storybook-stage #cinemaPageCount{font:10px system-ui;letter-spacing:3px;color:#d6c496}.reduced-motion .storybook-page img{will-change:auto}.reduced-motion .storybook-previous{display:none}
@media(max-width:700px){.storybook-stage .cinema-caption{bottom:190px;padding:55px 18px 14px}.storybook-stage blockquote{font-size:20px;line-height:1.35}.storybook-page img,.storybook-previous img{object-fit:cover}}
@media(max-height:550px){.storybook-stage .cinema-caption{bottom:108px;padding:28px 20px 10px}.storybook-stage blockquote{font-size:18px;max-width:720px;margin:6px auto}.storybook-stage #cinemaPageCount{font-size:9px}}

.storybook-stage:after{content:'';position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(transparent 42%,#07100922 58%,#071009e8 100%)}.storybook-stage .cinema-caption{background:none}.cinema-modal:has(.storybook-stage) .cinema-tools{background:none}

/* Shared-world supplies stay secondary to the objective capsule. */
.explore-supplies{position:absolute;bottom:175px;left:20px;color:#f4e1ad;font:11px/1.6 system-ui;text-shadow:0 2px 4px #10281a;max-width:42%;pointer-events:none}.explore-supplies:empty{display:none}.explore-supplies[hidden]{display:none}.return-to-world{margin-top:18px;background:transparent;border-color:#d0be8155;color:#e7d29c}.world-stock{font:13px/1.8 system-ui;color:#ccdab8}.explore-label[data-id^="field-"]{font-size:12px;color:#fff0ac}.explore-label[data-id^="chat-snowball"],.explore-label[data-id^="chat-napoleon"],.explore-label[data-id^="chat-squealer"]{color:#ffe39b}
@media(max-width:700px){.explore-supplies{bottom:185px;left:15px;max-width:calc(100% - 30px);font-size:10px}.explore-identity b{max-width:145px;font-size:17px}.return-to-world{min-height:44px}}

#exploreViewToggle #exploreCharacter{min-width:85px;border-left:1px solid #d8c28455;color:#f5dba0}#exploreViewToggle #exploreCharacter[hidden]{display:none}.character-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:24px 0}.character-grid button{display:flex;flex-direction:column;align-items:center;padding:12px;gap:8px}.character-grid img{width:100%;height:130px;object-fit:contain}.character-grid small{font-size:11px;line-height:1.4}.character-grid button[aria-pressed=true]{border-color:#f2d797;background:#355348}
@media(max-width:700px){.character-grid{grid-template-columns:repeat(2,1fr);gap:8px}.character-grid img{height:95px}#exploreViewToggle #exploreCharacter{min-width:65px;font-size:11px;padding:7px}#exploreViewToggle{max-width:calc(100% - 24px)}}

/* Animated chapters retain their complete widescreen composition on a phone. */
.film-stage .storybook-page{background:#070d09;display:grid;place-items:center}
.film-stage .storybook-page img,.film-stage .storybook-page video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;transform:none!important}
.film-stage .storybook-page video[hidden]{display:none}
.film-stage .storybook-previous{display:none!important}
.film-stage .cinema-caption{bottom:135px}
.film-stage blockquote{font-size:clamp(17px,1.6vw,21px);line-height:1.45;max-width:820px}
@media(max-width:700px) and (orientation:portrait){.film-stage .storybook-page img,.film-stage .storybook-page video{height:58%;object-fit:contain}.film-stage .cinema-caption{bottom:190px;padding:15px 20px}.film-stage blockquote{font-size:18px;line-height:1.45}.film-stage:after{background:linear-gradient(transparent 45%,#071009 63%)}}

/* Keep production controls clear of the view toggle and status strip. */
@media(min-width:701px){body:not(.exploring-3d) #exploreViewToggle{top:18px;right:76px}}
@media(max-width:700px){
 #farmWorldUI:has(#worldPanel:not([hidden])) .farm-goals,
 #farmWorldUI:has(#worldPanel:not([hidden])) .field-batch{visibility:hidden}
 #farmWorldUI .world-panel{bottom:150px;max-height:calc(100% - 238px)}
}

/* Keep later inventories legible without squeezing seven counters into three slots. */
@media(max-width:700px){
 #farmWorldUI .farm-resources{justify-content:flex-start;pointer-events:auto;overflow-x:auto;overflow-y:hidden;flex-wrap:nowrap;scrollbar-width:thin;scrollbar-color:#78916a #e9e7d5;overscroll-behavior-x:contain}
 #farmWorldUI .farm-resources>span{flex:0 0 52px;min-width:52px;padding:8px 5px}
 #farmWorldUI .farm-resources:focus-visible{outline:3px solid #d8b657;outline-offset:2px}
}

/* Farm View already exposes this ledger in Tasks; do not cover its objective button. */
body:not(.exploring-3d) #finaleLedgerButton{display:none}
/* Short landscape screens need a side panel, not stacked cards over the controls. */
@media(min-width:701px) and (max-height:550px){
 #farmWorldUI .farm-resources{left:12px;top:12px;max-width:calc(100% - 350px);justify-content:flex-start;overflow-x:auto;pointer-events:auto}
 #farmWorldUI .farm-resources>span{flex:0 0 64px;min-width:64px;padding:8px 6px}
 #farmWorldUI .farm-goals{top:90px;max-height:calc(100% - 175px);overflow:auto}
 #farmWorldUI:has(#worldPanel:not([hidden])) .farm-goals,
 #farmWorldUI:has(#worldPanel:not([hidden])) .map-controls,
 body:not(.exploring-3d):has(#worldPanel:not([hidden])) #exploreViewToggle{visibility:hidden}
 #farmWorldUI .world-panel{top:12px;bottom:84px;right:12px;width:300px;max-height:none;padding:16px}
 #farmWorldUI .farm-info{bottom:84px;left:12px;right:330px;width:auto;max-width:none;transform:none;font-size:11px}
 #farmWorldUI .farm-tools-bar{bottom:8px;padding:3px}
 #farmWorldUI .farm-tools-bar button{min-height:52px}
 #farmWorldUI .farm-tools-bar img{width:28px;height:28px}
 #farmWorldUI .field-batch{display:none}
}

/* The chapter is in the objective and picker; avoid repeating it under the phone view switch. */
@media(max-width:700px){body.exploring-3d .explore-identity{display:none}}
