.island-workshop h2{font-size:20px}.island-workshop>p{font-size:13px;margin:11px 0;line-height:1.8}.island-actions{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0}.island-actions button,.island-nudge button{border:1px solid #cedfd2;background:#edf5df;border-radius:10px;color:#567e6d;font-size:12px;padding:10px 8px;min-height:40px}.island-build-list{display:flex;gap:8px;margin:15px 0;align-items:center}.island-build-list select{flex:1;min-width:0;background:#fffdf0;border:1px solid #d8dfcb;border-radius:10px;color:#637967;padding:10px 5px;font-size:12px}.island-build-list .secondary{font-size:11px;padding:10px 8px}.island-editor{background:#e9f3e6;border:1px solid #ccdcbf;border-radius:15px;padding:12px;font-size:12px}.island-editor[hidden]{display:none}.island-nudge{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}.island-defense-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.island-defense-cards article{padding:12px 6px;background:linear-gradient(#fff8e3,#edf3e8);border:1px solid #d9e3cd;border-radius:15px;text-align:center;min-width:0}.island-defense-cards article>span{font-size:31px;display:block}.island-defense-cards b{font-size:12px;display:block;margin:8px 0}.island-defense-cards small{font-size:10px;line-height:1.7;display:block;color:#8c9e8a;min-height:36px}.island-defense-cards button{width:100%;margin-top:9px;border-radius:10px;border:1px solid #e4ce94;background:#f5dfaa;color:#94703e;padding:9px 3px;font-size:10px;font-weight:800}.island-note{font-size:11px!important;color:#8b9f8b!important;line-height:1.8;margin:12px 0}.island-battle-stats{display:flex;justify-content:space-between;gap:5px;background:#e5f1df;border-radius:12px;padding:10px 7px;margin:12px 0;color:#56806b;font-size:11px}.island-quiz{display:flex;gap:7px;margin:12px 0}.island-quiz button{flex:1;min-width:0;overflow-wrap:anywhere;background:#fff2d0;color:#89703c;border:1px solid #ebd7a8;border-radius:12px;padding:12px 4px;font-weight:800}.island-workshop .primary{font-size:16px}.island-workshop .sound-button{font-size:13px;padding:9px 12px}#island-battle-panel>p{font-size:13px;margin:12px 0}

.island-world-tools{position:absolute;top:65px;left:14px;right:14px;display:flex;align-items:center;justify-content:center;gap:6px;padding:8px;background:#fffeedec;border:1px solid white;border-radius:13px;z-index:5;box-shadow:0 3px 14px #42696b20}.island-world-tools[hidden]{display:none}.island-world-tools small{font-size:10px;color:#6c8263;flex:1}.island-world-tools button{font-size:11px;border:1px solid #d3ddb9;border-radius:8px;padding:8px 7px;background:#e4efce;color:#567951}.island-stored{margin:14px 0}.island-stored h3{font-size:14px;margin-bottom:8px}.island-stored button{font-size:11px;margin:4px}


.island-battle-hud{position:absolute;top:63px;left:14px;right:14px;z-index:4;background:#fcf7dfeb;border:1px solid white;border-radius:12px;padding:8px;display:flex;align-items:center;gap:6px;box-shadow:0 4px 12px #45686a20}.island-battle-hud[hidden]{display:none}.island-battle-hud span{font-size:10px;flex:1;color:#5c805f}.island-battle-hud button{padding:6px 7px;background:#d8eac9;color:#56794d;border-radius:8px;border:1px solid #c4d6b2;font-size:10px}

/* The home is a scene first. All secondary controls live inside one bottom drawer. */
.house-mode header{padding-top:calc(12px + env(safe-area-inset-top))}
.house-mode main{padding:0 14px 98px;min-height:calc(100dvh - 96px)}
.home-heading{display:flex;align-items:center;justify-content:space-between;margin:18px 3px 12px;gap:12px}
.home-heading span{font-size:9px;letter-spacing:2px;color:#56878a;font-weight:800}
.home-heading h1{margin:3px 0 0;font-size:25px;letter-spacing:1px;color:#255e63;text-shadow:0 2px #fff8}
.home-heading>button{background:#ffffecb8;border:1px solid #fff;border-radius:16px;padding:10px 12px;font-size:11px;color:#5e8075;min-height:44px;box-shadow:0 3px 9px #527b7712}
.home-heading>button b{font-size:17px;color:#368b79;margin-right:3px}
.home-touch-world{margin:0 0 12px;border-width:2px;border-radius:26px}
.home-touch-world .world-canvas{height:clamp(300px,calc(100dvh - 390px),630px)}
.home-touch-world .world-status{top:13px;left:12px;right:12px}
.home-touch-world .world-status span,.home-touch-world .world-status b{padding:7px 9px;font-size:10px}
.home-touch-world .scene-zoom{top:61px;right:10px;gap:5px}
.home-touch-world .scene-zoom button{width:38px;height:38px;font-size:21px;border-radius:12px;backdrop-filter:blur(10px)}
.home-touch-world .world-guide{bottom:12px;max-width:calc(100% - 20px);font-size:10px;padding:7px 9px;background:#fffef3ca;color:#507b73}
.home-scene-shortcuts{position:absolute;left:10px;bottom:48px;display:flex;gap:5px}
.home-scene-shortcuts button{background:#fffef0d9;border:1px solid white;min-height:36px;border-radius:12px;color:#4a7d77;font-size:11px;padding:7px 10px;backdrop-filter:blur(10px)}
.home-tool-dock{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));padding:6px;background:#fffff2e6;border:1px solid #fff;border-radius:21px;box-shadow:0 5px 16px #4d797b18;gap:3px}
.home-tool-dock button{min-height:65px;min-width:0;border-radius:16px;background:transparent;color:#5c7c72;font-size:11px;font-weight:800;padding:5px 1px;transition:background .15s}
.home-tool-dock button>span{display:block;font-size:24px;line-height:31px;margin-bottom:3px;filter:drop-shadow(0 2px 1px #63816d20)}
.home-tool-dock button[aria-pressed=true],.home-tool-dock .home-tool-active{background:#d8efdf;color:#287b63;box-shadow:inset 0 0 0 1px #b3d6bd}
.home-short-tip{text-align:center;font-size:10px;color:#6a8a80;margin:10px 4px 0;line-height:1.5}
.home-build-banner{display:flex;align-items:center;gap:5px;position:absolute;left:10px;right:10px;top:55px;background:#f9ffe8e8;border:1px solid #fff;border-radius:13px;z-index:4;padding:7px;box-shadow:0 3px 12px #315b5720}
.home-build-banner[hidden]{display:none}
.home-build-banner>span{flex:1;color:#537966;font-size:10px;font-weight:800}
.home-build-banner button{min-height:36px;background:#e4efd4;border-radius:9px;font-size:10px;padding:6px 9px;color:#477052;font-weight:800}
.home-build-banner button:last-child{background:#499c80;color:white}
.is-building .scene-zoom{top:111px}
.is-building .home-scene-shortcuts{display:none}
.is-building .world-canvas canvas{cursor:grab}
.is-building .world-canvas[data-dragging=true] canvas{cursor:grabbing}
.home-touch-world .island-world-tools{left:50%;right:auto;top:160px;transform:translate(-50%,-100%);width:min(300px,calc(100% - 20px));display:block;padding:9px 10px 7px;border-radius:17px;background:#fffff5f2;border:1px solid #fff;box-shadow:0 6px 24px #2c62563b;z-index:6;backdrop-filter:blur(12px)}
.home-touch-world .island-world-tools[hidden]{display:none}
.home-touch-world .island-world-tools:after{content:'';position:absolute;left:calc(50% - 7px);bottom:-6px;width:12px;height:12px;transform:rotate(45deg);background:#fffff5;border-radius:2px}
.home-touch-world .island-world-tools>div:first-child{display:flex;align-items:center;gap:6px;padding:1px 3px 7px}
.home-touch-world .island-world-tools b{color:#3c715f;font-size:12px;white-space:nowrap}
.home-touch-world .island-world-tools #island-world-hint{font-size:9px;text-align:right;line-height:1.4;color:#4a8b70}
.home-touch-world .island-world-tools[data-valid=false] #island-world-hint{color:#c76f59}
.home-object-actions{display:flex;gap:5px}
.home-touch-world .home-object-actions button{flex:1;min-width:44px;min-height:47px;background:#eef3e3;border:0;border-radius:10px;padding:3px 5px;color:#648364;font-size:19px}
.home-touch-world .home-object-actions small{display:block;font-size:9px;color:inherit;text-align:center}
.home-touch-world .home-object-actions [data-island-quick=confirm]{background:#439c7d;color:white}
.home-touch-world .home-object-actions [hidden]{display:none}
.home-touch-world .island-battle-hud{top:56px;left:10px;right:10px}
dialog.home-drawer{position:fixed;inset:auto 0 0;margin:0 auto;width:min(480px,100%);max-width:100%;max-height:min(76dvh,720px);height:auto;padding:0 0 env(safe-area-inset-bottom);border:1px solid white;border-radius:27px 27px 0 0;background:#f6f8ed;color:#355f58;box-shadow:0 -8px 40px #1c514c40;overflow:hidden}
dialog.home-drawer::backdrop{background:#254e5a47;backdrop-filter:blur(1px)}
dialog.home-drawer[open]{display:flex;flex-direction:column;animation:home-drawer-in .2s ease-out}
.home-drawer-grip{width:35px;height:4px;flex-shrink:0;border-radius:5px;background:#c5d6c6;margin:10px auto 3px}
.home-drawer-header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 17px 10px;flex-shrink:0;border-bottom:1px solid #e3e9d9}
.home-drawer-header h2{font-size:20px;color:#416f5e}
.home-drawer-header button{min-width:44px;min-height:44px;border-radius:15px;background:#e7eddd;color:#6b8a76;font-size:17px}
.home-drawer-content{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:14px 14px 24px;scrollbar-width:thin;scrollbar-color:#c4d9c7 transparent}
.home-drawer [data-home-page][hidden]{display:none}
.home-drawer .panel{padding:13px;border:1px solid #fff;border-radius:18px;box-shadow:none;margin-bottom:12px;background:#fffff9}
.home-drawer .panel:last-child{margin-bottom:0}
.home-drawer .home-inventory{margin-top:12px;gap:8px}
.home-drawer .home-inventory button{padding:10px 3px;min-height:110px}
.home-drawer .home-inventory button small{font-size:9px}
.home-inventory-intro{display:flex;gap:10px;align-items:center}
.home-inventory-intro p{font-size:11px;flex:1;color:#7a9081;line-height:1.6}
.home-inventory-intro button{font-size:11px;white-space:nowrap;background:#e1efdc;color:#598068;padding:9px;min-height:44px}
.home-empty{text-align:center;padding:18px 8px;font-size:46px}
.home-empty>b{display:block;font-size:17px;margin:12px 0;color:#4e7c63}
.home-empty>p{font-size:12px;margin-bottom:20px;color:#80947f}
.home-empty>button{max-width:230px;font-size:17px}
.home-expand{display:block;min-height:46px;width:100%;font-size:12px;font-weight:800;color:#61815c;background:#e8efda;border:1px solid #d4e0c5;border-radius:13px;padding:10px;margin:13px 0 5px}
.home-drawer .island-workshop .secondary{width:100%;font-size:11px;margin-top:10px;background:#e7f1e2;color:#598065}
.home-drawer .island-workshop h2{font-size:17px}
.home-drawer #island-battle-panel>.row{margin-top:0!important}
.home-drawer .island-defense-cards button{min-height:44px}
.home-drawer .character-panel h2,.home-drawer .home-atmosphere h2{font-size:17px}
.home-drawer .home-atmosphere>.row{flex-wrap:wrap;gap:4px}
.home-drawer .character-actions button{min-height:46px}
@keyframes home-drawer-in{from{transform:translateY(40px);opacity:.3}to{transform:translateY(0);opacity:1}}
@media(max-height:700px){.house-mode header{padding-top:8px}.home-heading{margin-top:12px;margin-bottom:8px}.home-heading h1{font-size:22px}.home-touch-world .world-canvas{height:300px}.home-tool-dock button{min-height:58px}.home-short-tip{display:none}}
@media(prefers-reduced-motion:reduce){dialog.home-drawer[open]{animation:none}}


