/**
 * SYNAPSE — 召唤卡牌展示系统样式
 * 包含召唤动画、卡牌翻转效果、粒子光效等
 */

/* ═══════════════════════════════════════════════
   SUMMON OVERLAY — 全屏召唤界面
══════════════════════════════════════════════ */
#summon-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#summon-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* 星空背景 */
#summon-overlay .so-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #0a0018 0%, #000 70%);
  overflow: hidden;
}
#summon-overlay .so-bg::before {
  content: '';
  position: absolute;
  inset: -50%;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 10%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 80%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 40%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 20% 90%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 80% 5%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 45%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 70%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(2px 2px at 15% 50%, rgba(139,92,246,0.8) 0%, transparent 100%),
    radial-gradient(2px 2px at 75% 25%, rgba(0,212,255,0.7) 0%, transparent 100%);
  animation: starRotate 60s linear infinite;
}

@keyframes starRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 召唤光柱 */
.so-beam {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%) scaleY(0);
  transform-origin: center top;
  background: linear-gradient(180deg, transparent 0%, rgba(0,212,255,0.8) 40%, rgba(139,92,246,1) 70%, transparent 100%);
  filter: blur(4px);
  opacity: 0;
}
.so-beam.animate {
  animation: beamDrop 1.2s ease-out forwards;
}
@keyframes beamDrop {
  0% { transform: translateX(-50%) scaleY(0); opacity: 0; }
  30% { opacity: 1; }
  70% { transform: translateX(-50%) scaleY(1); opacity: 1; }
  100% { transform: translateX(-50%) scaleY(1); opacity: 0.3; }
}

/* 能量环 */
.so-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 200px;
  height: 200px;
  transform: translate(-50%, -50%) scale(0);
  border-radius: 50%;
  border: 2px solid rgba(0,212,255,0.8);
  box-shadow: 0 0 20px rgba(0,212,255,0.5), inset 0 0 20px rgba(0,212,255,0.2);
  opacity: 0;
}
.so-ring:nth-child(2) {
  width: 300px; height: 300px;
  border-color: rgba(139,92,246,0.6);
  animation-delay: 0.1s;
}
.so-ring:nth-child(3) {
  width: 420px; height: 420px;
  border-color: rgba(239,68,68,0.4);
  animation-delay: 0.2s;
}
.so-ring.animate {
  animation: ringExpand 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes ringExpand {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  60% { opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ═══════════════════════════════════════════════
   SUMMON STAGES
══════════════════════════════════════════════ */
.so-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* 阶段1 — 召唤仪式动画 */
.so-stage-ritual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}
.so-ritual-circle {
  width: 200px;
  height: 200px;
  position: relative;
}
.so-ritual-circle svg {
  width: 100%;
  height: 100%;
  animation: ritualSpin 3s linear infinite;
}
@keyframes ritualSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.so-ritual-circle .inner-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  animation: innerPulse 1.5s ease-in-out infinite;
}
@keyframes innerPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
}
.so-ritual-text {
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.2em;
  text-align: center;
  animation: textGlow 1.5s ease-in-out infinite;
}
@keyframes textGlow {
  0%, 100% { text-shadow: 0 0 10px rgba(0,212,255,0.5); }
  50% { text-shadow: 0 0 30px rgba(0,212,255,1), 0 0 60px rgba(139,92,246,0.8); }
}
.so-ritual-subtitle {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.15em;
  margin-top: -1.5rem;
}

/* 阶段2 — 卡背翻转 */
.so-stage-flip {
  perspective: 1200px;
}
.so-card-wrapper {
  width: 320px;
  height: 500px;
  position: relative;
  transform-style: preserve-3d;
  cursor: pointer;
}
.so-card-wrapper.flip-animate {
  animation: cardFlipIn 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes cardFlipIn {
  0% {
    transform: rotateY(180deg) rotateX(-15deg) scale(0.3) translateY(100px);
    opacity: 0;
  }
  30% {
    opacity: 1;
    transform: rotateY(180deg) rotateX(-5deg) scale(0.8) translateY(20px);
  }
  60% {
    transform: rotateY(90deg) rotateX(0deg) scale(1.05) translateY(-10px);
  }
  80% {
    transform: rotateY(20deg) scale(1.02) translateY(-5px);
  }
  100% {
    transform: rotateY(0deg) scale(1) translateY(0);
    opacity: 1;
  }
}

/* 卡牌正面和背面共同样式 */
.card-face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  backface-visibility: hidden;
  overflow: hidden;
}

