/* /public/css/character-detail.css */

/* 캐릭터 상세 페이지 */
.character-detail-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  padding-bottom: 120px;
}

/* 캐릭터 헤더 */
.character-detail-header {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 32px;
  margin-bottom: 24px;
  display: flex;
  gap: 24px;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: relative;
}

/* 프로필 이미지 with 등급 테두리 */
.character-profile-image-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.character-profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Elo 등급별 테두리 */
.rank-core {
  border: 4px solid #8B4513;
  box-shadow: 0 0 20px rgba(139, 69, 19, 0.5);
}

.rank-mantle {
  border: 4px solid #D2691E;
  box-shadow: 0 0 20px rgba(210, 105, 30, 0.5);
}

.rank-crust {
  border: 4px solid #A0522D;
  box-shadow: 0 0 20px rgba(160, 82, 45, 0.5);
}

.rank-iron {
  border: 4px solid #71797E;
  box-shadow: 0 0 20px rgba(113, 121, 126, 0.5);
}

.rank-bronze {
  border: 4px solid #CD7F32;
  box-shadow: 0 0 20px rgba(205, 127, 50, 0.5);
}

.rank-silver {
  border: 4px solid #C0C0C0;
  box-shadow: 0 0 20px rgba(192, 192, 192, 0.5);
}

.rank-gold {
  border: 4px solid #FFD700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.rank-platinum {
  border: 4px solid #E5E4E2;
  box-shadow: 0 0 20px rgba(229, 228, 226, 0.6);
}

.rank-diamond {
  border: 4px solid #B9F2FF;
  box-shadow: 0 0 20px rgba(185, 242, 255, 0.6);
}

.rank-master {
  border: 4px solid #9933FF;
  box-shadow: 0 0 20px rgba(153, 51, 255, 0.7);
}

.rank-grandmaster {
  border: 4px solid #FF4444;
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.7);
  animation: grandmaster-glow 2s ease-in-out infinite;
}

@keyframes grandmaster-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.7);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 68, 68, 1);
  }
}

.rank-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  padding: 8px 12px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 헤더 정보 */
.character-header-info {
  flex: 1;
}

.character-detail-name {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.character-detail-worldview {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.character-detail-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-badge {
  background: var(--surface-light);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 헤더 액션 버튼 */
.character-header-actions {
  display: flex;
  gap: 12px;
  flex-direction: column;
}

.action-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--surface-light);
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn:hover {
  transform: scale(1.1);
}

.like-btn:hover {
  background: var(--error);
  color: white;
}

.share-btn:hover {
  background: var(--primary-color);
  color: white;
}

/* 탭 네비게이션 */
.character-tabs {
  display: flex;
  gap: 8px;
  background: var(--surface);
  padding: 8px;
  border-radius: var(--border-radius);
  margin-bottom: 24px;
  overflow-x: auto;
}

.character-tab {
  flex: 1;
  min-width: 100px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.character-tab:hover {
  background: var(--surface-light);
  color: var(--text-secondary);
}

.character-tab.active {
  background: var(--primary-color);
  color: white;
}

/* 탭 컨텐츠 */
.character-tab-content {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 24px;
  min-height: 400px;
}

.detail-tab-pane {
  display: none;
}

.detail-tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 서브탭 공통 스타일 */
.info-subtabs,
.equipment-subtabs,
.timeline-subtabs,
.manage-subtabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--surface-light);
}

.info-subtab,
.equipment-subtab,
.timeline-subtab,
.manage-subtab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.info-subtab:hover,
.equipment-subtab:hover,
.timeline-subtab:hover,
.manage-subtab:hover {
  color: var(--text-secondary);
}

.info-subtab.active,
.equipment-subtab.active,
.timeline-subtab.active,
.manage-subtab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* 서브탭 컨텐츠 */
.info-subtab-pane,
.equipment-subtab-pane,
.timeline-subtab-pane,
.manage-subtab-pane {
  display: none;
}

.info-subtab-pane.active,
.equipment-subtab-pane.active,
.timeline-subtab-pane.active,
.manage-subtab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

/* 소개 섹션 */
.intro-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.intro-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field-value {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  background: var(--background);
  padding: 12px 16px;
  border-radius: 8px;
}

/* 서사 목록 */
.narrative-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.narrative-card {
  background: var(--background);
  padding: 20px;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-color);
  transition: var(--transition);
}

