/* ==========================================================================
   8. 📜 모험 스테이지 패스 (Stage Pass) 시스템 UI
   ========================================================================== */

/* 1. 전투 화면 우측 상단 플로팅 둥근 패스 버튼 (0.65x 축소) */
.btn-arena-pass-circle {
  position: absolute;
  top: 38px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  border: 1.5px solid #fde047;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 25;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  padding: 0;
}

.btn-arena-pass-circle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.65);
}

.btn-arena-pass-circle:active {
  transform: scale(0.92);
}

.pass-circle-icon {
  font-size: 0.75rem;
  line-height: 1;
}

.pass-circle-txt {
  font-size: 0.42rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  margin-top: 1px;
}

.pass-badge-count {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #ef4444;
  color: #fff;
  font-size: 0.45rem;
  font-weight: 900;
  min-width: 12px;
  height: 12px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  border: 1px solid #0f172a;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  animation: pulseBadge 1.2s infinite;
}

@keyframes pulseBadge {   /* 성능: transform 만 움직임 */
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

/* 2. 패스 모달 시트 */
.pass-modal-sheet {
  max-width: 480px;
  width: 96%;
  height: 88vh;
  max-height: 760px;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 10px 12px;
  background: linear-gradient(180deg, #0f172a 0%, #090d16 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.35);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(245, 158, 11, 0.2);
  animation: passSheetPop 0.12s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes passSheetPop {
  0% { transform: scale(0.96); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.pass-modal-header {
  margin-bottom: 6px;
  padding-bottom: 6px;
}

.pass-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.pass-tag {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  color: #000;
  font-weight: 900;
}

.pass-stage-pill {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
}

.pass-stage-pill strong {
  color: #fff;
  font-size: 0.72rem;
}

/* 3. 풀와이드 로열 패스 배너 */
.pass-royal-status-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(180, 83, 9, 0.28));
  border: 1.5px solid rgba(251, 191, 36, 0.45);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.pass-royal-status-card.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(5, 150, 105, 0.32));
  border-color: rgba(52, 211, 153, 0.65);
}

.royal-status-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.royal-crown-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 0 6px #fbbf24);
  flex-shrink: 0;
}

.royal-text-box {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.royal-status-title {
  font-size: 0.76rem;
  font-weight: 900;
  color: #fef08a;
}

.pass-royal-status-card.active .royal-status-title {
  color: #6ee7b7;
}

.royal-status-sub {
  font-size: 0.6rem;
  color: #cbd5e1;
  line-height: 1.25;
}

.btn-toggle-royal-pass {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-size: 0.66rem;
  font-weight: 900;
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
  flex-shrink: 0;
}

.btn-toggle-royal-pass:hover {
  transform: scale(1.03);
  filter: brightness(1.1);
}

.btn-toggle-royal-pass.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

/* 4. 3열 컬럼 헤더 */
.pass-columns-header {
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  gap: 8px;
  padding: 5px 6px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 8px;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pass-col-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 900;
}

.free-col-title { color: #38bdf8; }
.stage-col-title { color: #94a3b8; }
.royal-col-title { color: #fbbf24; }

/* 5. 수직 패스 트랙 스크롤 영역 */
.pass-track-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 2px 14px 2px;
  position: relative;
}

.pass-track-scroll::-webkit-scrollbar {
  width: 4px;
}

.pass-track-scroll::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 2px;
}

.pass-timeline-track {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

/* 중앙 수직 타임라인 라인 */
.pass-timeline-track::before {
  content: '';
  position: absolute;
  top: 25px;
  bottom: 35px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  background: rgba(51, 65, 85, 0.65);
  border-radius: 2px;
  z-index: 1;
}

/* 마일스톤 한 줄 행 (3단 그리드: 무료카드 - 스테이지노드 - 로열카드) */
.pass-milestone-row {
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  gap: 8px;
  align-items: center;
  position: relative;
  z-index: 2;
}

/* 중앙 스테이지 노드 */
.pass-node-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  position: relative;
  z-index: 3;
}

.pass-node-badge {
  background: #1e293b;
  border: 2px solid #475569;
  color: #94a3b8;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 5px 6px;
  border-radius: 10px;
  text-align: center;
  min-width: 50px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
}

.pass-node-badge.reached {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

.pass-node-badge.boss {
  border-color: #f59e0b;
  color: #fef08a;
}

.pass-node-badge.boss.reached {
  background: linear-gradient(135deg, #d97706, #b45309);
  border-color: #fbbf24;
  color: #fff;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.8);
}

.pass-node-sub {
  font-size: 0.52rem;
  font-weight: 800;
  color: #64748b;
  white-space: nowrap;
}

.pass-node-badge.reached + .pass-node-sub {
  color: #38bdf8;
}

/* ==========================================================================
   보상 카드 (카드 세로 확장 및 텍스트 시인성 대폭 강화)
   ========================================================================== */
.pass-reward-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 8px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  min-height: 82px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

/* 무료 카드 */
.pass-reward-card.free {
  border-color: rgba(56, 189, 248, 0.3);
}

/* 로열 유료 카드 */
.pass-reward-card.premium {
  border-color: rgba(251, 191, 36, 0.4);
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.7), rgba(15, 23, 42, 0.95));
}

.pass-reward-card.premium::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, transparent 50%, rgba(251, 191, 36, 0.35) 50%);
  border-top-right-radius: 10px;
}

/* 상태별 카드 스타일 */
/* 1) 수령 가능 (Ready) */
.pass-reward-card.ready {
  border-color: #22c55e !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 4px 12px rgba(0, 0, 0, 0.5);
}

.pass-reward-card.premium.ready {
  border-color: #f59e0b !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* 2) 수령 완료 (Claimed) */
.pass-reward-card.claimed {
  opacity: 0.55;
  filter: grayscale(0.5);
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.06);
}

/* 3) 미달성 / 잠금 (Locked) */
.pass-reward-card.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
}

