/* 梦核映像模块（灵魂囚笼版 · 完整样式） */
.dreamcore-card {
  position: relative;
  overflow: visible;
  text-align: center;
}
.dreamcore-badge {
  background: #3a1a2a;
  color: #ffaa00;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-left: 12px;
  letter-spacing: 1px;
  border: 1px solid #ffd966;
}
.dreamcore-canvas-wrapper {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 12px;
  cursor: crosshair;
  aspect-ratio: 600 / 400;
  background: #05010a;
  border: 2px solid #4a2a2a;
  box-shadow: inset 0 0 40px #0a0000, 0 0 20px #3f1f2f;
}
.prison-background {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(circle at 20% 30%, #1a0f1a, #030103);
  animation: bgFlicker 6s infinite;
}
@keyframes bgFlicker {
  0%,100% { opacity: 1; }
  50% { opacity: 0.85; }
}
.trapped-ghost {
  position: absolute;
  top: 55%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100px; height: 120px;
  pointer-events: none;
  animation: ghostFloat 5s infinite ease-in-out;
  filter: drop-shadow(0 0 12px #7fcfcf);
}
.ghost-body {
  position: relative;
  width: 80px; height: 90px;
  background: radial-gradient(circle at 30% 20%, #c0e8e8, #5f9f9f);
  border-radius: 50% 50% 30% 30% / 60% 60% 30% 30%;
  box-shadow: inset 0 -10px 15px #3f6f6f, 0 0 20px #8fdfdf;
}
.ghost-eyes {
  display: flex; justify-content: space-around;
  padding-top: 20px; padding-left: 10px; padding-right: 10px;
}
.ghost-eye {
  width: 16px; height: 20px;
  background: #0a0a0a;
  border-radius: 50%;
  box-shadow: inset 0 0 5px #fff;
  animation: eyeBlink 4s infinite;
}
.ghost-eye.left { margin-left: 5px; }
.ghost-eye.right { margin-right: 5px; }
@keyframes eyeBlink {
  0%,90%,100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}
.ghost-mouth {
  width: 20px; height: 10px;
  background: #1a0a0a;
  border-radius: 0 0 20px 20px;
  margin: 8px auto 0;
  opacity: 0.8;
}
.ghost-tail {
  width: 60px; height: 30px;
  background: linear-gradient(to bottom, #5f9f9f, transparent);
  border-radius: 0 0 50% 50%;
  margin: -5px auto 0;
  opacity: 0.7;
  animation: tailWag 4s infinite ease-in-out;
}
@keyframes ghostFloat {
  0%,100% { transform: translate(-50%, -50%) translateY(0); }
  25% { transform: translate(-45%, -55%) translateY(-8px); }
  50% { transform: translate(-55%, -45%) translateY(5px); }
  75% { transform: translate(-50%, -55%) translateY(-5px); }
}
@keyframes tailWag {
  0%,100% { transform: rotate(0deg); }
  25% { transform: rotate(5deg); }
  75% { transform: rotate(-5deg); }
}
.seal-runes {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.rune {
  position: absolute;
  font-size: 28px; font-weight: 900;
  color: rgba(200, 50, 50, 0.7);
  text-shadow: 0 0 10px #ff0000, 0 0 20px #8b0000;
  font-family: 'Courier New', 'Noto Serif SC', monospace;
  transform: rotate(-10deg);
  animation: runeGlow 2s infinite alternate;
}
.rune1 { top: 10%; left: 8%; }
.rune2 { top: 20%; right: 12%; transform: rotate(15deg); }
.rune3 { top: 45%; left: 5%; font-size: 22px; }
.rune4 { bottom: 25%; right: 8%; transform: rotate(-20deg); }
.rune5 { bottom: 15%; left: 20%; }
.rune6 { top: 60%; right: 18%; font-size: 20px; }
@keyframes runeGlow {
  0% { opacity: 0.5; text-shadow: 0 0 8px #ff0000; }
  100% { opacity: 0.9; text-shadow: 0 0 20px #ff5555, 0 0 35px #cc0000; }
}
.iron-bars {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex; justify-content: space-around;
  pointer-events: none;
}
.bar {
  width: 8px; height: 100%;
  background: repeating-linear-gradient(to bottom, #2a1a1a, #4a2a2a 10px, #2a1a1a 20px);
  box-shadow: inset 0 0 10px #1a0a0a, 0 0 5px #1a0000;
  border-left: 1px solid #6a4a4a;
  border-right: 1px solid #1a0a0a;
}
.wail-popup {
  position: absolute; bottom: 20px; left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 5, 15, 0.9);
  backdrop-filter: blur(4px);
  border: 1px solid #af6f9f;
  border-radius: 60px;
  padding: 12px 24px;
  color: #ffeaaf;
  font-size: 18px; font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 0 20px #3f1f2f;
  z-index: 30;
  animation: wailFade 2s forwards;
  pointer-events: none;
}
@keyframes wailFade {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  20% { opacity: 1; transform: translateX(-50%) translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}
.wail-popup.hidden { display: none; }
.dreamcore-caption {
  color: #8b7a9e; font-size: 13px; font-style: italic;
  text-align: center; margin: 8px 0;
}
.dreamcore-actions {
  display: flex; gap: 12px; justify-content: center; margin-top: 16px;
}
.btn {
  background: rgba(20, 8, 25, 0.8);
  border: 1px solid #6f4f6f;
  border-radius: 60px;
  padding: 12px 24px;
  font-weight: 600; cursor: pointer;
  color: #e0c0d0;
}
.btn-gold {
  background: rgba(60, 20, 40, 0.8);
  border-color: #9f6f8f;
  color: #ffeaaf;
}
.hidden { display: none !important; }

/* 失败锁定面板 */
.fail-lock-panel {
  margin-top: 20px; padding: 20px;
  background: rgba(20, 0, 0, 0.7);
  border: 1px solid #8b1a1a;
  border-radius: 30px; text-align: center;
  backdrop-filter: blur(4px);
}
.fail-message {
  color: #ffaaaa; font-size: 18px; font-weight: 600;
  margin-bottom: 16px; text-shadow: 0 0 8px #8b0000;
}
.soul-interrogation {
  margin: 20px 0; padding: 16px;
  background: rgba(0,0,0,0.4);
  border-radius: 24px; border: 1px solid #8b1a1a;
}
.interrogation-title {
  color: #ffaa00; font-size: 14px; margin-bottom: 16px;
  text-shadow: 0 0 5px #aa0000;
}
.interrogation-question {
  color: #ffd7b0; font-size: 18px; font-weight: 600; margin: 16px 0;
}
.interrogation-options {
  display: flex; gap: 20px; justify-content: center;
}
.interrogation-btn {
  background: rgba(20,8,25,0.9); border: 1px solid #af6f9f;
  border-radius: 40px; padding: 10px 30px;
  color: #e0c0d0; font-size: 18px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.interrogation-btn:hover {
  background: #5f2f4f; border-color: #ffd966; color: #ffeaaf;
}
.typewriter-container {
  margin: 20px 0; padding: 16px;
  background: rgba(0,0,0,0.3);
  border-radius: 24px; border: 1px solid #af6f9f;
  text-align: left; min-height: 100px;
}
.typewriter-container .typewriter-line {
  color: #ffeaaf; font-size: 16px; line-height: 1.6;
  word-break: break-word; margin-bottom: 8px;
}
.goto-life-btn {
  padding: 14px 32px !important; font-size: 18px !important;
  background: #8b1a1a !important; border-color: #ff5555 !important;
  color: #ffd7b0 !important;
}
.skip-hint {
  margin-top: 12px; color: #8b7a9e; font-size: 12px; font-style: italic;
}

/* 指纹签署 */
.fingerprint-panel {
  margin-top: 20px; padding: 20px;
  background: rgba(0,0,0,0.4);
  border-radius: 30px; border: 1px solid #af6f9f;
  text-align: center;
}
.fingerprint-title {
  color: #ffd7b0; font-size: 16px; margin-bottom: 16px;
}
.mobile-only { display: block; }
.pc-only { display: none; }
@media (min-width: 768px) {
  .mobile-only { display: none; }
  .pc-only { display: block; }
}
.fingerprint-area {
  padding: 20px; background: #1a0f1a;
  border: 2px dashed #af6f9f;
  border-radius: 30px; cursor: pointer;
  touch-action: none;
}
.fingerprint-area:active { background: #2a1a2a; border-color: #ffd966; }
.fingerprint-icon { font-size: 48px; margin-bottom: 8px; }
.fingerprint-hint { color: #c0a0b0; font-size: 14px; }
.fingerprint-progress {
  margin-top: 12px; height: 6px; background: #2a1a2a;
  border-radius: 3px; overflow: hidden;
}
.fingerprint-progress::after {
  content: ''; display: block; width: 0%; height: 100%;
  background: #ffd966; animation: progressFill 2s linear forwards;
}
@keyframes progressFill {
  from { width: 0%; } to { width: 100%; }
}
.fingerprint-status {
  margin-top: 12px; color: #8b7a9e; font-size: 14px; min-height: 20px;
}

/* 成功/失败动效 */
.prison-weakened .rune { opacity: 0.3; text-shadow: 0 0 5px #8b0000; }
.prison-weakened .iron-bars { opacity: 0.6; filter: blur(1px); }
.ghost-success .trapped-ghost {
  animation: ghostSuccessFloat 3s forwards !important;
}
@keyframes ghostSuccessFloat {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  20% { transform: translate(-30%, -80%) scale(1.1); opacity: 1; }
  40% { transform: translate(-70%, -30%) scale(1.05); opacity: 1; }
  60% { transform: translate(-20%, -60%) scale(1.1); opacity: 1; }
  80% { transform: translate(-60%, -40%) scale(1.05); opacity: 1; }
  100% { transform: translate(-50%, -150%) scale(0); opacity: 0; }
}
.success-message-popup {
  position: absolute; top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  color: #a0f0a0; font-size: 20px; font-weight: 700;
  text-shadow: 0 0 15px #00aa00, 0 0 30px #006600;
  white-space: nowrap; z-index: 40;
  animation: successTextFade 3s forwards;
  pointer-events: none;
}
@keyframes successTextFade {
  0% { opacity: 0; transform: translate(-50%, -20px); }
  20% { opacity: 1; transform: translate(-50%, -50%); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -80px); }
}
.ghost-fail .trapped-ghost {
  animation: ghostFailStruggle 2s forwards !important;
}
@keyframes ghostFailStruggle {
  0%,100% { transform: translate(-50%, -50%) scale(1); filter: brightness(1); }
  20% { transform: translate(-45%, -55%) scale(1.1); filter: brightness(0.6) sepia(1) hue-rotate(-30deg); }
  40% { transform: translate(-55%, -45%) scale(0.95); filter: brightness(0.8) sepia(1) hue-rotate(-20deg); }
  60% { transform: translate(-50%, -50%) scale(1.05); filter: brightness(0.5) sepia(1) hue-rotate(-40deg); }
  80% { transform: translate(-48%, -52%) scale(1.02); filter: brightness(0.7) sepia(1) hue-rotate(-30deg); }
}
.destroy-animation {
  animation: cardDestroy 0.5s forwards !important;
}
@keyframes cardDestroy {
  0% { opacity: 1; transform: scale(1); filter: blur(0); }
  30% { opacity: 0.8; transform: scale(1.02); filter: blur(2px); background: #8b1a1a; }
  60% { opacity: 0.4; transform: scale(0.9); filter: blur(4px); background: #4a0000; }
  100% { opacity: 0; transform: scale(0); filter: blur(8px); display: none; }
}
.dreamcore-card.locked { pointer-events: none; }
.dreamcore-card.locked .fail-lock-panel { pointer-events: auto; }
.dreamcore-card.locked .dreamcore-actions { opacity: 0.3; pointer-events: none; }
/* ===== PC端卡片强制居中 ===== */
.deep-dive-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.horror-card,
.dreamcore-card,
.rule-card,
.soul-debt-card,
.poster-card {
    width: 100%;
    max-width: 680px;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
    align-self: center;
}

/* 确保幽灵囚笼画布内部不偏移 */
.dreamcore-canvas-wrapper {
    margin-left: auto;
    margin-right: auto;
}

/* ===== 灵魂飘荡两圈动画（强制生效补丁） ===== */
.ghost-success .trapped-ghost,
.ghost-success .trapped-ghost *,
#trappedGhost.ghost-success,
.trapped-ghost.ghost-success {
    animation: ghostSuccessFloat 3s ease-in-out forwards !important;
    -webkit-animation: ghostSuccessFloat 3s ease-in-out forwards !important;
    will-change: transform, opacity;
    transform-origin: center;
}

/* ===== 幽灵恐怖突袭动画（冲出屏幕 + 屏幕震动） ===== */
.ghost-success {
    animation: ghostTerrorRush 3s cubic-bezier(0.1, 0.8, 0.3, 1.2) forwards !important;
    -webkit-animation: ghostTerrorRush 3s cubic-bezier(0.1, 0.8, 0.3, 1.2) forwards !important;
    will-change: left, top, transform, opacity, filter;
    filter: drop-shadow(0 0 30px #ff0000) drop-shadow(0 0 60px #8b0000) !important;
    z-index: 100000 !important;
}

@keyframes ghostTerrorRush {
    /* 起始：从囚笼位置突然弹出 */
    0% {
        left: calc(var(--start-left, 50%) - 60px);
        top: calc(var(--start-top, 50%) - 70px);
        transform: scale(1) rotate(0deg);
        opacity: 0.9;
    }
    /* 第一次突袭：急速冲向右下角，瞬间放大 */
    10% {
        left: 90%;
        top: 85%;
        transform: scale(2.8) rotate(35deg);
        opacity: 1;
        filter: drop-shadow(0 0 50px #ff0000) drop-shadow(0 0 100px #ff5555);
    }
    /* 急转弯：闪到左上角边缘 */
    20% {
        left: -5%;
        top: 5%;
        transform: scale(2) rotate(-40deg);
        opacity: 1;
    }
    /* 第二次突袭：冲出右侧屏幕 */
    35% {
        left: 115%;
        top: 30%;
        transform: scale(2.5) rotate(20deg);
        opacity: 1;
    }
    /* 从左侧猛然冲回，带残影效果 */
    45% {
        left: -15%;
        top: 70%;
        transform: scale(1.8) rotate(-25deg);
        opacity: 1;
    }
    /* 在屏幕中央急速旋转并最大化 */
    60% {
        left: 50%;
        top: 45%;
        transform: scale(3.5) rotate(720deg);
        opacity: 1;
        filter: drop-shadow(0 0 80px #ff0000) drop-shadow(0 0 150px #ffaa00);
    }
    /* 最后一次冲刺：垂直冲出屏幕顶部 */
    80% {
        left: 35%;
        top: -40%;
        transform: scale(2.2) rotate(15deg);
        opacity: 0.9;
    }
    /* 彻底消失 */
    100% {
        left: 50%;
        top: -80%;
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
}

/* 屏幕震动效果（配合幽灵冲出时触发） */
.screen-shock {
    animation: shock 0.4s ease-out;
}

@keyframes shock {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-15px, -8px); }
    20% { transform: translate(15px, 8px); }
    30% { transform: translate(-8px, 15px); }
    40% { transform: translate(8px, -15px); }
    50% { transform: translate(-15px, -8px); }
    60% { transform: translate(15px, 8px); }
    70% { transform: translate(-8px, 15px); }
    80% { transform: translate(8px, -15px); }
    90% { transform: translate(-4px, 4px); }
    100% { transform: translate(0, 0); }
}

/* 血色闪光层（增强恐怖感） */
.blood-flash {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle, rgba(255,0,0,0.3) 0%, transparent 70%);
    pointer-events: none;
    z-index: 99998;
    animation: bloodPulse 0.8s ease-out forwards;
}

@keyframes bloodPulse {
    0% { opacity: 1; }
    100% { opacity: 0; }
}
/* 确保幽灵在动画期间不被裁剪 */
.dreamcore-canvas-wrapper {
    overflow: visible !important;
    z-index: 10;
}
.trapped-ghost {
    z-index: 999 !important;
    will-change: transform, opacity;
    contain: layout style paint;
    pointer-events: none !important;
}
/* 感恩文字也提升层级 */
.success-message-popup {
    z-index: 1000 !important;
}

