/* ============================================================================
   🏰 일간 던전(Daily Dungeons) & 대량 특수재화 파밍 UI 스타일
   ============================================================================ */

/* 1. 전투 스테이지 플로팅 던전 버튼 (0.65x 축소) */
.btn-arena-dungeon-circle {
  position: absolute;
  top: 74px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  border: 1.5px solid #a5b4fc;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 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-dungeon-circle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.65);
}

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

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

.dungeon-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;
}

.dungeon-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;
}

/* 2. 일간 던전 모달 시트 (상단 메뉴 & 배너 고정) */
#daily-dungeon-modal .dungeon-modal-sheet,
.dungeon-modal-sheet {
  width: 100% !important;
  max-width: 420px !important;
  height: 94% !important;
  max-height: 800px !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 12px 10px 10px 10px !important;
  background: linear-gradient(180deg, #0f172a 0%, #090d16 100%) !important;
  border: 1.5px solid rgba(99, 102, 241, 0.4) !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(99, 102, 241, 0.2) !important;
  animation: passSheetPop 0.12s cubic-bezier(0.16, 1, 0.3, 1) !important;
  overflow: hidden !important;
  position: relative !important;
  box-sizing: border-box !important;
}

#daily-dungeon-modal .dungeon-modal-header,
.dungeon-modal-header {
  margin-bottom: 6px;
  padding-bottom: 6px;
  flex-shrink: 0 !important;
}

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

.dungeon-tag {
  background: linear-gradient(90deg, #6366f1, #4f46e5);
  color: #fff;
  font-weight: 900;
}

.dungeon-reset-pill {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

/* 3. 3대 던전 탭 바 (고정) */
#daily-dungeon-modal .dungeon-type-tabs,
.dungeon-type-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* 던전 6종: 3열 x 2행 */
  gap: 4px;
  margin-bottom: 8px;
  flex-shrink: 0 !important;
}

.dungeon-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  background: rgba(30, 41, 59, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.dungeon-tab-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(255, 255, 255, 0.25);
}

.dungeon-tab-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(67, 56, 202, 0.4));
  border-color: #818cf8;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.dungeon-tab-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.dungeon-tab-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dungeon-tab-name {
  font-size: 0.72rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dungeon-tab-sub {
  font-size: 0.58rem;
  color: #94a3b8;
}

.ticket-cnt.has-ticket {
  color: #38bdf8;
  font-weight: 800;
}

/* 4. 던전 선택 상세 배너 (고정) */
#daily-dungeon-modal .dungeon-selected-banner,
.dungeon-selected-banner {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 8px;
  flex-shrink: 0 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.dungeon-banner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.dungeon-banner-title-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dungeon-banner-badge {
  font-size: 0.6rem;
  font-weight: 900;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
}

.dungeon-banner-title {
  font-size: 0.95rem;
  font-weight: 900;
  color: #fff;
  margin: 0;
}

.dungeon-ticket-pill {
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.dungeon-ticket-pill.active strong {
  color: #4ade80;
}

.dungeon-banner-desc {
  font-size: 0.68rem;
  color: #cbd5e1;
  line-height: 1.35;
  margin: 0 0 6px 0;
}

.dungeon-banner-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 8px;
  border-radius: 6px;
}

.dungeon-banner-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.btn-banner-quick-sweep {
  width: 100%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: 1.5px solid #34d399;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 900;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.45);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-banner-quick-sweep:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

.btn-banner-quick-sweep:active {
  transform: scale(0.98);
}

.btn-banner-quick-sweep:disabled {
  opacity: 0.45;
  filter: grayscale(0.8);
  cursor: not-allowed;
  box-shadow: none;
}

/* 5. 1~30단계 난이도 카드 리스트 (스크롤 영역) */
#daily-dungeon-modal .dungeon-tiers-list,
.dungeon-tiers-list {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px;
  padding-right: 2px;
  position: relative !important;
  box-sizing: border-box !important;
}

.dungeon-tiers-list::-webkit-scrollbar {
  width: 4px;
}

.dungeon-tiers-list::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 2px;
}

.dungeon-tier-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.dungeon-tier-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.dungeon-tier-card.selected {
  border-color: #818cf8;
  background: rgba(30, 41, 59, 0.9);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.dungeon-tier-card.locked-tier {
  opacity: 0.45;
  filter: grayscale(0.8);
  cursor: not-allowed;
}

.dungeon-tier-card.cleared {
  border-color: rgba(56, 189, 248, 0.4);
}

.tier-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.tier-name {
  font-size: 0.82rem;
  font-weight: 900;
  color: #fff;
}

.tier-badge-cleared {
  font-size: 0.55rem;
  font-weight: 800;
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
  padding: 1px 5px;
  border-radius: 4px;
}

.tier-badge-locked {
  font-size: 0.55rem;
  font-weight: 800;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 1px 5px;
  border-radius: 4px;
}

.tier-req-power {
  font-size: 0.68rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.tier-req-power.safe {
  color: #38bdf8;
}

.tier-req-power.danger {
  color: #f87171;
}

.tier-rewards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dungeon-reward-chip {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.key-chip {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.egg-chip {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

.ticket-chip {
  color: #f472b6;
  border-color: rgba(244, 114, 182, 0.3);
}

.fabric-chip {
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.3);
}

.gold-chip {
  color: #fde047;
  border-color: rgba(253, 224, 71, 0.3);
}

.tier-card-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  min-width: 80px;
}

.btn-dungeon-sweep {
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.12s;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
  text-align: center;
}

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

.btn-dungeon-enter {
  padding: 7px 12px;
  border-radius: 8px;
  border: none;
  font-size: 0.76rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.12s;
  text-align: center;
}

.btn-dungeon-enter.challenge {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45);
}

.btn-dungeon-enter.retry {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.45);
}

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

.btn-dungeon-enter:disabled, .btn-dungeon-sweep:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.8);
  box-shadow: none;
}

/* 6. 던전 보상 & 소탕 완료 팝업 */
.dungeon-reward-sheet {
  max-width: 380px;
  width: 90%;
  background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%);
  border: 2px solid #818cf8;
  border-radius: 18px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9), 0 0 30px rgba(99, 102, 241, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dungeon-reward-icon-burst {
  font-size: 2.5rem;
  margin-bottom: 6px;
}

.dungeon-reward-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: #fde047;
  margin: 0 0 4px 0;
  text-shadow: 0 0 10px rgba(253, 224, 71, 0.5);
}

