*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#102530;color:#fff;font:14px system-ui;touch-action:none}#stage{position:absolute;inset:0}#stage video{width:100%!important;height:100%!important;object-fit:contain}header{position:absolute;z-index:5;top:env(safe-area-inset-top);left:0;right:0;display:flex;align-items:center;gap:12px;padding:12px;background:linear-gradient(#102530e8,transparent)}header a{color:#efcc7b;text-decoration:none;font-weight:900;letter-spacing:2px}#status{flex:1;font-size:12px}button{border:1px solid #ffffff38;color:#fff;background:#193441df;border-radius:12px;padding:12px 16px;font:inherit;touch-action:none}button:active{background:#bc7255}button:disabled{opacity:.55}#connect{color:#172c35;background:#f0ca75;font-weight:700}#look{position:absolute;right:0;top:80px;bottom:70px;width:55%;z-index:1}#joystick{position:absolute;left:max(32px,env(safe-area-inset-left));bottom:max(55px,env(safe-area-inset-bottom));width:130px;height:130px;border:2px solid #ffffff55;border-radius:50%;background:#18364466;display:grid;place-items:center;z-index:3}#knob{width:55px;height:55px;background:#f2cd82aa;border:2px solid #f2cd82;border-radius:50%}#joystick span{position:absolute;bottom:-24px;font-size:12px}aside{position:absolute;right:max(22px,env(safe-area-inset-right));bottom:48px;display:flex;gap:8px;z-index:4}section{position:absolute;right:22px;bottom:105px;max-width:360px;display:flex;flex-wrap:wrap;gap:7px;padding:12px;border-radius:18px;background:#102530e8;z-index:5}.hidden{display:none}footer{position:absolute;bottom:10px;width:100%;text-align:center;font-size:11px;color:#c8d5db;pointer-events:none} @media(max-width:600px){header{gap:6px;padding:8px}header a{font-size:12px}button{padding:10px}aside{flex-wrap:wrap;max-width:180px}#joystick{left:20px;width:110px;height:110px}#status{font-size:10px}footer{font-size:10px}}