.narrative-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.narrative-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.narrative-preview {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.btn-view-narrative {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-view-narrative:hover {
  background: var(--primary-dark);
}

/* 서사 상세 */
.narrative-detail {
  padding: 20px;
}

.narrative-detail-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  text-align: center;
}

.narrative-detail-content {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
  white-space: pre-wrap;
}

/* 능력치 그리드 */
.proficiency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.proficiency-item {
  background: rgba(26, 26, 46, 0.6);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.proficiency-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.proficiency-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.proficiency-level {
  font-size: 14px;
  color: var(--primary-color);
  font-weight: 600;
}

.proficiency-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-light);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.proficiency-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  transition: width 0.3s ease-out;
}

.proficiency-exp {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

/* 스킬 목록 */
.skills-notice {
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  color: var(--primary-color);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.skills-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skill-card {
  background: var(--background);
  padding: 20px;
  border-radius: var(--border-radius);
  border: 2px solid var(--surface-light);
  transition: var(--transition);
}

.skill-card.equipped {
  border-color: var(--primary-color);
  background: rgba(102, 126, 234, 0.05);
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.skill-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.equipped-badge {
  background: var(--primary-color);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.skill-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.btn-toggle-skill {
  background: var(--surface-light);
  color: var(--text-secondary);
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-toggle-skill:hover {
  background: var(--primary-color);
  color: white;
}

/* 삭제 섹션 */
.delete-section {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.warning-box {
  background: rgba(248, 113, 113, 0.1);
  border: 2px solid var(--error);
  border-radius: var(--border-radius);
  padding: 32px;
  margin-bottom: 24px;
}

.warning-box i {
  font-size: 48px;
  color: var(--error);
  margin-bottom: 16px;
}

.warning-box h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.warning-box p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.btn-delete-character {
  background: var(--error);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-delete-character:hover {
  background: #dc2626;
  transform: scale(1.05);
}

/* 플로팅 액션 버튼 */
.floating-actions {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 80;
}

/* ⭐️ [신규] 배틀 모드 토글 백드롭 */
#battle-mode-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 70;
  animation: fadeIn 0.2s ease-out;
  /* fadeIn 애니메이션은 main.css에 이미 있어야 함 */
}

/* ⭐️ [신규] 배틀 모드 선택 컨테이너 */
.battle-mode-container {
  position: fixed;
  bottom: 80px; /* 플로팅 버튼과 동일한 위치 */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column; /* 세로로 쌓임 */
  gap: 12px;
  z-index: 81; /* 백드롭보다 위 */
  align-items: center;
}

/* ⭐️ [신규] 배틀 모드 선택 버튼 (애니메이션 적용) */
.battle-mode-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  animation: slideUpFadeIn 0.3s ease-out forwards;
}

/* 듀오 버튼 스타일 */
.battle-mode-btn.duo-btn {
  background: linear-gradient(135deg, #9c27b0, #7b1fa2) !important;
  animation-delay: 0.05s; /* 두 번째 버튼이 약간 늦게 */
}

/* 일반 배틀 버튼 스타일 */
.battle-mode-btn.general-btn {
  background: linear-gradient(135deg, var(--error), #dc2626) !important;
}

@keyframes slideUpFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.battle-mode-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.floating-action-btn {
  /* ( ... 기존 floating-action-btn 스타일 ...) */
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
}

.floating-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.battle-btn {
  background: linear-gradient(135deg, var(--error), #dc2626);
}

.encounter-btn {
  background: linear-gradient(135deg, var(--success), #22c55e);
}

/* 뒤로가기 버튼 */
.back-btn {
  position: fixed;
  top: 80px;
  left: 20px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 2px solid var(--surface-light);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.back-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* 플레이스홀더 컨텐츠 */
.placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.placeholder-text {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.placeholder-subtext {
  font-size: 14px;
  color: var(--text-muted);
}

.loading-placeholder {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

.error-message {
  text-align: center;
  color: var(--error);
  padding: 40px;
}

.info-message {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .character-detail-container {
    padding: 16px;
    padding-bottom: 100px;
  }
  
  .character-detail-header {
    flex-direction: column;
    padding: 20px;
    text-align: center;
  }
  
  .character-profile-image-wrapper {
    width: 150px;
    height: 150px;
  }
  
  .character-header-actions {
    flex-direction: row;
    justify-content: center;
  }
  
  .character-detail-name {
    font-size: 24px;
  }
  
  .character-detail-stats {
    justify-content: center;
  }
  
  .character-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  
  .character-tab {
    min-width: 80px;
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .proficiency-grid {
    grid-template-columns: 1fr;
  }
  
  .floating-actions {
    bottom: 70px;
    flex-direction: row;
    gap: 8px;
  }
  
  .floating-action-btn {
    padding: 10px 20px;
    font-size: 13px;
  }
  
  .back-btn {
    top: 70px;
    left: 10px;
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* 타임라인 카드 스타일 */
.timeline-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

.timeline-card {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 16px;
  border: 2px solid var(--surface-light);
  cursor: pointer;
  transition: var(--transition);
}

.timeline-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.timeline-card.battle-card.victory {
  border-left: 4px solid var(--success);
}

.timeline-card.battle-card.defeat {
  border-left: 4px solid var(--error);
}

.timeline-card.encounter-card {
  border-left: 4px solid var(--primary-color);
}

.timeline-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.timeline-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.timeline-icon.victory {
  background: rgba(74, 222, 128, 0.2);
  color: var(--success);
}

.timeline-icon.defeat {
  background: rgba(248, 113, 113, 0.2);
  color: var(--error);
}

.timeline-icon.encounter {
  background: rgba(102, 126, 234, 0.2);
  color: var(--primary-color);
}

.timeline-info {
  flex: 1;
}

.timeline-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.timeline-time {
  font-size: 13px;
  color: var(--text-muted);
}

.elo-badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

.elo-badge.positive {
  background: rgba(74, 222, 128, 0.2);
  color: var(--success);
}

.elo-badge.negative {
  background: rgba(248, 113, 113, 0.2);
  color: var(--error);
}

.timeline-card-body {
  margin-top: 12px;
}

.opponent-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.opponent-mini-image {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
}

.opponent-mini-name {
  font-size: 14px;
  color: var(--text-secondary);
}

.timeline-preview {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.proficiency-gains-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.proficiency-gains-mini i {
  color: var(--success);
  font-size: 12px;
}

.prof-mini-badge {
  font-size: 12px;
  padding: 3px 8px;
  background: rgba(102, 126, 234, 0.2);
  color: var(--primary-color);
  border-radius: 4px;
}

/* 배틀/조우 로그 상세 페이지 */
.battle-log-detail-container,
.encounter-log-detail-container {
  padding: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.battle-log-header,
.encounter-log-header {
  text-align: center;
  padding: 32px 24px;
  border-radius: var(--border-radius);
  margin-bottom: 24px;
}

.battle-log-header.victory {
  background: rgba(74, 222, 128, 0.1);
  border: 2px solid var(--success);
}

.battle-log-header.defeat {
  background: rgba(248, 113, 113, 0.1);
  border: 2px solid var(--error);
}

.encounter-log-header {
  background: rgba(102, 126, 234, 0.1);
  border: 2px solid var(--primary-color);
}

.result-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.battle-log-header.victory .result-icon {
  color: var(--success);
}

.battle-log-header.defeat .result-icon {
  color: var(--error);
}

.encounter-log-header .result-icon {
  color: var(--primary-color);
}

.result-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
}

.battle-log-section,
.encounter-log-section {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 24px;
  margin-bottom: 24px;
}

.log-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.battle-log-content,
.encounter-log-content {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.proficiency-gains-section {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 24px;
  margin-bottom: 24px;
}

.proficiency-gains-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.proficiency-gains-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.prof-gain-badge {
  padding: 8px 16px;
  background: rgba(102, 126, 234, 0.2);
  color: var(--primary-color);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.prof-gain-badge i {
  color: var(--success);
}

/* ⭐️ [신규] 타임라인 중첩 탭 스타일 */
.timeline-nested-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--surface-light);
}

.timeline-nested-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
}

.timeline-nested-tab:hover {
  color: var(--text-secondary);
}

.timeline-nested-tab.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary-light);
}

.timeline-nested-pane {
  display: none;
}

.timeline-nested-pane.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

/* 모의 배틀/조우 버튼 스타일 */
.mock-btn {
  background: linear-gradient(135deg, #9c27b0, #7b1fa2) !important;
  border-color: #9c27b0 !important;
}

.mock-btn:hover {
  background: linear-gradient(135deg, #7b1fa2, #6a1b9a) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(156, 39, 176, 0.4) !important;
}

.mock-btn:active {
  transform: translateY(0);
}

/* 모의 로그 카드 스타일 */
.timeline-card.mock-log {
  border-left: 4px solid #9c27b0 !important;
}

.timeline-card.mock-log .timeline-icon {
  background: rgba(156, 39, 176, 0.2) !important;
  color: #9c27b0 !important;
}

.timeline-card.mock-log .timeline-icon.victory,
.timeline-card.mock-log .timeline-icon.defeat {
  background: rgba(156, 39, 176, 0.2) !important;
  color: #9c27b0 !important;
}

.timeline-card.mock-log:hover {
  border-left-color: #7b1fa2 !important;
  box-shadow: 0 4px 12px rgba(156, 39, 176, 0.2) !important;
}

/* 모의 로그의 Elo 배지 스타일 */
.timeline-card.mock-log .elo-badge {
  background: rgba(156, 39, 176, 0.15) !important;
  color: #9c27b0 !important;
  border-color: rgba(156, 39, 176, 0.3) !important;
}

/* 타임라인 로드 더 버튼 */
.timeline-load-more {
  display: flex;
  justify-content: center;
  padding: 24px 0;
  margin-top: 16px;
}

.timeline-load-more .btn {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.timeline-load-more .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.timeline-load-more .btn i {
  font-size: 12px;
}

/* 타임라인 종료 메시지 */
.timeline-end-message {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

/* 아이템 등급별 색상 */
/* common - 회색 */
.rarity-common {
  background: rgba(158, 158, 158, 0.2);
  color: #9e9e9e;
  border: 1px solid rgba(158, 158, 158, 0.4);
}

/* uncommon - 초록색 */
.rarity-uncommon {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.4);
}

/* rare - 파란색 */
.rarity-rare {
  background: rgba(33, 150, 243, 0.2);
  color: #2196f3;
  border: 1px solid rgba(33, 150, 243, 0.4);
}

/* epic - 남색 */
.rarity-epic {
  background: rgba(63, 81, 181, 0.2);
  color: #3f51b5;
  border: 1px solid rgba(63, 81, 181, 0.4);
}

/* unique - 보라색 */
.rarity-unique {
  background: rgba(156, 39, 176, 0.2);
  color: #9c27b0;
  border: 1px solid rgba(156, 39, 176, 0.4);
}

/* legendary - 노란색 */
.rarity-legendary {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.4);
}

/* mythic - 빨간색 */
.rarity-mythic {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.4);
}

/* transcendent (초월) - 흰색 배경, 검은 글씨 */
.rarity-transcendent {
  background: #ffffff;
  color: #000000;
  border: 1px solid #cccccc;
  font-weight: 600;
}

/* primordial (태초) - 검은 배경, 흰 글씨, 카키색 강조, 애니메이션 */
.rarity-primordial {
  background: linear-gradient(135deg, #000000, #1a1a1a);
  color: #ffffff;
  border: 1px solid #f0e68c;
  font-weight: 700;
  animation: primordial-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(240, 230, 140, 0.5);
  position: relative;
  overflow: hidden;
}

.rarity-primordial::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(240, 230, 140, 0.1), transparent);
  animation: primordial-shimmer 3s linear infinite;
}

@keyframes primordial-pulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(240, 230, 140, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(240, 230, 140, 0.8), 0 0 30px rgba(240, 230, 140, 0.4);
  }
}

@keyframes primordial-shimmer {
  0% {
    transform: translate3d(-50%, -50%, 0) rotate(0deg);
  }
  100% {
    transform: translate3d(-50%, -50%, 0) rotate(360deg);
  }
}

/* divine (신성) - 금색/오렌지색 배경, 흰 글씨, 빛나는 이펙트 */
.rarity-divine {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #ffffff;
  border: 1px solid #FFD700;
  font-weight: 700;
  animation: divine-glow 3s ease-in-out infinite;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.rarity-divine::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  animation: divine-sparkle 2s ease-in-out infinite;
}

.rarity-divine::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%);
  animation: divine-shine 3s linear infinite;
}

@keyframes divine-glow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 25px rgba(255, 165, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 25px rgba(255, 215, 0, 1), 0 0 35px rgba(255, 165, 0, 0.6), 0 0 45px rgba(255, 215, 0, 0.3);
  }
}

@keyframes divine-sparkle {
  0%, 100% {
    opacity: 0.3;
    transform: translate3d(-50%, -50%, 0) scale(1);
  }
  50% {
    opacity: 0.6;
    transform: translate3d(-50%, -50%, 0) scale(1.2);
  }
}

@keyframes divine-shine {
  0% {
    transform: translateX(-100%) translateY(-100%);
  }
  100% {
    transform: translateX(100%) translateY(100%);
  }
}

/* 아이템 카드 스타일 */
.equipped-items-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}

.equipped-item-card {
  background: linear-gradient(135deg, rgba(30, 30, 50, 0.9), rgba(20, 20, 40, 0.9));
  border: 1px solid rgba(100, 100, 200, 0.3);
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.3s ease;
}

.equipped-item-card:hover {
  border-color: rgba(150, 150, 255, 0.5);
  box-shadow: 0 4px 12px rgba(100, 100, 255, 0.2);
}

/* 고등급 아이템 카드 강조 효과 */
/* Note: :has() selector requires modern browsers (Chrome 105+, Safari 15.4+, Firefox 121+) */
.equipped-item-card:has(.rarity-legendary) {
  border-color: rgba(255, 193, 7, 0.3);
}

.equipped-item-card:has(.rarity-legendary):hover {
  border-color: rgba(255, 193, 7, 0.6);
  box-shadow: 0 4px 20px rgba(255, 193, 7, 0.3);
}

.equipped-item-card:has(.rarity-mythic) {
  border-color: rgba(244, 67, 54, 0.3);
}

.equipped-item-card:has(.rarity-mythic):hover {
  border-color: rgba(244, 67, 54, 0.6);
  box-shadow: 0 4px 20px rgba(244, 67, 54, 0.3);
}

.equipped-item-card:has(.rarity-transcendent) {
  border-color: rgba(255, 255, 255, 0.3);
  background: linear-gradient(135deg, rgba(50, 50, 60, 0.9), rgba(40, 40, 50, 0.9));
}

.equipped-item-card:has(.rarity-transcendent):hover {
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

.equipped-item-card:has(.rarity-primordial) {
  border-color: rgba(240, 230, 140, 0.3);
  background: linear-gradient(135deg, rgba(20, 20, 25, 0.95), rgba(15, 15, 20, 0.95));
}

.equipped-item-card:has(.rarity-primordial):hover {
  border-color: rgba(240, 230, 140, 0.6);
  box-shadow: 0 4px 20px rgba(240, 230, 140, 0.3);
}

.equipped-item-card:has(.rarity-divine) {
  border-color: rgba(255, 215, 0, 0.4);
  background: linear-gradient(135deg, rgba(50, 45, 30, 0.95), rgba(40, 35, 25, 0.95));
}

.equipped-item-card:has(.rarity-divine):hover {
  border-color: rgba(255, 215, 0, 0.8);
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4), 0 8px 30px rgba(255, 165, 0, 0.2);
}

.item-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.item-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #e0e0ff;
  margin-bottom: 0.25rem;
}

.item-card-rarity {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.item-card-description {
  font-size: 0.9rem;
  color: #b0b0d0;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.item-card-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-unequip-item {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.9rem;
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.4);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-unequip-item:hover {
  background: rgba(244, 67, 54, 0.3);
  border-color: rgba(244, 67, 54, 0.6);
}

.available-items-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.available-item-card {
  background: linear-gradient(135deg, rgba(30, 30, 50, 0.9), rgba(20, 20, 40, 0.9));
  border: 1px solid rgba(100, 100, 200, 0.3);
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.3s ease;
}

.available-item-card:hover {
  border-color: rgba(150, 150, 255, 0.5);
}

.available-item-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-equip-item {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.9rem;
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.4);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-equip-item:hover:not(:disabled) {
  background: rgba(76, 175, 80, 0.3);
  border-color: rgba(76, 175, 80, 0.6);
}

.btn-equip-item:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.items-notice {
  padding: 1rem;
  background: rgba(33, 150, 243, 0.1);
  border: 1px solid rgba(33, 150, 243, 0.3);
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.items-notice i {
  color: #2196f3;
  font-size: 1.25rem;
}

.items-notice span {
  color: #b0b0d0;
  font-size: 0.9rem;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
  .timeline-load-more .btn {
    width: 100%;
    max-width: 300px;
  }
}

/* ⭐️ [추가] 스킬 이름 변경 버튼 스타일 */
.btn-edit-skill {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0; /* 버튼이 줄어들지 않도록 설정 */
}

.btn-edit-skill:hover:not(:disabled) {
  background: var(--surface-light);
  color: var(--primary-color);
}

.btn-edit-skill:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ⭐️ [수정] 기존 skill-header 및 name 스타일 수정 */
.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px; /* 버튼 추가를 위한 간격 */
}

.skill-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1; /* 이름이 공간을 차지하도록 함 */
  min-width: 0; /* 이름이 너무 길 경우 ... 처리 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipped-badge {
  flex-shrink: 0; /* 뱃지가 줄어들지 않도록 설정 */
}

/* [신규] 능력치 아이템 클릭 가능 스타일 */
.proficiency-item.clickable-stat {
  cursor: pointer;
  transition: var(--transition);
}

.proficiency-item.clickable-stat:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

/* [신규] 경험치 구매 모달 스타일 */
.buy-exp-modal .modal-description {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.buy-exp-modal .coin-display {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--background);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.buy-exp-modal .coin-display i {
  color: var(--warning);
}

.buy-exp-modal .input-group {
  margin-bottom: 12px;
}

.buy-exp-modal .input-label {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: block; /* [추가] */
}

.buy-exp-modal .input-label #coin-amount-display {
  color: var(--primary-color);
  font-size: 20px;
  margin-left: 8px; /* [추가] */
}

.buy-exp-modal .exp-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 12px;
  background: var(--surface-light);
  border-radius: 6px;
  outline: none;
  transition: opacity 0.2s;
}

.buy-exp-modal .exp-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.buy-exp-modal .exp-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.buy-exp-modal .exp-slider:hover::-webkit-slider-thumb {
   box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.3);
}
.buy-exp-modal .exp-slider:hover::-moz-range-thumb {
   box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.3);
}

.buy-exp-modal .exp-preview {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 16px;
}

.buy-exp-modal .exp-preview #exp-amount-display {
  color: var(--success);
  font-size: 22px;
  margin-left: 8px; /* [추가] */
}

/* [수정] 능력치 헤더 아이콘 스타일 */
.proficiency-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.proficiency-header div { /* 아이콘 + 이름 래퍼 */
  display: flex;
  align-items: center;
  gap: 8px;
}

.proficiency-header i {
  color: var(--primary-light);
  width: 16px; /* [추가] 아이콘 너비 고정 */
  text-align: center; /* [추가] 아이콘 중앙 정렬 */
}

/* ========================================
   듀오 배틀 타임라인 스타일
   ======================================== */

/* 듀오 배틀 타임라인 카드 */
.timeline-card.duo-battle-card {
  border-left: 4px solid #9c27b0;
}

.timeline-card.duo-battle-card.winner {
  background: linear-gradient(to right, rgba(156, 39, 176, 0.05), transparent);
}

.timeline-card.duo-battle-card.loser {
  background: linear-gradient(to right, rgba(156, 39, 176, 0.02), transparent);
}

/* 듀오 배틀 아이콘 */
.timeline-icon.duo-battle {
  background: linear-gradient(135deg, #9c27b0, #7b1fa2);
  color: white;
}

.timeline-icon.duo-battle.win {
  background: linear-gradient(135deg, #9c27b0, #7b1fa2);
  box-shadow: 0 0 15px rgba(156, 39, 176, 0.4);
}

.timeline-icon.duo-battle.lose {
  background: linear-gradient(135deg, #757575, #616161);
}

/* 듀오 팀 미니 표시 */
.duo-teams-mini {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.duo-team {
  flex: 1;
  min-width: 150px;
}

.team-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.team-members {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.team-member {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: var(--surface-light);
  border-radius: 8px;
  transition: var(--transition);
}

.team-member:hover {
  background: var(--surface);
  transform: translateX(4px);
}

.team-member-image {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--surface-light);
}

.team-member-image.current {
  border-color: var(--primary-color);
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.4);
}

.team-member-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.duo-vs {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 14px;
}

/* 듀오 배틀 로그 상세 페이지 */
.duo-battle-log-detail-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  padding-top: 120px;
  padding-bottom: 100px;
}

.duo-battle-log-header {
  text-align: center;
  padding: 32px;
  margin-bottom: 32px;
  background: var(--surface);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
}

.duo-battle-log-header.victory {
  border: 2px solid #9c27b0;
  background: linear-gradient(135deg, rgba(156, 39, 176, 0.1), transparent);
}

.duo-battle-log-header.defeat {
  border: 2px solid var(--text-muted);
  background: linear-gradient(135deg, rgba(117, 117, 117, 0.1), transparent);
}

/* 듀오 팀 상세 정보 */
.duo-teams-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.team-detail {
  background: var(--surface);
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
}

.team-detail h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--surface-light);
}

.team-detail.my-team h3 {
  color: #9c27b0;
  border-bottom-color: #9c27b0;
}

.team-detail.opponent-team h3 {
  color: var(--error);
  border-bottom-color: var(--error);
}

.team-members-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-member-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--background);
  border-radius: 8px;
  border: 2px solid var(--surface-light);
  transition: var(--transition);
}

.team-member-card.current {
  border-color: var(--primary-color);
  background: rgba(102, 126, 234, 0.05);
}

.team-member-card:hover {
  border-color: var(--primary-color);
  transform: translateX(4px);
}

.team-member-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--surface-light);
}

