/* ==========================================================================
   2. 하단 장비 & 상자 통합 작업 스테이지 (Forge Station)
   ========================================================================== */
.forge-station-area {
  flex: 1;
  background: var(--bg-panel);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

/* 상자 명칭 및 확률 버튼 (상자 바로 아래) */
.chest-title-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.65);
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 2px;
  margin-bottom: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  z-index: 3;
}

.tier-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.2px;
}

.btn-prob-info {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-prob-info:hover {
  background: #38bdf8;
  color: #0f172a;
  transform: scale(1.15);
}

/* --------------------------------------------------------------------------
   3열 통합 그리드: 좌측(피해 4슬롯) | 중앙(3D 상자) | 우측(체력 4슬롯)
   -------------------------------------------------------------------------- */
.gear-and-chest-grid {
  display: grid;
  grid-template-columns: 88px 1fr 88px;
  gap: 8px;
  align-items: center;
  background: rgba(15, 23, 42, 0.45);
  padding: 8px 6px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  min-height: 255px;
}

/* 슬롯 열 공통 */
.gear-slot-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.slot-col-header {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dmg-header {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.hp-header {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.col-dot { font-size: 0.5rem; }

/* 장비 슬롯 */
.equip-slot {
  width: 52px;
  height: 52px;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 8px rgba(0, 0, 0, 0.45);
}

.equip-slot:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 6px 12px rgba(0, 0, 0, 0.55);
}

.equip-slot:active {
  transform: scale(0.95);
}

.slot-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
}

.stat-type-icon {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 0.5rem;
}

.stat-type-icon.dmg-dot { color: #ef4444; }
.stat-type-icon.hp-dot { color: #22c55e; }

.slot-tier-tag {
  position: absolute;
  top: -3px;
  right: -3px;
  font-size: 0.48rem;
  font-weight: 900;
  padding: 1px 3px;
  border-radius: 4px;
  background: #334155;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
  line-height: 1.1;
  letter-spacing: -0.2px;
}

.slot-tier-tag.t1 { background: #94a3b8; color: #0f172a; }
.slot-tier-tag.t2 { background: #38bdf8; color: #0f172a; }
.slot-tier-tag.t3 { background: #10b981; color: #0f172a; }
.slot-tier-tag.t4 { background: #eab308; color: #0f172a; }
.slot-tier-tag.t5 { background: #ef4444; color: #fff; }
.slot-tier-tag.t6 { background: #a855f7; color: #fff; }
.slot-tier-tag.t7 { background: #06b6d4; color: #0f172a; }
.slot-tier-tag.t8 { background: #8b5cf6; color: #fff; }
.slot-tier-tag.t9 { background: #92400e; color: #fff; }
.slot-tier-tag.t10 { background: #f97316; color: #fff; }
.slot-tier-tag.empty { opacity: 0.3; }

/* 중앙 3D 상자 존 */
.chest-center-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.chest-display-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 118px;
  cursor: pointer;
  width: 100%;
}

.chest-halo {
  position: absolute;
  width: 130px;
  height: 130px;
  background: radial-gradient(ellipse at 50% 55%, var(--tier-glow, rgba(255, 255, 255, 0.04)) 0%, rgba(255, 255, 255, 0.01) 55%, transparent 72%);
  transition: background 0.4s ease;
  border-radius: 50%;
  pointer-events: none;
}

.chest-model {
  width: 110px;
  height: 82px;
  position: relative;
  z-index: 2;
  transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 이미지 상자: 티어별 PNG(512x512, 투명 배경)를 쓰고, CSS 도형 상자는 숨김 */
.chest-model.has-img { width: 132px; height: 132px; display: flex; align-items: center; justify-content: center; }
.chest-model.has-img > .chest-lid-part,
.chest-model.has-img > .chest-base-part { display: none; }
.chest-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 10px var(--tier-glow, transparent));
  transition: filter 0.3s ease;
}
.chest-model.has-img.opening .chest-img { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 18px var(--tier-color)); }
.chest-display-box { min-height: 132px; }

.chest-model:hover {
  transform: scale(1.03);
}

.chest-model:active {
  transform: scale(0.95);
}

.chest-lid-part {
  width: 110px;
  height: 35px;
  background: var(--tier-color);
  border-radius: 14px 14px 4px 4px;
  position: relative;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.3), 0 4px 8px rgba(0,0,0,0.4);
  transition: transform 0.2s ease;
  transform-origin: top center;
}

.lid-metallic-band {
  position: absolute;
  top: 7px;
  left: 14px;
  right: 14px;
  height: 4px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 2px;
}

.lid-lock-clasp {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 10px;
  background: #f1c40f;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.chest-base-part {
  width: 110px;
  height: 47px;
  background: var(--tier-color);
  filter: brightness(0.85);
  border-radius: 4px 4px 12px 12px;
  position: relative;
  box-shadow: 0 6px 14px rgba(0,0,0,0.5);
}

.keyhole-module {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 18px;
  background: #d4ac0d;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.keyhole-slit {
  width: 4px;
  height: 7px;
  background: #1e2430;
  border-radius: 2px;
}

.chest-model.opening .chest-lid-part {
  transform: translateY(-10px) rotateX(25deg);
}

.chest-model.opening {
  animation: chestBounce 0.3s ease;
}

@keyframes chestBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.08) translateY(-6px); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   🎁 상자 위 획득 장비 카드 (대기 & 비교 모달 호출 슬롯)
   ========================================================================== */
.chest-drop-item-slot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  animation: dropItemFloat 2s ease-in-out infinite alternate;
}

@keyframes dropItemFloat {
  0% { transform: translate(-50%, -50%) translateY(0); }
  100% { transform: translate(-50%, -50%) translateY(-6px); }
}

.drop-item-glow {
  position: absolute;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.45) 0%, rgba(234, 179, 8, 0.25) 45%, transparent 70%);
  border-radius: 50%;
  animation: dropGlowPulse 1.5s infinite alternate ease-in-out;
  pointer-events: none;
}

@keyframes dropGlowPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 1; }
}

.drop-item-card {
  position: relative;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.96));
  border: 2px solid #38bdf8;
  border-radius: 14px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(56, 189, 248, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  min-width: 130px;
  animation: dropCardPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
}

@keyframes dropCardPop {
  0% { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  70% { transform: scale(1.1) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.drop-item-card:hover {
  transform: scale(1.06);
  border-color: #facc15;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.8), 0 0 22px rgba(250, 204, 21, 0.7);
}

.drop-item-card:active {
  transform: scale(0.96);
}

.drop-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 6px;
}

.drop-item-tier-badge {
  font-size: 0.65rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  background: #38bdf8;
  color: #0f172a;
  letter-spacing: -0.2px;
}

.drop-item-stat-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #4ade80;
}

.drop-item-icon-box {
  width: 44px;
  height: 44px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-item-icon {
  font-size: 1.8rem;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
}

.drop-item-name {
  font-size: 0.75rem;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.drop-item-tap-hint {
  font-size: 0.6rem;
  font-weight: 800;
  color: #facc15;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.35);
  padding: 2px 6px;
  border-radius: 9999px;
  margin-top: 2px;
  animation: hintBlink 1.2s infinite alternate;
}

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

/* 티어별 드롭 카드 테두리 & 글로우 컬러 */
.drop-item-card.t1 { border-color: #94a3b8; box-shadow: 0 8px 24px rgba(0,0,0,0.7), 0 0 16px rgba(148, 163, 184, 0.4); }
.drop-item-card.t2 { border-color: #38bdf8; box-shadow: 0 8px 24px rgba(0,0,0,0.7), 0 0 16px rgba(56, 189, 248, 0.5); }
.drop-item-card.t3 { border-color: #10b981; box-shadow: 0 8px 24px rgba(0,0,0,0.7), 0 0 16px rgba(16, 185, 129, 0.5); }
.drop-item-card.t4 { border-color: #eab308; box-shadow: 0 8px 24px rgba(0,0,0,0.7), 0 0 18px rgba(234, 179, 8, 0.6); }
.drop-item-card.t5 { border-color: #ef4444; box-shadow: 0 8px 24px rgba(0,0,0,0.7), 0 0 18px rgba(239, 68, 68, 0.6); }
.drop-item-card.t6 { border-color: #a855f7; box-shadow: 0 8px 24px rgba(0,0,0,0.7), 0 0 20px rgba(168, 85, 247, 0.6); }
.drop-item-card.t7 { border-color: #06b6d4; box-shadow: 0 8px 24px rgba(0,0,0,0.7), 0 0 20px rgba(6, 182, 212, 0.6); }
.drop-item-card.t8 { border-color: #8b5cf6; box-shadow: 0 8px 24px rgba(0,0,0,0.7), 0 0 22px rgba(139, 92, 246, 0.7); }
.drop-item-card.t9 { border-color: #92400e; box-shadow: 0 8px 24px rgba(0,0,0,0.7), 0 0 22px rgba(146, 64, 14, 0.7); }
.drop-item-card.t10 { border-color: #f97316; box-shadow: 0 8px 24px rgba(0,0,0,0.7), 0 0 26px rgba(249, 115, 22, 0.8); }

.drop-item-tier-badge.t1 { background: #94a3b8; color: #0f172a; }
.drop-item-tier-badge.t2 { background: #38bdf8; color: #0f172a; }
.drop-item-tier-badge.t3 { background: #10b981; color: #0f172a; }
.drop-item-tier-badge.t4 { background: #eab308; color: #0f172a; }
.drop-item-tier-badge.t5 { background: #ef4444; color: #fff; }
.drop-item-tier-badge.t6 { background: #a855f7; color: #fff; }
.drop-item-tier-badge.t7 { background: #06b6d4; color: #0f172a; }
.drop-item-tier-badge.t8 { background: #8b5cf6; color: #fff; }
.drop-item-tier-badge.t9 { background: #92400e; color: #fff; }
.drop-item-tier-badge.t10 { background: #f97316; color: #fff; }

/* 상자 바로 아래 2대 메인 컨트롤 바 (1.상자 강화 | 2.자동 AUTO) */
.chest-sub-controls-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 0 4px;
}

/* 1. 상자 시간제 속성 강화 버튼 영역 */
.upgrade-btn-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.btn-quick-upgrade {
  background: linear-gradient(180deg, #1d4ed8 0%, #1e3a8a 100%);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #fff;
  height: 52px;
  padding: 4px 8px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 10px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s;
}

.btn-quick-upgrade:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 14px rgba(0, 0, 0, 0.55);
}

.btn-quick-upgrade:active {
  transform: scale(0.97);
}

.btn-upgrade-progress-bg {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.4), rgba(168, 85, 247, 0.4));
  pointer-events: none;
  transition: width 0.2s linear;
}

.btn-quick-upgrade.upgrading {
  background: #0f172a;
  border: 1.5px solid #38bdf8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 10px rgba(0, 0, 0, 0.5);
}

.btn-quick-upgrade .btn-sub-label {
  font-size: 0.64rem;
  opacity: 0.95;
  font-weight: 800;
  z-index: 2;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.btn-quick-upgrade strong {
  font-size: 0.82rem;
  font-weight: 900;
  z-index: 2;
  color: #fde047;
  line-height: 1.1;
}

.upgrade-time-sub {
  font-size: 0.56rem;
  color: #94a3b8;
  font-weight: 700;
  z-index: 2;
  line-height: 1.1;
}

.btn-quick-upgrade.upgrading .upgrade-time-sub {
  color: #38bdf8;
  font-weight: 900;
}

/* 즉시 완료 가속 버튼 */
.btn-speedup-upgrade {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s;
}

.btn-speedup-upgrade:active {
  transform: scale(0.95);
}

/* 2. 자동 오픈 (AUTO) 버튼 영역 */
.auto-btn-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.btn-quick-auto {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  height: 52px;
  padding: 4px 8px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 10px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
}

.btn-quick-auto:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 6px 14px rgba(0, 0, 0, 0.55);
}

.btn-quick-auto:active {
  transform: scale(0.97);
}

/* 활성화(동작중) 상태 */
.btn-quick-auto.active {
  background: linear-gradient(180deg, #065f46 0%, #064e3b 100%);
  border: 1.5px solid #10b981;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0, 0, 0, 0.5);
}

.btn-quick-auto.active .btn-auto-pulse-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.15), transparent);
  pointer-events: none;
}

.btn-quick-auto.locked {
  opacity: 0.7;
  cursor: pointer;
  border-color: rgba(239, 68, 68, 0.35);
}

.auto-top-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  z-index: 2;
}

.auto-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
  transition: background 0.2s;
}

.btn-quick-auto.active .auto-indicator-dot {
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.8);
}

.auto-btn-main-label {
  font-size: 0.72rem;
  font-weight: 900;
  color: #e2e8f0;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.btn-quick-auto.active .auto-btn-main-label {
  color: #34d399;
}

.auto-bottom-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 2px;
  z-index: 2;
}

.auto-batch-badge {
  font-size: 0.6rem;
  font-weight: 800;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.1;
}

.btn-quick-auto.active .auto-batch-badge {
  background: rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
}

.auto-sub-hint {
  font-size: 0.58rem;
  font-weight: 700;
  color: #94a3b8;
  line-height: 1.1;
  padding: 1px 3px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}

.auto-sub-hint:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

.auto-lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 900;
  color: #f87171;
  border-radius: 10px;
  z-index: 5;
}

/* 탭 네비게이션 자물쇠 뱃지 */
.nav-tab-btn {
  position: relative;
}

.tab-lock-badge {
  position: absolute;
  top: 2px;
  right: 10px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  font-size: 0.52rem;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.nav-tab-btn.locked-tab {
  opacity: 0.7;
}

/* ⚙️ 자동 오픈 설정 모달창 스타일 */
.auto-settings-sheet {
  max-width: 390px;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 25px rgba(56, 189, 248, 0.2);
}

.auto-tag {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.auto-settings-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 14px 0 16px 0;
}

.auto-setting-block {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
}

/* 👑 스마트 BM 블록 프리미엄 스타일 */
.auto-setting-block.smart-bm-block {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.12);
}

.smart-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.smart-crown-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.smart-ticket-counter {
  font-size: 0.68rem;
  font-weight: 900;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  padding: 2px 7px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.smart-desc-text {
  font-size: 0.65rem;
  color: #cbd5e1;
  line-height: 1.35;
  margin: 4px 0 10px 0;
}

.smart-desc-text strong {
  color: #fde047;
}

.smart-status-banner {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.smart-charge-info {
  display: flex;
  flex-direction: column;
}

.charge-label {
  font-size: 0.58rem;
  color: #94a3b8;
  font-weight: 700;
}

.charge-val {
  font-size: 0.85rem;
  font-weight: 900;
  color: #38bdf8;
}

.smart-status-banner.royal-active .charge-val {
  color: #fde047;
}

.btn-use-smart-ticket {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 6px 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-use-smart-ticket:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
}

.btn-use-smart-ticket:active {
  transform: scale(0.96);
}

.btn-use-smart-ticket:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

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

.setting-block-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #f1f5f9;
}

.setting-block-sub {
  font-size: 0.62rem;
  color: #94a3b8;
}

.auto-batch-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.batch-chip-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #f1f5f9;
}

.batch-chip-btn:hover:not(.locked) {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

.batch-chip-btn.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(2, 132, 199, 0.35));
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.batch-chip-btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: rgba(239, 68, 68, 0.3);
}

.batch-chip-title {
  font-size: 0.72rem;
  font-weight: 800;
}

.batch-chip-sub {
  font-size: 0.55rem;
  color: #f87171;
  font-weight: 700;
}

.batch-chip-sub.unlocked {
  color: #34d399;
}

.toggle-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.unlock-stage-tag {
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: -0.2px;
}

.unlock-stage-tag.locked {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.unlock-stage-tag.unlocked {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.locked-block {
  opacity: 0.55;
}

.sell-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sell-quick-actions {
  display: flex;
  gap: 4px;
}

.btn-sell-quick {
  background: rgba(51, 65, 85, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-sell-quick:hover {
  background: #0284c7;
  color: #fff;
  border-color: #38bdf8;
}

.auto-sell-checkboxes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 6px;
  max-height: 190px;
  overflow-y: auto;
  padding-right: 2px;
}

.tier-sell-check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 7px 8px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.tier-sell-check-item:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(30, 41, 59, 0.9);
}

.tier-sell-check-item.checked {
  background: rgba(14, 165, 233, 0.15);
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.tier-sell-check-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #0284c7;
  cursor: pointer;
}

.tier-badge-pill {
  font-size: 0.6rem;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 4px;
  background: #1e293b;
  color: #38bdf8;
  border: 1px solid currentColor;
  flex-shrink: 0;
}

.tier-badge-pill.t1 { color: #94a3b8; }
.tier-badge-pill.t2 { color: #38bdf8; }
.tier-badge-pill.t3 { color: #10b981; }
.tier-badge-pill.t4 { color: #eab308; }
.tier-badge-pill.t5 { color: #ef4444; }
.tier-badge-pill.t6 { color: #a855f7; }
.tier-badge-pill.t7 { color: #06b6d4; }
.tier-badge-pill.t8 { color: #8b5cf6; }
.tier-badge-pill.t9 { color: #92400e; }
.tier-badge-pill.t10 { color: #f97316; }

.tier-sell-text {
  font-size: 0.68rem;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 3px;
}

.tier-rate-sub {
  font-size: 0.58rem;
  color: #94a3b8;
}

.setting-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.setting-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-main-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #f1f5f9;
}

.toggle-sub-label {
  font-size: 0.62rem;
  color: #94a3b8;
  line-height: 1.2;
}

.auto-switch-label {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}

.auto-switch-label input {
  opacity: 0;
  width: 0;
  height: 0;
}

.auto-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  transition: 0.2s;
  border-radius: 22px;
}

.auto-switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

.auto-switch-label input:checked + .auto-switch-slider {
  background-color: #10b981;
}

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

.auto-modal-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.btn-modal-auto-start {
  flex: 1.3;
  height: 44px;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  transition: transform 0.1s, filter 0.15s, background 0.2s;
}

.btn-modal-auto-start:hover {
  filter: brightness(1.1);
}

.btn-modal-auto-start:active {
  transform: scale(0.97);
}

.btn-modal-auto-start.running {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-confirm-auto-save {
  flex: 1;
  height: 44px;
  background: linear-gradient(135deg, #334155, #1e293b);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}

.btn-confirm-auto-save:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-confirm-auto-save:active {
  transform: scale(0.97);
}


/* ==========================================================================
   🪭 일괄 오픈(5/10개) 결과: 상자 위 부채꼴 아이템 목록
   ========================================================================== */
.chest-drop-fan {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  z-index: 26;
  display: none;
  pointer-events: none;
}
.fan-card {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  min-width: 0;
  padding: 2px 2px 3px;
  gap: 1px;
  border-radius: 10px;
  pointer-events: auto;
  cursor: pointer;
  transform: translate(calc(-50% + var(--fx)), calc(-50% + var(--fy))) rotate(var(--fr));
  animation: fanPop 0.42s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
  transition: transform 0.15s, filter 0.15s;
}
.fan-card:hover {
  transform: translate(calc(-50% + var(--fx)), calc(-50% + var(--fy) - 6px)) rotate(0deg) scale(1.15);
  z-index: 5;
  filter: brightness(1.2);
}
.fan-card:active { transform: translate(calc(-50% + var(--fx)), calc(-50% + var(--fy))) scale(0.95); }
.fan-card .fan-tier { font-size: 0.55rem; padding: 1px 4px; align-self: center; }
.fan-card .fan-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.fan-card .fan-icon img, .fan-card .fan-icon .item-icon { max-width: 100%; max-height: 100%; }
@keyframes fanPop {
  0%   { transform: translate(-50%, -50%) scale(0.2) rotate(0deg); opacity: 0; }
  100% { transform: translate(calc(-50% + var(--fx)), calc(-50% + var(--fy))) rotate(var(--fr)); opacity: 1; }
}


/* ===== 상자 강화: 완료 대기(확인 버튼) / 티어 진화 연출 ===== */
/* 성능: 그림자 크기를 매 프레임 바꾸지 않고, 그림자를 가진 겹(::after)의 투명도와 버튼 크기만 움직임 */
.btn-quick-upgrade.upgrade-ready { position: relative; box-shadow: 0 0 6px rgba(74, 222, 128, 0.5); animation: upgradeReadyPulse 1.1s ease-in-out infinite; will-change: transform; }
.btn-quick-upgrade.upgrade-ready::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 18px rgba(74, 222, 128, 0.95); opacity: 0; animation: upgradeReadyGlow 1.1s ease-in-out infinite; pointer-events: none; will-change: opacity; }
@keyframes upgradeReadyPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes upgradeReadyGlow { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
#chest-img.chest-evolve { animation: chestEvolve 1.4s ease-out; }
@keyframes chestEvolve {
  0% { transform: scale(0.8); filter: brightness(3) saturate(0); }
  35% { transform: scale(1.18); filter: brightness(2) drop-shadow(0 0 24px #fde68a); }
  100% { transform: scale(1); filter: none; }
}

/* 좁은 화면에서 상자 강화 / 자동 버튼 글자가 줄바꿈되며 밀리지 않도록 한 줄 고정 */
.btn-quick-upgrade, .btn-quick-auto { padding: 4px 5px; min-width: 0; width: 100%; }
.btn-quick-upgrade > span, .btn-quick-upgrade > strong,
.auto-top-row, .auto-bottom-row, .auto-btn-main-label, .auto-batch-badge, .auto-sub-hint {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.auto-top-row, .auto-bottom-row { min-width: 0; }
.auto-btn-main-label, .auto-batch-badge, .auto-sub-hint { flex: 0 1 auto; min-width: 0; }
.auto-btn-main-label { font-size: 0.68rem; }
.auto-bottom-row { gap: 2px; }
.auto-batch-badge { font-size: 0.56rem; padding: 1px 3px; }
.auto-sub-hint { font-size: 0.54rem; padding: 1px 1px; }
.chest-sub-controls-row { gap: 5px; padding: 0; }
.btn-quick-upgrade, .btn-quick-auto { padding: 4px 3px; }
.auto-top-row { gap: 3px; }
.auto-indicator-dot { width: 6px; height: 6px; flex: none; }
