/* Phone and touch fixes. Every rule sits behind a narrow-screen or coarse-pointer query so desktop stays as designed. */

/* iOS zooms into any form field below 16px when it gets focus. */
@media (pointer: coarse), (max-width: 620px) {
  :is(input:not([type="radio"]):not([type="checkbox"]):not([type="range"]), select, textarea) { font-size: 16px; }
}

@media (max-width: 830px) {
  /* The header wraps to two rows here; keep it opaque behind the nav so scrolled content can't show through the labels. */
  .hud { background: linear-gradient(180deg, #181120 0%, #181120f7 86%, #18112000 100%); }
}

@media (max-width: 780px) {
  /* The chest hall stacks into a long page, so pin the single-chest reveal to the screen instead of the page middle. */
  .loot-reveal:not([data-batch="true"]) { position: fixed; inset: var(--hud-height) 0 0; }
  .banner-draw { width: 100%; }
  #loot-inspector { scroll-margin-top: calc(var(--hud-height) + 8px); }
}

@media (max-width: 620px) {
  /* Keep the Schmiedebuch button clear of the last row of upgrades. */
  .upgrade-shelf { padding-bottom: 58px; }
  .logbook[open] { left: 12px; right: 12px; width: auto; }

  /* A table grows taller than the scene, so stack it below the title instead of anchoring it to the bottom edge. */
  .tavern-world:has(.party-room:not([hidden])) { display: block; height: auto; min-height: 0; padding: 332px 14px 38px; }
  .tavern-world:has(.party-room:not([hidden])) .party-tavern { position: relative; inset: auto; }
  .tavern-world .party-room { position: relative; inset: auto; }
  .tavern-world .party-room .party-controls { width: 100%; }
}
