/* Keep the established ink/mist palette; spend the screen on the room. */
.world-minimap{background:rgba(231,243,234,.46);backdrop-filter:blur(3px);box-shadow:0 3px 14px #102b2220}
.world-minimap button,.world-minimap select{background:rgba(245,251,246,.6)}
body:not([data-mobile-roaming="true"]) .world-header{left:12px;padding:8px 12px;gap:12px}
body:not([data-mobile-roaming="true"]) .view-controls{left:12px;padding:5px;gap:4px}
body:not([data-mobile-roaming="true"]) .view-controls button{min-height:34px;padding:6px 9px;font-size:12px}
body:not([data-mobile-roaming="true"]) .indoor-tools{left:12px;width:280px;padding:10px;gap:6px}
body:not([data-mobile-roaming="true"]) .indoor-tools strong{font-size:15px}
body:not([data-mobile-roaming="true"]) .indoor-tools button{min-height:34px;padding:6px 8px;font-size:12px}
body:not([data-mobile-roaming="true"]) .world-hud{left:12px;bottom:12px;width:350px;min-width:0;transform:none;padding:9px 12px}
body:not([data-mobile-roaming="true"]) #worldStage .npc-world-chat .npc-chat-header{padding:9px 12px}
.roaming-mobile-shell[hidden],.roaming-mobile-shell [hidden]{display:none!important}
.roaming-drawer-tabs{position:fixed;z-index:61;left:10px;right:10px;bottom:calc(var(--roaming-keyboard-inset,0px) + max(8px,env(safe-area-inset-bottom)));display:grid;grid-template-columns:repeat(4,1fr);gap:4px;padding:4px;border:1px solid #bdd4c575;border-radius:12px;background:#183c30e8;backdrop-filter:blur(8px)}
.roaming-drawer-tabs button{position:relative;min-height:42px;border:0;border-radius:8px;padding:7px 4px;color:#eaf5ed;background:transparent;font-size:13px}
.roaming-drawer-tabs button[aria-expanded="true"]{background:#d6e9dd;color:#204d3f}
.roaming-drawer-tabs button[data-notice]::after{content:"";position:absolute;right:14px;top:8px;width:5px;height:5px;border-radius:50%;background:#e5bd72}
.roaming-drawer-backdrop{position:fixed;inset:0;z-index:54;background:transparent;border:0;border-radius:0;cursor:default}
.roaming-drawer{position:fixed;z-index:60;left:8px;right:8px;bottom:calc(var(--roaming-keyboard-inset,0px) + max(8px,env(safe-area-inset-bottom)) + 58px);height:min(68dvh,calc(var(--roaming-viewport-height,100dvh) - 84px));min-height:100px;display:flex;flex-direction:column;border:1px solid #c1d8c8b0;border-radius:15px;background:#e7f0e9f5;color:#234a43;box-shadow:0 8px 32px #0a221d4d;backdrop-filter:blur(10px)}
.roaming-drawer>header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 10px;border-bottom:1px solid #b9d0c1;flex:none}
.roaming-drawer>header strong{font-size:14px}.roaming-drawer>header button{min-height:40px;padding:6px 8px;font-size:12px;background:#f7fbf369}
.roaming-drawer-body{flex:1;min-height:0;padding:8px;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin}
.roaming-drawer-body>[data-roaming-panel]:not([hidden]){display:grid;gap:8px}
.roaming-drawer-empty{font-size:13px;line-height:1.7;padding:14px 8px;margin:0;color:#49675a}
.roaming-drawer-body [data-roaming-panel]>:not(.roaming-drawer-empty){position:static!important;inset:auto!important;transform:none!important;width:100%!important;min-width:0!important;max-width:none!important;height:auto!important;max-height:none!important;margin:0!important;box-sizing:border-box;overflow:visible;pointer-events:auto;visibility:visible;box-shadow:none}
.roaming-drawer-body .world-header{flex-wrap:wrap;padding:9px}.roaming-drawer-body .world-header nav{order:0;flex-wrap:wrap}
.roaming-drawer-body .view-controls{flex-wrap:wrap}.roaming-drawer-body .view-controls button{font-size:12px;flex:1 1 90px}
.roaming-drawer-body .world-hud{text-align:left}.roaming-drawer-body .world-hud span{font-size:12px}
.roaming-drawer-body #walkAvatarPanel{padding:10px}.roaming-drawer-body #walkAvatarPanel>summary{min-height:36px;cursor:pointer}
.roaming-drawer-body #itemInfo{background:transparent;border:0;padding:8px;visibility:visible!important}
.roaming-drawer-body #itemInfo p{font-size:14px}.roaming-drawer-body #itemInfo .actions button,.roaming-drawer-body #itemInfo>button{min-height:42px;font-size:13px}
.roaming-drawer-body:has([data-roaming-panel="npc"]:not([hidden])){overflow:hidden}
.roaming-drawer-body>[data-roaming-panel="npc"]:not([hidden]){height:100%;display:flex;flex-direction:column}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-world-chat{height:100%!important;max-height:100%!important;flex:1;min-height:0;overflow:auto;border-radius:9px}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-chat-header{padding:7px 9px;min-height:44px}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-chat-log{min-height:60px;flex:1 1 150px}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-world-chat:has(form:not([hidden])) .npc-chat-log{min-height:30px}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-chat-commands{max-height:100px}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer form{padding:8px;flex:none}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer textarea{font-size:16px;min-height:58px}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-game-form-actions button{min-height:42px}
.roaming-drawer [data-roaming-panel="npc"]:has(.npc-command-card:not([hidden])) .npc-world-chat{display:none!important}
.roaming-drawer .npc-command-card{flex:1;min-height:0;overflow:auto!important;background:#26483de8}

/* The map is the one persistent card on phones, including short landscapes. */
body[data-mobile-roaming="true"] #worldMinimap{right:8px;width:158px;padding:6px;max-height:calc(100dvh - 84px);overflow:auto;border-radius:11px;background:rgba(231,243,234,.38)}
body[data-mobile-roaming="true"] #worldMinimap #worldMapBody:not([hidden]){display:block!important}
body[data-mobile-roaming="true"] #worldMinimap canvas{display:block!important;width:100%;max-width:142px;margin:3px auto}
body[data-mobile-roaming="true"] #worldMinimap .world-map-controls{display:flex!important;gap:3px}
body[data-mobile-roaming="true"] #worldMinimap button{padding:3px 5px;min-height:28px;font-size:10px}
body[data-mobile-roaming="true"] #worldMinimap .world-map-controls select{width:62px;font-size:10px;padding:3px}
body[data-mobile-roaming="true"] #worldMapOrientation,body[data-mobile-roaming="true"] #worldMapLocation{font-size:10px;line-height:1.4;margin-top:3px}
body[data-mobile-roaming="true"] #worldMapDirections>summary{font-size:11px;min-height:27px}
body[data-mobile-roaming="true"] .npc-speech-bubble,body[data-mobile-roaming="true"] .npc-game-target,body[data-mobile-roaming="true"] .world-lock-prompt,body[data-mobile-roaming="true"] .attribution{display:none!important}
body[data-mobile-roaming="true"] #crosshair{font-size:26px;opacity:.6}
@media(max-height:520px){body[data-mobile-roaming="true"] #worldMinimap{width:134px}body[data-mobile-roaming="true"] #worldMinimap canvas{max-width:90px}body[data-mobile-roaming="true"] #worldMapOrientation{display:none}.roaming-drawer{height:calc(var(--roaming-viewport-height,100dvh) - 84px)}}

#touchPad.joystick-pad{position:fixed;z-index:50;left:max(12px,env(safe-area-inset-left));bottom:calc(max(8px,env(safe-area-inset-bottom)) + 68px);display:block;width:184px;height:148px;pointer-events:none}
.joystick-pad button{pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.joystick-pad #worldJoystick{position:absolute;left:0;bottom:22px;width:118px;height:118px;min-height:0;padding:0;border-radius:50%;border:1px solid #e0f4e580;background:radial-gradient(circle,#41695726 0 47%,#cbe5d138 48% 49%,#183e303b 50%);box-shadow:inset 0 0 0 10px #e1f2e619,0 2px 12px #102a2529}
#worldJoystick .joystick-north{position:absolute;left:0;right:0;top:5px;text-align:center;color:#eefbef;font-size:13px;pointer-events:none}
#worldJoystick [data-joystick-knob]{position:absolute;left:calc(50% - 23px);top:calc(50% - 23px);width:46px;height:46px;box-sizing:border-box;border-radius:50%;border:1px solid #dceee1b0;background:#cce2d6b3;box-shadow:0 3px 8px #1638294d;pointer-events:none}
#worldJoystick[data-moving="true"]{border-color:#d6edbf}#worldJoystick[data-moving="true"] [data-joystick-knob]{background:#d4ecce}
.joystick-pad #touchRun{position:absolute;left:126px;bottom:31px;min-width:48px;min-height:42px;padding:6px;font-size:12px;background:#dcebd5b8;border-radius:20px}
.joystick-pad #touchRun[aria-pressed="true"]{background:#285f48;color:#f4fff4}
.joystick-pad small{position:absolute;left:0;bottom:0;width:230px;color:#f4fcf4;font-size:10px;line-height:1.4;text-shadow:0 1px 3px #153a2a;pointer-events:none}
body[data-roaming-drawer] #touchPad{opacity:.25;pointer-events:none}

/* Give conversation history the available phone height; other drawers stay compact. */
body[data-roaming-drawer="npc"] .roaming-drawer{height:calc(var(--roaming-viewport-height,100dvh) - 84px)}
body[data-roaming-drawer="npc"] .roaming-drawer>header{padding:0 8px}
body[data-roaming-drawer="npc"] .roaming-drawer>header button{min-height:40px;padding:4px 8px}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-world-chat{overflow:hidden}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-chat-log,
body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-world-chat:has(form:not([hidden])) .npc-chat-log{min-height:0;flex:1 1 0}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-chat-scroll{box-sizing:border-box;height:100%;padding:10px 8px;touch-action:pan-y}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-chat-header{min-height:38px;padding:5px 8px}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-chat-header-actions{gap:6px}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-avatar-button span{display:none}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-world-chat:has(form:not([hidden]))>.academy-entry{display:none}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer form{padding:6px 8px}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer textarea{min-height:44px;height:44px;max-height:96px;resize:vertical}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-chat-commands{margin-bottom:3px!important;padding:3px 6px}
body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-world-chat[data-chat-history="true"] .npc-chat-log{flex:1 1 0;min-height:0}
@media(min-width:600px) and (max-height:520px){
  body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-world-chat:has(form:not([hidden])):not([data-chat-history="true"]){display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,40%);grid-template-rows:auto minmax(0,1fr) auto auto}
  body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-chat-header{grid-column:1/-1;grid-row:1}
  body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-chat-log{grid-column:1;grid-row:2/5;min-width:0}
  body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-chat-commands{grid-column:2;grid-row:2;min-width:0;min-height:0;max-height:100%;margin:0 6px!important}
  body[data-mobile-roaming="true"] #worldStage .roaming-drawer form{grid-column:2;grid-row:3;min-width:0}
  body[data-mobile-roaming="true"] #worldStage .roaming-drawer .npc-game-status{grid-column:2;grid-row:4}
}
