/* UI_13: keep the existing button/font sizes; each family occupies one slot. */
.hotbar-cell { position: relative; min-width: 0; }
.hotbar-cell .hotbar-group-toggle {
  position: absolute; right: 1px; top: 1px; z-index: 2; width: 23px; min-width: 0;
  height: 22px; min-height: 0; padding: 0; font-size: 14px; line-height: 20px;
  border-radius: 3px; pointer-events: auto; touch-action: none;
}
.hotbar-group-menu {
  position: fixed; z-index: 120; box-sizing: border-box; pointer-events: auto;
  overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  background: #142e26f7; border: 1px solid #b5b57f; border-radius: 7px;
  box-shadow: 0 6px 24px #0009; color: #eee5c9; padding: 10px;
}
.hotbar-group-menu header { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.hotbar-group-menu header strong { font-size: 16px; }
.hotbar-group-menu header button { width: 38px; height: 34px; padding: 0; font-size: 24px; }
.hotbar-group-resource { margin: 8px 0 10px; color: #e4cb89; font-size: 12px; line-height: 1.4; }
.hotbar-group-options { display: flex; flex-direction: column; gap: 6px; }
.hotbar-group-option { display: block; width: 100%; text-align: left; min-height: 64px; padding: 9px 10px; }
.hotbar-group-option strong, .hotbar-group-option small, .hotbar-group-option em { display: block; white-space: normal; }
.hotbar-group-option strong { font-size: 13px; margin-bottom: 4px; }
.hotbar-group-option small { font-size: 12px; line-height: 1.45; color: #d3ddcb; }
.hotbar-group-option em { font-style: normal; font-size: 11px; line-height: 1.4; color: #e4cb89; margin-top: 5px; }
.hotbar-group-option:disabled { opacity: .57; }
.ground-target-hint {
  position: absolute; left: 50%; bottom: 180px; transform: translateX(-50%);
  z-index: 35; max-width: calc(100% - 24px); pointer-events: auto;
  background: #153c32ee; color: #f1e4b6; border: 1px solid #bfc786; border-radius: 6px;
  padding: 7px 9px 7px 12px; font-size: 12px; display: flex; align-items: center; gap: 10px;
}
.ground-target-hint button { flex: 0 0 32px; width: 32px; height: 30px; padding: 0; font-size: 20px; }
#gameUI.mobile-hud .hotbar-cell { flex: 0 0 calc(54 * var(--mobile-unit, 1px)); width: calc(54 * var(--mobile-unit, 1px)); min-width: calc(54 * var(--mobile-unit, 1px)); height: calc(56 * var(--mobile-unit, 1px)); }
#gameUI.mobile-hud .hotbar-cell.empty { display: none; }
#gameUI.mobile-hud .hotbar-cell .hotbar-group-toggle { width: calc(27 * var(--mobile-unit, 1px)); height: calc(27 * var(--mobile-unit, 1px)); line-height: calc(25 * var(--mobile-unit, 1px)); }
#gameUI.mobile-hud .ground-target-hint { bottom: calc(142 * var(--mobile-unit, 1px)); font-size: calc(11 * var(--mobile-unit, 1px)); }
#gameUI.mobile-hud .hotbar-group-menu { padding: 8px; }
#gameUI.mobile-hud .hotbar-group-option { min-height: 66px; }

.hotbar-group-menu button { background: #294b38; border: 1px solid #8b9e6f; border-radius: 4px; color: #eee5c9; cursor: pointer; }
.hotbar-group-menu button:not(:disabled):hover { background: #385e44; }
.hotbar-group-menu button:disabled { background: #203b2e; cursor: default; }

/* UI_14: dismissal never scrolls out of sight, even with zero uses. */
.hotbar-group-menu { display: flex; flex-direction: column; overflow: hidden; }
.hotbar-group-menu[hidden] { display: none; }
.hotbar-group-menu > header, .hotbar-group-resource, .hotbar-group-current { flex: 0 0 auto; }
.hotbar-group-options { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.hotbar-group-current:empty { display: none; }
.hotbar-group-current .hotbar-group-option { min-height: 42px; margin-bottom: 8px; border-color: #e5ca7c; }
.hotbar-group-current .hotbar-group-option strong { margin: 0; }
.hotbar-group-current .hotbar-group-option em { margin-top: 2px; }
