/* Shared interaction sizes and responsive layout, after feature styles.
   Rooms keep their 16:9 coordinates. Outdoor cameras and picking use the
   actual viewport bounds, so they can fill the available portrait space. */
.world-ui { --ui-action: #d8bee9; --ui-action-ink: #2a2033; }
#worldHud :is(button,a,select,input):focus-visible,
.world-ui :is(.pocket-location-bar,.outdoor-edit-bar,.wilderness-edit-bar) :is(button,input,select):focus-visible {
  outline: 2px solid var(--glass-accent); outline-offset: 3px;
}
.world-location { width: 220px; padding: 10px 12px; }
.world-ui .world-location small { display: flex; justify-content: space-between; font-size: 10px; }
.world-location > span { font-size: 13px; text-wrap: pretty; }
.world-utilities { flex-direction: row; }
.world-ui .world-utilities button { width: 44px; height: 44px; }
.world-dock { width: 72px; gap: 4px; padding: 5px; }
.world-dock button { font-size: 11px; min-height: 52px; }
#worldHud .world-dock svg { width: 21px; height: 21px; }
#worldHud .world-option { font-size: 13px; font-weight: 700; }
.world-tool-group { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.world-tool-group h3 { grid-column: 1 / -1; margin: 3px 0 0; color: var(--glass-muted); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.world-tool-group + .world-tool-group { margin-top: 8px; }
.world-ui .glass-window { max-height: calc(100dvh - 112px); }
.world-ui.world-chat-open .glass-window:not(.has-window-layout) { max-height: calc(100dvh - 190px); }
.world-ui .glass-window .window-chrome :is(.floating-drawer-title,.tool-panel-title,.debug-panel-title,h2) { font-size: 16px; }
.world-ui .glass-window .window-chrome button:not(.window-reset-button) { min-height: 36px; }
.world-ui .glass-window .world-panel-back { font-size: 12px; }
.world-ui .glass-window .window-scroll-body { padding: 16px; gap: 14px; }
.world-ui .glass-window :is(p,label) { line-height: 1.5; }
.world-ui .glass-window :is(input[type=search],input[type=text],select) { min-height: 42px; width: 100%; min-width: 0; }
.world-ui .glass-window input[type=search] { border: 1px solid var(--glass-border); border-radius: 9px; background: var(--glass-field); color: var(--glass-text); padding: 9px 11px; font: inherit; font-size: 14px; }
.world-ui .glass-window :is(button.outdoor-primary,button.wilderness-primary):not(.window-resize-handle),
#worldHud .glass-window :is(.map-primary-button,.village-approach):not(:disabled) {
  background: var(--ui-action); color: var(--ui-action-ink); border: 1px solid transparent; font-weight: 700;
}
.world-ui .glass-window button:not(.window-resize-handle):is(.is-active,[aria-pressed=true],[aria-selected=true]) {
  background-color: #ac80c747; border-color: #d4b1ed99; color: #fff6ff; box-shadow: inset 0 -2px 0 #d4b1ed;
}
#worldHud .map-wallet { padding: 8px 12px; font-size: 12px; background: transparent; border-bottom: 1px solid var(--glass-border); border-radius: 0; align-items: center; }
#worldHud .map-wallet strong { font-size: 15px; }
#worldHud .map-selection { background: var(--glass-card); border: 1px solid var(--glass-border); padding: 14px; }
#worldHud .map-selection p { margin: 7px 0 0; font-weight: 400; color: var(--glass-muted); }
#worldHud .map-page-header { gap: 10px; }
#worldHud .map-neighborhood-picker { font-size: 11px; }
#worldHud :is(.map-private-house-button,.map-close-button) { min-height: 40px; font-size: 13px; }
#worldHud .village-toolbar { gap: 10px; margin: 0; }
#worldHud .village-search { display: grid; gap: 10px; }
#worldHud .village-search label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; }
#worldHud .village-search small { color: var(--glass-muted); font-size: 12px; font-weight: 400; }
.village-place-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.building-lot-editor fieldset { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin: 12px 0; padding: 12px; border: 1px solid var(--glass-border); border-radius: 10px; }
#worldHud .building-lot-editor fieldset label { display: flex; align-items: center; gap: 7px; margin: 0; min-width: 0; font-size: 12px; }
#worldHud .building-lot-editor input[type="checkbox"] { flex: 0 0 17px; width: 17px; height: 17px; min-height: 0; margin: 0; accent-color: #a9c4a0; }
.building-lot-editor > label { margin-top: 12px; }
#worldHud .village-place-filters button { flex: 1; min-height: 36px; padding: 6px 9px; border: 1px solid var(--glass-border); border-radius: 8px; font-size: 12px; }
#worldHud .village-jump { gap: 6px; background: transparent; padding: 0; font-size: 12px; color: var(--glass-muted); }
#worldHud .village-approach { min-height: 44px; font-size: 13px; border-radius: 9px; }
.world-ui.is-map-open:has(.neighborhood-3d[data-pocket=true]) #worldHud .world-neighborhood-options :is(.village-toolbar,.map-neighborhood-picker,.map-private-house-button) { display: none; }

/* Scene navigation belongs to the same visual family as the tool drawers. */
.world-ui .pocket-location-bar,
.world-ui .outdoor-edit-bar,
.world-ui .wilderness-edit-bar {
  background: var(--glass-surface); color: var(--glass-text); border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(125%); -webkit-backdrop-filter: blur(20px) saturate(125%);
  box-shadow: 0 12px 32px #08061030; color-scheme: dark;
}
.world-ui.is-map-open .pocket-location-bar { width: 156px; padding: 8px; border-radius: 12px; gap: 6px; }
.world-ui.is-map-open .pocket-location-bar :is(button,select) { color: var(--glass-text); background: #d9b9f012; min-height: 38px; border: 1px solid var(--glass-border); border-radius: 8px; font-size: 12px; }
.world-ui.is-map-open .pocket-location-bar option { background: #292232; }
.world-ui.is-map-open .pocket-location-bar span { color: var(--glass-muted); font-size: 11px; padding: 4px; }
.world-ui.is-map-open .pocket-location-bar :is(.property-view,[aria-pressed=true]) { background: #ac80c747; color: var(--glass-text); }
.world-ui.world-panel-open .pocket-location-bar { visibility: hidden; pointer-events: none; }
.world-ui .outdoor-edit-bar { position: fixed; bottom: 24px; max-width: min(600px,calc(100vw - 200px)); }
.world-ui .outdoor-edit-bar button { background: #d9b9f020; color: var(--glass-text); border: 1px solid var(--glass-border); min-height: 36px; }
.world-ui.world-panel-open .outdoor-edit-bar [data-tools] { display: none; }
.world-ui .wilderness-edit-bar { position: fixed; left: auto; right: 24px; bottom: 24px; max-height: calc(100dvh - 112px); overflow-y: auto; }
.world-ui .wilderness-edit-bar :is(button,select) { background: #d9b9f020; color: var(--glass-text); }
.world-ui .wilderness-edit-bar .wilderness-fine { color: var(--glass-muted); }

.outdoor-builder { gap: 12px; }
.outdoor-builder .outdoor-feedback { display: none; }
.outdoor-builder .outdoor-feedback.is-error { color: #ffb0c5; }
.outdoor-search { display: grid; gap: 6px; font-size: 12px; }
.outdoor-tabs { flex-wrap: nowrap; border-bottom: 1px solid var(--glass-border); padding-bottom: 10px; }
.outdoor-tabs button { padding: 8px 5px; font-size: 12px; min-height: 40px; white-space: nowrap; }
.outdoor-toolbar button { flex: 1 1 auto; min-height: 36px; }
.outdoor-categories button { min-height: 36px; }
.world-ui .glass-window .outdoor-card { border-radius: 10px; background: var(--glass-card); }
.outdoor-card img { height: 104px; background: radial-gradient(ellipse at 50% 80%,#52665f,#3f4149 75%); }
.outdoor-card strong { font-size: 13px; padding-top: 5px; }
.outdoor-card small { color: var(--glass-muted); font-size: 12px; }
.world-ui .outdoor-builder :is(.terrain-tools,.terrain-paints) button { min-height: 38px; }
.world-ui .outdoor-builder .outdoor-selection { background: #d9b9f008; border-color: var(--glass-border); }
.world-ui .terrain-brush-panel :is(small,.terrain-brush-help) { color: var(--glass-muted); font-size: 12px; }

.world-ui .quick-chat-emote-picker { grid-template-columns: repeat(3,minmax(0,1fr)); max-height: min(390px,60dvh); color-scheme: dark; scrollbar-width: thin; scrollbar-color: #b798c25c transparent; }
.world-ui .quick-chat-emote-picker :is(.speech-emote-button,.speech-style-normal),
.world-expressions button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; font-size: 12px; line-height: 1.2; padding: 7px 4px; white-space: normal; }
.world-ui .quick-chat-emote-picker small, .world-expressions small { font: 10px ui-monospace,monospace; opacity: .8; }
.world-ui .speech-style-normal { grid-column: 1 / -1; border: 1px solid var(--glass-border); border-radius: 8px; background: transparent; color: var(--glass-text); cursor: pointer; }
.world-ui .speech-style-normal[aria-pressed=true] { background: #ac80c747; }
.world-ui #quickChat .quick-chat-close-button { width: 32px; height: 32px; top: 2px; }
.world-ui #quickChat :is(#worldSpeechToggle,.quick-chat-send-button,.quick-chat-log-button) { min-height: 40px; }
.world-ui #quickChat .quick-chat-form > input { height: 40px; }

@media (max-width:700px) {
  .world-ui .map-page .map-page-shell, .world-ui .room-viewport { min-height: 100dvh; align-content: center; }
  .world-location { width: 210px; max-width: calc(100% - 98px); }
  .world-location > span { font-size: 12px; white-space: nowrap; }
  .world-dock { left: 50%; top: auto; bottom: 0; transform: translateX(-50%); flex-direction: row; width: min(400px,100%); max-height: none; overflow: visible; padding: 4px; gap: 2px; }
  .world-dock button { flex: 1 1 0; min-height: 48px; font-size: 10px; padding: 5px 2px; }
  .world-chat-toggle, .world-controls-help { bottom: 68px; }
  #worldHud .world-chat-toggle > button { width: 60px; height: 48px; }
  .world-ui.world-panel-open :is(.world-chat-toggle,.world-controls-help,.village-bottom) { visibility: hidden; }
  .world-ui:has(.village-scene.is-outdoor-editing) :is(.world-chat-toggle,.world-controls-help) { visibility: hidden; }
  .world-ui .glass-window, .world-ui .glass-window.has-window-layout,
  .world-ui.world-chat-open .glass-window:not(.has-window-layout) {
    left: 12px !important; top: 80px !important; width: calc(100vw - 24px) !important;
    height: auto !important; max-height: calc(100dvh - 160px); border-radius: 12px;
  }
  .world-ui .floating-drawer.glass-window { height: calc(100dvh - 160px) !important; }
  .world-ui .glass-window .window-scroll-body { padding: 12px; }
  .world-ui .glass-window .window-chrome { cursor: default; }
  .world-ui .glass-window :is(.window-resize-bar,.window-reset-button) { display: none; }
  .world-ui .glass-window :is(input[type=search],input[type=text],select) { font-size: 16px; min-height: 44px; }
  .world-ui .glass-window .window-chrome button { min-height: 40px; }
  .world-ui.is-map-open .pocket-location-bar { top: 82px; right: 12px; left: 12px; width: auto; transform: none; flex-direction: row; flex-wrap: wrap; max-height: 130px; gap: 5px; }
  .world-ui.is-map-open .pocket-location-bar :is(button,select) { width: auto; flex: 1 1 auto; min-height: 38px; }
  .world-ui.is-map-open .pocket-location-bar select { max-width: 100%; }
  .world-ui.is-map-open .pocket-location-bar span { display: none; }
  .world-ui .outdoor-edit-bar { bottom: 80px; width: calc(100vw - 24px); max-width: none; padding: 8px; }
  .world-ui.world-panel-open .outdoor-edit-bar { display: none; }
  .outdoor-builder .outdoor-feedback { display: block; font-size: 12px; color: var(--glass-muted); }
  .world-ui .wilderness-edit-bar { top: 80px; bottom: auto; right: 12px; width: calc(100vw - 24px); max-width: none; max-height: calc(100dvh - 160px); }
  .outdoor-tabs { gap: 4px; }
  .outdoor-tabs button { font-size: 11px; }
  .outdoor-categories button { font-size: 11px; padding: 6px; }
  .world-ui .outdoor-builder :is(.terrain-tools,.terrain-paints) button { padding: 7px 5px; gap: 4px; font-size: 11px; }
  .world-ui #quickChat { bottom: 80px; width: calc(100vw - 24px); padding: 10px; }
  .world-ui .quick-chat-form, .world-ui .quick-chat.is-open .quick-chat-form { grid-template-columns: 1fr 1fr 1fr; gap: 7px; }
  .world-ui #quickChat .quick-chat-form > input { grid-column: 1 / -1; grid-row: 1; width: 100%; min-height: 44px; }
  .world-ui #quickChat :is(#worldSpeechToggle,.quick-chat-send-button,.quick-chat-log-button) { grid-row: 2; min-height: 40px; }
  .world-ui #worldSpeechToggle { grid-column: 1; }
  .world-ui .quick-chat-send-button { grid-column: 2; }
  .world-ui .quick-chat-log-button { grid-column: 3; }
  .world-ui .quick-chat-emote-picker { width: calc(100vw - 24px); max-height: min(340px,calc(100dvh - 290px)); padding: 10px; }
  .world-chat-open .world-controls-help { visibility: hidden; }
  .world-ui.is-map-open .village-bottom { bottom: 138px; }
}
@media (max-width:700px) and (orientation:portrait) {
  .world-ui .map-page .map-page-shell { height: 100dvh; padding: 152px 12px 100px; box-sizing: border-box; }
  .world-ui .map-page .map-page-layout { width: calc(100vw - 24px); height: calc(100dvh - 252px); aspect-ratio: auto; }
}
@media (prefers-reduced-transparency:reduce) {
  .world-ui :is(.pocket-location-bar,.outdoor-edit-bar,.wilderness-edit-bar) { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
/* Compact, persistent place shortcuts live in the existing Places drawer. */
.place-directory{display:grid;grid-column:1/-1;gap:10px;margin-bottom:14px;min-width:0}
.place-directory-current{display:flex;align-items:center;justify-content:space-between;gap:8px}
.place-directory-current>span{font-size:12px;opacity:.78;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.place-directory-current button,.place-directory-tabs button{font:inherit;font-size:12px;border:1px solid #a99bb34d;border-radius:9px;background:#ffffff08;color:inherit;padding:7px 10px;white-space:nowrap}
.place-directory input{width:100%;min-width:0;border:1px solid #a99bb35c;border-radius:10px;padding:10px 12px;background:#18131e80;color:#f7effb;font:inherit;font-size:13px}
.place-directory-tabs{display:flex;gap:6px}
.place-directory-tabs button[aria-pressed=true]{background:#78558d66;border-color:#b58fca99}
.place-directory ul{display:grid;gap:4px;list-style:none;padding:0;margin:0;max-height:min(42vh,330px);overflow:auto;overscroll-behavior:contain}
.place-directory li{display:flex;align-items:stretch;gap:4px;border-radius:10px;background:#ffffff06}
.place-directory-visit{display:grid;gap:3px;flex:1;text-align:left;border:0;background:none;color:inherit;padding:10px 9px;min-width:0;font:inherit}
.place-directory-visit strong{font-size:13px;font-weight:600}.place-directory-visit span{font-size:11px;opacity:.7;line-height:1.4}
.place-directory-star{align-self:center;width:36px;height:36px;border:0;background:none;color:#cbb9d5;font-size:23px;border-radius:8px;flex-shrink:0}
.place-directory-star[aria-pressed=true]{color:#f5d68b}.place-directory button:hover{background:#a88bb52b}.place-directory button:focus-visible,.place-directory input:focus-visible{outline:2px solid #dfb7f5;outline-offset:1px}
.place-directory-status{font-size:12px;margin:0;opacity:.85}.place-directory-status:empty{display:none}.place-directory>small{font-size:10px;opacity:.6}
#worldHud [data-world-section=places]:has(.place-directory) :is(.village-search,.village-jump,.village-approach){display:none}