.team-member-card.current .team-member-img {
  border-color: var(--primary-color);
}

.team-member-info {
  flex: 1;
}

.member-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.member-elo {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

.member-elo .positive {
  color: var(--success);
  font-weight: 600;
}

.member-elo .negative {
  color: var(--error);
  font-weight: 600;
}

/* 듀오 배틀 로그 섹션 */
.duo-battle-log-section {
  background: var(--surface);
  padding: 24px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.duo-battle-log-content {
  line-height: 1.8;
  color: var(--text-primary);
  font-size: 15px;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .duo-teams-detail {
    grid-template-columns: 1fr;
  }
  
  .duo-teams-mini {
    flex-direction: column;
    align-items: stretch;
  }
  
  .duo-vs {
    text-align: center;
    padding: 8px 0;
  }
  
  .duo-battle-log-detail-container {
    padding: 16px;
    padding-top: 100px;
    padding-bottom: 80px;
  }
}

/* 이미지 업데이트 섹션 */
.image-update-section {
  max-width: 800px;
  margin: 0 auto;
}

.current-image-section,
.new-image-section {
  margin-bottom: 32px;
}

.section-header {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header i {
  color: var(--primary-color);
}

.current-image-container {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.current-character-image {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: var(--border-radius);
}

.image-update-notice {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--warning);
  padding: 16px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 14px;
}

.image-update-notice i {
  font-size: 20px;
  flex-shrink: 0;
}

.btn-update-image {
  width: 100%;
  padding: 16px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-update-image:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-update-image:disabled {
  background: var(--surface-light);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

.btn-update-image i {
  font-size: 18px;
}

/* 모바일 반응형 - 이미지 업데이트 */
@media (max-width: 768px) {
  .image-update-section {
    padding: 16px;
  }
  
  .current-character-image {
    max-height: 300px;
  }
  
  .image-update-notice {
    font-size: 13px;
    padding: 12px;
  }
}
