/* ================================
   포켓몬 카드 공통 스타일
   레어리티, 샤이니, 업그레이드 모달 등
================================ */

.pokemon-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 12px 10px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 160px;
  min-width: 130px;
  aspect-ratio: 3/4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  box-sizing: border-box;
  /* CSS Containment: 렌더링 성능 최적화 */
  contain: layout style paint;
  content-visibility: auto;
}

.pokemon-card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.pokemon-card.not-owned {
  background: rgba(255, 255, 255, 0.3);
  filter: grayscale(100%);
}

.pokemon-card.caught {
  background: rgba(255, 255, 255, 0.5);
  filter: grayscale(50%);
  opacity: 0.8;
}

.pokedex-caught-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  color: white;
  font-size: 9px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid #2e7d32;
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.4);
  z-index: 10;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.pokemon-card.shiny {
  background: linear-gradient(135deg, #fff9c4, #fff59d, #fff9c4);
  background-size: 200% 200%;
  border: 2px solid #ffd700;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.3);
  animation: shiny-glow 3s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.pokemon-card.shiny::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shiny-shimmer 2s infinite;
  pointer-events: none;
}

@keyframes shiny-glow {

  0%,
  100% {
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.3);
  }

  50% {
    box-shadow: 0 4px 30px rgba(255, 215, 0, 0.6), inset 0 0 30px rgba(255, 255, 255, 0.5);
  }
}

@keyframes shiny-shimmer {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }

  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.pokemon-card.shiny .shiny-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #8b6914;
  font-size: 9px;
  font-weight: bold;
  padding: 2px 5px;
  border-radius: 6px;
  border: 1px solid #ffd700;
  box-shadow: 0 2px 4px rgba(255, 215, 0, 0.4);
  z-index: 10;
  animation: shiny-badge-pulse 2s ease-in-out infinite;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.can-evolve-badge {
  display: none;
}

.pokemon-card.shiny .can-evolve-badge {
  top: 4px;
  right: 4px;
}

/* 5성 인챈트 카드 스타일 */
.pokemon-card.enchanted {
  border: 2px solid #ff4444;
  box-shadow: 0 0 15px rgba(255, 68, 68, 0.5), inset 0 0 10px rgba(255, 68, 68, 0.1);
  animation: enchant-glow 2s ease-in-out infinite;
}

@keyframes enchant-glow {

  0%,
  100% {
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.5), inset 0 0 10px rgba(255, 68, 68, 0.1);
  }

  50% {
    box-shadow: 0 0 25px rgba(255, 68, 68, 0.7), inset 0 0 15px rgba(255, 68, 68, 0.2);
  }
}

.enchant-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: linear-gradient(135deg, #ff4444, #cc0000);
  color: #ffffff;
  font-size: 9px;
  font-weight: bold;
  padding: 2px 5px;
  border-radius: 6px;
  border: 1px solid #ff6666;
  box-shadow: 0 2px 4px rgba(255, 68, 68, 0.4);
  z-index: 10;
  animation: enchant-badge-pulse 2s ease-in-out infinite;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

@keyframes enchant-badge-pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 2px 4px rgba(255, 68, 68, 0.4);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.6);
  }
}

/* 이로치 + 인챈트 동시일 때 배지 위치 조정 */
.pokemon-card.shiny.enchanted .shiny-badge {
  top: 6px;
  right: 6px;
}

.pokemon-card.shiny.enchanted .enchant-badge {
  top: 26px;
  right: 6px;
}

.pokemon-card.shiny.rarity-common {
  background: linear-gradient(135deg, #fff9c4, #fff59d, #fff9c4);
  background-size: 200% 200%;
}

.pokemon-card.shiny.rarity-uncommon {
  background: linear-gradient(135deg, #fff9c4 0%, #fff59d 30%, #e8f5e9 70%, #81c784 100%);
  background-size: 200% 200%;
}

.pokemon-card.shiny.rarity-rare {
  background: linear-gradient(135deg, #fff9c4 0%, #fff59d 30%, #e3f2fd 70%, #64b5f6 100%);
  background-size: 200% 200%;
}

.pokemon-card.shiny.rarity-epic {
  background: linear-gradient(135deg, #fff9c4 0%, #fff59d 30%, #f3e5f5 70%, #ba68c8 100%);
  background-size: 200% 200%;
}

.pokemon-card.shiny.rarity-legendary {
  background: linear-gradient(135deg, #fff9c4 0%, #fff59d 30%, #fff8e1 70%, #ffb74d 100%);
  background-size: 200% 200%;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4), 0 4px 15px rgba(255, 183, 77, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.3);
}

.pokemon-card.shiny.rarity-mythical {
  background: linear-gradient(135deg, #fff9c4 0%, #fff59d 30%, #fce4ec 70%, #f06292 100%);
  background-size: 200% 200%;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4), 0 4px 15px rgba(240, 98, 146, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.3);
}

@keyframes shiny-badge-pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 2px 6px rgba(255, 215, 0, 0.5);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.7);
  }
}

.pokemon-card.shiny:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 35px rgba(255, 215, 0, 0.6), inset 0 0 35px rgba(255, 255, 255, 0.5);
}

