/* Ajustes de jogabilidade sobre o tema de pedra e ouro. Geometria de toque compartilhada
   entre telefones; o HUD de desktop continua definido por hud.css. */
#ohm-cta[hidden], #ohm-comb-btn[hidden], #ohm-combat[hidden] { display: none !important; }
#ohm-local[hidden], #ohm-local-btn[hidden] { display: none !important; }
/* Avisos pertencem ao mapa, abaixo da navegação (30) e das janelas. */
.system-toasts { z-index: 29; }
.oh-chat-label { display: none; }

@media (max-width: 1000px) {
  :root {
    --oh-phone-left: max(8px, env(safe-area-inset-left));
    --oh-phone-right: max(8px, env(safe-area-inset-right));
    --oh-phone-bottom: env(safe-area-inset-bottom, 0px);
    --oh-phone-top: calc(56px + env(safe-area-inset-top));
  }
  app-game-shell > header {
    gap: 4px; padding: calc(4px + env(safe-area-inset-top)) var(--oh-phone-right) 4px var(--oh-phone-left);
    min-height: var(--oh-phone-top); background: linear-gradient(#101119f5, #101119d9);
  }
  app-game-shell > header .header-character { flex: 1 1 auto; min-width: 44px; gap: 6px; }
  .header-character-id { min-width: 0; overflow: hidden; }
  .header-character-name { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #header-portrait { width: 44px; height: 44px; }
  app-game-shell > header .header-purse { gap: 4px; margin-left: 0; }
  .header-purse #header-coins, .header-purse #header-gold { min-height: 44px; min-width: 44px; padding: 0 2px; }
  .header-purse .header-coins-count, .header-purse .header-gold-count { max-width: 7ch; overflow: hidden; text-overflow: ellipsis; }
  .header-purse #header-coins-buy { display: none; }
  .header-purse #nav-store, app-game-shell > header #nav-menu { width: 44px; height: 44px; flex: 0 0 44px; }
  app-game-shell > header #nav-menu { display: grid !important; place-items: center; padding: 0; }
  app-game-shell > header #top-nav.top-nav:not(.open) { display: none !important; }
  app-game-shell > header #top-nav.top-nav.open {
    display: flex; flex-direction: column; align-items: stretch; position: fixed;
    top: 0; right: 0; bottom: 0; width: min(86vw, 340px); height: 100dvh;
    z-index: 2650; gap: 6px; margin: 0; padding: env(safe-area-inset-top) var(--oh-phone-right) env(safe-area-inset-bottom) 8px;
    transform: none; animation: none;
    overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box;
    background: var(--oh-ink-1); border-left: 1px solid var(--oh-gold-dark); box-shadow: -18px 0 44px #000a;
  }
  #top-nav.open .nav-drawer-head { display: flex; align-items: center; justify-content: space-between; min-height: 52px; margin: 0; padding: 4px 8px; }
  #top-nav.open .nav-drawer-head button { min-width: 44px; min-height: 44px; }
  #top-nav.open .nav-labeled { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; width: 100%; min-height: 48px; padding: 8px 12px; }
  #top-nav.open .nav-labeled .nav-label { display: block !important; position: static; opacity: 1; transform: none; font-size: 14px; }
  #top-nav.open .nav-glyph { flex: 0 0 28px; }

  .hud-city-actions {
    top: var(--oh-phone-top); left: var(--oh-phone-left); right: var(--oh-phone-right);
    width: auto; max-width: none; transform: none; justify-content: flex-start; gap: 6px;
    padding: 4px 0; scroll-padding-inline: 4px; overscroll-behavior-x: contain;
  }
  .hud-city-action { min-height: 44px; padding: 0 12px; border-radius: 8px; font-size: 11px; letter-spacing: .03em; }
  .hud-dispatch-more, .hud-leave-more { min-width: 44px; }
  .hud-dispatch-group, .hud-leave-group { flex: 0 0 auto; }
  /* Cidade/caçada ficam num menu de alcance curto; o topo é reservado ao mundo. */
  #ohm-local {
    position: fixed; z-index: 1500; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: min(420px, calc(100vw - var(--oh-phone-left) - var(--oh-phone-right)));
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain; pointer-events: auto;
    border: 1px solid var(--oh-gold-dark); border-radius: 10px;
    background: var(--oh-ink-1); box-shadow: 0 16px 48px #000b; padding: 10px;
  }
  #ohm-local > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 0 8px 4px; zoom: 1; background: none; }
  #ohm-local-title { font: 700 16px/1.3 var(--oh-num); color: var(--oh-gold-3); }
  #ohm-local-close { width: 44px; height: 44px; border: 0; color: var(--oh-text-2); background: none; font-size: 20px; }
  #ohm-local .hud-city-actions {
    position: static; inset: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    width: auto; max-width: none; padding: 0; gap: 8px; overflow: visible; transform: none;
  }
  #ohm-local .hud-city-actions[hidden] { display: none !important; }
  #ohm-local .hud-city-action { width: 100%; min-height: 52px; padding: 8px; white-space: normal; font-size: 12px; line-height: 1.3; }
  #ohm-local .hud-hunt-details, #ohm-local .hud-dispatch-group, #ohm-local .hud-leave-group { grid-column: 1 / -1; }
  #ohm-local .hud-dispatch-group, #ohm-local .hud-leave-group { display: flex; gap: 8px; }
  #ohm-local .hud-dispatch-group > .hud-hunt-quick-sell, #ohm-local .hud-leave-group > .hud-leave-hunt { flex: 1 1 0; width: auto; min-width: 0; }
  #ohm-local .hud-dispatch-more, #ohm-local .hud-leave-more { flex: 0 0 44px; width: 44px; }
  #ohm-local .ohm-session-actions { display: flex; gap: 8px; margin-top: 8px; }
  #ohm-local .ohm-session-actions button { flex: 1; min-width: 0; min-height: 48px; padding: 8px; font: 600 13px/1.3 var(--oh-ui); color: var(--oh-gold-3); background: var(--oh-ink-3); border: 1px solid var(--oh-line); border-radius: 6px; }
  #ohm-local .ohm-session-actions button[hidden] { display: none; }
  #ohm-local .ohm-session-actions:not(:has(button:not([hidden]))) { display: none; }
  #ohm-local-btn {
    position: fixed; display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 44px; height: 44px; box-sizing: border-box; z-index: 24; pointer-events: auto; cursor: pointer;
    background: var(--oh-stone); border: 1px solid var(--oh-gold-dark); border-radius: 6px;
    color: var(--oh-gold-3); font: 600 10px/1.1 var(--oh-ui); gap: 1px; box-shadow: 0 3px 10px #0008;
  }
  #ohm-local-btn img { width: 22px; height: 22px; }
  #ohm-local-btn.has-loot::after { content: ''; position: absolute; right: -3px; top: -3px; width: 8px; height: 8px; border: 2px solid var(--oh-ink-1); border-radius: 50%; background: var(--oh-gold-3); }
  #ohm-local-btn:focus-visible, #ohm-local button:focus-visible { outline: 2px solid var(--oh-gold-3); outline-offset: 2px; }
  #ohm-cta .ohm-return { display: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
  #ohm-cta.in-hunt .ohm-return { display: block; }
  #ohm-cta.in-hunt > img { display: none; }
  #ohm-cta[aria-disabled="true"] { opacity: .7; cursor: wait; }
  /* As regras automáticas abrem como um painel, sem depender da posição do botão. */
  .leave-rules-menu {
    left: 50% !important; top: 50% !important; transform: translate(-50%, -50%);
    width: min(360px, calc(100vw - 16px)); max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    background: var(--oh-ink-1); border-color: var(--oh-gold-dark);
    box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain;
  }
  .ombria-hud:has(.leave-rules-menu) .context-backdrop { background: #0009; }
  .leave-rules-menu .context-toggle { min-height: 44px; font-size: 13px; }
  .system-toasts { top: calc(var(--oh-phone-top) + 8px) !important; max-width: calc(100vw - 24px); pointer-events: none; }
  .system-toast.pending-toast:has(.training-skill) {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px;
    width: min(400px, calc(100vw - 24px)); padding: 8px 10px;
    background: var(--oh-ink-1); border-radius: 8px; text-align: left; text-wrap: wrap;
  }
  .system-toast.pending-toast .training-skill { grid-area: 1 / 1; font-size: 13px; }
  .system-toast.pending-toast .training-progress { grid-area: 2 / 1; font-size: 12px; }
  .system-toast.pending-toast .training-bar { grid-area: 3 / 1; width: 100%; height: 6px; box-sizing: border-box; }
  .system-toast.pending-toast button { min-width: 44px; min-height: 44px; font-size: 12px; touch-action: manipulation; }
  .system-toast.pending-toast:has(.training-skill) > button { grid-area: 1 / 2 / 4 / 3; }

  #ohm-combat {
    position: fixed; top: 50%; bottom: auto; left: 50%; right: auto; transform: translate(-50%, -50%);
    width: min(360px, calc(100vw - var(--oh-phone-left) - var(--oh-phone-right)));
    max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 12px; overflow-y: auto; overscroll-behavior: contain; z-index: 1500; pointer-events: auto;
    background: var(--oh-ink-1); border: 1px solid var(--oh-gold-dark); border-radius: 8px; box-shadow: 0 12px 36px #000a;
  }
  #ohm-combat .oc-head { position: sticky; top: -12px; z-index: 2; min-height: 44px; margin: -12px -12px 8px; padding: 4px 8px 4px 14px; background: var(--oh-ink-1); }
  #ohm-combat .oc-head b { font-size: 13px; }
  #ohm-combat .oc-head button { min-width: 44px; min-height: 44px; margin: 0; }
  #ohm-combat .hud-preset-label { font-size: 11px; text-align: left; }
  #ohm-combat select { min-height: 44px; max-width: none; font-size: 14px; }
  #ohm-combat .hud-rail-controls { gap: 8px; }
  #ohm-combat .hud-rail-controls button, #ohm-combat .hud-distance-value { min-height: 44px; min-width: 44px; }
  #ohm-combat .hud-stance-row, #ohm-combat .hud-distance-row { gap: 4px; }
  #ohm-comb-btn { width: 44px; height: 44px; box-sizing: border-box; }
  #ohm-comb-btn:focus-visible, #ohm-combat button:focus-visible { outline: 2px solid var(--oh-gold-3); outline-offset: 2px; }

  .hud-slot { width: 44px !important; height: 44px !important; translate: none !important; }
  .hud-bar-panel > .hud-bag-buttons {
    width: auto !important; height: auto !important; padding: 0;
    grid-template: none !important; grid-auto-rows: 44px; grid-auto-columns: 44px;
  }
  .hud-bar-panel .hud-bag-button { width: 44px; height: 44px; }
  .hud-bar-panel .hud-exp .hud-level > .oh-nav-overlay { inset: -10px !important; }
  .hud-slot:active, .hud-city-action:active, #ohm-comb-btn:active { transform: none; filter: brightness(1.2); }
  .chat-panel.folded {
    height: 46px !important; min-height: 46px !important; padding: 0 !important;
    border: 1px solid var(--oh-gold-dark); border-radius: 8px; box-sizing: border-box;
  }
  .chat-panel.folded > :not(.chat-line) { display: none !important; }
  .chat-panel.folded > .chat-line {
    display: flex !important; align-items: center; justify-content: center; flex: 0 0 44px;
    width: 100%; height: 44px; min-height: 44px; padding: 0 !important;
    background: none !important; border: 0; box-shadow: none; color: var(--oh-gold-3); touch-action: manipulation;
  }
  .chat-panel.folded > .chat-line::before, .chat-panel.folded > .chat-line::after { content: none !important; }
  .chat-panel.folded .chat-line-last { display: none; }
  .chat-panel.folded::before, .chat-panel.folded::after { content: none; }
  .chat-panel.folded .oh-chat-label { display: flex; flex-direction: column; align-items: center; gap: 2px; font: 600 10px/12px var(--oh-ui); }
  .oh-chat-label svg { width: 20px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .chat-panel.folded:has(.chat-unread:not([hidden]))::after {
    content: ''; position: absolute; inset: 4px 4px auto auto; width: 6px; height: 6px;
    border: 0; border-image: none; border-radius: 50%; background: var(--oh-gold-3); pointer-events: none;
  }
  .chat-panel.folded:focus-within { outline: 2px solid var(--oh-gold-3); outline-offset: 2px; }
  #game .chat-panel > header .window-actions button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; font-size: 20px; }
  .loot-window, .hunt-analyzer-window.minimized { top: calc(var(--oh-phone-top) + 56px) !important; }
  .loot-window > header, .hunt-analyzer-window.minimized > header { min-height: 44px; }
  .loot-window:not(.expanded), .hunt-analyzer-window.minimized { display: none !important; }
  :is(#ui, #game) .loot-window.expanded:not([hidden]), :is(#ui, #game) .hunt-analyzer-window:not(.minimized):not([hidden]) {
    display: flex !important; flex-direction: column; position: fixed !important; z-index: 1500 !important;
    left: 50% !important; right: auto !important; top: calc(var(--oh-phone-top) + 8px) !important; bottom: 12px !important;
    width: min(520px, calc(100vw - 16px)) !important; height: auto !important;
    max-height: calc(100dvh - var(--oh-phone-top) - 20px) !important;
    transform: translateX(-50%) !important; box-sizing: border-box; overflow: hidden; background: var(--oh-ink-1) !important;
  }
  :is(#ui, #game) .loot-window.expanded > header, :is(#ui, #game) .hunt-analyzer-window:not(.minimized) > header { min-height: 52px; flex: 0 0 auto; }
  :is(#ui, #game) :is(.loot-window, .hunt-analyzer-window) > header .window-actions button { min-width: 44px; min-height: 44px; }
  :is(#ui, #game) .loot-window.expanded .loot-grid { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; padding: 12px; }
  :is(#ui, #game) .loot-window.expanded .loot-slot { min-width: 44px; min-height: 44px; }
  :is(#ui, #game) .loot-window.expanded footer { flex: 0 0 auto; font-size: 12px; padding: 8px 12px; }
  :is(#ui, #game) .hunt-analyzer-window .analyzer-body, :is(#ui, #game) .hunt-analyzer-window .analyzer-locked { min-height: 0; overflow-y: auto; }

  /* Textos longos e teclado: diálogos nunca deixam o botão de fechar fora da tela. */
  .broadcast-gate { max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; }
  .broadcast-gate button, .poll-window button { min-height: 44px; }
  .poll-window .poll-close { min-width: 44px; min-height: 44px; }
  .options-menu {
    width: min(520px, calc(100vw - 16px)); max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    display: flex; flex-direction: column; background: var(--oh-ink-1); border-color: var(--oh-gold-dark); font-size: 14px;
  }
  .options-menu > header { flex: 0 0 auto; min-height: 52px; background: none; }
  .options-menu > header button { min-width: 44px; min-height: 44px; }
  .options-menu .options-entries { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .options-menu button { min-height: 44px; font-size: 14px; }
  .options-toggle-head, .options-language { flex-wrap: wrap; gap: 8px; }
  .options-menu small { color: var(--oh-text-2); font-size: 13px; line-height: 1.45; }
  #ui input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), #ui textarea, #game .action-editor input { font-size: 16px; min-width: 0; box-sizing: border-box; }
  #ui section.ui-scaled > header button, #game > section.ui-scaled > header button { flex-shrink: 0; min-width: 44px !important; min-height: 44px !important; }
  #ui section.ui-scaled > header, #game > section.ui-scaled > header, .options-menu > header { zoom: 1 !important; }
  #ui section.ui-scaled > header > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #ui section.ui-scaled > nav button, #ui section.ui-scaled > footer button { min-height: 44px; }
  /* As abas já identificam a loja. Os dois saldos e as ações compartilham a mesma altura. */
  #ui section.trade-window.ui-scaled > header {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 44px;
    gap: 8px; padding: 8px var(--oh-phone-right) 8px var(--oh-phone-left); border-top: 0;
  }
  #ui #trade-title, #ui .trade-header-note { display: none; }
  #ui .trade-balance {
    display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 44px;
    box-sizing: border-box; padding: 0 8px; gap: 6px; border-radius: 8px;
    font: 600 13px/1 var(--oh-ui); font-variant-numeric: tabular-nums; white-space: nowrap;
  }
  #ui .trade-balance:has(#trade-coins) { display: grid; grid-template-columns: 14px minmax(0, 1fr) 44px; padding-right: 0; }
  #ui .trade-balance :is(.market-gold, .store-coin) { flex: 0 0 14px; width: 14px; height: 14px; margin: 0; }
  #ui #trade-gold, #ui #trade-coins { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  #ui #trade-topup {
    flex: 0 0 44px; width: 44px; height: 44px; margin: -1px -1px -1px 0; border-radius: 0 8px 8px 0;
    border: 1px solid var(--oh-gold-dark); background: var(--oh-stone); color: var(--oh-gold-3);
  }
  #ui #trade-topup::after { content: none; }
  #ui #trade-topup::before { transform: none; width: 14px; height: 14px; }
  #ui #trade-close { width: 44px; height: 44px; margin: 0; }
  .ombria-hud.oh-keyboard-open #game > .chat-panel:not(.folded) {
    left: 0 !important; right: 0 !important; top: var(--oh-visible-top) !important; bottom: auto !important;
    width: 100vw !important; height: var(--oh-visible-height) !important; max-height: var(--oh-visible-height) !important;
    transform: none !important; border-radius: 0; z-index: 1501 !important;
  }
  .oh-keyboard-open #ui section.ui-scaled:not(.chat-panel):not(.loot-window):not(.hunt-analyzer-window),
  .oh-keyboard-open #game > .action-editor {
    top: var(--oh-visible-top) !important; height: var(--oh-visible-height) !important; max-height: var(--oh-visible-height) !important;
  }
}
@media (max-width: 480px) {
  app-game-shell > header #header-exp-rate { display: none; }
  .header-character-vocation > span { display: none; }
  .header-character-vocation em { font-size: 11px; }
}
@media (max-width: 380px) { app-game-shell > header .header-character-id { display: none; } }

@media (max-width: 1000px) and (orientation: portrait) {
  .hud-slots { left: calc(50% - 144px); transform: none; bottom: calc(124px + var(--oh-phone-bottom)); grid-template-columns: repeat(5, 44px); gap: 6px 4px; }
  .hud-bar-panel > .hud-bag-buttons { left: calc(50% + 100px); bottom: calc(174px + var(--oh-phone-bottom)); gap: 6px; }
  #ohm-comb-btn { right: auto; left: calc(50% + 100px); bottom: calc(224px + var(--oh-phone-bottom)); }
  #ohm-local-btn { left: calc(50% + 100px); bottom: calc(124px + var(--oh-phone-bottom)); }
  #ohm-cta { bottom: calc(26px + var(--oh-phone-bottom)); min-width: 118px; height: 48px; font-size: 12px; }
  .hud-bar-panel .hud-bar.hud-hp { bottom: calc(14px + var(--oh-phone-bottom)); }
  .hud-bar-panel .hud-exp { bottom: calc(6px + var(--oh-phone-bottom)); }
  .hud-bar-panel .hud-bar.hud-mp { bottom: calc(14px + var(--oh-phone-bottom)); }
  .hud-bar-panel .hud-stamina { left: calc(50% - 58px); right: auto; bottom: calc(237px + var(--oh-phone-bottom)); width: 66px; height: 18px; }
  .hud-bar-panel .hud-stamina-buy { left: calc(50% + 16px); right: auto; bottom: calc(224px + var(--oh-phone-bottom)); width: 44px; height: 44px; font-size: 18px; }
  .chat-panel { bottom: calc(232px + var(--oh-phone-bottom)) !important; }
  .chat-panel.folded { left: var(--oh-phone-left) !important; right: auto !important; width: 56px !important; bottom: calc(224px + var(--oh-phone-bottom)) !important; }
  #game .chat-panel:not(.folded) { top: calc(var(--oh-phone-top) + 56px) !important; bottom: calc(280px + var(--oh-phone-bottom)) !important; }
  .hunt-analyzer-window:not(.minimized) { top: calc(var(--oh-phone-top) + 56px) !important; bottom: calc(280px + var(--oh-phone-bottom)) !important; }
}
@media (max-width: 1000px) and (orientation: landscape) {
  .hud-slots { bottom: calc(8px + var(--oh-phone-bottom)); grid-template-columns: repeat(10, 44px); gap: 4px; }
  .hud-bar-panel > .hud-bag-buttons { left: calc(50% + 246px); bottom: calc(8px + var(--oh-phone-bottom)); }
  #ohm-local-btn { left: calc(50% + 246px); bottom: calc(58px + var(--oh-phone-bottom)); }
  .hud-bar-panel .hud-bar.hud-hp { left: var(--oh-phone-left); bottom: calc(12px + var(--oh-phone-bottom)); }
  .hud-bar-panel .hud-exp { left: calc(var(--oh-phone-left) - 6px); bottom: calc(6px + var(--oh-phone-bottom)); }
  .hud-bar-panel .hud-bar.hud-mp { right: var(--oh-phone-right); bottom: calc(12px + var(--oh-phone-bottom)); }
  #ohm-cta { bottom: calc(100px + var(--oh-phone-bottom)); min-height: 44px; }
  #ohm-comb-btn { bottom: calc(152px + var(--oh-phone-bottom)); }
  .chat-panel.folded { left: var(--oh-phone-left) !important; width: 56px !important; bottom: calc(100px + var(--oh-phone-bottom)) !important; }
  #game .chat-panel:not(.folded), .hunt-analyzer-window:not(.minimized) { top: calc(var(--oh-phone-top) + 4px) !important; bottom: calc(60px + var(--oh-phone-bottom)) !important; }
}
@media (max-width: 739px) and (orientation: landscape) {
  .hud-slots { left: calc(50% - 144px); transform: none; grid-template-columns: repeat(5, 44px); gap: 6px 4px; }
  .hud-bar-panel > .hud-bag-buttons { left: calc(50% + 100px); }
  #ohm-local-btn { left: calc(50% + 100px); }
}

/* Duas colunas de desktop deixavam a descrição da caçada com só 130px no telefone. */
@media (max-width: 480px) and (orientation: portrait) {
  #ui .hunt-body { flex-direction: column; overflow-y: auto !important; }
  #ui .hunt-browser { width: auto; min-width: 0; max-width: none; flex: 0 0 auto; border-right: 0; border-bottom: 1px solid var(--oh-line); }
  #ui .hunt-search { margin: 8px; }
  #ui .hunt-search input { width: 100%; min-height: 44px; }
  #ui .hunt-list { flex: 0 0 auto; height: 148px; padding: 0 8px 8px; }
  #ui .hunt-entry { min-height: 48px; }
  #ui .hunt-entry strong { font-size: 13px; }
  #ui .hunt-detail { flex: 0 0 auto; min-height: auto; padding: 12px; overflow: visible; }
  #ui .hunt-detail h3 { font: 700 20px/1.2 var(--oh-num); }
  #ui .hunt-detail p { font-size: 14px; line-height: 1.45; }
  #ui .hunt-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  #ui .hunt-tiers button { min-height: 44px; font-size: 12px; }
  #ui .hunt-detail-loot { min-width: 0; width: auto; }
  #ui .imbue-columns { display: flex; flex-direction: column; overflow-y: auto; }
  #ui .imbue-gear { display: flex; gap: 8px; width: auto; max-width: none; max-height: 156px; flex: 0 0 auto; overflow: auto; border-right: 0; border-bottom: 1px solid var(--oh-line); }
  #ui .imbue-item { min-width: 120px; flex: 0 0 auto; }
  #ui .imbue-main { flex: 0 0 auto; min-height: 0; height: auto; overflow: visible; }
  #ui .imbue-detail { flex: 0 0 auto; min-height: 72px; overflow: visible; }
  #ui .imbue-dock { flex: 0 0 auto; height: auto; max-height: none; overflow: visible; }
  #ui .imbue-dock-body { overflow: visible; }
  #ui .imbue-dock-note { height: auto; max-height: none; overflow: visible; }
  #ui .imbue-dock-tier button, #ui .imbue-slot { min-height: 44px; font-size: 12px; }
  #ui .imbuement-window p, #ui .imbue-dock-note, #ui .imbue-note,
  #ui .quick-sell-window .quick-sell-hint, #ui .quick-sell-window > footer { font-size: 13px; line-height: 1.45; }
}

/* Auditoria 08/09: medidas estáveis, texto legível e painéis de acompanhamento. */
@media (max-width: 1000px) {
  /* O observer do cliente divide a largura pelo zoom medido do próprio footer.
     Após rotação isso alternava 567,72/568,28px e disparava outro resize. */
  .footer-hud { width: 100vw !important; max-width: none !important; left: 0 !important; right: 0 !important; }
  :is(#ui, #game) .alerts-window .alerts-body { font-size: 14px; line-height: 1.5; }
  :is(#ui, #game) .alerts-body :is(p, li, a, button, label, small, strong) { font-size: 14px; line-height: 1.5; }
  :is(#ui, #game) .alerts-body .alerts-code { font-size: 20px; }

  :is(#ui, #game) .bestiary-tracker {
    position: fixed !important; left: var(--oh-phone-left) !important; right: auto !important;
    top: calc(var(--oh-phone-top) + 8px) !important; bottom: auto !important;
    width: min(280px, calc(100vw - 16px)) !important; height: auto !important;
    max-width: none !important; max-height: min(260px, calc(100dvh - 160px)) !important;
    min-width: 0; transform: none !important; box-sizing: border-box;
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--oh-ink-1); border: 1px solid var(--oh-gold-dark); border-radius: 8px;
  }
  :is(#ui, #game) .bestiary-tracker[hidden] { display: none !important; }
  :is(#ui, #game) .bestiary-tracker > header { min-height: 44px; padding: 0 4px 0 12px; flex: 0 0 auto; }
  :is(#ui, #game) .bestiary-tracker-title { font-size: 14px; }
  :is(#ui, #game) .bestiary-tracker-rows { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  :is(#ui, #game) .bestiary-tracker-row { min-height: 48px; }
  :is(#ui, #game) .bestiary-tracker-label, :is(#ui, #game) .bestiary-tracker-row-count { font-size: 12px; }
  :is(#ui, #game) .bestiary-tracker-remove, :is(#ui, #game) .bestiary-tracker-add { min-height: 44px; min-width: 44px; font-size: 13px; flex-shrink: 0; }
  :is(#ui, #game) .bestiary-tracker-picker { min-height: 0; overflow-y: auto; }
  :is(#ui, #game) .bestiary-tracker:has(.bestiary-tracker-picker:not([hidden])) { max-height: calc(100dvh - 128px) !important; }
  :is(#ui, #game) .bestiary-tracker:has(.bestiary-tracker-picker:not([hidden])) .bestiary-tracker-rows { display: none; }
  :is(#ui, #game) .bestiary-tracker-search { width: 100%; min-height: 44px; font-size: 16px; }
  :is(#ui, #game) .bestiary-tracker-option { min-height: 44px; font-size: 13px; }
  /* Com a Cyclopedia aberta, o tracker fica abaixo dos seus comandos. */
  :is(#ui, #game):has(.cyclopedia-window:not([hidden])) .bestiary-tracker { top: 116px !important; }
}
@media (max-width: 1000px) and (orientation: landscape) and (max-height: 520px) {
  :is(#ui, #game) .char-window:not([hidden]):has([data-main-tab="outfit"].active) {
    display: grid !important; grid-template-columns: minmax(150px, 1fr) minmax(250px, 1.4fr);
    grid-template-rows: 48px minmax(0, 1fr) 52px;
  }
  :is(#ui, #game) .char-window:not([hidden]):has([data-main-tab="outfit"].active) > header { grid-area: 1 / 1 / 2 / 2; min-height: 44px; gap: 4px; padding: 0 4px 0 10px; }
  :is(#ui, #game) .char-window:not([hidden]):has([data-main-tab="outfit"].active) > nav { grid-area: 1 / 2 / 2 / 3; margin: 0; padding: 2px 4px; }
  :is(#ui, #game) .char-window:not([hidden]):has([data-main-tab="outfit"].active) > footer { grid-column: 1 / -1; padding: 4px 8px; }
  :is(#ui, #game) .char-window .outfit-columns { grid-column: 1 / -1; grid-template-columns: 176px minmax(0, 1fr); gap: 8px; padding: 4px 8px; overflow: hidden !important; }
  :is(#ui, #game) .outfit-stylist { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
  :is(#ui, #game) .outfit-preview-box { order: -1; flex: 0 0 152px; width: 152px; height: 152px; margin: 0 auto; padding: 11px; }
  :is(#ui, #game) .outfit-preview { width: 128px; height: 128px; }
  :is(#ui, #game) .outfit-preview canvas { width: 128px; height: 128px; }
  :is(#ui, #game) .outfit-rotate { min-height: 44px; min-width: 44px; }
  :is(#ui, #game) .outfit-toggles { display: flex; flex-wrap: wrap; gap: 4px; }
  :is(#ui, #game) .outfit-toggles label { min-height: 44px; padding: 4px; font-size: 12px; }
  :is(#ui, #game) .outfit-wardrobe { min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
  :is(#ui, #game) .outfit-tabs { flex: 0 0 44px; margin: 0; }
  :is(#ui, #game) .outfit-tabs button { min-height: 44px; font-size: 12px; }
  :is(#ui, #game) .outfit-filters { display: flex; flex-wrap: wrap; gap: 4px; flex: 0 0 auto; }
  :is(#ui, #game) .outfit-filter { min-height: 44px; flex: 1 1 120px; padding: 4px; font-size: 11px; }
  :is(#ui, #game) .outfit-gender { min-height: 44px; flex: 1 1 160px; gap: 2px; }
  :is(#ui, #game) .outfit-gender label { min-height: 44px; padding: 3px; font-size: 11px; }
  :is(#ui, #game) .outfit-list, :is(#ui, #game) .outfit-mounts { flex: 1 1 0; min-height: 96px; overflow-y: auto; overscroll-behavior: contain; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  :is(#ui, #game) .outfit-card { min-height: 96px; font-size: 12px; }
}
