/* Grelha e reposicionamento de edifícios ao estilo GGE */
.castle-iso-building[data-id] {
  touch-action: none;
  cursor: grab;
}

.castle-iso-building[data-id]:active {
  cursor: grabbing;
}

.castle-building-awaiting-drag {
  animation: castle-awaiting-drag .65s ease-in-out 3;
  filter:brightness(1.18) drop-shadow(0 0 10px #f4db72) !important;
}

.castle-grid-placement-active .castle-ground-tile {
  cursor: crosshair !important;
  color: transparent !important;
  background:rgba(232,240,213,.22) !important;
  outline:1px solid rgba(244,245,215,.52) !important;
  box-shadow:inset 0 0 7px rgba(36,51,29,.24) !important;
  filter:none !important;
  transform:none !important;
}

.castle-grid-placement-active .castle-ground-tile:nth-of-type(2n) {
  background:rgba(205,225,177,.17) !important;
}

.castle-grid-placement-active .castle-ground-tile.castle-cell-occupied {
  background:rgba(84,55,44,.48) !important;
  outline-color:rgba(84,44,35,.72) !important;
}

.castle-grid-placement-active .castle-ground-tile.castle-placement-footprint.castle-placement-valid {
  background:rgba(105,205,67,.78) !important;
  outline:2px solid #dfff9a !important;
  box-shadow:inset 0 0 12px rgba(31,92,18,.55),0 0 8px rgba(162,255,104,.35) !important;
}

.castle-grid-placement-active .castle-ground-tile.castle-placement-footprint.castle-placement-invalid {
  background:rgba(201,55,46,.76) !important;
  outline:2px solid #ffb0a3 !important;
  box-shadow:inset 0 0 12px rgba(91,18,14,.62),0 0 8px rgba(255,92,74,.32) !important;
}

.castle-grid-placement-active .castle-ground-tile span {
  display:none !important;
}

.castle-building-drag-source {
  opacity:.24 !important;
  filter:grayscale(.35) brightness(.72) !important;
  pointer-events:none !important;
}

.castle-building-drag-ghost {
  position:absolute !important;
  pointer-events:auto !important;
  cursor:grabbing !important;
  opacity:.93;
  transform:translateY(-7px) scale(1.025);
  transition:left .07s linear,top .07s linear,filter .12s,opacity .12s !important;
  animation:none !important;
}

.castle-building-drag-ghost::before {
  opacity:1 !important;
  outline-width:3px !important;
}

.castle-building-drag-ghost.is-valid-placement {
  filter:drop-shadow(0 10px 7px rgba(15,38,14,.65)) drop-shadow(0 0 9px rgba(125,239,82,.65)) !important;
}

.castle-building-drag-ghost.is-valid-placement::before {
  background:rgba(111,211,71,.27) !important;
  outline-color:#bff58d !important;
}

.castle-building-drag-ghost.is-invalid-placement {
  filter:grayscale(.28) sepia(.22) drop-shadow(0 10px 7px rgba(38,12,10,.68)) drop-shadow(0 0 9px rgba(236,67,52,.72)) !important;
}

.castle-building-drag-ghost.is-invalid-placement::before {
  background:rgba(207,57,45,.32) !important;
  outline-color:#ff9d91 !important;
}

.castle-building-new-ghost {
  z-index:2800 !important;
}

.castle-placement-help {
  position:absolute;
  left:50%;
  top:78px;
  z-index:3100;
  width:min(540px,calc(100% - 180px));
  transform:translateX(-50%);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:9px 14px;
  border:2px solid #8e6d2e;
  border-radius:8px;
  background:linear-gradient(#f0dfb4,#ceb17a);
  color:#49351e;
  box-shadow:0 6px 15px #0008,inset 0 1px #fff8d9;
  pointer-events:none;
}

.castle-placement-help strong {
  color:#6a4216;
  white-space:nowrap;
}

.castle-placement-help span {
  font-size:11px;
}

.castle-placement-toolbar {
  position:absolute;
  left:50%;
  bottom:26px;
  z-index:3150;
  min-width:330px;
  transform:translateX(-50%);
  display:grid;
  grid-template-columns:58px 1fr 58px;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border:2px solid #6f542c;
  border-radius:12px;
  background:linear-gradient(#ead6a9,#c7a36b);
  box-shadow:0 8px 20px #0009,inset 0 1px #fff4cf;
}

.castle-placement-toolbar > div {
  display:flex;
  flex-direction:column;
  text-align:center;
  color:#4b341c;
}

.castle-placement-toolbar > div strong {
  font-size:14px;
}

.castle-placement-toolbar > div span {
  margin-top:2px;
  font-size:10px;
  opacity:.82;
}

.castle-placement-toolbar button {
  width:54px;
  height:54px;
  border:3px solid rgba(255,255,255,.58);
  border-radius:50%;
  color:white;
  cursor:pointer;
  font:900 26px/1 Segoe UI,Arial,sans-serif;
  text-shadow:0 2px 2px #0007;
  box-shadow:0 4px 8px #0008,inset 0 0 0 3px rgba(0,0,0,.2);
}

.castle-placement-cancel {
  background:linear-gradient(#dd553d,#9f261f);
}

.castle-placement-confirm {
  background:linear-gradient(#85d33c,#3a941f);
}

.castle-placement-toolbar button:hover:not(:disabled) {
  filter:brightness(1.12);
  transform:translateY(-1px);
}

.castle-placement-toolbar button:disabled {
  cursor:not-allowed;
  filter:grayscale(.9) brightness(.7);
  opacity:.65;
}

@keyframes castle-awaiting-drag {
  0%,100% { transform:translateY(0); }
  50% { transform:translateY(-7px) scale(1.025); }
}

@media (max-width:850px) {
  .castle-placement-help {
    top:112px;
    width:calc(100% - 30px);
    flex-direction:column;
    gap:2px;
    text-align:center;
  }

  .castle-placement-toolbar {
    min-width:min(330px,calc(100% - 24px));
  }
}
/* v0.1.135 — construção exige posicionamento antes de confirmar; mover permitido durante melhorias. */