.pokemon-card.shiny .pokemon-image {
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

.pokemon-card.rarity-common {
  background: #ffffff;
}

.pokemon-card.rarity-common .pokemon-name {
  color: #2c3e50;
}

.pokemon-card.rarity-common .pokemon-number {
  color: rgba(0, 0, 0, 0.6);
}

.pokemon-card.rarity-uncommon {
  background: linear-gradient(135deg, #e8f5e9, #81c784);
}

.pokemon-card.rarity-rare {
  background: linear-gradient(135deg, #e3f2fd, #64b5f6);
}

.pokemon-card.rarity-epic {
  background: linear-gradient(135deg, #f3e5f5, #ba68c8);
}

.pokemon-card.rarity-legendary {
  background: linear-gradient(135deg, #fff8e1, #ffb74d);
  box-shadow: 0 4px 15px rgba(255, 183, 77, 0.3);
}

.pokemon-card.rarity-mythical {
  background: linear-gradient(135deg, #fce4ec, #f06292);
  box-shadow: 0 4px 15px rgba(240, 98, 146, 0.3);
}

.pokemon-card[class*="rarity-"]:not(.rarity-common) .pokemon-name {
  color: #2c3e50;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

.pokemon-card[class*="rarity-"]:not(.rarity-common) .pokemon-number {
  color: rgba(255, 255, 255, 0.8);
}

.card-top-info {
  position: absolute;
  top: 6px;
  left: 6px;
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  color: #ffffff !important;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  z-index: 5;
  backdrop-filter: blur(4px);
}

.card-rarity-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 800;
  color: #ffffff !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 10;
  backdrop-filter: blur(4px);
}

.card-rarity-badge.rarity-common {
  background: #95a5a6;
}

.card-rarity-badge.rarity-uncommon {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.card-rarity-badge.rarity-rare {
  background: linear-gradient(135deg, #3498db, #2980b9);
}

.card-rarity-badge.rarity-epic {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.card-rarity-badge.rarity-legendary {
  background: linear-gradient(135deg, #f1c40f, #e67e22);
}

.card-rarity-badge.rarity-mythical {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}


.pokemon-image {
  width: 80px;
  height: 80px;
  margin: 8px auto;
  object-fit: contain;
  transition: transform 0.25s ease;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.2));
  flex-shrink: 0;
}

.pokemon-number {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.pokemon-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-top: 4px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.rarity-common .pokemon-name {
  color: #2c3e50;
  text-shadow: none;
}

.pokemon-rarity {
  display: none;
}

.rarity-common {
  background: #e0e0e0;
  color: #666;
}

.rarity-uncommon {
  background: #2ecc71;
  color: white;
}

.rarity-rare {
  background: #4fc3f7;
  color: white;
}

.rarity-epic {
  background: #ba68c8;
  color: white;
}

.rarity-legendary {
  background: linear-gradient(135deg, #ffd700, #ff8f00);
  color: white;
}

.rarity-mythical {
  background: linear-gradient(135deg, #e91e63, #9c27b0);
  color: white;
}

/* 잠금: 왼쪽 하단에 자물쇠만 표시 (::before 사용해 enchanted-glow-red::after와 겹치지 않음) */
.pokemon-card.locked {
  position: relative;
}

.pokemon-card.locked::before {
  content: '🔒';
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 12px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
  pointer-events: none;
  z-index: 2;
}

.lock-icon {
  font-size: 12px;
  margin-left: 4px;
  vertical-align: middle;
}

.pokemon-card-stats {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  margin-top: 4px;
  width: 100%;
  line-height: 1;
}

.pokemon-card-stats .star-rank {
  font-size: 10px;
  letter-spacing: -1px;
  line-height: 1;
}

.pokemon-card-stats .grade-badge {
  display: inline-block;
  padding: 2px 4px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  color: white;
  line-height: 1;
  vertical-align: middle;
  min-width: 8px;
  text-align: center;
}

.pokemon-card-stats .grade-badge.grade-S {
  background: linear-gradient(135deg, #ff4081, #f50057);
}

.pokemon-card-stats .grade-badge.grade-A {
  background: linear-gradient(135deg, #7c4dff, #651fff);
}

.pokemon-card-stats .grade-badge.grade-B {
  background: linear-gradient(135deg, #2196f3, #2979ff);
}

.pokemon-card-stats .grade-badge.grade-C {
  background: linear-gradient(135deg, #4caf50, #388e3c);
}

.pokemon-card-stats .nature-badge,
.nature-badge {
  display: inline-block;
  padding: 2px 4px;
  border-radius: 2px;
  font-size: 10px;
  color: #000;
  background: #eee;
  line-height: 1;
  vertical-align: middle;
  margin-left: 2px;
}

.pokemon-card:hover .pokemon-stat-tooltip {
  opacity: 1;
  visibility: visible;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 4px;
}

.stat-row:last-child {
  margin-bottom: 0;
}

.stat-label {
  color: #aaa;
}

.stat-value {
  font-weight: 600;
  color: #fff;
}

.stat-value.bonus {
  color: #4caf50;
}

.upgrade-modal-content {
  padding: 20px;
  background: #ffffff !important;
  color: #2c3e50 !important;
}

#star-upgrade-modal .upgrade-modal-content h2 {
  color: #1a237e !important;
  font-weight: 700;
}

#star-upgrade-modal .upgrade-modal-content h4 {
  color: #1a237e !important;
  font-weight: 700;
  margin-bottom: 12px;
}

.target-pokemon-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 16px;
}

.target-pokemon-card {
  text-align: center;
  color: #2c3e50;
}

#star-upgrade-modal .target-pokemon-card div:not(.star-rank):not(.grade-badge) {
  color: #1a237e !important;
  font-weight: 600;
  margin-top: 4px;
}

.target-pokemon-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.material-arrow {
  font-size: 32px;
  color: var(--pokemon-red);
}

.material-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 12px;
  margin-bottom: 20px;
}

.material-pokemon-card {
  width: 80px;
  padding: 8px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.material-pokemon-card:hover {
  border-color: var(--pokemon-red);
  transform: translateY(-2px);
}

.material-pokemon-card.selected {
  border-color: var(--pokemon-red);
  background: linear-gradient(135deg, #fff5f5, #ffe5e5);
}

.material-pokemon-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* 잠금: 왼쪽 하단에 자물쇠만 표시 */
.material-pokemon-card.material-locked {
  position: relative;
}

.material-pokemon-card.material-locked::before {
  content: '🔒';
  position: absolute;
  bottom: 4px;
  left: 4px;
  font-size: 11px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
  pointer-events: none;
  z-index: 2;
}

.material-pokemon-card img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.material-pokemon-card .name {
  font-size: 10px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #2c3e50;
  font-weight: 500;
}

.upgrade-rate-display {
  text-align: center;
  padding: 15px;
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border-radius: 12px;
  margin-bottom: 20px;
}

.upgrade-rate-display .rate {
  font-size: 24px;
  font-weight: 700;
  color: var(--pokemon-blue);
}

.upgrade-rate-display .label {
  font-size: 12px;
  color: #495057;
  margin-top: 4px;
  font-weight: 500;
}

.exp-preview {
  text-align: center;
  padding: 15px;
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  border-radius: 12px;
  margin-bottom: 20px;
}

.exp-preview .exp-amount {
  font-size: 20px;
  font-weight: 700;
  color: #2e7d32;
}

.exp-preview .exp-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

@keyframes upgrade-success {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes upgrade-fail {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-10px);
  }

  75% {
    transform: translateX(10px);
  }
}

.upgrade-success {
  animation: upgrade-success 0.5s ease;
}

.upgrade-fail {
  animation: upgrade-fail 0.3s ease;
}

.no-material-message {
  text-align: center;
  padding: 30px;
  color: #6c757d;
  font-size: 14px;
}

#star-upgrade-modal .no-material-message {
  color: #6c757d !important;
}

.pokemon-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 12px;
  margin-bottom: 16px;
}

.pokemon-detail-header img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.pokemon-detail-info {
  flex: 1;
  color: #2c3e50;
}

#pokemon-detail-modal .pokemon-detail-info,
#pokemon-detail-modal .pokemon-detail-info * {
  color: #2c3e50;
}

#pokemon-detail-modal .pokemon-detail-info .exp-bar-text {
  color: #495057 !important;
}

#pokemon-detail-modal .pokemon-detail-info .interaction-display,
#pokemon-detail-modal .pokemon-detail-info .friendship-display {
  color: #2c3e50 !important;
}

#pokemon-detail-modal .btn-secondary {
  background: #6c757d !important;
  color: #ffffff !important;
  border: 1px solid #5a6268 !important;
}

#pokemon-detail-modal .btn-secondary:hover {
  background: #5a6268 !important;
  border-color: #495057 !important;
}

.pokemon-detail-info .detail-name {
  font-size: 18px;
  font-weight: 700;
  color: #1a237e;
  margin-bottom: 4px;
}

.pokemon-detail-info .detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: #2c3e50;
  font-weight: 500;
}

/* 등급과 IV를 함께 표시하는 행 */
.pokemon-detail-info .detail-row.stats-row {
  gap: 12px;
  margin-bottom: 8px;
  margin-top: 4px;
}

/* 포켓몬 상세 정보 모달의 등급 배지 스타일 */
#pokemon-detail-modal .grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  min-width: 32px;
  text-align: center;
  letter-spacing: 0.5px;
}

/* IV 배지 스타일 */
#pokemon-detail-modal .iv-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #2c3e50;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  line-height: 1.2;
  letter-spacing: 0.3px;
}

/* 등급과 IV 배지가 함께 있을 때 간격 조정 */
.pokemon-detail-info .stats-row .grade-badge,
.pokemon-detail-info .stats-row .iv-badge {
  flex-shrink: 0;
}

#pokemon-detail-modal .grade-badge.grade-S {
  background: linear-gradient(135deg, #ff4081, #f50057);
  box-shadow: 0 2px 8px rgba(255, 64, 129, 0.4);
}

#pokemon-detail-modal .grade-badge.grade-A {
  background: linear-gradient(135deg, #7c4dff, #651fff);
  box-shadow: 0 2px 8px rgba(124, 77, 255, 0.4);
}

#pokemon-detail-modal .grade-badge.grade-B {
  background: linear-gradient(135deg, #2196f3, #2979ff);
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.4);
}