.dungeon-reward-subtitle {
  font-size: 0.72rem;
  color: #cbd5e1;
  margin: 0 0 14px 0;
}

.dungeon-reward-items-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.dungeon-reward-item-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.82rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-confirm-dungeon-reward {
  width: 100%;
  padding: 10px 0;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
  transition: all 0.15s;
}

.btn-confirm-dungeon-reward:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}




/* ===== 일일 던전 개편: 5탭 · 입장/소탕 버튼 · 보상표 · 전투 HUD ===== */
.dungeon-tab-btn {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 2px;
  padding: 6px 2px;
}
.dungeon-tab-info { align-items: center; }
.dungeon-tab-name { font-size: 0.6rem; }
.dungeon-action-row { gap: 6px; }
.dungeon-main-enter { flex: 1.6; padding: 8px 6px; font-size: 0.74rem; }
.dungeon-main-sweep { flex: 1; padding: 8px 6px; font-size: 0.68rem; }
.dungeon-main-enter:disabled, .dungeon-main-sweep:disabled { opacity: 0.45; filter: grayscale(0.8); cursor: not-allowed; }
.dungeon-rules-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 5px;
}
.dungeon-rule-title { font-size: 0.78rem; font-weight: 900; color: #fde047; }
.dungeon-rule-line { font-size: 0.68rem; color: #cbd5e1; line-height: 1.4; }
.dungeon-rule-line strong { color: #67e8f9; }
.dungeon-reward-table { display: flex; flex-direction: column; gap: 6px; }
.dungeon-reward-row { align-items: center; justify-content: space-between; padding: 8px 12px; }
.dungeon-reward-amount { font-size: 0.85rem; font-weight: 900; color: #fde047; }
.btn-dungeon-retreat {
  flex: 0 0 auto;
  background: rgba(127, 29, 29, 0.85);
  border: 1px solid #f87171;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 900;
  padding: 3px 7px;
  border-radius: 8px;
  cursor: pointer;
}
.dungeon-wave-label { font-size: 0.7rem; font-weight: 900; color: #fde047; letter-spacing: 0.5px; }

/* 🔒 스테이지 도달 전 잠긴 던전 탭 */
.dungeon-tab-btn.locked { opacity: 0.55; filter: grayscale(0.6); }
.dungeon-tab-btn.locked .dungeon-tab-sub { color: #fbbf24; font-weight: 800; }


/* 🔒 던전 진행 중: 전투 화면 이외의 조작 차단 */
#tab-forge { position: relative; }
#dungeon-lock-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(2, 6, 23, 0.78);
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto; cursor: not-allowed;
}
.dungeon-lock-msg { text-align: center; color: #e2e8f0; font-size: 14px; font-weight: 900; line-height: 1.5; }
.dungeon-lock-msg small { font-size: 11px; font-weight: 700; color: #94a3b8; }
.mobile-frame.dungeon-running .header-status-bar,
.mobile-frame.dungeon-running .bottom-nav-bar {
  pointer-events: none;
  filter: brightness(0.5);
}
.mobile-frame.dungeon-running #btn-open-pass,
.mobile-frame.dungeon-running #btn-open-daily-dungeon {
  display: none;
}
/* 던전 중 퇴각 버튼: 패스 버튼과 같은 둥근 플로팅 버튼 (빨간 톤) */
.btn-dungeon-retreat-circle {
  background: linear-gradient(135deg, #b91c1c, #7f1d1d) !important;
  border-color: #fca5a5 !important;
}


/* 던전 스테이지 선택 */
.dungeon-stage-picker {
  display: flex; align-items: center; gap: 8px; margin: 6px 0;
  background: rgba(15, 23, 42, 0.6); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px; padding: 6px 8px;
}
.dg-stage-btn {
  width: 32px; height: 32px; flex: 0 0 auto; border-radius: 8px; cursor: pointer;
  background: rgba(56, 189, 248, 0.2); color: #e0f2fe; border: 1px solid rgba(56, 189, 248, 0.5);
  font-size: 13px; font-weight: 900;
}
.dg-stage-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.dg-stage-info { flex: 1; text-align: center; display: flex; flex-direction: column; gap: 1px; }
.dg-stage-info strong { color: #f8fafc; font-size: 14px; }
.dg-stage-info small { color: #94a3b8; font-size: 10px; }