/* 카드 상단: 아이콘 + 텍스트 정보 */
.pass-card-top {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
}

.pass-reward-icon {
  font-size: 1.35rem;
  width: 34px;
  height: 34px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pass-reward-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.pass-reward-label {
  font-size: 0.74rem;
  font-weight: 900;
  color: #fff;
  white-space: normal;
  line-height: 1.25;
  word-break: keep-all;
}

.pass-reward-card.premium .pass-reward-label {
  color: #fef08a;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.35);
}

.pass-reward-name {
  font-size: 0.58rem;
  color: #cbd5e1;
  font-weight: 700;
  white-space: normal;
  line-height: 1.2;
  word-break: keep-all;
}

/* 카드 하단: 액션 버튼 & 상태 뱃지 */
.pass-card-bottom {
  width: 100%;
  margin-top: 4px;
}

.pass-action-btn {
  width: 100%;
  padding: 5px 0;
  border-radius: 7px;
  font-size: 0.65rem;
  font-weight: 900;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
  display: block;
  text-align: center;
  box-sizing: border-box;
}

.pass-action-btn.btn-claim-free {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.45);
}

.pass-action-btn.btn-claim-royal {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.5);
}

.pass-action-btn:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}

.pass-action-btn:active {
  transform: scale(0.97);
}

.pass-status-pill {
  width: 100%;
  padding: 4px 0;
  border-radius: 6px;
  font-size: 0.58rem;
  font-weight: 800;
  white-space: nowrap;
  display: block;
  text-align: center;
  box-sizing: border-box;
}

.pass-status-pill.claimed-pill {
  background: rgba(100, 116, 139, 0.25);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.35);
}

.pass-status-pill.locked-pill {
  background: rgba(30, 41, 59, 0.5);
  color: #64748b;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.pass-status-pill.royal-locked-pill {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.4);
  cursor: pointer;
}

.pass-status-pill.royal-locked-pill:hover {
  background: rgba(245, 158, 11, 0.3);
  transform: scale(1.02);
}

/* 6. 하단 일괄 수령 바 (슬림 콤팩트 디자인) */
.pass-bottom-actions {
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-claim-all-pass {
  width: 100%;
  height: 38px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1.5px solid #38bdf8;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0 14px;
  border-radius: 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.35);
  transition: all 0.12s ease;
  box-sizing: border-box;
}

.claim-all-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.claim-all-txt {
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.claim-all-count {
  font-size: 0.75rem;
  font-weight: 800;
  color: #fef08a;
  line-height: 1;
}

.btn-claim-all-pass:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-claim-all-pass:active {
  transform: scale(0.98);
}

.btn-claim-all-pass:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.8);
  box-shadow: none;
}

@media (max-width: 440px) {
  .pass-columns-header, .pass-milestone-row {
    grid-template-columns: 1fr 54px 1fr;
    gap: 5px;
  }
  .pass-node-badge {
    min-width: 44px;
    font-size: 0.58rem;
    padding: 4px 4px;
  }
  .pass-reward-card {
    padding: 7px 6px;
    min-height: 78px;
  }
  .pass-reward-icon {
    width: 28px;
    height: 28px;
    font-size: 1.05rem;
  }
  .pass-reward-label {
    font-size: 0.68rem;
  }
  .pass-reward-name {
    font-size: 0.52rem;
  }
  .pass-action-btn {
    padding: 4px 0;
    font-size: 0.6rem;
  }
  .pass-status-pill {
    padding: 3px 0;
    font-size: 0.54rem;
  }
}

.pass-reward-label .pr-line { display: block; }
.pass-reward-label { font-size: 0.7rem; }