/* 卡牌背面 */
.card-back {
  background: linear-gradient(135deg, #0a0018 0%, #150030 50%, #0a0018 100%);
  border: 2px solid rgba(139,92,246,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(139,92,246,0.3);
}
.card-back-pattern {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 20px, rgba(139,92,246,0.05) 20px, rgba(139,92,246,0.05) 21px),
    repeating-linear-gradient(-45deg, transparent, transparent 20px, rgba(0,212,255,0.03) 20px, rgba(0,212,255,0.03) 21px);
}
.card-back-logo {
  font-size: 4rem;
  opacity: 0.6;
  position: relative;
  z-index: 1;
  animation: logoFloat 3s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(180deg); }
}

/* ═══════════════════════════════════════════════
   CHARACTER CARD — 角色卡牌主体
══════════════════════════════════════════════ */
.char-card {
  width: 320px;
  height: 500px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
  user-select: none;
}
.char-card:hover {
  transform: translateY(-8px) scale(1.02);
}

/* 稀有度发光边框 */
.char-card.rarity-legendary {
  box-shadow: 0 0 0 2px rgba(245,158,11,0.8), 0 0 40px rgba(245,158,11,0.4), 0 20px 60px rgba(0,0,0,0.8);
  animation: legendaryPulse 2s ease-in-out infinite;
}
.char-card.rarity-rare {
  box-shadow: 0 0 0 2px rgba(139,92,246,0.7), 0 0 30px rgba(139,92,246,0.35), 0 20px 50px rgba(0,0,0,0.7);
  animation: rarePulse 2.5s ease-in-out infinite;
}
.char-card.rarity-elite {
  box-shadow: 0 0 0 2px rgba(0,212,255,0.6), 0 0 25px rgba(0,212,255,0.3), 0 20px 40px rgba(0,0,0,0.6);
}

@keyframes legendaryPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(245,158,11,0.8), 0 0 40px rgba(245,158,11,0.4), 0 20px 60px rgba(0,0,0,0.8); }
  50% { box-shadow: 0 0 0 3px rgba(245,158,11,1), 0 0 70px rgba(245,158,11,0.7), 0 20px 80px rgba(0,0,0,0.9); }
}
@keyframes rarePulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(139,92,246,0.7), 0 0 30px rgba(139,92,246,0.35), 0 20px 50px rgba(0,0,0,0.7); }
  50% { box-shadow: 0 0 0 2px rgba(139,92,246,0.9), 0 0 50px rgba(139,92,246,0.6), 0 20px 60px rgba(0,0,0,0.8); }
}

/* 卡牌背景图 */
.card-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.5s ease;
}
.char-card:hover .card-bg-img {
  transform: scale(1.05);
}

/* 颜色渐变叠加层 */
.card-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.1) 0%,
    rgba(0,0,0,0.05) 30%,
    rgba(0,0,0,0.4) 55%,
    rgba(0,0,0,0.92) 80%,
    rgba(0,0,0,0.98) 100%
  );
}

/* 类型颜色光晕 */
.card-type-glow {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 200px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.4;
}

/* 顶部稀有度角标 */
.card-rarity-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 3;
}
.card-rarity-badge.rarity-legendary {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  box-shadow: 0 0 12px rgba(245,158,11,0.6);
}
.card-rarity-badge.rarity-rare {
  background: linear-gradient(135deg, #8b5cf6, #00d4ff);
  color: #fff;
  box-shadow: 0 0 10px rgba(139,92,246,0.5);
}
.card-rarity-badge.rarity-elite {
  background: linear-gradient(135deg, #00d4ff, #10b981);
  color: #fff;
  box-shadow: 0 0 8px rgba(0,212,255,0.4);
}

/* 类型标签 */
.card-type-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  z-index: 3;
  border: 1px solid currentColor;
}

/* 卡牌底部信息 */
.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  z-index: 3;
}

