/* One thin, transparent scroll track for dialogs, panels and horizontal lists. */
:root{--scroll-thumb:#b49361;--scroll-hover:#8f7048}
*{scrollbar-width:thin;scrollbar-color:var(--scroll-thumb) transparent}
*::-webkit-scrollbar{width:7px;height:7px;background:transparent}
*::-webkit-scrollbar-track,*::-webkit-scrollbar-corner{background:transparent;border:0;box-shadow:none}
*::-webkit-scrollbar-thumb{background:var(--scroll-thumb);border-radius:12px;border:2px solid transparent;background-clip:padding-box;min-height:36px;min-width:36px}
*::-webkit-scrollbar-thumb:hover{background-color:var(--scroll-hover)}
*::-webkit-scrollbar-button{display:none;width:0;height:0;background:transparent}
.cozy-dialog,#modal,#app #atmosphere-panel,#app #materials,.house-dots,.view-controls{scrollbar-color:var(--scroll-thumb) transparent}
#app .view-controls{scrollbar-width:thin}
.cozy-dialog,#modal,#app #atmosphere-panel{scrollbar-gutter:stable;overflow-x:hidden;overscroll-behavior:contain}
#app.night{--scroll-thumb:#aebf92;--scroll-hover:#d0dbb6}
.cozy-dialog{box-sizing:border-box;width:min(580px,calc(100vw - 28px));padding:30px 34px;}
.cozy-dialog h2{padding-inline:20px}.cozy-dialog .wood-button{max-width:100%;white-space:nowrap}
.playlist-current strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}
#app .segmented button span,#app .palette-options button,#app .finish-choices button span,#app #photo-dock button,#app #reset-paint{white-space:nowrap;word-break:normal;overflow-wrap:normal}
#app .paint-parts{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:8px;margin:10px 0 16px;padding:4px 2px 8px;scroll-snap-type:x proximity}
#app .paint-parts button{flex:0 0 46px;width:46px;min-height:46px;height:46px;gap:0;padding:9px;scroll-snap-align:start}
#app .paint-parts button .ui-icon{width:25px;height:25px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
#app .paint-parts button>span{display:none}
.menu-tools{display:flex;align-items:center;gap:8px;margin-left:auto}.language-flag{width:29px;height:20px;display:block;fill:none;stroke:none;overflow:hidden;border-radius:3px;box-shadow:0 0 0 1px #76572c26;flex:none}
.menu-tools .wood-round{margin:0}.language-picker{position:absolute;top:64px;right:0;padding:13px;background:#f4e8cc;border:2px solid #bc9a65;border-radius:18px;box-shadow:0 4px #957345,0 12px 30px #35432830;z-index:30;max-width:calc(100vw - 28px)}
.language-choices{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;min-width:0}.language-choices button{display:grid;place-items:center;width:44px;height:38px;padding:6px;border:2px solid #fff2d0;border-radius:11px;background:#e8cca0;box-shadow:0 3px #ac8957}
.language-choices button[aria-pressed=true]{background:#a4ba7d;border-color:#657f46;box-shadow:0 3px #637d45}.language-choices button:focus-visible{outline:3px solid #5c7542;outline-offset:3px}.language-choices .language-flag{width:28px;height:19px}
.language-setting{min-inline-size:0;border:0;padding:0;margin:22px 0}.language-setting legend{font-weight:700;margin-bottom:12px;font-size:15px}.language-picker .language-choices{max-width:210px}
:lang(hi),:lang(bn){font-family:'Nirmala UI','Noto Sans Devanagari','Noto Sans Bengali',sans-serif}:lang(ja){font-family:'Yu Gothic','Hiragino Kaku Gothic ProN',sans-serif}:lang(zh){font-family:'Microsoft YaHei','PingFang SC',sans-serif}
@media(min-width:701px){#app #atmosphere-panel{width:440px;max-width:calc(100vw - 32px)}#app .setting-label{width:105px;flex-shrink:0}#app .setting-row .segmented,#app .setting-row .palette-options{min-width:0;flex:1}.cozy-dialog.achievements-dialog{width:min(800px,calc(100vw - 28px))}}
@media(max-width:700px){.cozy-dialog{width:calc(100vw - 24px);padding:28px 20px}.cozy-dialog h2{font-size:25px}.cozy-dialog .wood-button{font-size:14px}.language-setting .language-choices{gap:7px}.language-setting .language-choices button{width:36px;height:34px}.language-setting .language-choices .language-flag{width:25px;height:17px}.menu-tools{gap:5px}.menu-tools .wood-round{width:38px;height:44px;min-width:38px}.menu-tools .language-flag{width:24px;height:17px}#app #atmosphere-panel>.setting-row{align-items:stretch}#app #atmosphere-panel .setting-row>.segmented,#app #atmosphere-panel .setting-row>.palette-options{width:100%;min-width:0}.playlist-current strong{font-size:13px}}
@media(forced-colors:active){*{scrollbar-color:auto}*::-webkit-scrollbar-thumb{background:ButtonText}}
@media(max-width:700px){.language-setting .language-choices{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}.language-setting .language-choices button{width:100%;min-width:0;padding:1px}.language-setting .language-choices .language-flag{width:22px;height:15px}}

/* Dark surfaces use explicit light copy, including small progress labels. */
#app.night{--ui-ink:#fff3d7;color:#fff3d7}
#app.night .coin-pouch{background:#465168;color:#fff0bb;border-color:#adba9b;box-shadow:0 4px #263247}
#app.night .coin-pouch small{color:#f0e7d2}
#app.night #progress-panel{background:#39485bf5;border-color:#8997ae;color:#fff3d7}
#app.night .progress-label,#app.night .progress-label strong,#app.night #scene-caption,#app.night .story-panel h1{color:#fff3d7}
#app.night #atmosphere-panel{background:#303e50f5;border-color:#8997ae;color:#fff3d7}
#app.night #panel-caption,#app.night #atmosphere-panel .setting-label,#app.night #atmosphere-panel .eyebrow,#app.night #atmosphere-panel p,#app.night .paint-section,#app.night .paint-row legend,#app.night #wall-textures>p{color:#f0e7d2}
#app.night .paint-row{background:#39485b;border-color:#81908f}
#app.night #atmosphere-panel .segmented button,#app.night #atmosphere-panel .palette-options button,#app.night .paint-parts button,#app.night .finish-choices button,#app.night #reset-paint,#app.night #close-atmosphere{background:linear-gradient(#66728a,#465168);border-color:#a6adbc;color:#fff3d7;box-shadow:0 3px #202d43}
#app.night #atmosphere-panel .segmented button.active,#app.night #atmosphere-panel .palette-options button.active,#app.night .paint-parts button.active,#app.night .finish-choices button.active{background:linear-gradient(#657d56,#425a3d);border-color:#b1c995;color:#fffbe9;box-shadow:0 3px #263c25}
#app.night #photo-actions .photo-secondary button,#app.night #next-refuge{color:#f0e7d2}
#app.night #tutorial-tip-toggle{background:#62765b;color:#fff3d7}
#app #panel-toolbar{background:#f9f5e9;box-shadow:0 -18px #f9f5e9}
#app.night #panel-toolbar{background:#303e50;box-shadow:0 -18px #303e50}

/* This canvas is shared with export, but never receives pointer input. */
#photo-backdrop{display:none;position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:0}
#app.photo #photo-backdrop{display:block}
#photo-backgrounds{min-inline-size:0;border:0;padding:0;margin:8px 0 20px;text-align:left}
#photo-backgrounds legend{font-weight:700;color:inherit}
#app #photo-backgrounds p{font-size:calc(12px * var(--ui-scale));line-height:1.5;margin:8px 0 12px}
#background-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 9px}
#app #background-choices button{min-width:0;padding:5px 5px 8px;border:2px solid #fff1d1;border-radius:13px;background:#e6c99c;color:#624b30;box-shadow:0 3px #a17b4d}
#background-choices canvas{display:block;width:100%;height:auto;aspect-ratio:8/5;border-radius:7px;margin-bottom:7px}
#background-choices span{font-size:calc(11px * var(--ui-scale));white-space:nowrap}
#app #background-choices button[aria-pressed=true]{outline:3px solid #657f46;outline-offset:1px;background:#a4ba7d;color:#273c24}
#app.night #background-choices button{background:#465168;color:#fff3d7;border-color:#a6adbc;box-shadow:0 3px #202d43}
#app.night #background-choices button[aria-pressed=true]{background:#425a3d;color:#fffbe9;outline-color:#b1c995}
/* A wider desktop panel must reserve its actual space in the camera viewport. */
@media(min-width:701px){#app.photo:not(.panel-hidden):not(.clean-photo) #scene{right:calc(440px + 5vw)}}

/* Unlock confirmation puts the house, cost and resulting balance before the action. */
#game-menu{overflow:clip}
.cozy-dialog.unlock-dialog{width:min(560px,calc(100vw - 24px));padding:30px;text-align:center}
.unlock-eyebrow{display:flex;justify-content:center;align-items:center;gap:8px;color:#626f42;font-size:13px;font-weight:700}
.unlock-eyebrow .ui-icon{width:21px;height:21px}
.unlock-dialog h2{font-size:30px;line-height:1.2;padding:0;margin:13px 0 12px;overflow-wrap:normal}
.unlock-dialog #unlock-intro{font-size:15px;line-height:1.6;color:#625138;margin:0 auto 22px;max-width:380px}
.unlock-cost{padding:17px;background:#fff7e3;border:2px solid #d3b581;border-radius:20px}
.unlock-cost>span{font-size:13px;font-weight:600;color:#6a5537}
.unlock-cost strong{display:flex;justify-content:center;align-items:center;gap:10px;margin-top:8px;font-size:35px;line-height:1.2;color:#634a24}
.unlock-cost strong>.ui-icon{width:32px;height:32px;color:#aa7823}.unlock-cost small{font-size:15px;font-weight:600}
#unlock-budget{display:grid;gap:11px;margin:20px 0 22px;font-size:14px;color:#5f5039}
#unlock-budget>div{display:flex;justify-content:space-between;align-items:baseline;gap:15px;text-align:left}
#unlock-budget dt{line-height:1.4}#unlock-budget dd{font-weight:700;margin:0;white-space:nowrap;text-align:right}
.unlock-dialog #buy-house{display:flex;align-items:center;justify-content:center;gap:9px;min-height:64px;line-height:1.35;margin:0 0 15px;font-size:18px;padding:14px 10px;white-space:normal;word-break:normal;overflow-wrap:normal}
.unlock-dialog #buy-house .ui-icon{width:23px;height:23px;flex:none}
.unlock-dialog #cancel-buy{width:100%;min-height:44px;border:1px solid #bca47b;border-radius:13px;background:#eee0bf;color:#614c32;font-size:14px;font-weight:600}
.unlock-dialog .unlock-note{font-size:12px;line-height:1.5;color:#6b614b;margin:17px 0 0}
#game-menu #unlock-note:not(:empty){padding:10px 15px;background:#fff7e3;border:1px solid #b7c58c;border-radius:13px;font-weight:600}
#background-status:empty{display:none}#app #background-status{color:#685338;font-weight:600}
#app.night #background-status{color:#fff3d7}
@media(max-width:700px){.cozy-dialog.unlock-dialog{padding:25px 20px}.unlock-dialog h2{font-size:27px}.unlock-dialog #buy-house{font-size:15px;gap:7px}.unlock-dialog #buy-house .ui-icon{width:20px;height:20px}#unlock-budget{font-size:13px;gap:12px}.unlock-cost strong{font-size:32px}}
