/* Skillbar V6 — port visual do protótipo, isolado no HUD real. */
.move-dock.skillbar-shell,
.move-dock.skillbar-shell *,
#skill-rotation-panel.rotation-modal-backdrop,
#skill-rotation-panel.rotation-modal-backdrop * {
  box-sizing: border-box;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

.move-dock.skillbar-shell button {
  padding: 1px 6px;
  border-radius: 0;
  color: inherit;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.move-dock.skillbar-shell {
  position: absolute;
  left: 50%;
  bottom: 50px;
  width: auto;
  height: auto;
  min-height: auto;
  display: inline-block;
  gap: normal;
  padding: 3px;
  overflow: visible;
  transform: translateX(-50%);
  pointer-events: auto;
  border: 1px solid #2d6382;
  border-radius: 5px;
  background: #06131d;
  box-shadow: 0 7px 15px rgba(0, 0, 0, .32), inset 0 0 0 1px rgba(116, 184, 220, .03);
  backdrop-filter: none;
  color: #eaf3f8;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

.move-dock.skillbar-shell.hidden { display: none; }

.move-dock.skillbar-shell::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #5ba4ce 20%, #5ba4ce 80%, transparent);
  opacity: .65;
}

.skillbar-rail {
  height: 54px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  background: linear-gradient(180deg, #0a2233 0%, #071925 100%);
}

.utility-button {
  width: 43px;
  min-width: 43px;
  display: grid;
  place-items: center;
  padding: 1px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #65879b;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}

.utility-button svg { width: 17px; height: 17px; }
.utility-button:hover { color: #a8c7d9; background: rgba(74, 127, 157, .1); }
.utility-button:focus-visible { outline: 1px solid #6d9ab4; outline-offset: -2px; }

.rail-separator {
  width: 1px;
  margin: 8px 7px;
  flex: 0 0 1px;
  background: #21445a;
}

.skills-group {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 4px 0;
}

.skill-slot.move-button {
  --cooldown-progress: 0;
  width: 52px;
  height: 46px;
  min-width: 52px;
  min-height: auto;
  flex: 0 0 52px;
  position: relative;
  display: block;
  gap: normal;
  overflow: hidden;
  padding: 1px 6px;
  border: 0;
  border-left: 1px solid #1b3b4f;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #eaf3f8;
  cursor: pointer;
  opacity: 1;
  filter: none;
  transform: none;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.skill-slot.move-button:disabled { cursor: not-allowed; opacity: 1; }
.skill-slot.move-button.locked::after { content: none; display: none; }

.skills-group .skill-slot:first-child { border-left: 0; }
.skills-group .skill-slot + .skill-slot { border-left: 1px solid #1b3b4f; }

.skill-slot.move-button:hover:not(.skill-slot-locked),
.skill-slot.move-button:focus-visible:not(.skill-slot-locked) {
  border-color: #1b3b4f;
  background: linear-gradient(180deg, rgba(37, 84, 111, .18), rgba(18, 50, 69, .08));
  box-shadow: inset 0 -2px #4382a7;
  filter: none;
  transform: none;
}

.skill-slot.move-button:active:not(.skill-slot-locked),
.skill-slot.move-button.is-activating:not(.skill-slot-locked) {
  background: rgba(24, 65, 89, .15);
  transform: none;
}

.skill-slot.move-button.rotation-blocked { filter: none; }
.skill-slot.move-button.rotation-blocked::before { display: none; }

.skill-slot .skill-icon {
  position: absolute;
  inset: 5px 6px 10px;
  z-index: 1;
  width: auto;
  height: auto;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  margin: 0;
  transform: none;
}

.skill-slot .skill-icon::before {
  content: "";
  width: 30px;
  height: 30px;
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(76, 158, 198, .11), rgba(76, 158, 198, .04) 48%, transparent 72%);
  pointer-events: none;
}

.skill-slot.move-button .move-skill-preview-frame .move-skill-preview,
.skill-slot.move-button .move-skill-preview-frame .move-skill-preview-fallback {
  position: static !important;
  z-index: 1;
  inset: auto;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  grid-area: 1 / 1;
  margin: auto;
  object-fit: contain;
  object-position: center;
  image-rendering: pixelated;
  filter: none;
  transform: none;
}

.skill-slot.move-button .move-skill-preview-frame .move-skill-preview-fallback { width: 100%; height: 100%; }

.cooldown-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: 0;
  background: rgba(4, 11, 16, .68);
  transform: scaleY(0);
  transform-origin: bottom;
  pointer-events: none;
}

.skill-slot.is-cooling .cooldown-overlay { transform: scaleY(var(--cooldown-progress, 1)); }

.skill-slot.move-button .cooldown-text {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: 16px;
  bottom: auto;
  height: auto;
  display: block;
  color: #edf7fb;
  font-size: 9px;
  line-height: 1;
  font-style: normal;
  font-weight: 700;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  letter-spacing: normal;
  text-align: center;
  text-shadow: 0 1px 2px #000;
  border-radius: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}

.skill-slot.is-cooling .cooldown-text { opacity: 1; }

.skill-slot.move-button .hotkey {
  min-width: 12px;
  height: 11px;
  position: absolute;
  z-index: 7;
  right: 3px;
  bottom: 1px;
  display: grid;
  place-items: center;
  padding: 0 2px;
  border: 0;
  border-radius: 2px;
  background: #07141d;
  color: #c7d8e1;
  font-size: 6.5px;
  line-height: 1;
  font-weight: 800;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  box-shadow: none;
}

.skill-slot:not(.is-cooling):not(.skill-slot-locked)::after {
  content: "";
  width: 3px;
  height: 3px;
  position: absolute;
  left: 4px;
  bottom: 4px;
  border-radius: 50%;
  background: #52ce83;
}

.slot-edge { display: none; }

.skill-slot.move-button.skill-slot-locked {
  color: #71838d;
  background: transparent;
  cursor: default;
  opacity: 1;
}

.skill-slot.move-button.skill-slot-locked:hover {
  background: rgba(74, 89, 98, .07);
  box-shadow: inset 0 -2px #4d626e;
}

.skill-slot-locked .skill-icon { filter: saturate(.25); }
.skill-slot-locked .move-skill-preview,
.skill-slot-locked .move-skill-preview-fallback { opacity: .28; filter: grayscale(.9) saturate(.25); }

.lock-symbol {
  width: 18px;
  height: 20px;
  position: relative;
  z-index: 3;
  grid-area: 1 / 1;
}

.lock-shackle {
  width: 12px;
  height: 10px;
  position: absolute;
  left: 3px;
  top: 0;
  border: 2px solid #96a8b1;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}

.lock-body {
  width: 16px;
  height: 12px;
  position: absolute;
  left: 1px;
  bottom: 0;
  border: 1px solid #7b8f99;
  border-radius: 2px;
  background: #5d707a;
  box-shadow: inset 0 1px rgba(255, 255, 255, .06);
}

.lock-body::after {
  content: "";
  width: 2px;
  height: 4px;
  position: absolute;
  left: 6px;
  top: 4px;
  border-radius: 2px;
  background: #24353d;
}

.locked-level {
  min-width: 31px;
  min-height: 14px;
  position: absolute;
  z-index: 6;
  top: 1px;
  right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1px solid #587181;
  border-radius: 3px;
  background: #07131b;
  color: #f1f6f9;
  font-size: 7.2px;
  line-height: 1;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}

.skillbar-bottom-line {
  height: 1px;
  margin: 3px 5px 0;
  background: linear-gradient(90deg, transparent, #2b6483 20%, #2b6483 80%, transparent);
  opacity: .42;
}

.skill-tooltip {
  width: 218px;
  position: absolute;
  z-index: 100;
  display: none;
  padding: 9px 10px 8px;
  border: 1px solid #2c6485;
  border-radius: 5px;
  background: linear-gradient(180deg, #0b2638, #071b29);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .38), inset 0 1px rgba(255, 255, 255, .035);
  color: #eaf3f8;
  pointer-events: none;
}

.skill-tooltip.is-visible { display: block; }

.skill-tooltip::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, #59a9d5, rgba(89, 169, 213, .2) 72%, transparent);
}

.skill-tooltip-head {
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding-bottom: 6px;
  border-bottom: 1px solid #1d435a;
}

.skill-tooltip-head strong {
  min-width: 0;
  overflow: hidden;
  color: #f2f7fa;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-tooltip-type {
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border: 1px solid #38769c;
  border-radius: 3px;
  background: #0d2b40;
  color: #9bd9f4;
  font-size: 6.5px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .03em;
}

.skill-tooltip-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 8px 0 7px;
}

.skill-tooltip-stats > div { min-width: 0; padding: 0 7px; border-right: 1px solid #183a50; }
.skill-tooltip-stats > div:first-child { padding-left: 0; }
.skill-tooltip-stats > div:last-child { padding-right: 0; border-right: 0; }
.skill-tooltip-stats span { display: block; margin-bottom: 4px; color: #698698; font-size: 6px; line-height: 1; font-weight: 800; letter-spacing: .05em; }
.skill-tooltip-stats strong { display: block; color: #dbe9f0; font-size: 9px; line-height: 1; font-weight: 700; }
.skill-tooltip-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.skill-tooltip-category {
  min-height: 16px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border: 1px solid #315a73;
  border-radius: 3px;
  background: #0a1f2e;
  color: #8ba9ba;
  font-size: 6px;
  line-height: 1;
  font-weight: 800;
}

.skill-tooltip-lock-text { color: #d5ad55; font-size: 6.5px; line-height: 1; font-weight: 700; }

.skill-tooltip-caret {
  width: 10px;
  height: 10px;
  position: absolute;
  left: var(--caret-left, 50%);
  bottom: -6px;
  border-right: 1px solid #2c6485;
  border-bottom: 1px solid #2c6485;
  background: #071b29;
  transform: translateX(-50%) rotate(45deg);
}

.skill-tooltip.is-below .skill-tooltip-caret {
  top: -6px;
  bottom: auto;
  border: 0;
  border-top: 1px solid #2c6485;
  border-left: 1px solid #2c6485;
}

.ditto-skills-group { padding-inline: 4px; gap: 4px; }
.move-button.ditto-utility-slot { width: 112px; height: 46px; min-height: 46px; }

/* Modal de rotação V6. */
.skill-rotation-overlay.rotation-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 10, 14, .68);
  backdrop-filter: blur(2px);
}

.skill-rotation-overlay.rotation-modal-backdrop.hidden { display: none; }

.skill-rotation-window.rotation-modal {
  width: min(620px, calc(100vw - 28px));
  max-height: none;
  display: block;
  overflow: hidden;
  border: 1px solid #2f6687;
  border-radius: 7px;
  background: #071723;
  box-shadow: 0 24px 52px rgba(0, 0, 0, .48), inset 0 0 0 1px rgba(116, 184, 220, .035);
  color: #eaf3f8;
}

.skill-rotation-header.rotation-modal-header {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px 0 16px;
  border-bottom: 1px solid #28516a;
  background: linear-gradient(180deg, #103049, #0b2234);
  position: static;
}

.skill-rotation-header .rotation-modal-title-group { display: flex; align-items: center; gap: 10px; }
.skill-rotation-header .rotation-modal-title-group > div { display: block; }
.skill-rotation-header .rotation-modal-mark { width: 28px; height: 28px; display: grid; place-items: center; color: #61b5df; }
.skill-rotation-header .rotation-modal-mark svg { width: 21px; height: 21px; }
.skill-rotation-header .rotation-modal-eyebrow { display: block; margin-bottom: 4px; color: #6f91a6; font-size: 7px; line-height: 1; font-weight: 800; letter-spacing: .13em; }
.skill-rotation-header.rotation-modal-header h2 { margin: 0; color: #eef5f9; font-size: 16px; line-height: 1; font-weight: 700; }

.rotation-modal-close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #7895a6;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.rotation-modal-close:hover { color: #d7e6ee; }
.rotation-modal-body { min-height: auto; padding: 0 12px 12px; overflow: visible; }

.skill-rotation-intro.rotation-pokemon-summary {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 2px;
  border-bottom: 1px solid #1d4055;
  background: transparent;
}

.rotation-pokemon-copy { min-width: 0; }
.rotation-pokemon-line { display: flex; align-items: center; gap: 7px; color: #a7bfcd; font-size: 8px; }
.rotation-pokemon-line strong { color: #e1edf3; font-size: 11px; font-weight: 700; }
.rotation-pokemon-mini { color: #e6a742; font-size: 8px; }
.rotation-pokemon-copy p { margin: 5px 0 0; color: #617d8f; font-size: 8px; line-height: 1.4; }

#skill-rotation-dirty.rotation-change-state {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #35556a;
  border-radius: 3px;
  color: #7892a2;
  background: #091b28;
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: .04em;
  gap: normal;
}

#skill-rotation-dirty.rotation-change-state.has-changes { border-color: #756129; color: #e1b652; background: rgba(73, 57, 20, .16); }

.rotation-list-header {
  min-height: 27px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 175px;
  align-items: end;
  gap: 10px;
  padding: 0 8px 5px;
  color: #56778b;
  font-size: 6px;
  font-weight: 800;
  letter-spacing: .09em;
}

.rotation-list-header span:last-child { text-align: right; }

.skill-rotation-list.rotation-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  overflow: visible;
  list-style: none;
}

.skill-rotation-item.rotation-row {
  min-height: 57px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 175px;
  align-items: center;
  gap: 10px;
  position: relative;
  padding: 7px 8px;
  border: 1px solid #27536e;
  border-radius: 5px;
  background: linear-gradient(180deg, #0e2a3f, #0a2132);
  box-shadow: none;
  opacity: 1;
  transition: border-color 120ms ease, background 120ms ease;
}

.skill-rotation-item.rotation-row:hover { border-color: #39779c; background: linear-gradient(180deg, #11334b, #0c283b); }
.skill-rotation-item.rotation-row.dragging { opacity: .55; transform: none; }
.skill-rotation-item.rotation-row.drag-over { border-color: #4c8fb7; box-shadow: 0 0 0 1px rgba(76, 143, 183, .3); }
.skill-rotation-item.rotation-row.blocked { border-color: #425865; background: #17242b; opacity: 1; }
.skill-rotation-item.rotation-row.level-locked { filter: saturate(.55); }

.rotation-order { display: flex; align-items: center; gap: 9px; }
.rotation-drag { width: 14px; display: grid; gap: 2px; opacity: .55; cursor: grab; }
.rotation-drag i { width: 3px; height: 3px; border-radius: 50%; background: #5d869d; box-shadow: 5px 0 #5d869d; }
.rotation-index { min-width: 20px; color: #a7bdca; font-size: 11px; font-weight: 700; text-align: center; }
.rotation-skill-main { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 9px; align-items: center; }
.rotation-skill-icon { width: 36px; height: 36px; display: grid; place-items: center; position: relative; }
.rotation-skill-icon img { width: 36px; height: 36px; object-fit: contain; image-rendering: pixelated; }
.rotation-skill-copy { min-width: 0; }
.rotation-skill-copy strong { display: block; overflow: hidden; color: #d8e7ef; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.rotation-skill-meta { display: flex; align-items: center; gap: 7px; margin-top: 4px; color: #698697; font-size: 6.5px; font-weight: 700; }
.rotation-skill-meta .locked { color: #d8ad52; }
.rotation-controls { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.skill-rotation-order-actions { display: flex; gap: 5px; }

.skill-rotation-order-actions .rotation-arrow {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid #315d77;
  border-radius: 4px;
  background: #0b2030;
  color: #a7c1d0;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.skill-rotation-order-actions .rotation-arrow:hover:not(:disabled) { border-color: #4c84a8; background: #103047; color: #e1eef5; }
.skill-rotation-order-actions .rotation-arrow:disabled { color: #3f5a69; border-color: #254657; opacity: 1; cursor: default; }

.skill-rotation-toggle.rotation-toggle {
  min-width: 88px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid #2f7952;
  border-radius: 4px;
  background: #0f3c29;
  color: #9ee6b7;
  font-size: 6.5px;
  font-weight: 800;
  cursor: pointer;
}

.skill-rotation-toggle.rotation-toggle::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #54dc89; box-shadow: 0 0 5px rgba(84, 220, 137, .26); }
.skill-rotation-toggle.rotation-toggle.is-off { border-color: #425865; background: #17242b; color: #7c909b; }
.skill-rotation-toggle.rotation-toggle.is-off::before { background: #607580; box-shadow: none; }

.skill-rotation-error { min-height: 0; padding: 0 8px; color: #ff8f8f; font-size: 9px; font-weight: 800; }
.skill-rotation-error:not(:empty) { min-height: 29px; display: flex; align-items: center; margin: 0 -12px 6px; padding-inline: 14px; border-bottom: 1px solid #5c2930; background: #32151b; }

.skill-rotation-footer.rotation-modal-footer {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid #28516a;
  background: #081824;
}

.rotation-footer-actions { display: flex; gap: 7px; }
.skill-rotation-footer .rotation-action { min-height: 34px; padding: 0 12px; border-radius: 4px; font-size: 7px; font-weight: 800; line-height: normal; letter-spacing: normal; text-transform: uppercase; cursor: pointer; }
.skill-rotation-footer .rotation-action.secondary { border: 1px solid #37637d; background: #0d2638; color: #afc8d6; }
.skill-rotation-footer .rotation-action.secondary:hover { background: #113149; }
.skill-rotation-footer .rotation-action.primary { border: 1px solid #3f9563; background: linear-gradient(180deg, #2d8a55, #207044); color: #f2fff7; box-shadow: inset 0 1px rgba(255, 255, 255, .08); }
.skill-rotation-footer .rotation-action.primary:hover { filter: brightness(1.07); }
.skill-rotation-footer .rotation-action:disabled { opacity: .55; cursor: wait; }

@media (max-width: 650px), (max-width: 900px) and (max-height: 560px) {
  .move-dock.skillbar-shell {
    bottom:max(46px,env(safe-area-inset-bottom));
    max-width:calc(100vw - 8px);
    transform:translateX(-50%) scale(.9);
    transform-origin:center bottom;
  }
  .skill-rotation-overlay.rotation-modal-backdrop {
    align-items:stretch;
    padding:
      max(8px,env(safe-area-inset-top))
      max(8px,env(safe-area-inset-right))
      max(8px,env(safe-area-inset-bottom))
      max(8px,env(safe-area-inset-left));
  }
  .skill-rotation-window.rotation-modal {
    width:100%;
    height:100%;
    max-height:calc(100dvh - 16px);
    display:grid;
    grid-template-rows:auto minmax(0,1fr) auto;
  }
  .rotation-modal-body {
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
  }
  .rotation-list-header { display: none; }
  .skill-rotation-item.rotation-row { grid-template-columns: 42px minmax(0, 1fr); }
  .rotation-controls { grid-column: 1 / -1; justify-content: flex-end; padding-top: 7px; border-top: 1px solid #1d4055; }
  .rotation-order { justify-content: center; }
  .skill-rotation-order-actions .rotation-arrow,
  .skill-rotation-toggle.rotation-toggle,
  .rotation-modal-close,
  .skill-rotation-footer .rotation-action {
    min-height:44px;
  }
  .skill-rotation-order-actions .rotation-arrow,
  .rotation-modal-close {
    width:44px;
    height:44px;
  }
  .skill-rotation-toggle.rotation-toggle { min-width:104px; }
  .skill-rotation-footer.rotation-modal-footer {
    padding-bottom:max(10px,env(safe-area-inset-bottom));
  }
}

@media (max-width: 480px) {
  .skill-rotation-header.rotation-modal-header { min-height:58px; }
  .skill-rotation-intro.rotation-pokemon-summary {
    align-items:flex-start;
    flex-direction:column;
    gap:7px;
  }
  .skill-rotation-footer.rotation-modal-footer {
    align-items:stretch;
    flex-direction:column;
  }
  .rotation-footer-actions {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .rotation-footer-actions .rotation-action.primary:last-child { grid-column:1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .skill-slot.move-button,
  .skill-rotation-item.rotation-row { transition: none; }
}
