.hotbar {
  height: 48px;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

/* O botão de edição sai do fluxo para não deslocar os 12 slots do centro.
   O bloco contido é .main .middle (position: relative). Escopado ao desktop:
   o botão mobile (#mobile-actions > .hotbar-edit-btn) não é afetado. */
.hotbar > .hotbar-edit-btn {
  position: absolute;
  left: 8px;
  bottom: 8px;
}

.hotbar-item:hover {
  cursor: pointer;
  box-shadow: 0px 0px 10px 0px white;
}

.active {
  animation: fade 0.25s ease-in-out;
}

@keyframes fade {
  0% {   box-shadow: 0px 0px 0px 0px white; }
  50% {   box-shadow: 0px 0px 10px 0px white; }
  100% {   box-shadow: 0px 0px 0px 0px white; }
}

.hotbar-item {
  color: grey;
  display: flex;
  height: 32px;
  width: 32px;
  user-select: none;
  align-items: flex-end;
  justify-content: center;
  border: 1px solid black;
  background-image: url("/png/bg2.png");
  margin: 2px;
  position: relative;
  box-shadow: 0px 0px 10px 0px black;
}

.hotbar-item .hotbar-text {
  flex: 1 1 auto;
  z-index: 10;
  font-size: 8px;
  color: white;
  text-align: center;
}

.hotbar-item .hotbar-key {
  font-size: 8px;
  pointer-events: none;
  position: absolute;
  left: 2px;
  top: 2px;
}

.hotbar-item canvas {
  position: absolute;
  pointer-events: none;
  width: 32px;
  height: 32px;
}

/* Preset bar removida (ROADMAP em docs/local/VIEWPORT-dock.md):
 * markup + regras apagados. A lógica de presets continua no
 * HotbarManager (storage intacto) para a volta futura. */

/* Add/Edit modal (Minibia pattern): abas + listas reaproveitando o
 * estilo das linhas do spellbook (.spellbook-wrapper). */

#hotbar-add-modal {
  width: 420px;
  max-width: 92vw;
}

#hotbar-add-modal .hotbar-add-list {
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  background-image: url("/png/bg.png");
  width: 400px;
  max-width: 100%;
}

#hotbar-add-modal .hotbar-add-list .empty-note {
  padding: 8px;
  font-size: 12px;
  color: grey;
}

/* .hidden global é visibility-based: esconder de verdade aqui */
#hotbar-add-modal .hotbar-add-pane.hidden,
#hotbar-add-modal #hotbar-add-io.hidden {
  display: none;
}

#hotbar-add-modal input[type="text"],
#hotbar-add-modal textarea {
  color: white;
  border: 1px solid black;
  background-color: #111;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

#hotbar-add-actions-pane {
  display: flex;
  gap: 8px;
  padding: 12px 4px;
}

#hotbar-add-actions-pane.hidden {
  display: none;
}

.hotbar-edit-btn {
  background: transparent;
  border: 1px solid #555;
  border-radius: 4px;
  color: #aaa;
  cursor: pointer;
  font-size: 16px;
  height: 32px;
  width: 32px;
  margin: 2px;
  padding: 0;
}

.hotbar-edit-btn:hover {
  border-color: white;
  color: white;
}

.hotbar-edit-btn.active {
  border-color: gold;
  color: gold;
  box-shadow: 0px 0px 10px 0px gold;
}

.hotbar.edit-mode .hotbar-item,
#mobile-hotbar.edit-mode .mobile-hotbar-slot {
  border: 1px dashed gold;
}

/* Add/Edit modal: Minibia item entries, use-mode buttons, action rows */
#hotbar-add-modal .hotbar-item-entry {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  cursor: pointer;
  border: 1px solid transparent;
}

#hotbar-add-modal .hotbar-item-entry:hover {
  background: #222;
}

#hotbar-add-modal .hotbar-item-entry.selected {
  border-color: gold;
  background: #2a2a1a;
}

#hotbar-add-modal .hotbar-item-entry .item-label {
  font-size: 12px;
  flex: 1;
}

#hotbar-add-modal .hotbar-mode-btn {
  margin: 2px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

#hotbar-add-modal .hotbar-action-help {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

#hotbar-add-modal .hotbar-action-desc {
  flex-basis: 100%;
  font-size: 11px;
  color: #bbb;
  padding: 2px 6px 6px 44px;
}

#hotbar-add-actions-pane {
  flex-direction: column;
  align-items: stretch;
}

#hotbar-add-actions-pane .hotbar-add-list {
  width: 100%;
}

/* Aba Spell ordenada por level: indisponível (level/vocação/ml abaixo
 * do requisito) em cinza desabilitada, sem assign no clique */
#hotbar-add-modal .hotbar-spell-disabled {
  opacity: 0.45;
  filter: grayscale(100%);
  cursor: not-allowed;
}

#hotbar-add-modal .hotbar-spell-disabled span {
  color: #888;
}

