/**
 * Mini Power Cards Component - Catan-style
 * Compact power card display along bottom of screen
 * Shows one card at a time with navigation
 * Positioned on left side, before radial menu
 */

/* Container - fixed to bottom LEFT with paging buttons */
.cmp-mini-power-cards {
  position: fixed;
  bottom: 0;
  right: 125px;
  transform: none; /* No centering */
  width: auto;
  max-width: 65vw;
  height: 80px;
  border-radius: 8px 8px 0 0; /* Rounded top corners only */
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 6800; /* Above radial menu buttons (6700) */
  display: none; /* Hidden by default on desktop */
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  overflow: visible;
  padding: 12px 16px;
}

/* Single card display area */
.mpc-card-display {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffefa5;
  border-color: #ffefa5;
}

/* Individual mini power card - auto-width to fit content */
.mini-power-card {
  position: relative;
  flex-shrink: 0;
  height: 54px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mini-power-card:hover {
  transform: translateY(-4px);
  z-index: 1;
}

.mini-power-card:active {
  transform: translateY(-2px) scale(0.98);
}

/* Card inner content */
.mpc-card-inner {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  border: 2px solid #333;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Align text to top */
  background: linear-gradient(135deg, #2d3436 0%, #1b1f20 78%);
  box-shadow: 2px 2px 0 #000, 0 0 0 1px #222 inset;
  position: relative;
  overflow: hidden;
}

.mini-power-card:hover .mpc-card-inner {
  border-color: #ffcf33;
  box-shadow: 2px 2px 0 #000, 0 0 0 1px #ffcf33 inset, 0 0 12px rgba(255, 207, 51, 0.4);
}

/* Peek card styling - subtle white glow */
.mini-power-card.is-peek-card .mpc-card-inner {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 2px 2px 0 #000, 
              0 0 0 1px rgba(255, 255, 255, 0.3) inset,
              0 0 16px rgba(255, 255, 255, 0.3);
  animation: subtlePeekGlow 3s ease-in-out infinite;
}

.mini-power-card.is-peek-card:hover .mpc-card-inner {
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 2px 2px 0 #000, 
              0 0 0 1px rgba(255, 255, 255, 0.5) inset,
              0 0 20px rgba(255, 255, 255, 0.5);
}

@keyframes subtlePeekGlow {
  0%, 100% {
    box-shadow: 2px 2px 0 #000, 
                0 0 0 1px rgba(255, 255, 255, 0.3) inset,
                0 0 12px rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 2px 2px 0 #000, 
                0 0 0 1px rgba(255, 255, 255, 0.4) inset,
                0 0 20px rgba(255, 255, 255, 0.4);
  }
}

/* Card cost badge - top right corner */
.mpc-card-cost {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 24px;
  height: 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
  color: #000;
  font-size: 11px;
  font-weight: bold;
  font-family: 'Bangers', cursive;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 2px solid #000;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
}

/* Card emoji - circular badge positioned outside card in bottom-right corner */
.mpc-card-emoji {
  position: absolute;
  bottom: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  background: #fff;
  border: 2px solid #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  z-index: 10;
  padding: 0;
}

/* Light emoji variant - inverted colors for better contrast */
.mpc-card-emoji.mpc-emoji-light {
  background: #000;
  border-color: #fff;
}

.mpc-card-emoji svg {
  width: 10px;
  height: 10px;
  display: block;
  margin: auto;
}

/* Card name - single line, no wrapping, with sufficient padding to avoid cost overlap */
.mpc-card-name {
  font-size: 14px;
  font-weight: 700;
  font-family: 'Bangers', cursive;
  color: #ffcf33;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* Force single line, no wrapping */
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  padding-right: 48px; /* Increased from 36px to prevent cost overlap */
  letter-spacing: 0.5px;
  max-width: 100%;
}

/* Card indicator (e.g., "1 / 3") - positioned above the mini power cards */
.mpc-indicator {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 600;
  font-family: 'Bangers', cursive;
  color: rgba(255, 207, 51, 0.9);
  letter-spacing: 0.5px;
  min-width: 40px;
  text-align: center;
  flex-shrink: 0;
  z-index: 1;
}

/* Paging buttons */
.mpc-page-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 207, 51, 0.2);
  border: 2px solid #ffcf33;
  color: #ffcf33;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
  line-height: 1;
}

.mpc-page-btn:hover {
  background: rgba(255, 207, 51, 0.4);
  transform: scale(1.1);
}

.mpc-page-btn:active {
  transform: scale(0.95);
}

.mpc-page-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Glowing arrow indicator for peek card */
.mpc-page-btn.glow-peek {
  animation: peekArrowGlow 2.5s ease-in-out infinite;
}

@keyframes peekArrowGlow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.4),
                0 0 12px rgba(255, 255, 255, 0.2),
                inset 0 0 8px rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.8),
                0 0 24px rgba(255, 255, 255, 0.4),
                inset 0 0 12px rgba(255, 255, 255, 0.2);
  }
}

/* Empty state */
.mpc-empty-state {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-style: italic;
  text-align: center;
  font-family: 'Comic Neue', cursive;
}

/* Scrollbar styling for cards container */
.cmp-mini-power-cards::-webkit-scrollbar {
  height: 4px;
}

.cmp-mini-power-cards::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.cmp-mini-power-cards::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.cmp-mini-power-cards::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Show when radial-menu mode is active */
body[data-mobile-ui-mode="radial-menu"] .cmp-mini-power-cards {
  display: flex;
}

/* Always show on mobile screens regardless of mode */
@media (max-width: 1024px) {
  .cmp-mini-power-cards {
    display: flex !important;
  }
}
