#stage .topbar{display:flex;height:60px;align-items:center;gap:9px;padding:9px 12px;background:linear-gradient(#23362d40,transparent)}
#stage .topbar .gold,#stage .topbar .header-stock,#stage .topbar #farm-resources,#stage #play-mode,#stage #player-life-status,#stage #map-title{display:none!important}
#vitals{pointer-events:auto;width:180px;padding:6px 9px;border:1px solid #fff4cc65;border-radius:12px;background:#253c38dc;box-shadow:0 2px 5px #182a3426;color:#fff4d9}
.vital-row{display:flex;align-items:center;gap:6px;font-size:10px;line-height:16px}.vital-row>span:first-child{width:24px}.vital-row b{width:22px;text-align:right;font-size:9px;font-variant-numeric:tabular-nums}.vital-track{flex:1;height:7px;border-radius:5px;background:#122826;overflow:hidden;box-shadow:inset 0 1px 2px #0006}.vital-track i{display:block;height:100%;border-radius:5px;transition:width .35s;background:linear-gradient(#e8af85,#c7795c)}#fullness-fill{background:linear-gradient(#b7d78b,#79ab74)}
#materials-bag,#world-toggle,#notice-icon{display:grid;place-items:center;width:36px;height:36px;padding:6px;border:1px solid #f8e9c69c;border-radius:11px;color:#f9edcd;background:#344c43d9;box-shadow:0 2px 5px #162b3222;pointer-events:auto}#materials-bag svg{width:24px;height:24px}
#world-toggle{position:absolute;top:66px;left:12px;z-index:26;font-size:18px}#notice-icon{position:absolute;top:110px;left:12px;width:28px;height:28px;z-index:24;font-size:13px;background:#344c439e}#notice-icon[hidden]{display:none}#notice-icon i{display:none}#notice-icon[data-unread=true] i{display:block;position:absolute;right:3px;top:3px;width:4px;height:4px;border-radius:50%;background:#f4d390}
#stage[data-world-details=false] #world-shortcuts{display:none!important}#stage[data-world-details=true] #notice-icon{top:66px;left:56px}
#stage #world-shortcuts{top:109px;left:12px;width:135px;max-height:calc(100% - 245px);overflow:auto;padding:10px;gap:7px;border:1px solid #fff0ce88;border-radius:13px;background:#faf1dcf2;box-shadow:0 4px 12px #182a3425}
#stage #world-shortcuts button{width:100%;min-height:32px;border:1px solid #cdbd9f;border-radius:8px;box-shadow:none;font-size:11px;display:flex;align-items:center;justify-content:center;gap:7px}#stage #world-shortcuts button svg{width:19px;height:19px;margin:0}#stage #world-shortcuts #objective{position:static;max-width:none;display:block;padding:3px;text-align:left;background:none;border:0}#stage #world-shortcuts #weather-status{width:100%;font-size:10px}#stage #world-shortcuts .world-settings{display:flex;gap:5px}#stage #world-shortcuts #quality,#stage #world-shortcuts #game-speed{position:static;width:50%;height:33px;font-size:10px;pointer-events:auto}#stage #world-shortcuts #quality svg{width:16px}#stage #speed-hint{display:none!important}
#stage .camera-turn{opacity:.22;background:#fff6e560;border-color:#fff7e240;box-shadow:none}#stage .camera-turn:hover,#stage .camera-turn:focus-visible,#stage .camera-turn:active{opacity:.7}
.bag-gold{display:flex;justify-content:space-between;padding:12px 0;color:#88703e}.bag-stock{width:100%;border-collapse:collapse;font-size:12px}.bag-stock th,.bag-stock td{padding:10px 4px;border-bottom:1px solid #9c8d6925;text-align:right}.bag-stock th:first-child{text-align:left}.bag-stock thead{color:#8b7b60;font-size:10px}.notice-row{font-size:12px;padding:12px 0;line-height:1.5;border-bottom:1px solid #99856533}
#stage[data-session-started=false] #vitals,#stage[data-session-started=false] #materials-bag,#stage[data-session-started=false] #world-toggle,#stage[data-session-started=false] #notice-icon,#stage[data-cinematic=true] #world-toggle,#stage[data-cinematic=true] #notice-icon{visibility:hidden}
#stage[data-world-details=true] #task-list{visibility:hidden}#stage[data-cinematic=true] #world-shortcuts{visibility:hidden}
/* Compact, warm game HUD: consistent weight, no thin gold outlines. */
#stage .topbar{width:49%;height:54px;padding:8px 0 0 8px;gap:5px;align-items:flex-start;background:none}
#vitals{flex:1;min-width:0;width:auto;height:43px;padding:4px 6px;border:2px solid #7c8272;border-radius:10px;background:#f2efdf;color:#4d5748;box-shadow:0 2px 0 #505b4b33}
.vital-row{gap:4px;font-size:9px;line-height:15px;font-weight:700}.vital-row>span:first-child{width:22px;flex-shrink:0}.vital-row b{width:18px;font-size:9px}.vital-track{height:7px;background:#d7d9c9;box-shadow:inset 0 1px 2px #56654a26}.vital-track i{background:linear-gradient(#dba282,#bd785e)}#fullness-fill{background:linear-gradient(#a2c48a,#74955e)}#vitals[data-low=true]{border-color:#b6735f}
#materials-bag,#world-toggle,#notice-icon{border:2px solid #7c8272;border-radius:10px;background:#f2efdf;color:#5e6b54;box-shadow:0 2px 0 #505b4b33}
#materials-bag{flex:0 0 32px;width:32px;height:43px;padding:4px}#materials-bag svg{width:21px;height:21px;stroke-width:1.9}
#world-toggle{top:59px;width:32px;height:30px;left:9px;padding:5px}#world-toggle svg{width:18px;height:18px;stroke-width:2.4}
#notice-icon{top:97px;left:9px;width:32px;height:32px;padding:5px;background:#f2efdf}#notice-icon svg{width:20px;height:20px}#notice-icon[data-unread=true] i{background:#c47c58;right:2px;top:2px;width:5px;height:5px}
#stage[data-world-details=true] #notice-icon{top:59px;left:49px}#stage #world-shortcuts{top:97px;border:2px solid #8e9480;background:#f2efdf}
#stage #task-list{top:8px;right:8px;width:48%;max-width:none;padding:0 0 3px}#stage #next-task{border:2px solid #8e8977;border-radius:10px;background:#f7f1df;box-shadow:0 2px 0 #6d675328;min-height:43px;color:#565443}#stage #next-task strong{font-size:12px}
#stage #toast{display:block;left:50%;right:auto;bottom:var(--dock-clearance)!important;max-width:calc(100% - 32px);width:max-content;white-space:normal;text-align:center;line-height:1.5;padding:8px 13px;font-size:11px;border:0;border-radius:10px;background:#34463beF;color:#f6f3e6;box-shadow:0 3px 10px #162b3226;pointer-events:none;z-index:41}#stage #toast.show{animation:quiet-notice 2.4s both}@keyframes quiet-notice{0%,100%{opacity:0}12%,78%{opacity:1}}
#stage[data-cinematic=true] #toast,#stage[data-session-started=false] #toast{visibility:hidden}
/* Optional indoor actions: quiet secondary controls above the dock. */
#stage #home-info,#stage #home-blueprint{width:76px;min-width:0;height:30px;min-height:30px;padding:4px 8px;border:1px solid #e0e6d240;border-radius:8px;background:#35473dda;color:#e2e7d8;font-size:11px;font-weight:500;line-height:20px;box-shadow:none}
#stage #home-info{left:calc(50% - 79px)}#stage #home-blueprint{left:calc(50% + 3px)}
#stage #home-info:hover,#stage #home-blueprint:hover,#stage #home-info:focus-visible,#stage #home-blueprint:focus-visible{background:#485c4f;color:#fff9e9}

/* Speed shortcut beside the compact task rail. */
#stage #task-list{right:54px;width:calc(48% - 46px)}
#stage #game-speed{position:absolute;top:8px;right:8px;left:auto;width:40px;height:43px;min-height:43px;padding:4px 3px;z-index:26;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;border:2px solid #8e8977;border-radius:11px;background:linear-gradient(155deg,#fff9e9,#e9e3cf);color:#79735e;box-shadow:inset 0 1px 0 #fffdf5,0 2px 0 #6d675328;cursor:pointer;touch-action:manipulation;transition:background .18s,color .18s,transform .12s}
#stage #game-speed svg{width:24px;height:18px;fill:currentColor;stroke:none;filter:drop-shadow(0 1px 0 #fff6)}
#stage #game-speed span{font-size:10px;font-weight:850;line-height:13px;letter-spacing:.4px}
#stage #game-speed[aria-pressed=true]{background:linear-gradient(155deg,#daeabf,#abc78c);border-color:#708360;color:#365332;box-shadow:inset 0 1px 0 #edf7da,0 2px 0 #4a613b55}
#stage #game-speed:active{transform:translateY(2px);box-shadow:inset 0 1px 3px #42563622}
#stage #game-speed:focus-visible{outline:2px solid #526d47;outline-offset:3px}
#stage #game-speed.speed-suggested{outline:none;animation:task-speed-invite 1.8s ease-in-out infinite}
@keyframes task-speed-invite{50%{border-color:#8eae66;box-shadow:0 0 0 3px #b5ce8c55,inset 0 1px #fffdf5,0 2px 0 #6d675328}}
#stage #world-shortcuts #quality{width:100%}
#stage[data-session-started=false] #game-speed,#stage[data-cinematic=true] #game-speed,#stage[data-world-details=true] #game-speed,#stage[data-menu-open=true] #game-speed,#stage[data-blueprint=true] #game-speed,#stage[data-placing=true] #game-speed{visibility:hidden}
@media(prefers-reduced-motion:reduce){#stage #game-speed.speed-suggested{animation:none;border-color:#8eae66}#stage #game-speed{transition:none}}

/* Brief reward chip, then three bounded icon echoes stream into the actual bag. */
#reward-burst{position:absolute;left:50%;top:43%;transform:translate(-50%,-50%);z-index:45;pointer-events:none;display:flex;align-items:center;gap:7px;width:max-content;max-width:65%;padding:6px 11px 6px 6px;border:1px solid #e5d9b9;border-radius:16px;background:#fff8e8eb;box-shadow:0 3px 10px #26382e22;color:#536d3e}
#reward-burst[hidden],#reward-trail[hidden]{display:none}#reward-burst-title,#reward-burst>span{display:none}#reward-burst-icon{flex:0 0 32px;width:32px;height:32px;font-size:28px;color:#bb9352}#reward-burst-icon svg{width:100%;height:100%}#reward-burst strong{font-size:17px;font-weight:850;line-height:1.3}
.reward-pop{animation:reward-quick-pop 1.15s both}
@keyframes reward-quick-pop{0%{opacity:0;transform:translate(-50%,-50%) scale(.55)}12%{opacity:1;transform:translate(-50%,-50%) scale(1.1)}22%,48%{opacity:1;transform:translate(-50%,-50%) scale(1)}66%{opacity:.75}95%,100%{opacity:0;transform:translate(calc(-50% + var(--reward-dx)),calc(-50% + var(--reward-dy))) scale(.12)}}
#reward-trail{position:absolute;left:50%;top:43%;width:0;height:0;z-index:44;pointer-events:none}#reward-trail i{position:absolute;display:block;width:25px;height:25px;opacity:0;color:#bf9c57;font-size:24px;font-style:normal}#reward-trail svg{width:100%;height:100%}.reward-flight i{animation:reward-stream .59s cubic-bezier(.55,0,.8,.35) both;animation-delay:calc(.46s + var(--trail-delay))}
@keyframes reward-stream{0%{opacity:0;transform:translate(-50%,-50%) scale(.8)}15%{opacity:.65}80%{opacity:.4}100%{opacity:0;transform:translate(calc(-50% + var(--reward-dx)),calc(-50% + var(--reward-dy))) scale(.08)}}
#materials-bag.reward-received{animation:reward-bag-catch .28s ease-out}@keyframes reward-bag-catch{35%{transform:scale(1.12);background:#e0ebcb}100%{transform:scale(1)}}
@media(prefers-reduced-motion:reduce){.reward-pop{animation:reward-soft-fade 1.15s both}.reward-flight i{animation:none}#materials-bag.reward-received{animation:none}@keyframes reward-soft-fade{0%,100%{opacity:0}12%,70%{opacity:1}}}
/* Bottom task dock: normal flow keeps tutorial, choices and tools from overlapping. */
#stage .topbar{left:auto;right:8px;top:8px;width:48%;height:44px;padding:0;gap:5px}
#stage #materials-bag{flex-basis:36px;width:36px;height:44px}#stage #vitals{height:44px}
#player-heading{position:absolute;top:10px;left:12px;width:calc(50% - 22px);z-index:16;pointer-events:none;color:#354a3b;text-shadow:0 1px 1px #fff8;line-height:1.6}#player-heading strong,#player-heading span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#player-heading strong{font-size:13px;font-weight:850}#player-heading span{font-size:10px;font-weight:650}
#stage[data-session-started=false] #player-heading,#stage[data-cinematic=true] #player-heading{visibility:hidden}
#stage #world-shortcuts #objective{display:none}#stage #world-shortcuts #resident-menu span{font-size:0}#stage #world-shortcuts #resident-menu span:after{content:'주민 관리';font-size:11px}
#stage #farm-hud{padding:7px 7px 6px;border-color:#9c9b84;background:#f8f2e3f5;box-shadow:0 3px 10px #283c3022}
#task-dock{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:6px;align-items:end;margin-bottom:6px}#task-dock[hidden]{display:none!important}
#stage #task-dock #task-list{position:relative;inset:auto;width:auto;max-width:none;max-height:none;overflow:visible;padding:0;display:grid;grid-template-columns:minmax(0,1fr) 44px;grid-template-rows:auto 52px;column-gap:0;z-index:auto}
#stage #task-dock #task-list #next-task{grid-column:1 / -1;grid-row:2;width:100%;height:52px;min-height:52px;padding:8px 12px;display:flex;align-items:center;gap:9px;border:1px solid #a6b28d;border-radius:11px;background:#e7edda;color:#42523c;box-shadow:inset 0 1px #faffed;text-align:left;animation:none}
#stage #task-dock #task-list[data-has-alternatives=true] #next-task{padding-right:48px}
#stage #task-dock #task-list #next-task strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:13px;line-height:1.35;margin:0;word-break:keep-all}
#stage #task-dock #task-list #next-task[data-working=true]:before{content:'';flex:0 0 6px;width:6px;height:6px;border-radius:50%;background:#83a36b;animation:task-working 1.8s ease-in-out infinite}
@keyframes task-working{50%{opacity:.35}}
#stage #task-dock[data-ready=true] #next-task{animation:task-ready-once .65s ease-out 1}@keyframes task-ready-once{45%{background:#d6e7bd;box-shadow:inset 0 0 0 2px #b1c88e}}
#stage #task-dock #task-options-toggle{position:relative;inset:auto;grid-column:2;grid-row:2;align-self:center;z-index:2;width:44px;height:44px;min-height:44px;padding:0;margin:0;border:0;background:transparent;box-shadow:none;color:#687b54;font-size:22px}
#stage #task-dock #task-alternatives{grid-column:1 / -1;grid-row:1;display:grid;gap:5px;max-height:min(24vh,140px);overflow-y:auto;overscroll-behavior:contain;margin:0 0 6px;padding:0;touch-action:pan-y}
#stage #task-dock #task-alternatives:empty{display:none}#stage #task-dock .task-summary{min-height:44px;padding:7px 11px;border:1px solid #d4d7bf;border-radius:9px;background:#f2f3e6;text-align:left}#stage #task-dock .task-summary strong{font-size:11px;line-height:1.4}
#stage #task-dock #game-speed{position:static;inset:auto;width:44px;height:52px;min-height:52px;padding:4px;border:1px solid #a6b28d;border-radius:11px;box-shadow:inset 0 1px #fffdf5;font-size:12px;z-index:auto}
#stage[data-menu-open=true] #task-dock,#stage[data-blueprint=true] #task-dock,#stage[data-placing=true] #task-dock,#stage[data-world-details=true] #task-dock{display:none!important}
#stage #farm-hud .farm-dock{padding-top:5px;border-top:1px solid #c6c7ad66}
#stage #toast,#stage #merchant-speech{bottom:var(--notice-clearance,var(--dock-clearance))!important}
#stage[data-tutorial-notice=true] #toast,#stage[data-merchant-notice=true] #toast{visibility:hidden}
@media(prefers-reduced-motion:reduce){#stage #task-dock #task-list #next-task,#stage #task-dock #task-list #next-task:before{animation:none!important}}

/* Floating action panel: only the backing is translucent, never the text. */
#stage #task-dock{position:absolute;right:10px;bottom:var(--task-clearance,var(--dock-clearance));width:55%;min-width:210px;max-width:min(300px,calc(100% - 20px));margin:0;gap:4px;z-index:27;pointer-events:none}
#stage #task-dock button,#stage #task-dock #task-list{pointer-events:auto}
#stage #task-dock #task-list{grid-template-rows:auto 48px}
#stage #task-dock #task-list #next-task{height:48px;min-height:48px;padding:6px 9px;border:0;border-radius:10px;background:rgba(245,245,225,.72);box-shadow:none;color:#344b38}
#stage #task-dock #task-list #next-task strong{font-size:12px;line-height:1.35}
#stage #task-dock #task-list[data-has-alternatives=true] #next-task{padding-right:42px}
#stage #task-dock #task-list[data-tutorial-locked=true] #next-task{box-shadow:none}
#stage #task-dock #task-list #next-task[data-working=true]{background:rgba(237,241,222,.66)}
#stage #task-dock #task-options-toggle{width:44px;height:44px;color:#42583c}
#stage #task-dock #game-speed{height:48px;min-height:48px;border:0;background:rgba(245,241,224,.72);box-shadow:none;color:#5d674a}
#stage #task-dock #game-speed[aria-pressed=true]{background:rgba(192,216,163,.78);color:#355332;box-shadow:none}
#stage #task-dock .task-summary{background:rgba(242,244,225,.76);border:0;box-shadow:none;color:#344b38}
#stage #task-dock #task-alternatives{margin-bottom:4px;gap:4px}
#stage #task-dock[data-ready=true] #next-task{animation:task-float-ready .6s ease-out 1}@keyframes task-float-ready{50%{background:rgba(225,240,196,.9)}}
#stage[data-cinematic=true] #task-dock,#stage[data-session-started=false] #task-dock{visibility:hidden}
#stage #farm-hud .farm-dock{padding-top:0;border-top:0}
@media(prefers-reduced-motion:reduce){#stage #task-dock[data-ready=true] #next-task{animation:none}}
/* User-supplied art: atlas stays intact and is shared by dialogue and resident cards. */
#stage .resident-avatar.illustrated-portrait{width:64px;height:64px;flex:0 0 64px;border-radius:0;background-color:transparent;background-image:url('assets/npc-portraits.png?v=211');background-size:500% 500%;background-repeat:no-repeat;image-rendering:pixelated}
#stage #story-portrait{image-rendering:auto}
#stage #start-screen{background:#e0e8d2 url('assets/title-village-v236.png?v=236') center center / cover no-repeat;backdrop-filter:none;display:flex;align-items:flex-end;justify-content:center;padding:0 16px max(14px,env(safe-area-inset-bottom));box-sizing:border-box}
#stage #start-screen[hidden]{display:none}

#stage .start-card{position:static;z-index:1;width:min(86%,300px);padding:8px 14px 5px;border:0;border-radius:18px;background:#fff8e4d9;box-shadow:0 3px 12px #35452a22}
#stage .start-card>small:first-child{display:none}
#stage .start-card h1{position:absolute;top:5%;left:0;width:100%;margin:0;color:#fff7db;font-size:clamp(25px,5vw,36px);font-weight:900;letter-spacing:-1px;text-shadow:0 3px 0 #765337,2px 0 #765337,-2px 0 #765337,0 -1px #765337,0 5px 12px #3c3b3555;pointer-events:none}
#stage .start-card p{font-size:11px;line-height:1.45;margin:4px 0 6px;color:#65533f}
#stage .start-card button{min-height:44px;margin:6px 0;border-radius:12px;font-size:14px;font-weight:750}
#stage .start-card>small:last-child{font-size:9px;color:#786749}
/* Frosted lower title panel and warm illustrated dialogue. */
#stage #start-screen{padding:0;isolation:isolate}

#stage .start-card{width:min(86%,320px);height:40%;display:flex;flex-direction:column;justify-content:center;padding:16px 14px max(16px,env(safe-area-inset-bottom));box-sizing:border-box;background:transparent;border:0;border-radius:0;box-shadow:none}
#stage .start-card h1{display:none}
#stage .start-card p{margin:0 0 12px;font-size:12px;line-height:1.65;color:#786955}
#stage .start-card button{flex-shrink:0;min-height:44px;margin:5px 0;background:#fff9ed;border:1px solid #d1bfa3;box-shadow:0 2px 0 #bca3803d;color:#6b5843}
#stage .start-card #continue-game{background:linear-gradient(#e9f0da,#dce8c5);border-color:#aeba94;color:#4c6240}
#stage .start-card>small:last-child{margin-top:9px;color:#8b806d;font-size:10px}
#stage #story-scene .cinema-dialog{grid-template-columns:82px minmax(0,1fr);gap:7px 12px;padding:16px;border:1px solid #e4d5bf;border-radius:22px;background:linear-gradient(135deg,#fffdf5,#faf0e1);color:#67523f;box-shadow:inset 0 1px 0 #fff,0 6px 24px #3c362127;max-height:65%;overflow-y:auto}
#stage #story-scene #story-portrait{width:82px!important;height:90px!important;align-self:start;margin:2px 0 0;border-radius:18px;background:radial-gradient(ellipse at 50% 65%,#f4d9c7a6,transparent 72%);filter:drop-shadow(0 2px 1px #b4886a22);image-rendering:auto}
#stage #story-scene #story-speaker{justify-self:start;align-self:center;margin:0;padding:3px 10px;border-radius:8px;background:#eed9c4;color:#81583e;font-size:12px;font-weight:800;line-height:1.4;letter-spacing:.2px}
#stage #story-scene #story-dialogue{color:#65523f;font-size:14px;line-height:1.8;text-shadow:none;margin:0;white-space:pre-line;word-break:keep-all;overflow-wrap:anywhere}
#stage #story-scene #story-next{min-height:40px;margin:5px 0 0;padding:8px 14px;border:1px solid #c1cea7;border-radius:11px;background:#e5edda;color:#536644;box-shadow:0 2px 0 #b8c6a33d;font-size:12px;font-weight:700;text-shadow:none}
#stage #story-scene #story-next:active{transform:translateY(1px);box-shadow:none}#stage #story-scene #story-next:focus-visible{outline:2px solid #81986b;outline-offset:3px}
@container game (max-width:350px){#stage #story-scene .cinema-dialog{grid-template-columns:64px minmax(0,1fr);gap:6px 9px;padding:12px;border-radius:18px}#stage #story-scene #story-portrait{width:64px!important;height:70px!important}#stage #story-scene #story-dialogue{font-size:13px}}
@media(max-height:550px){#stage .start-card{padding-top:6px;padding-bottom:6px}#stage .start-card p{font-size:10px;margin-bottom:3px}#stage .start-card button{min-height:36px;margin:3px 0}#stage .start-card>small:last-child{margin-top:3px;font-size:9px}}

/* Dark glass gives title controls and world labels clear separation. */

#stage .start-card p{color:#f0e9dd;text-shadow:0 1px 2px #0008}#stage .start-card>small:last-child{color:#d3d0c5}#stage .start-card #cancel-new{background:#ffffff18;color:#fff2dd;border-color:#ffffff30}
#stage #player-heading{top:8px;left:8px;width:calc(50% - 20px);box-sizing:border-box;min-height:44px;padding:5px 9px;border:1px solid #ffffff25;border-radius:10px;background:rgba(19,32,31,.72);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);color:#fff4df;text-shadow:0 1px 2px #0006}
#stage #player-heading strong{font-size:12px;line-height:17px}#stage #player-heading span{font-size:10px;line-height:15px;color:#e0e8d6}
/* Readiness stays visible until tapped, without flashing during automatic work. */
#stage #task-dock[data-ready=true] #task-list #next-task{background:rgba(245,246,206,.94);box-shadow:inset 0 0 0 2px #f8d982,0 0 8px #ffdc8680;animation:task-call-attention 1.7s ease-in-out infinite;color:#3e5031}
@keyframes task-call-attention{0%,100%{box-shadow:inset 0 0 0 2px #f4d78d,0 0 6px #ffe29b65;background:rgba(244,245,209,.88)}50%{box-shadow:inset 0 0 0 2px #fff1b3,0 0 0 3px #f8d57b60,0 0 18px 3px #ffe19c99;background:rgba(255,249,214,.98)}}
@media(prefers-reduced-motion:reduce){#stage #task-dock[data-ready=true] #task-list #next-task{animation:none;box-shadow:inset 0 0 0 2px #ffe49b,0 0 10px #ffe19c99}}
#stage #area-rotate.home-lesson-focus{outline:3px solid #fff0ab;outline-offset:3px;animation:home-rotate-guide 1.3s ease-in-out infinite}@keyframes home-rotate-guide{50%{box-shadow:0 0 0 6px #f9d98166,0 0 15px #ffe1a3}}
@media(prefers-reduced-motion:reduce){#stage #area-rotate.home-lesson-focus{animation:none}}
#home-gesture-focus{position:absolute;inset:0;z-index:39;pointer-events:none;overflow:hidden}#home-gesture-focus[hidden]{display:none}
#home-gesture-hole{position:absolute;box-sizing:border-box;border:2px solid #ffeab2;border-radius:24px;box-shadow:0 0 0 150vmax #101b28a6,0 0 16px #ffe4a9a0}
#home-gesture-focus[data-phase=rotate] #home-gesture-hole{border-radius:16px;border-width:3px}
#home-gesture-label{position:absolute;transform:translateX(-50%);width:max-content;max-width:216px;text-align:center;padding:7px 11px;border-radius:12px;background:#fff7e5;color:#654d33;font-size:12px;font-weight:800;box-shadow:0 2px 8px #0003}
#home-gesture-hand{position:absolute;left:32%;top:42%;width:44px;height:52px;animation:home-drag-hand 2s ease-in-out infinite;filter:drop-shadow(0 3px 2px #0004)}#home-gesture-hand[hidden]{display:none}#home-gesture-hand svg{position:relative;width:44px;height:52px}#home-gesture-hand i{position:absolute;left:5px;top:-7px;width:30px;height:30px;border:3px solid #ffe4a0;border-radius:50%;animation:home-drag-touch 2s ease-in-out infinite}
@keyframes home-drag-hand{0%{opacity:0;transform:translate(0,0) scale(1.12)}15%,28%{opacity:1;transform:translate(0,0) scale(.94)}68%,78%{opacity:1;transform:translate(48px,-12px) scale(.94)}92%,100%{opacity:0;transform:translate(48px,-12px) scale(1.08)}}
@keyframes home-drag-touch{0%,12%{opacity:0;transform:scale(1.3)}22%,68%{opacity:1;transform:scale(.8)}85%,100%{opacity:0;transform:scale(1.2)}}
@media(prefers-reduced-motion:reduce){#home-gesture-hand,#home-gesture-hand i{animation:none}#home-gesture-hand{opacity:1}}
/* Keep the disclosure above the primary button's glow and open upwards. */
#stage #task-dock #task-options-toggle{z-index:4;display:flex;align-items:center;justify-content:center;isolation:isolate;border-radius:9px;background:rgba(232,239,216,.85)}
#stage #task-dock #task-options-toggle[hidden],#stage #task-dock #task-alternatives[hidden]{display:none!important}
#stage #task-dock #task-alternatives{position:relative;z-index:3;grid-row:1;max-height:112px;overflow-y:auto}
#stage #task-dock .task-empty{padding:9px;border-radius:9px;background:#f2f4e1dd;color:#42583c;font-size:11px}
#stage #task-dock #task-options-toggle{width:32px;height:36px;min-height:36px;justify-self:end;background:transparent;border:0;border-radius:0;color:#52644c;box-shadow:none}
#stage #task-dock #task-options-toggle svg{width:12px;height:12px;opacity:.85}
#stage #task-dock #task-list[data-has-alternatives=true] #next-task{padding-right:34px}
#stage #task-dock #task-list{overflow:visible!important}
#stage #task-dock #task-alternatives{position:absolute;grid-area:auto;top:auto;height:auto;left:0;right:0;bottom:calc(100% + 5px);width:100%;max-height:120px;margin:0;z-index:10;pointer-events:auto}
#stage #task-dock #task-list[data-expanded=true] #task-alternatives{display:grid!important;visibility:visible!important}
#stage #task-dock #task-list[data-expanded=false] #task-alternatives{display:none!important}
#stage #task-dock #task-options-toggle{z-index:12;pointer-events:auto}
/* Local stacking: legacy #next-task z-index:26 must not cover disclosure. */
#stage #task-dock #task-list{isolation:isolate}
#stage #task-dock #task-list #next-task{z-index:0}
#stage #task-dock #task-list #task-options-toggle{z-index:2;width:44px;height:44px;min-height:44px;touch-action:manipulation}
#stage #task-dock #task-list #task-options-toggle svg{pointer-events:none}
#stage #task-dock #task-list[data-has-alternatives=true] #next-task{padding-right:46px}
.space-purpose{font-size:12px;margin:8px 0;color:#605b49}.space-purpose summary{cursor:pointer;padding:6px 0;font-weight:700}.space-purpose select{max-width:100%;margin:5px;padding:6px;border:1px solid #c5c7b4;border-radius:7px;background:#f6f3e7;color:#4a5944}.space-purpose button{font-size:11px!important;min-height:32px!important;padding:5px 8px!important;margin:3px!important;border-radius:7px!important}.space-purpose p{font-size:11px;margin:6px 0}
/* Reserve a fixed end slot for music; the title yields space on narrow screens. */
#stage .topbar{left:auto;right:8px;width:min(60%,224px);height:44px;padding:0;gap:5px}
#stage #player-heading{left:8px;width:calc(100% - min(60%,224px) - 24px);padding-left:7px;padding-right:7px}
#stage #vitals{flex:1 1 0;min-width:0}
#stage #materials-bag{flex:0 0 36px}
#stage #music-toggle{display:grid;place-items:center;position:static;flex:0 0 44px;width:44px;height:44px;min-height:44px;margin:0;padding:9px;box-sizing:border-box;border:2px solid #7c8272;border-radius:10px;background:#f2efdf;color:#5e6b54;box-shadow:0 2px 0 #505b4b33;pointer-events:auto;touch-action:manipulation}
#stage #music-toggle svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
#stage #music-toggle[data-enabled=false]{color:#8a8274;background:#e5e1d5}
#stage #music-toggle:focus-visible{outline:2px solid #f4d78d;outline-offset:2px}
#stage[data-session-started=false] #music-toggle{visibility:hidden}
#stage #game-speed .speed-time{font-size:8px;line-height:9px;font-variant-numeric:tabular-nums}.speed-reward{text-align:center}.speed-reward>p{font-size:14px}.speed-reward-items{display:grid;gap:10px;padding:16px;border-radius:14px;background:#ecebdc;text-align:left}.speed-reward-items>strong{color:#4e6840;font-size:18px}.speed-reward-items span{display:flex;justify-content:space-between}.speed-reward-items small{font-size:12px}.speed-reward-actions{display:flex;gap:8px;margin:16px 0 10px}.speed-reward-actions button{flex:1;min-height:44px;border:1px solid #bcb49f;border-radius:12px;background:#efecdf;color:#565944;font-weight:700}.speed-reward-actions .action{background:#d9e5c3}.speed-reward>small{font-size:11px;color:#786f5e}

#stage #start-screen:before{display:none;content:none;backdrop-filter:none;-webkit-backdrop-filter:none}

/* Compact title controls: keep the illustration visible around the card. */
#stage #start-screen{padding:18px 0 max(44px,calc(env(safe-area-inset-bottom) + 34px));overflow-y:auto}
#stage .start-card{position:relative;flex:0 0 auto;width:min(340px,calc(100% - 44px));height:auto;min-height:0;padding:20px 20px 16px;border:1px solid #fff9e8;border-radius:23px;background:rgba(255,248,230,.96);box-shadow:0 8px 28px #342a2b38,inset 0 0 0 3px #e3d3b752;gap:0}
#stage .start-card:before{content:'';display:block;width:34px;height:4px;margin:0 auto 12px;border-radius:4px;background:#e5a15a}
#stage .start-card #start-description{margin:0 0 15px;color:#435437;font-size:clamp(13px,3.8vw,16px);font-weight:800;line-height:1.55;letter-spacing:-.5px;text-shadow:none;overflow-wrap:break-word}
#stage .start-card button{width:100%;min-height:48px;margin:5px 0;padding:10px 14px;border:1px solid #c9b38b;border-radius:13px;background:#fffdf5;color:#665039;font-size:15px;font-weight:800;box-shadow:0 3px 0 #cbb795;touch-action:manipulation;transition:transform .12s,box-shadow .12s}
#stage .start-card #continue-game{background:linear-gradient(#648849,#4b7039);color:#fffcef;border-color:#416333;box-shadow:0 3px 0 #365029,inset 0 1px 0 #ffffff30}
#stage .start-card #continue-game:disabled{background:#e1e4d5;color:#717a60;border-color:#bec5ab;box-shadow:none;opacity:1;cursor:default}
#stage .start-card #cancel-new{background:#ede5d3;color:#645641;border-color:#d3c4a6;box-shadow:none;min-height:44px}
#stage .start-card button:not(:disabled):active{transform:translateY(2px);box-shadow:none}
#stage .start-card button:focus-visible{outline:3px solid #bf7d35;outline-offset:3px}
#stage .start-card>small:last-child{display:block;margin-top:13px;font-size:10px;line-height:1.5;color:#6c624f;text-shadow:none}
#stage #title-copyright{position:absolute;bottom:max(9px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:1;padding:3px 12px;border-radius:20px;background:#fff8e7e8;color:#574b36;font-size:10px;font-weight:700;letter-spacing:1.2px;white-space:nowrap}
@media(max-height:550px){#stage .start-card{padding:12px 18px 10px}#stage .start-card:before{margin-bottom:7px}#stage .start-card #start-description{font-size:13px;margin-bottom:7px}#stage .start-card button{min-height:44px;margin:4px 0}#stage .start-card>small:last-child{margin-top:8px}}