#pokemon-detail-modal .grade-badge.grade-C {
  background: linear-gradient(135deg, #4caf50, #388e3c);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.pokemon-detail-stats {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
  color: #2c3e50;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* 스탯 그리드 레이아웃 - 한 줄에 6개씩 */
#detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.pokemon-detail-stats .stat-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 8px 6px;
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  border-radius: 6px;
  border: 1px solid #e9ecef;
  color: #2c3e50;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  min-height: 45px;
  overflow: hidden;
}

.pokemon-detail-stats .stat-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-color: #dee2e6;
}

.pokemon-detail-stats .stat-row span:first-child {
  font-size: 10px;
  color: #6c757d;
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.pokemon-detail-stats .stat-row span:last-child {
  font-size: 15px;
  color: #2c3e50;
  font-weight: 700;
  line-height: 1.2;
}

.pokemon-detail-stats .stat-row.bonus {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  border-color: #81c784;
  color: #2e7d32;
  padding: 6px 12px;
  min-height: auto;
}

.pokemon-detail-stats .stat-row.bonus span:first-child {
  color: #2e7d32;
  font-size: 11px;
  margin-bottom: 2px;
}

.pokemon-detail-stats .stat-row.bonus span:last-child {
  color: #1b5e20;
  font-size: 14px;
}

.pokemon-detail-header .header-main-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.lock-toggle-wrapper {
  display: flex;
  align-items: center;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
  background-color: #f44336;
}

input:focus+.slider {
  box-shadow: 0 0 1px #f44336;
}

input:checked+.slider:before {
  transform: translateX(18px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.pokemon-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
  padding: 0 4px;
}

.btn-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  border: none;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  color: white;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  gap: 6px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-detail:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  filter: brightness(1.1);
}

.btn-detail:active {
  transform: translateY(-1px) scale(0.96);
}

.action-pet {
  background: linear-gradient(135deg, #11998e, #38ef7d);
}

.action-play {
  background: linear-gradient(135deg, #00c6ff, #0072ff);
}

.action-upgrade {
  background: linear-gradient(135deg, #f09819, #edde5d);
  color: #333;
  text-shadow: none;
}

.action-feed {
  background: linear-gradient(135deg, #ff512f, #dd2476);
}

.modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.modal-buttons button {
  flex: 1;
  padding: 12px 20px;
  font-size: 14px;
  min-height: 44px;
}

.upgrade-modal-content .modal-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.upgrade-modal-content .modal-buttons button {
  min-width: 140px;
  height: 48px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  transition: all 0.3s ease;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  box-sizing: border-box;
}

#execute-upgrade-btn {
  background: linear-gradient(135deg, #fceabb, #f8b500);
  color: #443300;
  box-shadow: 0 4px 12px rgba(248, 181, 0, 0.3);
}

#execute-upgrade-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(248, 181, 0, 0.4);
}

#execute-feed-btn {
  background: linear-gradient(135deg, #FF512F, #DD2476);
  color: white;
  box-shadow: 0 4px 12px rgba(221, 36, 118, 0.3);
}

#execute-feed-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(221, 36, 118, 0.4);
}

.upgrade-modal-content .modal-buttons .btn-secondary {
  background: #f1f3f5;
  color: #495057;
  border: 1px solid #dee2e6;
}

.upgrade-modal-content .modal-buttons .btn-secondary:hover {
  background: #e9ecef;
  color: #212529;
  transform: translateY(-2px);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  background: #dee2e6 !important;
  color: #adb5bd !important;
  box-shadow: none !important;
  cursor: not-allowed;
}

#star-upgrade-modal,
#feed-modal {
  z-index: 1100;
}

#star-upgrade-modal .btn-secondary {
  background: #6c757d !important;
  color: #ffffff !important;
  border: 1px solid #5a6268 !important;
}

#star-upgrade-modal .btn-secondary:hover {
  background: #5a6268 !important;
  border-color: #495057 !important;
}

