/* Compact portrait HUD: ivory tabs, ink outlines, honey action buttons. */
#stage{--ink:#454249;--paper:#fff5df;--edge:#746557;--honey:#f4cb71;--muted:#887d70}
#stage button{touch-action:manipulation}
#stage button:focus-visible{outline:3px solid #72b5c2;outline-offset:3px}
#stage .topbar{height:54px;padding:0;background:linear-gradient(#31334130,transparent)}
#stage .gold{left:12px;top:12px;padding:8px 12px;background:#343744ed;border:2px solid #eadbc0;border-radius:12px;color:#fff1c4;text-shadow:none;box-shadow:0 3px 0 #24273355;font-size:15px;line-height:20px;max-width:38%;white-space:nowrap}
#stage #quality,#stage #game-speed,#stage #play-mode{top:12px;height:40px;min-height:40px;border:2px solid #8a7864;border-radius:12px;background:linear-gradient(#fff9e8 52%,#eee0c2 53%);box-shadow:inset 0 2px #fffdf4,0 3px 0 #756653;color:#554c43;font-size:11px;font-weight:800;padding:0 8px}
#stage #quality{right:12px;width:38px}#stage #play-mode{right:58px;width:77px}#stage #game-speed{right:143px;width:38px;padding:0;font-size:14px}
#stage #game-speed[aria-pressed=true]{background:linear-gradient(#d9e9b0 52%,#b8ce8d 53%);color:#405b32}
#stage #objective{top:63px;left:13px;max-width:42%;width:auto;border:0;padding:0;background:transparent;box-shadow:none;color:#4c4d4b;font-size:11px;text-align:left;line-height:1.6}
#objective .hud-level{font-weight:850;display:block;color:#4b4b49}#objective .hud-day{font-size:10px;color:#746b58}
#stage #world-shortcuts{top:108px;left:12px;right:auto;flex-direction:column;gap:9px;z-index:25}
#stage #world-shortcuts button{width:58px;min-height:44px;padding:5px 3px;border:2px solid #887764;border-radius:13px;background:linear-gradient(#fff8e7,#e9d9bb);color:#574d43;box-shadow:inset 0 2px #fffdfa,0 3px 0 #756653;font-size:10px;font-weight:800}
#stage #next-task{top:65px;right:12px;width:56%;max-width:220px;border:2px solid #776756;border-radius:14px;padding:9px 11px;background:#fff5dfee;box-shadow:inset 0 2px #fffdfa,0 3px 0 #77675655;color:#4b453f}
#stage #next-task small{color:#7c724e;font-size:9px;letter-spacing:.4px}#stage #next-task strong{font-size:13px;margin:3px 0 5px;line-height:1.3;font-weight:850}#stage #next-task span{font-size:10px;color:#756a59;line-height:1.45}
#stage #next-task b{background:linear-gradient(#ffe3a0,#f1c66b);border:1px solid #ba9249;border-radius:7px;color:#62502e;margin-top:7px;padding:5px 8px;text-align:center;font-size:10px;box-shadow:0 2px 0 #b8985c40}
#stage #next-task[data-working=true] b{background:#e2e8d0;border-color:#aaba8a;color:#5f7047}#stage #next-task progress{height:5px;margin-top:7px;border:0;border-radius:5px;overflow:hidden;background:#e1d7bd;accent-color:#91ac65}
#stage #next-task progress::-webkit-progress-bar{background:#e1d7bd}#stage #next-task progress::-webkit-progress-value{background:#91ac65;border-radius:5px}
#stage #map-title{top:220px;font-size:19px}
#stage #farm-hud{left:9px;right:9px;bottom:max(8px,env(safe-area-inset-bottom));padding:5px 7px 6px;border:2px solid #837360;border-radius:17px;background:#fff3dcee;box-shadow:inset 0 2px #fffcef,0 4px 0 #5f554550}
#stage .hud-stock{padding:0 3px 5px;min-height:36px;gap:4px}
#stage .hud-stock #farm-resources{font-size:10px;font-weight:700;color:#675c49;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;min-width:0}
#stage .hud-stock button{min-height:32px;border:0;border-radius:8px;padding:4px 7px;font-size:10px;background:#e8ddc5;color:#756548;box-shadow:none}
#stage .hud-stock #world-menu{display:none}#stage .hud-stock #farm-center,#stage .hud-stock #hud-more{width:32px;min-height:32px;font-size:21px}
#stage .farm-dock{grid-template-columns:repeat(5,1fr);gap:3px;padding-top:5px;border-top:1px solid #c6b797}
#stage .farm-dock button{position:relative;min-height:52px!important;border-radius:10px!important;font-size:10px!important;gap:3px;color:#786d5a!important;box-shadow:none}
#stage .farm-dock svg{width:25px;height:25px;stroke-width:1.9;fill:#e7d8b7;filter:drop-shadow(0 1px 0 #fff)}
#stage .farm-dock button:nth-child(2) svg{color:#698251;fill:#c2d495}#stage .farm-dock button:nth-child(3) svg{color:#987447;fill:#efd398}#stage .farm-dock button:nth-child(4) svg{color:#998078;fill:#d8bba4}#stage .farm-dock button:nth-child(5) svg{color:#af6a57;fill:#e9ba9e}
#stage .farm-dock button.selected{background:linear-gradient(#f9dda0,#edcc86)!important;color:#634f2d!important;box-shadow:inset 0 0 0 1px #c4a269,0 2px 0 #c2a26b}
#stage .farm-dock button.selected:before{content:'';position:absolute;top:-6px;left:28%;right:28%;height:3px;background:#ad803c;border-radius:3px}
#stage #hud-context{max-height:30dvh;overflow:auto;padding:8px 2px;overscroll-behavior:contain}#stage #hud-extra{display:grid;grid-template-columns:repeat(3,1fr);max-height:26dvh;overflow:auto;gap:6px}
#stage #hud-extra button{min-height:40px}#stage #hud-extra button[onclick='beginAreaDemolition()']{display:none}
#stage #farm-hud button:not(.farm-dock button):not(.hud-stock button),#stage #farm-hud select{border-color:#cabb9e;border-radius:9px;color:#6a5943}
#stage #farm-confirm,#stage #build-start,#stage #placement-confirm{background:linear-gradient(#ffe2a0,#f0c46c)!important;color:#634c29!important;border:1px solid #b18b4e!important;box-shadow:0 3px 0 #aa884f;min-height:42px!important}
#stage .bottom-hud{padding-top:12px;background:linear-gradient(transparent,#38394744)}#stage .combat-actions{display:none}
#stage .bottom-hud .skillbar{width:88%;max-width:310px;margin:0 auto 9px;gap:6px}
#stage .slot{border:2px solid #776b58;border-radius:11px;background:#fff2d3;box-shadow:inset 0 2px #fffdf2,0 3px 0 #665b4b80}
#stage .slot.basic{background:linear-gradient(#ffe1a3,#e6bc71)}#stage .navigation{border:2px solid #837360;border-bottom:0;border-radius:16px 16px 0 0;padding:7px 6px max(8px,env(safe-area-inset-bottom));background:#f8ecd4;box-shadow:inset 0 2px #fffdfa}
#stage .nav-button{min-height:45px;font-size:10px;gap:3px;color:#786b59;padding:3px}#stage .nav-button svg{fill:#dec79d;stroke:#76644c}#stage .nav-button.active{background:#f0d394;color:#5f4d31;border-radius:9px}
#stage #panel,#stage #panel[data-kind=explore]{z-index:40;left:12px;right:12px;bottom:123px;top:auto;max-height:65%;max-width:390px;margin:0 auto;border:2px solid #766654;border-radius:17px;box-shadow:inset 0 2px #fffdf4,0 5px 0 #64574866,0 12px 25px #29262c35;background:#fff5e2;backdrop-filter:none;color:#594d40}
#stage .panel-head{background:#f0dfbd;border-bottom:1px solid #c4b18d;padding:9px 12px}.panel-head h2{font-size:16px!important}#stage #panel-close{width:40px;height:40px;border:1px solid #bba482;border-radius:10px;box-shadow:0 2px 0 #ae9572;background:#fff4db;color:#806247}
#stage .panel-body{padding:12px;font-size:12px}#stage .action,#stage .resident-card button,#stage .seed-actions button:last-child{background:linear-gradient(#ffe5a5 50%,#f3cd7e 51%);border:1px solid #b3915c;border-radius:9px;color:#654d2e;box-shadow:0 3px 0 #b0905e;min-height:40px;font-weight:800}
#stage .action:disabled{background:#e2dccd;border-color:#c8c0b0;color:#998c77;box-shadow:none}
#stage .resident-card,#stage .seed-card,#stage .item,#stage .region-card{background:#f4e8d1;border:1px solid #d2bfa0;border-radius:12px;box-shadow:inset 0 1px #fffaf0}.resident-avatar{border:1px solid #b8a680;background:#e0d4b9!important}
#stage .bag-cell,#stage .gear-slot{border-radius:9px;border-color:#b5a181}#stage .bag-cell.selected{outline:2px solid #ba8f3d}
#stage #build-editor{border:2px solid #7d6b55;border-radius:17px;background:#fff5e5;box-shadow:0 5px 0 #67574477;max-height:76%}#stage #build-editor button{min-height:38px}
#stage #mine-hud{top:220px;left:12px;padding:8px 9px;border:1px solid #8a7967;background:#41434de8;color:#fff0d0;border-radius:11px;max-width:132px;font-size:10px;box-shadow:0 3px 0 #30303950}#stage #mine-hud small{display:none}#stage #mine-hud button{min-height:36px;background:#eed496;color:#594b35;padding:6px 8px;display:block;width:100%;font-size:10px}
#stage .toast{bottom:128px!important;background:#3d4049f5;border:1px solid #edddb9;color:#fff2d5;border-radius:11px;box-shadow:0 3px 0 #292d3755;font-size:11px}
#stage[data-menu-open=true] #hud-context,#stage[data-menu-open=true] #hud-extra,#stage[data-menu-open=true] #next-task{display:none!important}
#stage[data-menu-open=true] #mine-hud{display:none}#stage[data-placing=true] #world-shortcuts,#stage[data-placing=true] #mine-hud{display:none!important}
#stage dialog{border:2px solid #7d6b55;border-radius:17px;background:#fff3dd;color:#675640;max-width:390px;max-height:70dvh}#close-dialog{min-width:40px;min-height:40px;border-radius:10px;background:#e4d4b6!important}
.material-list{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:12px 0}.material-list div{display:flex;justify-content:space-between;padding:8px;background:#ece0c8;border-radius:7px;font-size:12px}
#stage button:active:not(:disabled){transform:translateY(2px);box-shadow:none}
@container game (max-width:350px){#stage #next-task{width:58%;padding:8px}#stage .gold{font-size:12px;padding:8px}#stage #play-mode{width:66px}#stage #game-speed{right:132px}#stage .hud-stock #farm-resources{font-size:9px}#stage #next-task strong{font-size:12px}}
@media(prefers-reduced-motion:reduce){#stage button{transition:none}}

#stage #world-shortcuts svg{display:block;width:24px;height:24px;margin:0 auto 2px;stroke:#746046;fill:#e2c99b}#stage #world-shortcuts button span{display:block;font-size:9px}#stage #world-shortcuts button{min-height:51px}#stage #world-shortcuts #resident-menu svg{fill:#ccd8a9;stroke:#6c7c51}

/* Clear the old centered transform; it previously pushed left-anchored panels offscreen. */
#stage #panel,#stage #panel[data-kind=explore]{left:12px;right:12px;width:auto;transform:none;margin:0 auto;max-width:390px;bottom:84px;max-height:calc(100% - 155px);min-width:0}
#stage #panel .panel-head{flex:0 0 auto;min-width:0}#stage #panel .panel-body{min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;overflow-wrap:anywhere}
#stage .resident-card>div:last-child{min-width:0;flex:1}#stage .resident-card button{max-width:100%;white-space:normal}#stage .region-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#stage .region-card{min-width:0}
#stage .topbar{display:flex;align-items:flex-start;gap:7px;padding:10px 12px;height:103px}
#stage .gold{position:static;flex:0 1 auto;min-width:0;max-width:39%;padding:7px 10px;font-size:13px;overflow:hidden;text-overflow:ellipsis}
#stage .topbar #farm-resources{position:static;pointer-events:auto;flex:1;min-width:0;height:38px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:6px 8px;font-size:10px;font-weight:750;color:#66573f;background:#fff3ddeb;border:1px solid #a8916b;border-radius:10px;box-shadow:0 2px 0 #8e775849}
#stage #quality,#stage #game-speed,#stage #play-mode{top:57px}#stage #objective{top:60px}
#stage #next-task{top:108px}#stage #world-shortcuts{top:104px}
#stage .hud-stock{display:none!important}#stage .farm-dock{border-top:0;padding-top:0}#stage #farm-hud{padding-top:5px}
#stage #world-shortcuts #hud-more{font-size:22px;line-height:19px}#stage #world-shortcuts #hud-more span{font-size:9px;line-height:15px}
#stage #mine-hud{top:294px}#stage .toast{bottom:87px!important}
#stage[data-play-mode=combat] #panel{bottom:143px;max-height:calc(100% - 205px)}
#stage[data-play-mode=combat] #hud-extra{display:none!important}
@container game (max-width:350px){#stage #next-task{top:108px}#stage .topbar{gap:5px;padding-left:9px;padding-right:9px}#stage .topbar #farm-resources{font-size:9px;padding:6px}#stage .gold{font-size:12px;padding:7px}}
#stage #panel,#stage #panel[data-kind=explore]{max-height:min(65%,calc(100% - 155px))}
#stage[data-play-mode=combat] #panel{max-height:min(65%,calc(100% - 205px))}
#stage[data-play-mode=combat] #world-shortcuts #hud-more{display:none}

/* Seven fixed roles, one row at every portrait width. */
#stage .topbar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) repeat(4,34px);gap:4px;align-items:start;padding:10px 8px;height:52px}
#stage .topbar .gold,#stage .topbar .header-stock{position:static;display:flex;align-items:center;justify-content:center;gap:3px;margin:0;min-width:0;max-width:none;height:36px;padding:4px 2px;border:1px solid #b6a486;border-radius:9px;background:#fff3ddeb;color:#67573d;font-size:11px;font-weight:800;white-space:nowrap;box-shadow:0 2px 0 #8e775840;text-shadow:none}
#stage .topbar .gold{order:0;background:#3b3e49ed;color:#ffe6a3;border-color:#cbb98e}#header-wood{order:1}#header-stone{order:2}
#stage .topbar .gold svg,#stage .header-stock svg{width:16px;height:18px;flex-shrink:0;stroke-width:1.8}#stage .topbar .gold svg{fill:#c2a05e33}#header-wood svg{fill:#c4a170;stroke:#806344}#header-stone svg{fill:#b8c1bc;stroke:#6c797b}
#stage .topbar #farm-resources,#stage .topbar #game-speed,#stage .topbar #play-mode,#stage .topbar #quality{position:static;left:auto;right:auto;top:auto;margin:0;width:34px;height:36px;min-height:36px;padding:0;border:1px solid #a28c69;border-radius:9px;box-shadow:inset 0 1px #fffdf1,0 2px 0 #8e77585c;display:grid;place-items:center;min-width:0;font-size:12px}
#stage .topbar #farm-resources{order:3;font-size:23px;background:#fff1d8;color:#766449}#stage .topbar #game-speed{order:4}#stage .topbar #play-mode{order:5}#stage .topbar #quality{order:6}#stage .topbar #play-mode svg{width:23px;height:23px;fill:#dec79d;stroke:#775d3d}#stage .topbar #quality svg{width:18px;height:18px}
#stage .topbar #play-mode[hidden]{display:none}#stage #objective{top:59px}#stage #next-task{top:59px}#stage #world-shortcuts{top:104px}
@container game (min-width:440px){#stage .topbar{grid-template-columns:repeat(3,minmax(0,1fr)) repeat(4,39px);gap:6px;padding:10px 12px}#stage .topbar #farm-resources,#stage .topbar #game-speed,#stage .topbar #play-mode,#stage .topbar #quality{width:39px}#stage .topbar .gold,#stage .topbar .header-stock{font-size:12px}}
#stage .topbar .gold span,#stage .header-stock span{font-variant-numeric:tabular-nums;min-width:0}
@container game (max-width:360px){#stage .topbar .gold,#stage .topbar .header-stock{font-size:10px;gap:2px}#stage .topbar .gold svg,#stage .header-stock svg{width:14px}}
.crop-history{margin-top:12px;padding:10px;border-top:1px solid #d5c4a5;color:#88775b;font-size:10px}.crop-history h3{font-size:12px;color:#66563d}.crop-history p{margin:6px 0;line-height:1.5}
#area-handles{position:absolute;inset:0;pointer-events:none;z-index:31}#area-handles[hidden]{display:none}#area-handles button{position:absolute;transform:translate(-50%,-50%)!important;width:28px;height:28px;min-width:0;min-height:0;padding:0;border:2px solid #fffae8;border-radius:8px;background:#91ae69;color:#fff9db;box-shadow:0 2px 0 #4d653b;pointer-events:auto;touch-action:none;font-size:18px;line-height:1;cursor:nwse-resize}#area-handles button::after{content:"";position:absolute;inset:-8px}#area-handles button.dragging{background:#d5a551}#area-handles[data-destructive=true] button{background:#c97965;box-shadow:0 2px 0 #914c41}
#stage[data-placing=true] .placement-nudge,#stage[data-placing=true] #placement-pan{display:none!important}#stage #placement-info{white-space:pre-line;max-height:none;line-height:1.5;font-size:11px;color:#6b5940}.area-help{font-size:9px;color:#998464;margin:4px 0 7px}#stage .placement-actions button{min-height:40px}#stage #placement-tools[data-destructive=true] #placement-confirm{background:#cb7967!important;border-color:#945547!important;color:#fff6e8!important}

#renovation-controls{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:8px 0;font-size:11px}#renovation-controls[hidden]{display:none}#renovation-controls select,#renovation-controls button{font:inherit;color:#746449;background:#fff8e6;border:1px solid #ded2b8;border-radius:9px;padding:7px 5px}#renovation-controls button:disabled{opacity:.45}

#stage #build-editor #build-delete{flex:.9;display:block!important;min-height:43px;background:#fae6dc!important;color:#9a5140!important;border:1px solid #d6a897!important;font-weight:700}#build-editor .blueprint-footer{flex-wrap:wrap}#build-editor .blueprint-footer>button{min-width:80px}

#home-info{position:absolute;bottom:116px;left:50%;transform:translateX(-50%);z-index:19;padding:10px 18px;border:2px solid #fff9e9;border-radius:18px;background:#fff4dceF;color:#786446;box-shadow:0 3px 0 #8b785530;font-weight:700;font-size:13px;min-height:42px}#home-info[hidden]{display:none!important}

#placement-crops{display:grid;grid-template-columns:auto 1fr;gap:6px 10px;align-items:center;border-top:1px solid #ddd0b4;padding:9px 0 5px;margin-top:5px;color:#766044}#placement-crops[hidden]{display:none!important}#placement-crops label{font-size:12px;font-weight:800}#placement-seed{width:100%;min-height:40px;padding:7px 10px;border:1px solid #b5bd8d;border-radius:12px;background:#f4f5df;color:#635b40;font-size:14px}#placement-seed-detail{grid-column:1/-1;font-size:10px;line-height:1.6;color:#8b795b}

.house-orientation{display:flex;align-items:center;gap:6px;margin:6px 0}.house-orientation button{flex:1;background:#e6edcf!important}.house-orientation span{font-size:11px;color:#7b7556}.house-orientation button:disabled{opacity:.4}#stage[data-cinematic="true"]>.topbar,#stage[data-cinematic="true"]>#farm-hud,#stage[data-cinematic="true"]>#next-task,#stage[data-cinematic="true"]>#world-shortcuts,#stage[data-cinematic="true"]>#objective,#stage[data-cinematic="true"]>.camera-turn,#stage[data-cinematic="true"]>#home-info,#stage[data-cinematic="true"]>.bottom-hud{visibility:hidden}#story-scene .cinema-dialog{border:1px solid #f8eacb60;background:#263b39;color:#fff5df;border-radius:18px;margin:0 10px 16px;padding:18px}#story-scene #story-speaker{color:#efd49b}#story-scene #story-dialogue{color:#fff5df;line-height:1.8}#story-scene .cinema-dialog .action{background:#fff3d9;color:#34423a;border:1px solid #efd49b;text-shadow:none}#story-scene .cinema-dialog .action:focus-visible{outline:3px solid #efd49b;outline-offset:3px}#campaign-journal{padding:12px;border-radius:15px;background:#ecead5;color:#6f644d;font-size:12px;margin-bottom:10px}#campaign-journal button{border:0;background:#9aaa77;color:white;border-radius:10px;padding:10px;margin-top:8px}

/* Keep the model and height controls in view while materials scroll below. */
#build-editor .blueprint-preview{position:sticky;top:-15px;z-index:3;background:#fff5e5;padding:6px 0 8px;box-shadow:0 5px 8px #7d6b5512}
#blueprint-height-tools{display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:7px 9px 0;color:#6c593e}
#blueprint-height-tools[hidden]{display:none!important}
#blueprint-height-tools span{margin-right:auto;font-size:12px;font-weight:700}
#blueprint-height-tools b{min-width:32px;text-align:center;font-size:13px}
#stage #build-editor #blueprint-height-tools button{width:42px;min-height:40px;font-size:21px;background:#e6edcf;border-color:#b8c691;touch-action:manipulation}
#build-editor .blueprint-footer{z-index:4}
@media(max-height:700px){#build-editor .blueprint-preview{top:-12px}#stage #build-editor #build-model{height:130px!important}}
.crop-plot-settings{color:#6b593f;font-size:12px;line-height:1.65}.plot-summary{display:grid;gap:5px;padding:12px;background:#e9edda;border-radius:13px;margin-bottom:14px}.plot-summary b{font-size:17px}.crop-plot-settings label{display:block;font-weight:700;margin-bottom:6px}.crop-plot-settings select{width:100%;min-height:44px;padding:8px 12px;border:1px solid #cabb9b;border-radius:12px;background:#fffaf0;color:#68563c;font:inherit}.plot-rule{padding:12px;background:#f1ead8;border-radius:12px}.crop-plot-settings .action{width:100%;min-height:44px;margin-top:14px;background:#dce7bd;color:#45542f;border:1px solid #afbe8b;border-radius:12px;font-weight:700}.crop-plot-settings .action:disabled{opacity:.55}
/* Readable dialogue pages and an always-reachable farming notebook. */
#story-scene #story-dialogue{white-space:pre-line;word-break:keep-all;overflow-wrap:anywhere;line-height:1.85;font-size:15px;max-height:42vh;overflow-y:auto}
#story-scene .cinema-dialog{max-height:65%;overflow-y:auto;padding:20px;bottom:5%}
#story-scene .cinema-top{gap:12px;line-height:1.6}#story-scene .cinema-top button{flex-shrink:0;min-height:40px}
#stage #next-task span,#placement-seed-detail{white-space:pre-line;word-break:keep-all}
#farm-guide{position:absolute;left:12px;top:155px;z-index:18;border:1px solid #a1ad7d;background:#fff6df;color:#405139;border-radius:12px;padding:9px 11px;font-size:12px;min-height:40px;box-shadow:0 2px 5px #273a2420}
#farm-guide[hidden]{display:none!important}#stage[data-cinematic=true] #farm-guide{visibility:hidden}
.farm-guide-content{color:#463e31;line-height:1.75;word-break:keep-all}.farm-guide-content h3{font-size:21px;margin:8px 0 14px}.farm-guide-content small{color:#60764a}.guide-advice{background:#e7eed9;border-radius:14px;padding:14px}.guide-stats{background:#f4eddf;border-radius:12px;padding:12px;font-size:13px}.farm-guide-content ol{padding-left:24px}.farm-guide-content li{padding:10px 0}.farm-guide-content li p{margin:5px 0;font-size:13px}.guide-note{font-size:13px;border-left:3px solid #a4b87d;padding-left:12px}.guide-actions{display:grid;gap:9px}.guide-actions button,.guide-link{min-height:44px;border:1px solid #b3bd97;border-radius:12px;padding:11px;background:#eff1df;color:#405139;font-weight:700}.guide-actions button:disabled{opacity:.45}.guide-link{width:100%;margin-top:12px}
#story-scene .cinema-dialog{padding-top:24px;overflow:visible}#story-portrait{float:left;width:110px;height:120px;margin:-12px 10px 0 -10px;image-rendering:pixelated;filter:drop-shadow(0 4px 1px #102c3240)}#story-scene #story-dialogue{min-height:105px;font-size:14px}#story-scene .cinema-dialog .action{clear:both}

/* Portraits occupy their own column; only the world canvas fills its container. */
#story-scene .cinema-dialog{display:grid;grid-template-columns:72px minmax(0,1fr);grid-template-areas:"portrait speaker" "portrait dialogue" ". next";gap:6px 12px;padding:16px;overflow-y:auto;max-height:65%;align-items:start}
#story-scene #story-portrait{grid-area:portrait;float:none;width:72px!important;height:79px!important;max-width:none;margin:0;align-self:start}
#story-scene #story-speaker{grid-area:speaker;min-width:0;margin:0;line-height:1.5}
#story-scene #story-dialogue{grid-area:dialogue;min-width:0;min-height:0;max-height:none;overflow:visible;margin:0;font-size:14px;line-height:1.75;white-space:pre-line;word-break:keep-all;overflow-wrap:anywhere}
#story-scene #story-next{grid-area:next;justify-self:end;clear:none;margin:6px 0 0;min-height:40px}
@container game (max-width:350px){#story-scene .cinema-dialog{grid-template-columns:56px minmax(0,1fr);gap:5px 9px;padding:12px;margin-left:0;margin-right:0}#story-scene #story-portrait{width:56px!important;height:61px!important}#story-scene #story-dialogue{font-size:13px}}

#placement-tutorial-hint.tutorial-inline{font-size:11px;line-height:1.5;color:#526242;background:#eaf0dc;border-radius:8px;padding:7px 9px;margin:5px 0;pointer-events:none}

/* Tutorial is a two-line row in the bottom dock, never an overlay. */
#stage #farm-hud #guided-tutorial{position:static;inset:auto;z-index:auto;width:100%;overflow:hidden;pointer-events:none;margin:0 0 4px;padding:0}
#stage #farm-hud #guided-tutorial #tutorial-card{position:static;inset:auto;display:grid;grid-template-columns:minmax(0,1fr) 26px;grid-template-areas:none;align-items:center;gap:5px;width:100%;max-width:none;max-height:none;margin:0;padding:3px 5px;background:#edf0df;border:0;border-radius:8px;box-shadow:none;overflow:hidden;pointer-events:none}
#stage #farm-hud #tutorial-prompt{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;max-height:36px;min-height:0;margin:0;padding:0;border:0;background:transparent;box-shadow:none;color:#405537;font-size:12px;font-weight:500;line-height:18px;text-align:left;white-space:normal;word-break:keep-all;pointer-events:auto}
#stage #farm-hud #tutorial-prompt:disabled{opacity:1;cursor:default;pointer-events:none}
#stage #farm-hud #tutorial-dismiss{width:26px;height:26px;min-height:26px;min-width:26px;padding:0;margin:0;border:0;background:transparent;box-shadow:none;color:#858775;font-size:16px;font-weight:400;line-height:26px;pointer-events:auto}
#placement-tutorial-hint.tutorial-inline{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;max-height:34px;line-height:17px;font-size:11px;padding:0 4px;margin:4px 0;background:transparent;border-radius:0}

#guided-tutorial[hidden]{display:none!important}
#stage #world-shortcuts{display:flex;position:absolute;top:104px;left:12px;right:auto;gap:8px;align-items:stretch;width:58px}
#stage #world-shortcuts #weather-status{position:static;inset:auto;width:58px;margin:0;padding:5px 3px;border-radius:9px;box-sizing:border-box;font-size:10px;line-height:1.4;text-align:center;white-space:normal;overflow-wrap:anywhere;pointer-events:none}
#stage #hud-extra #farm-guide{position:static;inset:auto;z-index:auto;width:auto;margin:0;padding:8px;font-size:11px;box-shadow:none}

#stage #world-shortcuts[hidden],#stage #world-shortcuts #weather-status[hidden]{display:none!important}

#stage #placement-confirm.tutorial-confirm-focus{outline:3px solid #ffdb7b;outline-offset:4px;animation:tutorial-confirm-glow 1s ease-in-out 3}
@keyframes tutorial-confirm-glow{50%{box-shadow:0 0 0 8px #ffdb7b66}}
@media(prefers-reduced-motion:reduce){#stage #placement-confirm.tutorial-confirm-focus{animation:none}}

#stage #farm-hud #player-life-status{width:100%;min-height:20px;padding:1px 4px;margin:0 0 3px;border:0;background:transparent;font-size:11px;line-height:18px;text-align:left;color:#526347;box-shadow:none}#player-life-status[hidden]{display:none!important}.living-panel{font-size:12px;line-height:1.6}.living-actions{display:flex;gap:6px;flex-wrap:wrap}.living-panel button{padding:8px 10px;border:1px solid #c9d1b5;border-radius:9px;background:#edf1dd;color:#526347}.living-crop{display:flex;align-items:center;gap:8px;padding:7px 0;border-bottom:1px solid #ded9c8}.living-crop small{flex:1}.living-panel h3{font-size:14px;margin:14px 0 6px}

.content-card{padding:12px;margin:8px 0;border:1px solid #c4b58e;border-radius:12px;background:#f8efd8}.content-card strong,.content-card small{display:block;margin-bottom:6px}.content-card small{line-height:1.5;color:#655c44}.content-card button{margin:4px 6px 0 0}#panel-body details{padding:10px 0;border-top:1px solid #c4b58e}#panel-body summary{cursor:pointer;font-weight:bold}

#next-task.task-needs-input{animation:task-call 1.6s ease-in-out infinite;border-color:#dfaf4d}#next-task.task-needs-input b:before{content:'여기를 눌러 ';font-weight:700}@keyframes task-call{50%{box-shadow:0 0 0 4px #f0cf7945,0 0 15px #e6b75c66}}@media(prefers-reduced-motion:reduce){#next-task.task-needs-input{animation:none;outline:3px solid #e3b65d}}
.food-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:16px 0}.food-choice{min-height:82px;display:flex;gap:10px;align-items:center;justify-content:center;border:2px solid #cabc96;border-radius:16px;background:#fff8e7;color:#514d3d;font-size:16px}.food-choice span{font-size:28px}.food-choice.selected{border-color:#789655;background:#e6edcd;box-shadow:inset 0 0 0 1px #789655}

/* One measured clearance for overlays above the variable-height bottom controls. */
#stage{--dock-clearance:150px}
#stage .toast,#stage #home-info,#stage #field-actions{bottom:var(--dock-clearance)!important}
#stage #panel,#stage #panel[data-kind=explore],#stage[data-play-mode=combat] #panel{bottom:var(--dock-clearance);max-height:calc(100% - var(--dock-clearance) - 92px)}
#stage .toast{z-index:41;line-height:1.5;max-width:90%;white-space:normal;max-height:54px;overflow:hidden}
#merchant-speech{position:absolute;left:12px;right:12px;bottom:var(--dock-clearance);z-index:42;padding:10px 13px;border:1px solid #b6b68d;border-radius:13px;background:#fff7e8f5;color:#4f5840;box-shadow:0 3px 10px #26342725;pointer-events:none}
#merchant-speech[hidden]{display:none!important}#merchant-speaker{font-size:11px;color:#728647}#merchant-line{font-size:12px;line-height:18px;margin:4px 0 0;white-space:normal;overflow-wrap:anywhere}
#stage:has(#merchant-speech:not([hidden])) .toast{visibility:hidden}
#stage[data-cinematic=true] #merchant-speech{visibility:hidden}
#building-demolish{width:100%;margin:10px 0 4px;border:1px solid #c59c86!important;background:#f3dfd2!important;color:#864d3c!important;min-height:38px!important}#building-demolish[hidden]{display:none!important}
/* Stable indoor actions sit above the measured dock, not over its buttons. */
#stage #home-info,#stage #home-blueprint{position:absolute;bottom:var(--dock-clearance,116px)!important;z-index:32;min-width:110px;min-height:48px;padding:10px 16px;touch-action:manipulation;pointer-events:auto;border:2px solid #fff9e9;border-radius:16px;background:#fff4dc;color:#67563c;font-weight:700;font-size:13px;box-shadow:0 3px 0 #8b785530;transform:none}
#stage #home-info{left:calc(50% - 116px)}#stage #home-blueprint{left:calc(50% + 6px)}#home-blueprint[hidden]{display:none!important}#stage[data-cinematic="true"]>#home-blueprint{visibility:hidden}
/* A bounded, scrollable task rail; only the lead task uses the full card. */
#stage #task-list{position:absolute;top:59px;right:12px;width:56%;max-width:220px;max-height:min(42%,310px);overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin;scrollbar-color:#ae9974 transparent;z-index:26;padding:0 2px 5px;box-sizing:border-box}
#stage #task-list[hidden]{display:none!important}
#stage #task-list #next-task{position:relative;inset:auto;width:100%;max-width:none;box-sizing:border-box;margin:0}
#task-alternatives{display:grid;gap:6px;margin-top:7px}
#task-alternatives:empty{display:none}
#stage .task-summary{display:block;width:100%;box-sizing:border-box;text-align:left;padding:7px 9px;border:1px solid #a49479;border-radius:10px;background:#f6eedbeb;color:#514b40;touch-action:pan-y}
#stage .task-summary strong{display:block;font-size:11px;line-height:1.35}
#stage .task-summary span{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;font-size:9px;color:#766c58;line-height:1.5;margin-top:2px}
#stage .task-summary b{display:block;font-size:9px;color:#777d48;margin-top:3px}
#stage .task-summary:focus-visible,#stage #task-list:focus-visible{outline:2px solid #b68a36;outline-offset:-2px}
#stage[data-cinematic="true"] #task-list{visibility:hidden}
#stage[data-menu-open=true] #task-list,#stage[data-blueprint=true] #task-list,#stage[data-placing=true] #task-list{display:none!important}
@container game (max-width:350px){#stage #task-list{width:58%;right:10px}}

#task-alternatives[hidden],#task-options-toggle[hidden]{display:none!important}
#stage #task-options-toggle{display:block;width:100%;min-height:30px;margin-top:5px;padding:5px 8px;border:1px solid #b9ab91;border-radius:8px;background:#efe7d6e8;color:#756b55;font-size:10px;line-height:1.4;text-align:center;touch-action:manipulation}
#stage #task-options-toggle:focus-visible{outline:2px solid #b68a36;outline-offset:-2px}

/* Compact status cards: the whole card is the action, no inner CTA. */
#stage #task-list{max-height:min(34%,240px)}
#stage #task-list #next-task{padding:6px 9px;border-radius:11px}
#stage #task-list #next-task strong{font-size:12px;line-height:1.25;margin:2px 0 3px}
#stage #task-list #next-task span{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;font-size:9px;line-height:1.35;white-space:normal}
#stage #task-list #next-task small{font-size:8px;line-height:1.35;letter-spacing:0}
#stage #task-list #next-task progress{height:3px;margin-top:4px}
#stage #task-list #next-task b{display:none}
#stage #task-list .task-summary{padding:6px 8px;min-height:40px}
#stage #task-list[data-tutorial-locked=true] #next-task{opacity:1;cursor:default;animation:none;box-shadow:inset 0 2px #fffdfa,0 2px 0 #77675635}

#stage #task-list #next-task{padding:9px 11px;min-height:40px}
#stage #task-list #next-task strong{margin:0;line-height:1.4}
#stage #task-list .task-summary{min-height:34px;padding:7px 9px}

#stage #task-list[data-has-alternatives=true] #next-task{padding-right:34px}
#stage #task-options-toggle{position:absolute;right:5px;top:3px;width:28px;height:32px;min-height:32px;margin:0;padding:0;border:0;border-radius:7px;background:transparent;font-size:22px;line-height:1;color:#786a50}

#area-rotate{position:absolute;pointer-events:auto;width:40px;height:40px;transform:translate(-50%,-50%);border:2px solid #fff4d8;border-radius:12px;background:#e6c984;color:#665338;font-size:27px;line-height:32px;box-shadow:0 3px 0 #88785555}#area-rotate[hidden]{display:none}

#placement-entry{position:absolute;inset:0;z-index:21;pointer-events:none;overflow:hidden}#placement-entry[hidden]{display:none}#placement-entry-lines{position:absolute;width:100%;height:100%;inset:0;overflow:visible}#placement-entry-label{position:absolute;transform:translate(-50%,-50%);padding:3px 9px;border:2px solid #fff1b0;border-radius:9px;background:#6b4a26;color:#fff2bc;font-size:12px;font-weight:800;white-space:nowrap;box-shadow:0 2px 4px #0003}

.task-help{padding:6px 0}.task-help p{margin:0 0 16px;font-size:14px}.task-help .action{width:100%;min-height:46px}

#game-speed.speed-suggested{outline:3px solid #ffe29a;animation:speed-hint-glow 1.1s ease-in-out infinite}#speed-hint{position:absolute;right:42px;top:57px;padding:5px 9px;border-radius:9px;background:#fff0bd;color:#65502c;font-size:11px;white-space:nowrap;pointer-events:none;box-shadow:0 2px 5px #0002}#speed-hint[hidden]{display:none}@keyframes speed-hint-glow{50%{box-shadow:0 0 0 6px #ffe29a66,0 0 13px #ffe29a}}@media(prefers-reduced-motion:reduce){#game-speed.speed-suggested{animation:none;box-shadow:0 0 0 4px #ffe29a66}}
