/* ============================================================
   modal.css - 弹窗样式
   ============================================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: overlayFadeIn 0.2s ease;
}

.modal-content {
  max-width: 420px;
  min-width: 300px;
  border-radius: 20px;
  padding: 28px 32px;
  text-align: center;
  cursor: pointer;
  animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}

/* --- 等级配色 --- */
.modal-s {
  background: linear-gradient(135deg, #B8860B 0%, #DAA520 30%, #FFD700 70%, #FFF8DC 100%);
  color: #000;
  border: 2px solid rgba(255, 215, 0, 0.6);
  box-shadow:
    0 0 40px rgba(255, 215, 0, 0.3),
    0 0 80px rgba(255, 215, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.modal-a {
  background: linear-gradient(135deg, #5B21B6 0%, #7C3AED 40%, #A855F7 100%);
  color: #fff;
  border: 2px solid rgba(168, 85, 247, 0.4);
  box-shadow:
    0 0 30px rgba(168, 85, 247, 0.25),
    0 0 60px rgba(168, 85, 247, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modal-b {
  background: linear-gradient(135deg, #1E3A5F 0%, #2563EB 50%, #3B82F6 100%);
  color: #fff;
  border: 2px solid rgba(59, 130, 246, 0.4);
  box-shadow:
    0 0 20px rgba(59, 130, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.modal-skin {
  background: linear-gradient(135deg, #BE185D 0%, #EC4899 40%, #F97316 100%);
  color: #fff;
  border: 2px solid rgba(236, 72, 153, 0.4);
  box-shadow:
    0 0 25px rgba(236, 72, 153, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modal-none {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

/* --- 弹窗内容 --- */
.modal-rank-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.modal-s .modal-rank-badge {
  background: rgba(0, 0, 0, 0.15);
  color: #5D4200;
}

.modal-a .modal-rank-badge {
  background: rgba(255, 255, 255, 0.15);
  color: #E0D0FF;
}

.modal-reward-name {
  font-size: 26px;
  font-weight: 800;
  margin: 12px 0;
  letter-spacing: 1px;
}

.modal-s .modal-reward-name {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.modal-detail {
  font-size: 13px;
  opacity: 0.8;
  line-height: 1.6;
}

.modal-close {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 28px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition-fast), transform var(--transition-fast);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.modal-close:active {
  transform: translateY(0);
}

.modal-s .modal-close {
  color: #3D2800;
  border-color: rgba(61, 40, 0, 0.3);
}

.modal-a .modal-close,
.modal-b .modal-close,
.modal-skin .modal-close {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* --- 分支选择弹窗 --- */
.modal-branch-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-white);
}

.modal-branch-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.modal-branch-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-branch-btn {
  padding: 12px 28px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.modal-branch-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.modal-branch-enter {
  background: linear-gradient(135deg, var(--blue-start), var(--blue-end));
  color: #fff;
}

.modal-branch-skip {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

/* --- 弹窗动画 --- */
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* --- 保底触发特殊效果 --- */
@keyframes pityPulse {
  0% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); }
  50% { box-shadow: 0 0 50px rgba(255, 215, 0, 0.6); }
  100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); }
}

.modal-s.modal-pity {
  animation: modalSlideIn 0.3s ease, pityPulse 1.5s ease-in-out infinite;
}

/* --- 十连批量结果列表 --- */
.batch-list {
  max-height: 360px;
  overflow-y: auto;
  margin-bottom: 16px;
  text-align: left;
}

.batch-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  line-height: 1.6;
}

.batch-item:last-child {
  border-bottom: none;
}

.batch-num {
  color: var(--text-secondary);
  font-size: 12px;
  min-width: 28px;
}

.batch-dice {
  color: var(--text-secondary);
  font-size: 12px;
  min-width: 32px;
}

.batch-reward {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* --- 移动端适配 --- */
@media (max-width: 600px) {
  .modal-content {
    max-width: calc(100vw - 32px);
    min-width: 260px;
    border-radius: 16px;
    padding: 20px 24px;
  }
  .modal-reward-name {
    font-size: 22px;
  }
  .modal-close {
    padding: 10px 24px;
    width: 100%;
    display: block;
    text-align: center;
  }
  .modal-branch-buttons {
    flex-direction: column;
    gap: 8px;
  }
  .modal-branch-btn {
    width: 100%;
    padding: 14px 28px;
  }
}