#pokemon-detail-modal {
  z-index: 1050;
}

#pokemon-detail-modal .modal-content {
  background: #ffffff !important;
  color: #2c3e50 !important;
}

#pokemon-detail-modal .modal-content h2 {
  color: #1a237e !important;
  font-weight: 700;
}

#pokemon-detail-modal .pokemon-detail-header {
  color: #2c3e50;
}

#pokemon-detail-modal .pokemon-detail-header * {
  color: #2c3e50;
}

#pokemon-detail-modal .pokemon-detail-info {
  color: #2c3e50 !important;
}

#pokemon-detail-modal .pokemon-detail-info * {
  color: #2c3e50 !important;
}

#pokemon-detail-modal .pokemon-detail-info span:not(.star-rank):not(.grade-badge) {
  color: #2c3e50 !important;
}

#pokemon-detail-modal #detail-pokemon-iv {
  color: inherit;
  font-weight: inherit;
}

/* 상세 모달 성격 배지: 상속된 글자색 덮어써서 항상 보이게 */
#pokemon-detail-modal .nature-badge {
  color: #000 !important;
  background: #e9ecef !important;
  border: 1px solid #dee2e6;
}

#pokemon-detail-modal .pokemon-types-row .pokemon-types {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#pokemon-detail-modal .pokemon-types-row .type-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  color: #fff;
}

