/* The park stays the focal point. Touch devices get two persistent controls. */
html,body{height:100dvh;overscroll-behavior:none;-webkit-text-size-adjust:100%;text-size-adjust:100%}body{position:relative}
.display-button{display:flex;align-items:center;justify-content:center;gap:7px;min-height:44px;padding:8px 12px;border:1px solid #e5dfc93d;border-radius:22px;background:#243b42b8;color:#efeada;font-size:12px;white-space:nowrap}
.display-button svg{width:17px;height:17px}
.mobile-menu-button,.mobile-camera,.mobile-move-tip,.touch-controls{display:none}
.game-menu{border:1px solid #c6c7a64d;border-radius:16px;background:#243d39f5;color:#f0e9d7;box-shadow:0 16px 70px #0e292b66;padding:0;width:min(600px,calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));max-width:none;max-height:calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow:auto}
.game-menu::backdrop{background:#152c2c66;backdrop-filter:blur(3px)}
.game-menu-head{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;border-bottom:1px solid #b6c1a62e;position:sticky;top:0;background:#243d39;z-index:2}
.game-menu-head h2{font-size:17px;font-family:"Songti SC",Georgia,serif;font-weight:500;margin:0}
.game-menu .close-button{color:#eee5cf;border-color:#b6c1a64d;width:44px;height:44px}
.game-menu-content{display:grid;grid-template-columns:1.1fr 1fr;gap:12px;padding:14px 16px 10px}
.game-menu .tools{position:static;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.game-menu .tools button{width:100%;height:auto;min-height:64px;display:flex;flex-direction:column;justify-content:center;gap:5px;padding:9px 4px;font-size:11px;border-color:#d8d6b629;background:#365149;box-shadow:none;backdrop-filter:none}
.game-menu .tools button>span:not(.count){display:block;max-width:100%;overflow-wrap:anywhere}
.game-menu .tools svg{width:19px;height:19px}
.game-menu .tools .count{position:absolute;right:5px;top:4px;font-size:9px;padding:1px 4px;background:#d8c89e;color:#263e36;border-radius:6px}
.game-menu .park-nav{position:static;display:grid;width:100%;max-width:none;gap:8px}
.game-menu .park-nav button,.game-menu .park-nav select{width:100%;min-height:44px;height:auto;font-size:12px;padding:8px 10px}
.menu-home{display:flex;align-items:center;justify-content:space-between;margin-top:8px;font-size:12px;gap:8px}
.game-menu .icon-button{width:44px;height:44px;background:#365149}
#menu-settings{grid-column:1 / -1;border-top:1px solid #b6c1a62e;padding-top:10px}
.game-menu .top-right{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.game-menu .local-pill{display:block;order:4;width:100%;font-size:10px;padding:0;margin-top:2px}
.game-menu #language{margin-right:auto;width:auto;max-width:180px;min-height:44px;background:#1c3531;border:1px solid #d8d6b64d;color:#efeada;border-radius:8px;padding:8px 10px;font-size:16px}
.game-menu .help-button{width:44px;height:44px;flex-shrink:0}
.game-menu .display-button{min-width:44px}
.menu-note{margin:0;padding:0 16px 12px;color:#c0cbb9;font-size:10px;line-height:1.5}
.display-guide-body{padding:20px 24px}.display-guide ol{padding-left:22px;font-size:14px;line-height:1.85}.display-guide li{padding:5px 0}.display-guide h2{font-size:23px;margin:0}.display-guide .notice{margin:24px 0 0}
/* JS and CSS share the same device classification, even if pointer media changes. */
.touch-device .touch-controls{display:block}
.touch-device button,.touch-device select{touch-action:manipulation}
.touch-device .topbar{gap:8px;padding:calc(8px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 8px calc(12px + env(safe-area-inset-left));min-height:60px}
.touch-device .top-right{gap:6px}.touch-device .local-pill{display:none}.touch-device .topbar .brand{font-size:13px;gap:7px}.touch-device .topbar .brand svg{width:23px;height:23px}
.touch-device .topbar #language{font-size:16px;max-width:140px;min-width:80px;min-height:44px;padding:7px}
.touch-device .topbar .display-button{font-size:11px;padding:8px 10px}
.touch-device .help-button,.touch-device .close-button,.touch-device .icon-button{min-width:44px;min-height:44px}
.touch-device .game-menu select,.touch-device .panel input,.touch-device .panel textarea,.touch-device .panel select{font-size:16px}
.touch-device .panel{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
.touch-device .welcome .landscape-note{display:block;color:#e2cc9e;font-size:12px;line-height:1.6;margin:14px 0 0;max-width:340px}
.touch-device .welcome .primary{min-height:44px;margin-top:18px}
.mobile-layout .topbar,.mobile-layout .garden-label,.mobile-layout .bottom-bar{display:none}
.mobile-layout .scene-shade{background:linear-gradient(180deg,#152b3f26,transparent 20%,transparent 82%,#162c3233)}
.mobile-layout .mobile-menu-button,.mobile-layout .mobile-camera{display:flex;align-items:center;justify-content:center;gap:7px;position:absolute;min-height:44px;min-width:44px;padding:0 12px;border:1px solid #e7dfbb45;border-radius:24px;color:#f4edda;background:#263f3cbf;backdrop-filter:blur(8px);font-size:11px;line-height:1.3}
.mobile-layout .mobile-menu-button{top:calc(8px + env(safe-area-inset-top));left:calc(12px + env(safe-area-inset-left));z-index:5}
.mobile-layout .mobile-camera{right:calc(12px + env(safe-area-inset-right));bottom:calc(12px + env(safe-area-inset-bottom));max-width:180px}
.mobile-menu-button svg,.mobile-camera svg{width:18px;height:18px}
.mobile-layout .mobile-move-tip{display:block;position:absolute;left:calc(20px + env(safe-area-inset-left));bottom:calc(20px + env(safe-area-inset-bottom));margin:0;max-width:48%;pointer-events:none;font-size:11px;line-height:1.5;color:#f1ead7;text-shadow:0 1px 6px #16332e}
.mobile-layout.touch-learned .mobile-move-tip{display:none}
.mobile-layout .joystick-wrap{position:static;width:auto}
.touch-device .virtual-joystick.is-floating{position:fixed;left:0;top:0;bottom:auto;margin:0;width:104px;height:104px;opacity:0;pointer-events:none;background:#263f3c6b;border-color:#eadbb57a;box-shadow:none;z-index:1}
.touch-device .virtual-joystick.is-floating.is-active{opacity:1}.touch-device .is-floating .joystick-knob{width:42px;height:42px;background:#e2d5b3b8}.touch-device .is-floating .joystick-axis{opacity:.45}
.mobile-layout #joystick-note,.mobile-layout #touch-look-hint{display:none}
.mobile-layout .world-marker{font-size:10px;min-height:44px;padding:7px 10px;background:#eee6d3d9;max-width:150px}
.mobile-layout .near-action{bottom:calc(16px + env(safe-area-inset-bottom));left:50%;right:auto;transform:translateX(-50%);max-width:220px;min-height:44px;padding:8px 12px;font-size:11px}
.mobile-layout .near-action kbd{display:none}
.mobile-layout #toast{top:calc(62px + env(safe-area-inset-top))}
.rotation-needed .mobile-camera{display:none}
.touch-device .display-guide{width:440px;max-width:100vw}
@media(orientation:portrait){
 .touch-device .topbar .brand span{display:none}.touch-device .topbar #language{max-width:120px}.touch-device .topbar .display-button{padding:8px;min-width:44px}
 .touch-device .topbar .display-button span{display:none}
 .game-menu-content{grid-template-columns:1fr}.game-menu .tools button{min-height:62px}
 .game-menu .park-nav{grid-template-columns:1fr 1fr}.menu-home{justify-content:flex-end}
 #menu-settings{grid-column:1}
}
@media(orientation:landscape) and (max-height:500px){
 .touch-device .welcome{left:calc(28px + env(safe-area-inset-left));right:calc(28px + env(safe-area-inset-right));top:calc(64px + env(safe-area-inset-top));bottom:max(12px,env(safe-area-inset-bottom));width:auto;max-width:none;overflow:auto;display:grid;grid-template-columns:minmax(0,1.4fr) minmax(190px,1fr);grid-template-rows:auto auto 1fr;column-gap:32px;align-content:start}
 .touch-device .welcome .eyebrow{font-size:10px;grid-column:1;grid-row:1}.touch-device .welcome h1{grid-column:1;grid-row:2;font-size:clamp(24px,4vw,34px);line-height:1.3;margin:10px 0;max-width:410px;letter-spacing:.015em}
 .touch-device .welcome>p:not(.landscape-note){grid-column:1;grid-row:3;font-size:11px;line-height:1.7;margin:0;max-width:390px}
 .touch-device .welcome .landscape-note{grid-column:2;grid-row:1 / 3;align-self:end;margin:0 0 12px;max-width:none;line-height:1.6}
 .touch-device .welcome .primary{grid-column:2;grid-row:3;align-self:start;margin:0;min-width:0;width:100%}
 .touch-device .welcome small{grid-column:2;grid-row:3;align-self:start;margin-top:55px;max-width:none;line-height:1.6;font-size:10px}
 .touch-device .panel{width:460px;max-width:100vw}.touch-device .panel-head{padding:12px 20px;align-items:center}.touch-device .panel-head h2{font-size:23px;margin-top:4px}.touch-device .panel #panel-body{padding:18px 20px}
}
@media(orientation:landscape) and (max-height:360px){
 .game-menu-head{padding:3px 12px}.game-menu-content{padding:8px 12px;gap:8px}
 .game-menu .tools button{min-height:58px}.game-menu .tools{gap:6px}
 #menu-settings{padding-top:6px}.game-menu .local-pill{display:none}.menu-note{padding:0 12px 8px;font-size:9px}
}