.card-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 0.2rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}
.card-title-text {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.8rem;
  letter-spacing: 0.05em;
}

/* 属性条 */
.card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 0.8rem;
  margin-bottom: 0.8rem;
}
.card-stat-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.card-stat-label {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.45);
  width: 22px;
  flex-shrink: 0;
}
.card-stat-bar-wrap {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.card-stat-bar-fill {
  height: 100%;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-stat-bar-fill.animate {
  transform: scaleX(1);
}
.card-stat-val {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.7);
  font-family: monospace;
  width: 22px;
  text-align: right;
  flex-shrink: 0;
}

/* 收益预览 */
.card-income {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
}
.card-income-label {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.45);
}
.card-income-val {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: monospace;
  color: #10b981;
}

/* 特效粒子 */
.card-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}
.card-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  animation: particleFloat linear infinite;
}
@keyframes particleFloat {
  0% {
    transform: translateY(100%) translateX(0) scale(0);
    opacity: 0;
  }
  10% { opacity: 1; transform: translateY(85%) translateX(5px) scale(1); }
  90% { opacity: 0.8; }
  100% {
    transform: translateY(-20%) translateX(-5px) scale(0);
    opacity: 0;
  }
}

/* 闪光扫描效果 */
.card-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255,255,255,0.12) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  z-index: 4;
  pointer-events: none;
}
.char-card:hover .card-shine {
  animation: cardShine 0.6s ease forwards;
}
@keyframes cardShine {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* ═══════════════════════════════════════════════
   SUMMON RESULT PAGE — 召唤结果展示
══════════════════════════════════════════════ */
.so-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  position: relative;
  z-index: 5;
  transform: translateY(30px);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
}
.so-result.show {
  transform: translateY(0);
  opacity: 1;
}

.so-result-title {
  font-size: 1rem;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.so-result-name {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  text-align: center;
  text-shadow: 0 0 30px currentColor;
  margin-top: -1rem;
}
.so-result-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.so-btn {
  padding: 0.7rem 1.8rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}
.so-btn-primary {
  background: linear-gradient(135deg, #8b5cf6, #00d4ff);
  color: #fff;
  box-shadow: 0 0 20px rgba(139,92,246,0.4);
}
.so-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 25px rgba(139,92,246,0.6);
}
.so-btn-secondary {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.15);
}
.so-btn-secondary:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
}

/* 进入世界按钮 — 最突出 */
.so-btn-enter {
  background: linear-gradient(135deg, #8b5cf6, #00d4ff);
  color: #fff;
  font-size: 1rem;
  padding: 0.85rem 2.2rem;
  border: none;
  box-shadow: 0 0 25px rgba(139,92,246,0.5);
  letter-spacing: 0.08em;
  position: relative;
  overflow: hidden;
}
.so-btn-enter::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s;
}
.so-btn-enter:hover::after { transform: translateX(100%); }
.so-btn-enter:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 35px rgba(139,92,246,0.7);
}

/* 结果区按钮排列：进入世界在第一行独占，其余在第二行 */
.so-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}
.so-btn-enter {
  width: 100%;
  text-align: center;
}

/* ═══════════════════════════════════════════════
   CHARACTER GALLERY — 角色展览网格
══════════════════════════════════════════════ */
.chars-gallery {
  padding: 3rem 2rem;
}
.chars-gallery-title {
  text-align: center;
  margin-bottom: 2.5rem;
}
.chars-gallery-title h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary, #fff);
}
.chars-gallery-title p {
  color: var(--text-muted, rgba(255,255,255,0.5));
  margin-top: 0.5rem;
}

