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

/* The Hub look (owner 2026-10-01: "the general hotbar and the hotbar add to hotbar modules could use an upgrade too
   visualy"): each slot a framed stone well, the key label on a dark tab so it reads over a bright icon, an empty slot
   dashed so a free key shows at a glance (HotbarManager.render sets .hotbar-empty), a gold edge on hover. Sizes and
   positions are unchanged. */
.hotbar-item:hover {
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(229, 196, 106, 0.85), 0 0 8px rgba(229, 196, 106, 0.35);
}

.hotbar-item.hotbar-success {
  animation: hotbar-success 0.2s ease-out;
}

.hotbar-item.hotbar-reject {
  animation: hotbar-reject 0.3s ease-out;
}

@keyframes hotbar-success {
  0% { box-shadow: 0px 0px 0px 0px rgba(255, 170, 0, 0); border-color: black; transform: scale(1); }
  40% { box-shadow: 0px 0px 14px 3px rgba(255, 170, 0, 0.8); border-color: #ffaa00; transform: scale(1.3); }
  100% { box-shadow: 0px 0px 0px 0px rgba(255, 170, 0, 0); border-color: black; transform: scale(1); }
}

@keyframes hotbar-reject {
  0%, 100% { transform: translateX(0); border-color: black; }
  15% { transform: translateX(-3px); border-color: #ff4444; }
  30% { transform: translateX(3px); border-color: #ff4444; }
  45% { transform: translateX(-2px); border-color: #ff3333; }
  60% { transform: translateX(2px); border-color: #ff3333; }
  75% { transform: translateX(-1px); border-color: #ff2222; }
  90% { transform: translateX(0); border-color: black; }
}

.hotbar-item {
  color: grey;
  display: flex;
  height: 32px;
  width: 32px;
  user-select: none;
  align-items: flex-end;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.9);
  border-radius: 5px;
  background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.09), rgba(0, 0, 0, 0.32) 72%), url("/png/bg3.png");
  margin: 2px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 1px 3px rgba(0, 0, 0, 0.65);
}

.hotbar-item.hotbar-empty {
  background: rgba(0, 0, 0, 0.28);
  border: 1px dashed rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
}

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

/* Text-hotkey preview label. Discriminator: data-text-label attribute is
   set by HotbarManager.__drawTextIcon when the slot is bound to text.
   Item-count and spell-cooldown uses of .hotbar-text don't set this
   attribute, so they keep the default bottom-anchored flex layout above. */
.hotbar-item .hotbar-text[data-text-label] {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  flex: none;
  pointer-events: none;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}

/* Two-line text-hotkey label: a tiny command tag (exiva / sio) stacked above
   the compressed target name, for name-targeted commands. Set by
   HotbarManager.__drawTextIcon. text-shadow is inherited from the parent. */
.hotbar-item .hotbar-text[data-text-label] .hk-cmd {
  display: block;
  font-size: 6px;
  font-weight: normal;
  line-height: 1;
  opacity: 0.8;
}
.hotbar-item .hotbar-text[data-text-label] .hk-name {
  display: block;
  font-size: 9px;
  font-weight: bold;
  line-height: 1;
  margin-top: 1px;
}

.hotbar-item .hotbar-key {
  font-size: 8px;
  font-weight: 700;
  line-height: 10px;
  letter-spacing: 0.02em;
  pointer-events: none;
  position: absolute;
  z-index: 11;
  left: 2px;                    /* inset from the rounded frame (owner 2026-10-01: "very close to the button edge") */
  top: 2px;
  padding: 0 3px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.62);
  color: #efe9da;
}

/* The Shift layer's labels (⇧F1..⇧F12) are a character longer: "⇧F10".."⇧F12" ran past the slot's right edge (owner
   2026-10-09, a screenshot). The arrow is drawn smaller and the tag a little tighter, so the longest fits with the
   same 2 px inset on the left; tools/hotbar-shift-label-test.js measures it. */
.hotbar-item.hotbar-bank2 .hotbar-key {
  padding: 0 2px;
  letter-spacing: -0.02em;
}
.hotbar-item .hotbar-key-shift {
  font-size: 6.5px;
  margin-right: 0.5px;
}

.hotbar-item.hotbar-empty .hotbar-key {
  background: transparent;
  color: #8a8478;
}

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

.hotbar-presets {
  display: grid;
  /* 6 presets: 3 wide x 2 tall keeps the same height as the old 2x2 */
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3px;
  margin-right: 8px;
  align-self: center;
}

.hotbar-preset-btn {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.9);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.28)), url("/png/bg3.png");
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color: #a39d90;
  text-shadow: 0 1px 0 #000;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  line-height: 16px;
  text-align: center;
  font-family: inherit;
}

.hotbar-preset-btn:hover {
  border-color: rgba(229, 196, 106, 0.75);
  color: #efe9da;
}

.hotbar-preset-btn.active {
  color: #e5c46a;
  border-color: #e5c46a;
}

/* Second hotbar bank (slots 12-23, fired by Shift+F1..F12). Only one bank is
   shown at a time; the #hotbar-bank-toggle button flips which. Bank 2 hidden by
   default; .show-bank2 on .hotbar swaps the visible set. Shift+F always fires
   bank 2 regardless of which is shown (offset lives in the key handler). */
.hotbar-item.hotbar-bank2 { display: none; }
.hotbar.show-bank2 .hotbar-item:not(.hotbar-bank2) { display: none; }
.hotbar.show-bank2 .hotbar-item.hotbar-bank2 { display: flex; }

.hotbar-bank-toggle {
  width: 18px;
  height: 38px;
  padding: 0;
  margin-left: 6px;
  border: 1px solid rgba(0, 0, 0, 0.9);
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.28)), url("/png/bg3.png");
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color: #cfc8b8;
  text-shadow: 0 1px 0 #000;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  align-self: center;
  flex: 0 0 auto;
}
.hotbar-bank-toggle:hover { border-color: rgba(229, 196, 106, 0.75); color: #efe9da; }
.hotbar-bank-toggle.active { color: #e5c46a; border-color: #e5c46a; }

.hotbar-item.rebinding {
  animation: hotbar-rebind 0.8s ease-in-out infinite;
}

@keyframes hotbar-rebind {
  0%, 100% { border-color: #555; }
  50% { border-color: #ffaa00; box-shadow: 0 0 8px #ffaa00; }
}

/* Regras proprias deste client (o modal Add to Hotbar, o botao de editar, o brilho .active) */
.hotbar > .hotbar-edit-btn {
  position: absolute;
  left: 8px;
  bottom: 8px;
}

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

#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;
}

#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;
}

#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%;
}

#hotbar-add-modal .hotbar-spell-disabled {
  opacity: 0.45;
  filter: grayscale(100%);
  cursor: not-allowed;
}

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

@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; }
}
