@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root{color-scheme:light;--ink:#4b4b40;--cream:#f6f0e5;--green:#58694d}
*{box-sizing:border-box}
body{margin:0;background:#d5d8b4;color:var(--ink);font-family:'DM Sans',sans-serif}
main{height:100svh;min-height:420px;display:flex;flex-direction:column}
.world{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:#d5d8b4}
.world-bar,.world-bottom{flex:none;padding:9px 20px;display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:11px;background:#f6f0e5}
.world-bar>span:first-child{display:flex;align-items:center;gap:8px}
.world-bar i{width:6px;height:6px;border-radius:50%;background:#91a171}
#clock{font-size:9px;letter-spacing:1px;color:#8c8b79}
.stage{flex:1;min-height:0;display:grid;place-items:center;container-type:size;background:#d5d8b4}
.scene{position:relative;width:min(100cqw,177.777778cqh);aspect-ratio:16/9}
canvas{display:block;width:100%;height:100%;image-rendering:pixelated;touch-action:pinch-zoom;cursor:default}
.world-bottom{color:#7c7d69;min-height:34px}
button,select{font:inherit}
button{cursor:pointer}
#pause{border:0;background:transparent;color:#777c64;font-size:12px;display:flex;align-items:center;gap:8px;min-height:26px}
.play-controls{flex:none;display:flex;align-items:center;justify-content:space-between;padding:14px 24px 16px;gap:20px;background:var(--cream);border-top:1px solid #dedbcc}
.toy-controls>p,.time-controls>label{display:block;margin:0 0 8px;font-size:11px;font-weight:600}
.toy-controls{min-width:0}
#toys{display:flex;flex-wrap:wrap;gap:7px;max-width:650px}
#toys button{border:1px solid #d8d5c6;border-radius:7px;background:#fffaf0;padding:8px 11px;color:#666a56;font-size:11px;transition:background .2s,transform .2s;min-height:34px}
#toys button:hover{background:#e6ead9;transform:translateY(-2px)}
#toys button[aria-pressed=true]{background:#dde5cb;border-color:#9fae89}
#toys button:disabled{opacity:.55;cursor:default}
#toys button[data-toy="blue-frog"]{border-color:#91b4bc}
#toys button[data-toy="highland-bull"]{border-color:#bda084}
.hint{font-size:10px;color:#979483;display:block;margin-top:7px}
.time-controls{flex:none}
select{border:1px solid #d4d1bf;border-radius:7px;background:#eeeddf;color:#626b53;padding:9px 29px 9px 11px;font-size:11px;max-width:100%}
button:focus-visible,select:focus-visible{outline:3px solid #72865b;outline-offset:3px}
#bubble{position:absolute;display:none;pointer-events:none;background:#fff9df;border:2px solid #665b61;border-radius:7px;padding:5px 9px;color:#72546b;font-size:13px;box-shadow:2px 2px #0001;transform:translate(-50%,-100%)}
#bubble:after{content:'';position:absolute;bottom:-6px;left:45%;border-width:5px 5px 0;border-style:solid;border-color:#665b61 transparent transparent}
@media(max-width:650px){
 main{min-height:520px}
 .world-bar,.world-bottom{padding:7px 12px;font-size:10px}
 .play-controls{padding:12px 14px max(14px,env(safe-area-inset-bottom));gap:12px;flex-wrap:wrap}
 #toys{gap:6px}
 #toys button{padding:8px 10px;min-height:38px}
 .time-controls{display:none}
 .time-controls>label{margin:0}
 #pause span{display:none}
}
@media(max-height:500px) and (min-width:651px){main{min-height:320px}.play-controls{padding:8px 16px}.hint,.toy-controls>p,.time-controls>label{display:none}}
@media(prefers-reduced-motion:reduce){#toys button{transition:none}}

#toys button[hidden]{display:none}
.animal-browser{display:flex;align-items:center;gap:10px;margin-top:9px;max-width:100%;font-size:11px}
.animal-browser select{max-width:360px;min-width:0;flex:1;padding-top:7px;padding-bottom:7px}
@media(max-width:650px){.animal-browser{align-items:flex-start;flex-direction:column;gap:5px}.animal-browser select{width:100%;max-width:100%}.toy-controls{width:100%}}

/* Readable, touch-friendly controls without adding a title over the world. */
.world-bar{font-size:13px;padding:8px 20px}
#clock{display:none}
.world-bottom{font-size:13px;color:#4b5042;padding:6px 20px;min-height:56px}
#activity{line-height:1.45}
.world-actions{display:flex;gap:8px;flex:none}
#pause,#hug,#bedtime{min-height:44px;border:1px solid #b9bea8;border-radius:12px;padding:9px 14px;background:#fffaf0;color:#394934;font-size:14px;font-weight:600;white-space:nowrap}
#hug{background:#f1dce0;border-color:#d7a8b1;color:#713c4c}
#bedtime{background:#e3e5f0;border-color:#a6aec8;color:#444f73}
#bedtime[hidden]{display:none}
#pause[aria-pressed=true]{background:#dce7ce;border-color:#83976d}
#hug:disabled{opacity:.5;cursor:default}
.play-controls{padding:12px 20px;align-items:flex-start;gap:24px;box-shadow:0 -3px 12px #5e543708}
.toy-controls>p,.time-controls>label{font-size:13px;color:#394934;margin-bottom:8px}
#toys{max-width:none;gap:8px}
#toys button{min-height:44px;padding:10px 14px;font-size:14px;border-radius:12px;color:#394934;border-color:#bfc5ae;background:#fffdf6;font-weight:500}
#toys button[aria-pressed=true]{background:#dce7ce;border-color:#6c8557;box-shadow:inset 0 0 0 1px #6c8557}
#toys button[aria-pressed=true]::after{content:' ✓';font-weight:700}
#toys button:disabled{opacity:.65}
.hint{font-size:12px;line-height:1.4;color:#626650;margin-top:8px}
.animal-browser{font-size:13px;margin-top:10px;align-items:center}
.animal-browser select{max-width:420px;min-height:44px}
select{font-size:14px;min-height:44px;border-radius:10px;color:#394934;border-color:#b9bea8;background:#fffdf6}
.time-controls{padding-top:0}
button:active:not(:disabled){transform:translateY(1px)}
@media(max-width:650px){
 main{min-height:650px}
 .world-bar{font-size:12px;padding:7px 12px}
 #clock{font-size:10px}
 .world-bottom{padding:8px 12px;flex-wrap:wrap;gap:6px;font-size:12px}
 #activity{flex:1;min-width:145px}
 .world-actions{gap:6px}
 #pause,#hug,#bedtime{padding:8px 10px;font-size:13px}
 #pause{min-width:44px;justify-content:center}
 .play-controls{padding:12px 12px max(12px,env(safe-area-inset-bottom));gap:10px}
 #toys{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;max-width:100%}
 #toys button{font-size:13px;padding:8px 5px;min-height:48px;line-height:1.25}
 .toy-controls>p{margin-bottom:5px}
 .animal-browser{gap:5px;align-items:stretch;margin-top:6px}
 .animal-browser select{width:100%;max-width:100%}
 .hint{margin-top:5px}
 .time-controls>label{font-size:13px}
 .time-controls select{min-width:190px}
}
@media(max-height:500px) and (min-width:651px){
 .world-bar{padding:4px 12px}.world-bottom{min-height:46px;padding:2px 12px}
 .play-controls{padding:6px 12px}.animal-browser{margin-top:5px}
}

/* Pixel menu for the explicitly simulated support flow. */
#support-dialog{--wood:#74513b;--plum:#75464b;position:fixed;width:min(432px,calc(100% - 32px));max-height:calc(100svh - 32px);overflow:auto;border:4px solid #b99264;border-radius:0;background:#f4e6c9;color:#514335;padding:22px;box-shadow:0 -4px 0 var(--wood),0 4px 0 var(--wood),-4px 0 0 var(--wood),4px 0 0 var(--wood),8px 8px 0 #362c2550,inset 0 0 0 3px #fff3d9;scrollbar-color:#b99264 #e8d5b2}
#support-dialog::backdrop{background:#302b248f}
.support-close{position:absolute;right:6px;top:5px;width:44px;height:44px;border:0;background:transparent;font-family:monospace;font-size:28px;color:var(--wood)}
.support-badge{display:inline-block;background:#e4d3b1;color:#614c37;padding:5px 7px;font-size:10px;letter-spacing:.8px;font-weight:700;margin-right:30px;border-bottom:2px solid #cbb089}
.support-heading{display:flex;gap:12px;align-items:center;margin:20px 0 8px}
#support-dialog h2{font-family:inherit;font-weight:700;font-size:24px;line-height:1.2;margin:0;color:var(--plum);min-width:0}
.pixel-heart{display:inline-block;flex:none;width:28px;height:28px;background:linear-gradient(#be777b 0 57%,#9d5c65 57%);clip-path:polygon(14% 0,43% 0,43% 14%,57% 14%,57% 0,86% 0,86% 14%,100% 14%,100% 57%,86% 57%,86% 71%,71% 71%,71% 86%,57% 86%,57% 100%,43% 100%,43% 86%,29% 86%,29% 71%,14% 71%,14% 57%,0 57%,0 14%,14% 14%)}
#support-dialog p{font-size:13px;line-height:1.5;margin:10px 0 16px}
#support-dialog #support-description{margin:0 0 20px;color:#705d47}
#support-dialog fieldset{border:0;margin:0;padding:0}
#support-dialog legend{font-size:12px;font-weight:600;margin-bottom:10px}
.support-amounts{display:flex;gap:10px}
.support-amounts label{flex:1;position:relative;cursor:pointer}
.support-amounts input{position:absolute;opacity:0;width:100%;height:100%;margin:0}
.support-amounts span{display:block;text-align:center;padding:12px 8px;border:2px solid #b99d77;font-family:inherit;font-size:22px;font-weight:700;background:#fff3da;box-shadow:0 3px 0 #c9ab81}
.support-amounts input:checked+span{background:#ecd1cb;border-color:#8b5860;color:var(--plum);box-shadow:0 3px 0 #8b5860,inset 0 0 0 2px #fae4dc}
.support-amounts input:focus-visible+span{outline:3px solid #536443;outline-offset:3px}
.support-primary,.support-secondary{width:100%;min-height:46px;padding:10px 8px;border:2px solid #5b3e38;border-radius:0;background:#8e5960;color:#fff7e5;font-family:inherit;font-size:14px;font-weight:600;line-height:1.3;box-shadow:inset 2px 2px 0 #b88082,inset -2px -2px 0 #70454e,0 3px 0 #5b3e38}
.support-secondary{border-color:#9a7952;background:#e9d6af;color:#654c36;box-shadow:inset 2px 2px 0 #fff0d0,inset -2px -2px 0 #c8a77a,0 3px 0 #9a7952;margin-bottom:12px}
#support-dialog button:hover{filter:brightness(1.06)}
#support-dialog :focus-visible{outline:3px solid #536443;outline-offset:3px}
#support-dialog .support-footnote{font-size:11px;color:#705d47;margin:14px 0 0;text-align:center}
.support-heart{margin:22px 0 16px}
.support-heart .pixel-heart{width:42px;height:42px}
#support-result{text-align:center}
#support-result-message{font-weight:600;color:var(--plum)}
#support-dialog [hidden]{display:none}
.support-options{margin:18px 0;border-top:2px solid #d5be96;padding-top:5px}
.support-options summary{font-size:13px;font-weight:600;cursor:pointer;min-height:44px;padding:12px 0;color:var(--plum)}
.support-check{display:flex;align-items:center;gap:10px;min-height:44px;font-size:13px;line-height:1.4;cursor:pointer}
.support-check input{width:18px;height:18px;flex:none;accent-color:var(--plum)}
.support-field{display:block;margin:12px 0 6px;font-size:13px;font-weight:600}
.support-field span{display:block;font-size:11px;font-weight:400;color:#705d47;margin-top:3px}
#support-profile input[type=text],#support-profile textarea{width:100%;min-height:44px;border:2px solid #b99d77;border-radius:0;padding:9px 10px;font:inherit;font-size:16px;background:#fff6e1;color:#514335;box-shadow:inset 2px 2px 0 #e5d1b0}
#support-profile textarea{resize:vertical;min-height:70px}
#support-profile:disabled{opacity:.55}
#support-dialog .support-privacy{font-size:11px;line-height:1.5;margin:8px 0;color:#705d47}
#support-dialog .support-list-order{font-size:11px;color:#705d47;margin:0 0 10px}
#supporters-list{list-style:none;margin:0 0 20px;padding:0}
#supporters-list li{display:flex;gap:12px;border:2px solid #d2b58c;background:#fff2d8;padding:12px;margin-top:8px;box-shadow:2px 2px 0 #dfc9a4;overflow-wrap:anywhere}
.supporter-icon{width:35px;height:35px;flex:none;display:grid;place-items:center;background:#ecd6b4;box-shadow:inset 2px 2px 0 #f9e7c9,inset -2px -2px 0 #d5b68a}
.supporter-icon .pixel-heart{width:21px;height:21px}
#supporters-list li:nth-child(3n+2) .pixel-heart{background:linear-gradient(#95a279 0 57%,#75835a 57%)}
#supporters-list li:nth-child(3n+3) .pixel-heart{background:linear-gradient(#c99d57 0 57%,#ab813f 57%)}
.supporter-body{flex:1;min-width:0}
.supporter-heading{display:flex;gap:10px;justify-content:space-between;align-items:baseline;font-size:14px;color:var(--plum)}
.supporter-heading strong{min-width:0;font-weight:600}
.supporter-amount{flex:none;font-family:inherit;font-size:17px;font-weight:700;line-height:1.2}
.supporter-label{display:block;font-size:10px;color:#786449;margin-top:3px}
#supporters-list p{font-size:12px;line-height:1.45;margin:6px 0 0;white-space:pre-wrap}
.support-footer{display:flex;gap:12px}
.support-footer button{flex:1;margin:0}
@media(max-width:650px){#support-dialog{padding:20px 16px}.support-heading{gap:10px}#support-dialog h2{font-size:23px}}
@media(max-width:360px){.support-heading>.pixel-heart{width:21px;height:21px}#support-dialog h2{font-size:22px}#supporters-list li{gap:8px;padding:10px}.supporter-icon{width:28px;height:28px}.support-footer{gap:8px}.support-footer button{font-size:13px}}

/* Always-visible supporters, in the bottom layout rather than over the scene. */
#supporter-dock{--plum:#75464b;flex:none;border-top:3px solid #b99264;box-shadow:inset 0 2px 0 #fff0d4;background:#eadcbe;padding:8px 20px max(12px,env(safe-area-inset-bottom));color:#514335}
.supporter-dock-top{display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:1100px;margin:0 auto 8px}
.supporter-dock-heading h2{display:flex;align-items:center;gap:8px;font:600 14px/1.3 'DM Sans',sans-serif;margin:0}
.supporter-dock-heading .pixel-heart{width:14px;height:14px}
#supporter-dock-demo{display:block;font-size:9px;letter-spacing:.6px;color:#705d47;margin-top:4px}
.supporter-dock-actions{display:flex;gap:8px;flex:none}
.supporter-dock-actions button{min-height:44px;border:1px solid #b99970;background:#f8ebd0;color:#704a40;padding:8px 12px;font-size:12px;font-weight:600;box-shadow:0 2px 0 #c3a37b}
.supporter-dock-actions #support-open{background:#8e5960;border-color:#70454e;color:#fff7e5;box-shadow:0 2px 0 #70454e}
#supporters-latest{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;max-width:1100px;padding:0;margin:0 auto;list-style:none}
#supporters-latest li{display:flex;align-items:center;gap:10px;min-width:0;border:1px solid #c6a67b;background:#fff2d8;padding:9px 12px;box-shadow:1px 1px 0 #d5b98f}
#supporters-latest .supporter-heading{font-size:13px}
#supporters-latest .supporter-heading strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#supporters-latest .supporter-amount{font-size:14px}
#supporters-latest li:nth-child(3n+2) .pixel-heart{background:linear-gradient(#95a279 0 57%,#75835a 57%)}
#supporters-latest li:nth-child(3n+3) .pixel-heart{background:linear-gradient(#c99d57 0 57%,#ab813f 57%)}
@media(max-width:650px){
 .world{min-height:calc(56.25vw + 108px)}
 #supporter-dock{padding:8px 12px max(10px,env(safe-area-inset-bottom))}
 .supporter-dock-top{gap:8px}.supporter-dock-heading h2{font-size:13px;gap:5px}
 .supporter-dock-actions{gap:6px}.supporter-dock-actions button{padding:8px;font-size:11px}
 #supporters-latest{gap:6px}#supporters-latest li{padding:8px;align-items:flex-start}
 #supporters-latest .supporter-icon{display:none}
 #supporters-latest .supporter-heading{display:block;font-size:12px}
 #supporters-latest .supporter-heading strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;min-height:30px;line-height:15px;overflow-wrap:anywhere}
 #supporters-latest .supporter-amount{display:block;line-height:18px;margin-top:2px}
 #supporters-latest .supporter-label{font-size:9px}
}
@media(max-width:360px){.supporter-dock-heading h2{font-size:12px}.supporter-dock-heading .pixel-heart{display:none}.supporter-dock-actions button{padding:8px 6px}}
@media(max-height:500px) and (min-width:651px){.world{min-height:260px}}

/* The wardrobe stays out of the scene until opened. */
#wardrobe-open{display:flex;align-items:center;justify-content:center;gap:7px;min-height:44px;min-width:44px;border:1px solid #b9bea8;border-radius:12px;padding:9px 12px;background:#f5ead5;color:#654c36;font-size:14px;font-weight:600;white-space:nowrap}
#wardrobe-open svg{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#wardrobe-open:hover{background:#ecddbf}
#wardrobe-dialog{--wardrobe-wood:#74513b;position:fixed;width:min(368px,calc(100% - 32px));max-height:calc(100svh - 32px);overflow:auto;border:4px solid #b99264;border-radius:0;background:#f4e6c9;color:#514335;padding:20px;box-shadow:0 -4px 0 var(--wardrobe-wood),0 4px 0 var(--wardrobe-wood),-4px 0 0 var(--wardrobe-wood),4px 0 0 var(--wardrobe-wood),8px 8px 0 #362c2550,inset 0 0 0 3px #fff3d9;scrollbar-color:#b99264 #e8d5b2}
#wardrobe-dialog::backdrop{background:#302b246b}
#wardrobe-dialog .wardrobe-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
#wardrobe-dialog h2{margin:0;font-size:23px;line-height:1.2;font-weight:700;color:#75464b}
#wardrobe-close{flex:none;width:44px;height:44px;margin:-8px -8px -8px 0;border:0;background:transparent;color:var(--wardrobe-wood);font-family:monospace;font-size:28px}
#wardrobe-description{margin:12px 0 20px;font-size:13px;line-height:1.5;color:#705d47}
#wardrobe-options{border:0;margin:0;padding:0;min-width:0}
#wardrobe-options legend{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#wardrobe-options label{display:block;margin:0 0 7px;font-size:14px;font-weight:600;color:#654c36}
#wardrobe-options select{display:block;width:100%;min-height:46px;border:2px solid #b99d77;border-radius:0;padding:10px 32px 10px 10px;background:#fff6e1;color:#514335;font-size:16px;box-shadow:inset 2px 2px 0 #e5d1b0}
#wardrobe-day-note{margin:7px 0 18px;color:#705d47;font-size:12px;line-height:1.5}
#wardrobe-options:disabled{opacity:.55}
#wardrobe-options:disabled select{cursor:wait}
#wardrobe-status{margin:18px 0;font-size:12px;line-height:1.5;color:#654c36;min-height:36px}
#wardrobe-done{width:100%;min-height:46px;padding:10px;border:2px solid #5b3e38;border-radius:0;background:#8e5960;color:#fff7e5;font-size:14px;font-weight:600;line-height:1.3;box-shadow:inset 2px 2px 0 #b88082,inset -2px -2px 0 #70454e,0 3px 0 #5b3e38}
#wardrobe-dialog button:hover{filter:brightness(1.06)}
#wardrobe-dialog :focus-visible{outline:3px solid #536443;outline-offset:3px}
@media(max-width:650px){#wardrobe-open{padding:8px 10px;font-size:13px}#wardrobe-open span{display:none}#wardrobe-dialog{padding:18px 16px}}