/* 类型筛选 tabs */
.chars-type-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.chars-type-tab {
  padding: 0.45rem 1.2rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
  transition: all 0.2s ease;
  letter-spacing: 0.05em;
}
.chars-type-tab:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-color: rgba(255,255,255,0.3);
}
.chars-type-tab.active {
  color: #fff;
  border-color: currentColor;
  background: rgba(255,255,255,0.12);
}

/* 角色卡片网格 */
.chars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* 角色缩略卡片 */
.char-mini-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 2/3;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0s;
}
.char-mini-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.char-mini-card:hover {
  transform: translateY(-6px) scale(1.03);
}
.char-mini-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.char-mini-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.9) 100%);
}
.char-mini-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.8rem;
}
.char-mini-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.15rem;
}
.char-mini-type {
  font-size: 0.68rem;
  opacity: 0.7;
}
.char-mini-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.char-mini-rarity {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.62rem;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════
   CARD DETAIL MODAL — 卡牌详情弹窗
══════════════════════════════════════════════ */
#char-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1rem;
}
#char-detail-modal.open {
  opacity: 1;
  pointer-events: all;
}
.cdm-inner {
  background: #080014;
  border-radius: 20px;
  border: 1px solid rgba(139,92,246,0.2);
  display: flex;
  gap: 0;
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 80px rgba(139,92,246,0.2), 0 40px 80px rgba(0,0,0,0.8);
}
#char-detail-modal.open .cdm-inner {
  transform: scale(1) translateY(0);
}
.cdm-card-col {
  width: 300px;
  flex-shrink: 0;
  position: relative;
}
.cdm-info-col {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.cdm-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
}
.cdm-close:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* 详情页信息区 */
.cdm-header {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 1.2rem;
}
.cdm-name {
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 0.3rem;
}
.cdm-title {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.8rem;
}
.cdm-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.cdm-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* 属性雷达/条 */
.cdm-stats h4 {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
}
.cdm-stat-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}
.cdm-stat-name {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  width: 40px;
  flex-shrink: 0;
}
.cdm-stat-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.cdm-stat-fill {
  height: 100%;
  border-radius: 3px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.cdm-stat-fill.animate {
  transform: scaleX(1);
}
.cdm-stat-num {
  font-size: 0.75rem;
  font-family: monospace;
  color: rgba(255,255,255,0.7);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* 技能列表 */
.cdm-skills h4 {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
}
.cdm-skill-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.8rem;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  margin-bottom: 0.4rem;
  border: 1px solid rgba(255,255,255,0.06);
}
.cdm-skill-type {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.62rem;
  font-weight: 600;
  flex-shrink: 0;
  text-transform: uppercase;
}
.cdm-skill-type.attack { background: rgba(239,68,68,0.2); color: #f87171; }
.cdm-skill-type.defense { background: rgba(59,130,246,0.2); color: #60a5fa; }
.cdm-skill-type.special { background: rgba(139,92,246,0.2); color: #a78bfa; }
.cdm-skill-type.support { background: rgba(16,185,129,0.2); color: #34d399; }
.cdm-skill-type.control { background: rgba(245,158,11,0.2); color: #fbbf24; }
.cdm-skill-type.passive { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }
.cdm-skill-name {
  flex: 1;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
}
.cdm-skill-power {
  font-size: 0.75rem;
  font-family: monospace;
  color: #f59e0b;
}

/* 背景故事 */
.cdm-lore {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
  font-style: italic;
  border-left: 2px solid rgba(139,92,246,0.4);
  padding-left: 1rem;
}

/* 收益卡片 */
.cdm-income-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 10px;
}
.cdm-income-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
}
.cdm-income-value {
  font-size: 1rem;
  font-weight: 700;
  color: #10b981;
  font-family: monospace;
}

/* 召唤按钮（在详情里） */
.cdm-summon-btn {
  width: 100%;
  padding: 0.9rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #8b5cf6, #00d4ff);
  border: none;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(139,92,246,0.3);
  margin-top: auto;
}
.cdm-summon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 30px rgba(139,92,246,0.5);
}

/* ═══════════════════════════════════════════════
   WORLDS.HTML 召唤流程 — Step 2 卡牌选择区
══════════════════════════════════════════════ */
.char-picker-wrap {
  position: relative;
}
.char-picker-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.8rem;
}
.char-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.8rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 0.3rem;
}
.char-picker-grid::-webkit-scrollbar {
  width: 4px;
}
.char-picker-grid::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
}
.char-picker-grid::-webkit-scrollbar-thumb {
  background: rgba(139,92,246,0.5);
  border-radius: 2px;
}
.char-pick-card {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.25s ease;
}
.char-pick-card:hover {
  transform: scale(1.04);
  border-color: rgba(139,92,246,0.5);
}
.char-pick-card.selected {
  border-color: var(--card-color, #8b5cf6);
  box-shadow: 0 0 15px var(--card-glow, rgba(139,92,246,0.5));
}
.char-pick-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.char-pick-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.85) 100%);
}
.char-pick-name {
  position: absolute;
  bottom: 0.5rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  padding: 0 4px;
  line-height: 1.2;
}
.char-pick-rarity-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.char-pick-check {
  position: absolute;
  inset: 0;
  background: rgba(139,92,246,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.char-pick-card.selected .char-pick-check {
  opacity: 1;
}
.char-picker-filter {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.cpf-btn {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
  transition: all 0.2s;
}
.cpf-btn:hover, .cpf-btn.active {
  background: rgba(139,92,246,0.15);
  border-color: rgba(139,92,246,0.4);
  color: #a78bfa;
}

/* ═══════════════════════════════════════════════
   LOADING / ENTRY ANIMATION
══════════════════════════════════════════════ */
.char-card-enter {
  animation: charCardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes charCardEnter {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 传奇卡专属光芒爆发动画 */
.legendary-reveal {
  animation: legendaryReveal 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes legendaryReveal {
  0% {
    transform: scale(0) rotate(-15deg);
    opacity: 0;
    filter: brightness(3) blur(10px);
  }
  20% {
    transform: scale(1.3) rotate(5deg);
    opacity: 1;
    filter: brightness(2) blur(3px);
  }
  50% {
    transform: scale(0.95) rotate(-2deg);
    filter: brightness(1.5) blur(1px);
  }
  75% {
    transform: scale(1.05) rotate(0deg);
    filter: brightness(1.2) blur(0);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    filter: brightness(1) blur(0);
  }
}

/* 稀有卡出现动画 */
.rare-reveal {
  animation: rareReveal 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes rareReveal {
  0% {
    transform: scale(0.3) translateY(40px);
    opacity: 0;
    filter: brightness(2) saturate(2);
  }
  40% {
    transform: scale(1.08) translateY(-8px);
    opacity: 1;
  }
  70% {
    transform: scale(0.98) translateY(3px);
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
    filter: brightness(1) saturate(1);
  }
}

/* 普通卡出现动画 */
.normal-reveal {
  animation: normalReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes normalReveal {
  0% { transform: scale(0.7) translateY(20px); opacity: 0; }
  60% { transform: scale(1.03) translateY(-3px); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Detail modal */
  .cdm-inner {
    flex-direction: column;
    max-height: 93svh;
    overflow: hidden;
  }
  .cdm-card-col {
    width: 100%;
    height: 200px;
    flex-shrink: 0;
  }
  .cdm-card-col .char-card {
    width: 100%;
    height: 200px;
    border-radius: 18px 18px 0 0;
  }
  .cdm-card-col .char-card .card-bg-img {
    object-position: center 18%;
  }
  .cdm-info-col {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    padding: 1rem 1.1rem 1.5rem;
  }

  /* Characters grid */
  .chars-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  /* Char picker */
  .char-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    max-height: 200px;
    overflow-y: auto;
  }

  /* Summon card wrapper */
  .so-card-wrapper {
    width: 220px;
    height: 340px;
  }

  /* Result */
  .so-result {
    padding: 1rem 0.75rem 1.5rem;
    max-height: 96svh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .so-result-name {
    font-size: 1.3rem;
  }

  /* Result card */
  .so-result .char-card {
    width: 200px !important;
    height: 310px !important;
  }
}
