.world-tools { max-width:none; align-items:center; padding:8px; z-index:6; }
.world-tools .world-button { min-height:40px; }
.hud-actions .live-status { border-radius:5px; }
#world-settings, #welcome-guide { width:min(600px,calc(100vw - 32px)); max-height:86dvh; overflow:auto; padding:24px; }
#welcome-guide { width:min(480px,calc(100vw - 32px)); padding:30px; }
#welcome-guide h2 { margin:18px 0 14px; font-size:1.9rem; }
#welcome-guide .button-row { margin-top:24px; }
.world-settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:22px 0 14px; }
.world-settings-grid label { display:block; font-size:.8rem; color:#d8e5dc; min-width:0; }
.world-settings-grid select { display:block; width:100%; padding:10px; margin-top:7px; background:#10252d; color:var(--ink); border:1px solid #506369; border-radius:8px; }
.world-settings-grid input[type=range] { display:block; width:100%; margin:18px 0 8px; accent-color:var(--mint); cursor:pointer; }
.sensitivity-field output { float:right; color:var(--mint); }
.sensitivity-field .small-note { font-size:.68rem; }
.keyboard-settings { border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding:15px 0; margin:18px 0; }
.keyboard-settings summary { cursor:pointer; font-weight:550; }
.keyboard-settings>p { font-size:.75rem; margin:12px 0; }
.key-binding-row { display:grid; grid-template-columns:minmax(100px,1.3fr) 1fr 1fr; align-items:center; gap:10px; margin:8px 0; font-size:.78rem; }
.key-binding-row button { min-height:38px; }
.key-binding-head { color:var(--muted); font-size:.65rem; margin-top:18px; }
.settings-utilities { border-top:1px solid var(--line); padding-top:16px; }
.vrm-viewer .touch-controls { display:none; }
.vrm-viewer.touch-enabled .touch-controls { position:absolute; left:20px; right:20px; bottom:calc(var(--world-tools-height,56px) + 36px); display:flex; flex-direction:row; justify-content:space-between; align-items:end; gap:10px; z-index:4; pointer-events:none; }
.touch-controls .movement-stick { display:grid; place-items:center; position:relative; flex:0 0 116px; width:116px; height:116px; background:radial-gradient(circle,#1b35438a,#142b309e); backdrop-filter:blur(8px); border:1px solid #d3eac77a; box-shadow:inset 0 0 0 12px #e5f3dd0a,0 4px 18px #102e3220; border-radius:50%; touch-action:none; user-select:none; pointer-events:auto; }
.movement-stick::after { content:'MOVE'; position:absolute; bottom:-22px; font-size:.55rem; letter-spacing:.15em; color:#e1ebde; text-shadow:0 1px 3px #142b30; }
.movement-stick:focus-visible { outline:3px solid var(--mint); outline-offset:4px; }
.movement-stick.active { border-color:#d3eac7; }
.stick-cross { position:absolute; color:#b7d8a73d; font-size:65px; font-weight:200; }
#movement-knob { width:44px; height:44px; border-radius:50%; background:linear-gradient(145deg,#d4e9c6,#95b283); box-shadow:0 3px 12px #102c3260; border:1px solid #f0f8e299; pointer-events:none; }
.touch-controls .touch-actions { display:flex; flex-direction:column; gap:10px; pointer-events:auto; }
.touch-controls .touch-actions button { min-width:62px; width:auto; height:46px; padding:8px 13px; border-radius:15px; border:1px solid #c5dfb97a; background:#142b30da; color:#e6f0df; touch-action:none; user-select:none; font-size:.8rem; }
.touch-controls .touch-actions button[aria-pressed=true] { background:var(--mint); color:var(--deep); }
.vrm-viewer.touch-enabled .viewer-chat { bottom:calc(var(--world-tools-height,56px) + 176px); max-height:150px; }
.viewer-chat--collapsed .ai-chat-notice { display:none; }
/* The canvas must not contribute its full-screen buffer size to the page layout. */
.vrm-section-home .vrm-viewer { flex:none; min-width:0; }
.vrm-viewer > canvas { position:absolute; inset:0; width:100%; height:100%; }
.vrm-viewer:fullscreen { width:100%; height:100dvh; min-height:0; margin:0; border:0; border-radius:0; }
.world-reduced-motion *, .world-reduced-motion *::before, .world-reduced-motion *::after { scroll-behavior:auto!important; transition:none!important; animation:none!important; }
.world-reduced-motion .world-button:hover { transform:none; }
.world-reduced-motion .interaction-prompt:hover { transform:translateX(-50%); }
@media(max-width:767px) {
  .world-tools { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; }
  .world-tools .world-button { padding:8px 5px; font-size:.7rem; min-height:42px; }
  .hud-actions { max-width:50%; }
  .hud-actions #world-presence { width:auto; }
  .hud-actions .live-status { padding:3px 5px; font-size:.5rem; }
  #world-settings { padding:18px; }
  #world-settings h2 { font-size:1.35rem; }
  #world-settings .dialog-header { gap:10px; }
  .world-settings-grid { gap:14px 10px; }
  .world-settings-grid select { font-size:.75rem; padding:9px 6px; }
  .vrm-viewer.touch-enabled .viewer-chat { min-height:105px; max-width:calc(100% - 30px); width:250px; left:14px; }
  .vrm-viewer.touch-enabled .viewer-chat--collapsed { width:115px!important; min-width:115px; }
  .vrm-viewer.touch-enabled .viewer-chat__toggle { width:30px; height:30px; top:4px; right:4px; }
  .vrm-viewer.touch-enabled .viewer-chat__resize-handle { display:none; }
  .world-caption { line-height:1.65; }
}
@media(max-width:350px) { .world-settings-grid { grid-template-columns:minmax(0,1fr); } }