@media(max-height:480px){header{padding:6px;gap:8px}header a{font-size:12px}#status{font-size:10px}button{padding:8px 11px;font-size:12px}#joystick{width:94px;height:94px;bottom:24px;left:22px}#knob{width:42px;height:42px}#joystick span{bottom:-18px}aside{bottom:18px;max-width:none;flex-wrap:nowrap}section{bottom:65px;max-width:330px;padding:9px;gap:5px}footer{display:none}#look{top:52px;bottom:58px;width:65%}}

#wardrobe-menu{width:min(440px,calc(100vw - 28px));max-width:440px;max-height:calc(100dvh - 155px);overflow:auto;display:block;touch-action:pan-y;overscroll-behavior:contain}#wardrobe-menu.hidden{display:none}.avatar-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.avatar-heading strong{font-size:18px;color:#efcc7b}.avatar-heading button{padding:5px 10px}#avatar-tabs{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:12px}#avatar-tabs button{padding:8px 10px;font-size:12px}#avatar-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}#avatar-options button{display:flex;align-items:center;justify-content:center;gap:8px;font-size:13px}#wardrobe-menu button[aria-pressed=true]{border-color:#efcc7b;background:#765d38;color:#fff4d7}.skin-swatch{width:20px;height:20px;border-radius:50%;border:1px solid #fff7;flex-shrink:0}.outfit-heading{margin:16px 0 8px;color:#efcc7b}#outfit-options{display:flex;flex-wrap:wrap;gap:6px}#outfit-options button{font-size:12px;padding:8px}#wardrobe-menu small{display:block;margin-top:12px;color:#bdcdd3;font-size:11px}@media(max-height:480px){#wardrobe-menu{bottom:65px;max-height:calc(100dvh - 110px);width:430px}#avatar-options{grid-template-columns:repeat(5,minmax(0,1fr))}#avatar-options button{padding:8px 4px;font-size:11px}.avatar-heading{margin-bottom:6px}.outfit-heading{margin-top:10px}}

#look{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;top:60px;bottom:0;width:60%}#look::after{content:"右側滑動轉視角";position:absolute;right:24px;top:12px;font-size:11px;color:#ffffff80;pointer-events:none}@media(max-height:480px){#look{top:45px;width:65%}}

#fullscreen{position:fixed;right:max(10px,env(safe-area-inset-right));top:max(10px,env(safe-area-inset-top));z-index:30;min-height:44px;background:#193441f2;border-color:#efcc7b;color:#fff4d7;font-weight:700}header{padding-right:125px}.play-fullscreen,.play-fullscreen body{width:100%;height:100dvh;overflow:hidden}.play-fullscreen #stage{position:fixed;inset:0}.play-fullscreen header{background:none;pointer-events:none}.play-fullscreen header>a,.play-fullscreen #status,.play-fullscreen #connect,.play-fullscreen footer{display:none}.play-fullscreen #fullscreen{pointer-events:auto}.play-fullscreen #look{top:0}.play-fullscreen aside{bottom:max(18px,env(safe-area-inset-bottom))}.play-fullscreen #joystick{bottom:max(32px,env(safe-area-inset-bottom))}
.play-fullscreen #connect:not(:disabled){display:block;pointer-events:auto}

#native-ui-surface{position:fixed;inset:0;z-index:2;touch-action:none;user-select:none}.native-ui-mode #look,.native-ui-mode #joystick{display:none}#native-ui[aria-pressed="true"]{background:#efcc7b;color:#172c35}

.play-fullscreen.stream-disconnected #status{display:block;position:fixed;top:max(62px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));right:12px;padding:12px;border-radius:12px;background:#102530e8;z-index:20;pointer-events:none;color:#ffe8b8}

aside{max-width:calc(100vw - 160px);flex-wrap:wrap;justify-content:flex-end}#return-to-game{border-color:#efcc7b}@media(max-height:480px){aside{max-width:calc(100vw - 150px);flex-wrap:wrap;gap:6px}}

/* Keep primary movement and inventory controls usable on touch screens. */
aside button,#connect{min-width:44px;min-height:44px}

#seat-zoom{position:absolute;z-index:5;top:calc(env(safe-area-inset-top) + 80px);right:max(14px,env(safe-area-inset-right));display:flex;align-items:center;gap:6px;padding:6px;border-radius:14px;background:#102530c7}#seat-zoom span{font-size:11px;color:#efcc7b}#seat-zoom button{min-width:44px;min-height:44px;padding:9px 12px} @media(max-width:700px){#seat-zoom{top:calc(env(safe-area-inset-top) + 64px);gap:4px}#seat-zoom span{display:none}#seat-zoom button{font-size:12px;padding:8px}}

#fullscreen-help{z-index:100;color:#fff8e7;background:#163330;border:1px solid #f4ce8966;border-radius:16px;width:min(440px,calc(100vw - 32px));max-height:85dvh;overflow:auto;padding:28px;touch-action:pan-y}#fullscreen-help::backdrop{background:#00130ecc}#fullscreen-help h2{font-size:22px;padding-right:20px}#fullscreen-help p,#fullscreen-help li{font-size:14px;line-height:1.8}#fullscreen-help a{color:#f4ce89}#close-fullscreen-help{position:absolute;right:10px;top:10px;padding:8px}#rotate-hint{display:none;position:fixed;z-index:6;left:50%;transform:translateX(-50%);bottom:200px;white-space:nowrap;font-size:12px;padding:9px 14px;background:#163330dd;border:1px solid #f4ce8966;border-radius:30px;pointer-events:none}@media(orientation:portrait) and (max-width:600px){#rotate-hint{display:block}header #status{max-width:120px}#seat-zoom{top:110px}.stream-disconnected #stage{background:linear-gradient(#102b2970,#102b29),url('assets/exterior-current.png') center/cover}}html,body{overscroll-behavior:none;-webkit-user-select:none}#fullscreen-help{user-select:text}.play-fullscreen #seat-zoom{top:calc(env(safe-area-inset-top) + 66px)}

.touch-actions{right:max(20px,env(safe-area-inset-right));bottom:max(28px,env(safe-area-inset-bottom));display:grid;grid-template-columns:54px 60px;max-width:none;gap:12px;background:none;z-index:4}.touch-actions button{width:54px;height:54px;border-radius:50%;padding:2px;font-size:23px;background:#123a32bb;border:1px solid #fff8;display:grid;place-content:center;line-height:1}.touch-actions small{font-size:10px;margin-top:4px}.touch-actions .interact-control{background:#ebc984e0;color:#17362e;border-color:#f4ce89}.rear-control{position:fixed;z-index:5;right:max(16px,env(safe-area-inset-right));top:calc(env(safe-area-inset-top) + 135px);min-height:44px}#utility-tray{position:absolute;right:max(145px,env(safe-area-inset-right));bottom:max(26px,env(safe-area-inset-bottom));z-index:5;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px;width:min(310px,calc(100vw - 170px));padding:12px;background:#12382fee;border-radius:16px}#utility-tray.hidden{display:none}#utility-tray button{font-size:12px;min-height:44px}#joystick{width:112px;height:112px;left:max(28px,env(safe-area-inset-left));bottom:max(40px,env(safe-area-inset-bottom))}#look{top:0;bottom:0;width:65%}#look::after{display:none}@media(max-height:480px){.touch-actions{bottom:max(20px,env(safe-area-inset-bottom));gap:10px}#joystick{width:100px;height:100px;bottom:max(30px,env(safe-area-inset-bottom))}.rear-control{top:calc(env(safe-area-inset-top) + 124px)}#utility-tray{bottom:20px}#seat-zoom{top:calc(env(safe-area-inset-top) + 64px)}}@media(orientation:portrait) and (max-width:600px){.rear-control{top:calc(env(safe-area-inset-top) + 172px)}#utility-tray{right:145px;bottom:28px}#rotate-hint{bottom:205px}}

/* Native menus own touch input; movement HUD must not intercept touch adjustment. */
.native-ui-mode .touch-actions{display:none}

/* V574: the game fills the visual viewport in both orientations. */
html,body{height:100dvh;width:100vw}#stage{position:fixed;inset:0;overflow:hidden}#stage video{object-fit:cover}
/* Native menus retain their complete click surface; shop ROI keeps its own transform. */
body.native-ui-mode:not(.portrait-shop-focus) #stage video{object-fit:contain}
header{background:none;pointer-events:none}header>a{pointer-events:auto;font-size:12px;opacity:.8}#status,#connect,footer,#rotate-hint{display:none!important}#fullscreen{pointer-events:auto;font-size:12px;padding:8px;min-height:44px}
.stream-disconnected #status{display:block!important;position:fixed!important;left:50%!important;right:auto!important;top:42dvh!important;transform:translateX(-50%);width:min(340px,calc(100vw - 40px));max-width:none!important;text-align:center;font-size:15px;padding:20px;background:#102b29ed;border-radius:16px;color:#ffe8b8;z-index:20}
.stream-disconnected #connect:not(:disabled){display:block!important;position:fixed;left:50%;top:calc(42dvh + 90px);transform:translateX(-50%);pointer-events:auto;min-height:48px;z-index:21}
.stream-disconnected #joystick,.stream-disconnected .touch-actions,.stream-disconnected #seat-zoom,.stream-disconnected .rear-control{display:none}
#seat-zoom{top:calc(env(safe-area-inset-top) + 64px)}.rear-control{top:calc(env(safe-area-inset-top) + 122px)}#look{inset:0 0 0 35%;width:auto}
#joystick{bottom:calc(env(safe-area-inset-bottom) + 38px);left:calc(env(safe-area-inset-left) + 24px)}.touch-actions{bottom:calc(env(safe-area-inset-bottom) + 24px);right:calc(env(safe-area-inset-right) + 20px)}
@media(orientation:landscape) and (max-height:500px){#seat-zoom{top:calc(env(safe-area-inset-top) + 60px)}.rear-control{top:calc(env(safe-area-inset-top) + 114px)}}
