/* Archer Preview CSS - Mobile-first design */

.ability-preview-container {
  margin: 20px 0;
  padding: 15px;
  background: linear-gradient(135deg, #1a1f3a 0%, #0d1225 100%);
  border-radius: 12px;
  border: 2px solid rgba(0, 226, 255, 0.3);
  box-shadow: 
    0 0 20px rgba(0, 226, 255, 0.2),
    inset 0 0 15px rgba(0, 0, 0, 0.4);
}

.ability-preview-title {
  text-align: center;
  color: #00e2ff;
  font-size: 0.9em;
  font-weight: 600;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(0, 226, 255, 0.5);
}

.ability-preview-boards {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.preview-board-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.preview-board-label {
  color: #73f5ff;
  font-size: 0.8em;
  font-weight: 500;
  text-align: center;
}

.preview-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 2px;
  background: linear-gradient(135deg, #151a32 30%, #1b2d56 100%);
  padding: 8px;
  border-radius: 8px;
  border: 2px solid rgba(0, 226, 255, 0.4);
  box-shadow: 
    0 0 15px rgba(0, 226, 255, 0.3),
    0 0 10px rgba(0, 0, 0, 0.6);
}

.preview-cell {
  width: 32px;
  height: 32px;
  background: linear-gradient(145deg, #1e2744 70%, #253555 100%);
  border: 1px solid rgba(58, 68, 134, 0.4);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 0.8em;
  font-weight: 700;
  font-family: 'Audiowide', 'Orbitron', sans-serif;
  color: #fff;
  box-shadow: 
    0 0 3px rgba(0, 226, 255, 0.2),
    0 0 2px rgba(0, 0, 0, 0.4);
}

/* Archer token styling in preview */
.preview-cell.has-archer {
  position: relative;
}

.preview-token.archer {
  background: radial-gradient(circle at 30% 30%, #ff86d1 10%, #ff00aa 60%);
  color: #4F2C00;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75em;
  box-shadow: 
    0 0 8px #ff00aa,
    0 0 16px #ff009988;
  border: 1.5px solid #4e1a3a;
  font-weight: 900;
  text-shadow: 0 0 8px #ff00aa, 0 0 4px #fff;
  position: absolute;
  z-index: 10;
}

/* SVG decoration for archer in preview */
.preview-token.archer::before {
  content: '';
  position: absolute;
  width: 36px;
  height: 36px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-image: url('../../svg/archer-decoration.svg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  z-index: -1;
}

/* Enemy tokens in preview */
.preview-enemy {
  background: radial-gradient(circle at 30% 30%, #ff86a3 10%, #DC143C 60%);
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7em;
  border: 1.5px solid #3a1c29;
  box-shadow: 
    0 0 8px rgba(255, 62, 107, 0.6),
    0 0 12px rgba(255, 62, 107, 0.3);
  font-weight: 700;
  text-shadow: 0 0 8px #ff3e6b, 0 0 4px #fff;
  position: absolute;
  z-index: 10;
}

/* Target enemy highlighting */
.preview-enemy.target-enemy {
  border-color: #FFD700;
  box-shadow: 
    0 0 12px rgba(255, 215, 0, 0.8),
    0 0 20px rgba(255, 215, 0, 0.4);
  animation: targetEnemyPulse 1.2s ease-in-out infinite;
}

@keyframes targetEnemyPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 
      0 0 12px rgba(255, 215, 0, 0.8),
      0 0 20px rgba(255, 215, 0, 0.4);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 
      0 0 16px rgba(255, 215, 0, 1),
      0 0 28px rgba(255, 215, 0, 0.6);
  }
}

/* IDENTICAL IN-GAME POSSIBLE MOVE HIGHLIGHTING FOR ARCHER RANGE */
.preview-cell.possible-move.archer-range {
  box-shadow:
    0 0 15px rgba(255, 20, 147, 0.9),
    0 0 25px rgba(255, 20, 147, 0.6),
    inset 0 0 8px rgba(255, 20, 147, 0.3);
  border: 2px dashed #FF1493;
  background: linear-gradient(145deg, #4a1e3a 50%, #552535 100%);
  transform: scale(1.1);
  animation: pulsePossibleMove 1.5s infinite ease-in-out;
  position: relative;
}

/* Enhanced archer range indicator */
.preview-cell.possible-move.archer-range::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border: 1px solid rgba(255, 20, 147, 0.4);
  border-radius: 8px;
  animation: expandIndicator 1.5s infinite ease-in-out;
}

@keyframes expandIndicator {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

@keyframes pulsePossibleMove {
  0%, 100% { 
    box-shadow:
      0 0 15px rgba(255, 20, 147, 0.8),
      0 0 25px rgba(255, 20, 147, 0.5);
    transform: scale(1.08);
  }
  50% { 
    box-shadow:
      0 0 20px rgba(255, 20, 147, 0.9),
      0 0 35px rgba(255, 20, 147, 0.6);
    transform: scale(1.1);
  }
}

/* Subtle styling for range shown in after board */
.preview-cell.archer-range-shown {
  background: linear-gradient(145deg, #4a1e3a 60%, #552535 100%);
  border-color: rgba(255, 20, 147, 0.2);
}

/* Highlight changed values */
.preview-token.value-changed {
  animation: valueGlow 1s ease-in-out infinite;
}

@keyframes valueGlow {
  0%, 100% {
    box-shadow: 
      0 0 8px #ff00aa,
      0 0 16px #ff009988;
  }
  50% {
    box-shadow: 
      0 0 12px #ff00aa,
      0 0 24px #ff00cc,
      0 0 32px #FFD700;
    transform: scale(1.1);
  }
}

/* Arrow indicator */
.ability-arrow {
  color: #00e2ff;
  font-size: 1.5em;
  text-align: center;
  text-shadow: 0 0 10px rgba(0, 226, 255, 0.8);
  animation: arrowPulse 1.5s ease-in-out infinite;
}

@keyframes arrowPulse {
  0%, 100% { opacity: 0.6; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(3px); }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .preview-cell {
    width: 28px;
    height: 28px;
    font-size: 0.7em;
  }
  
  .preview-token {
    width: 22px;
    height: 22px;
    font-size: 0.65em;
  }
  
  .preview-enemy {
    width: 20px;
    height: 20px;
    font-size: 0.6em;
  }
  
  .preview-board {
    padding: 6px;
    gap: 1.5px;
  }
  
  .preview-cell.possible-move.archer-range {
    transform: scale(1.06);
  }
  
  .preview-cell.possible-move.archer-range::after {
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
  }
}

@media (max-width: 360px) {
  .preview-cell {
    width: 24px;
    height: 24px;
    font-size: 0.65em;
  }
  
  .preview-token {
    width: 20px;
    height: 20px;
    font-size: 0.6em;
  }
  
  .preview-enemy {
    width: 18px;
    height: 18px;
    font-size: 0.55em;
  }
  
  .preview-board {
    padding: 5px;
    gap: 1px;
  }
  
  .ability-preview-container {
    padding: 12px;
  }
  
  .preview-cell.possible-move.archer-range {
    transform: scale(1.04);
  }
  
  .preview-cell.possible-move.archer-range::after {
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
  }
}

/* Landscape orientation optimization */
@media (orientation: landscape) and (max-height: 600px) {
  .ability-preview-boards {
    flex-direction: row;
    gap: 20px;
  }
  
  .ability-arrow {
    transform: rotate(-90deg);
    margin: 0 10px;
  }
  
  @keyframes arrowPulse {
    0%, 100% { opacity: 0.6; transform: rotate(-90deg) translateX(0); }
    50% { opacity: 1; transform: rotate(-90deg) translateX(3px); }
  }
} 