#pokemon-detail-modal .interaction-timer {
  color: #6c757d !important;
  font-size: 12px;
}

#pokemon-detail-modal .loading {
  color: #6c757d !important;
}

#pokemon-detail-modal .modal-content * {
  color: inherit;
}

.pokemon-card-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  width: 100%;
}

.pokemon-card-stats .star-rank {
  font-size: 11px;
  letter-spacing: -2px;
}

.pokemon-card-stats .grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 900;
  color: #ffffff !important;
  min-width: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}


.grade-S {
  background: linear-gradient(135deg, #ff4081, #f50057);
}

.grade-A {
  background: linear-gradient(135deg, #7c4dff, #651fff);
}

.grade-B {
  background: linear-gradient(135deg, #2196f3, #2979ff);
}

.grade-C {
  background: linear-gradient(135deg, #4caf50, #388e3c);
}

@keyframes gradeS-shine {

  0%,
  100% {
    box-shadow: 0 0 10px rgba(255, 64, 129, 0.5);
  }

  50% {
    box-shadow: 0 0 20px rgba(255, 64, 129, 0.8);
  }
}

/* 성격 표시 - 진화 버튼과 동일한 위치·모양 (글자 검정으로 항상 보이게) */
.pokemon-nature-display {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: auto;
  padding: 3px 8px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.3);
  color: #000;
  font-weight: 700;
  font-size: 9px;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.rarity-common .pokemon-nature-display {
  background: rgba(0, 0, 0, 0.1);
  color: #000;
}

.pokemon-evolution-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: auto;
  padding: 3px 8px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-weight: 700;
  font-size: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
}

.pokemon-evolution-btn.can-evolve {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #8b4513;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.pokemon-evolution-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.rarity-common .pokemon-evolution-btn {
  background: rgba(0, 0, 0, 0.1);
  color: #666;
}

/* 미디어 쿼리 */
@media (max-width: 480px) {
  .pokemon-detail-header {
    flex-direction: column;
    text-align: center;
  }

  #detail-pokemon-image {
    max-width: 100px;
  }

  .pokemon-detail-actions {
    grid-template-columns: 1fr;
  }

  .btn-detail {
    padding: 12px;
  }
}