/* World-map power-ups (services/worldMapItems.js): the mini card drawn on a
   protected hex, and the Power-ups section of the hex panel.

   The card is a tiny playing card, not another round status pip: it reads as
   "something was played here", and keeps clear of the badge column
   (top-right) and the chest (bottom-left) by sitting bottom-right. */

.worldmap-hex-item-cards {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: flex;
  z-index: 3;
  pointer-events: auto;
}

.worldmap-item-card {
  --item-card-edge: #e8c766;
  --item-card-face: linear-gradient(160deg, #3f5fb8 0%, #22306e 100%);
  --item-card-glow: rgba(120, 160, 255, 0.65);
  width: 13px;
  height: 18px;
  border-radius: 2px;
  border: 1px solid var(--item-card-edge);
  background: var(--item-card-face);
  color: #fdf6dc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 6px var(--item-card-glow);
  flex: none;
}

.worldmap-item-card-shield {
  --item-card-face: linear-gradient(160deg, #5a7de0 0%, #26357a 100%);
  --item-card-glow: rgba(120, 160, 255, 0.7);
}

.worldmap-item-card-ward {
  --item-card-face: linear-gradient(160deg, #c2862e 0%, #6b3f10 100%);
  --item-card-glow: rgba(255, 196, 90, 0.65);
}

.worldmap-item-card-claim {
  --item-card-face: linear-gradient(160deg, #4f9a5c 0%, #22522c 100%);
  --item-card-glow: rgba(120, 220, 140, 0.5);
}

/* Two cards on one hex fan out like a hand. */
.worldmap-hex-item-cards .worldmap-item-card {
  transform: rotate(8deg);
  animation: worldmapItemCardGlow 2.6s ease-in-out infinite;
}

.worldmap-hex-item-cards .worldmap-item-card + .worldmap-item-card {
  margin-left: -5px;
  transform: rotate(-6deg) translateY(-2px);
}

@keyframes worldmapItemCardGlow {
  0%, 100% { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 4px var(--item-card-glow); }
  50% { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 9px var(--item-card-glow); }
}

@media (prefers-reduced-motion: reduce) {
  .worldmap-hex-item-cards .worldmap-item-card {
    animation: none;
  }
}

/* The protection is the one thing a visitor must not miss, so the card stays
   on the hex when territory blobs hide the per-hex castles and pips. */
.worldmap-blobs-on .worldmap-hex-owned:not(.is-blob-revealed) .worldmap-hex-item-cards {
  opacity: 1;
}

/* Bigger card in the hex panel. */
.worldmap-item-card-lg {
  width: 26px;
  height: 36px;
  border-radius: 4px;
  border-width: 2px;
  font-size: 13px;
}

/* --- Hex panel -------------------------------------------------------------- */

.worldmap-item-active-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
}

.worldmap-item-active {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.3;
}

.worldmap-item-active-shield {
  background: rgba(70, 105, 210, 0.16);
  border: 1px solid rgba(110, 145, 240, 0.45);
}

.worldmap-item-active-ward {
  background: rgba(200, 140, 50, 0.16);
  border: 1px solid rgba(230, 175, 80, 0.45);
}

.worldmap-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.worldmap-item-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.worldmap-item-row-empty .worldmap-item-card {
  filter: grayscale(0.8) brightness(0.8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.worldmap-item-body {
  flex: 1;
  min-width: 0;
}

.worldmap-item-name {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.worldmap-item-count {
  font-weight: 600;
  font-size: 0.8rem;
  opacity: 0.75;
}

.worldmap-item-desc,
.worldmap-item-note,
.worldmap-item-hint {
  margin: 4px 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
}

.worldmap-item-note {
  opacity: 0.7;
  font-style: italic;
}

.worldmap-item-hint {
  margin-top: 10px;
  opacity: 0.85;
}

.worldmap-item-use-btn {
  margin-top: 8px;
  font-size: 0.85rem;
  padding: 6px 12px;
}

[data-theme="light"] .worldmap-item-row {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

/* In the hub, line up with the owner card and stat meters. */
.worldmap-hex-hub > .worldmap-item-active-list {
  margin: 8px 12px;
}
