/* ═══ VOID GACHA · 召喚影院 Pull Cinema（電子化 / 全息） ═══ */

@keyframes pcIridescent {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes pcTextSparkle {
    0%, 100% {
        filter: drop-shadow(0 0 6px rgba(0, 255, 255, 0.7)) drop-shadow(0 0 14px rgba(255, 110, 200, 0.45));
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.95)) drop-shadow(0 0 22px rgba(0, 255, 255, 0.75));
    }
}

body.pull-overlay-open {
    overflow: hidden;
    overscroll-behavior: none;
}

html.pull-overlay-open {
    overflow: hidden;
    overscroll-behavior: none;
}

body.pull-overlay-open #screen-app {
    overflow: hidden;
    max-height: 100dvh;
    touch-action: none;
}

body.pull-overlay-open #void-scroll-top {
    display: none !important;
}

#pull-overlay {
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    height: 100dvh;
    max-height: 100dvh;
    touch-action: pan-y;
    background: #020108;
    font-family: 'Noto Sans TC', system-ui, sans-serif;
}

#pull-overlay:has(.pc-phase-summary.active),
#pull-overlay:has(.pc-phase-flip.active) {
    overflow: hidden;
}

#pull-overlay:not(.hidden) {
    justify-content: flex-start;
    align-items: stretch;
}

.pull-cinema {
    position: relative;
    width: 100%;
    min-height: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
}

/* —— 虛空背景層 —— */
.pc-void-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 90% 70% at 50% 35%, rgba(60, 10, 120, 0.55), transparent 62%),
        radial-gradient(ellipse 120% 50% at 50% 100%, rgba(0, 255, 200, 0.06), transparent 55%),
        #020108;
}

.pc-grid-floor {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 55%, #000 20%, transparent 75%);
    transform: perspective(400px) rotateX(58deg) scale(1.4);
    transform-origin: 50% 80%;
    opacity: 0.65;
    animation: pcGridDrift 18s linear infinite;
}

@keyframes pcGridDrift {
    to { background-position: 48px 48px; }
}

.pc-aurora {
    position: absolute;
    inset: -50%;
    background: conic-gradient(from 0deg, #ff0055, #7f00ff, #00ffff, #ffd700, #ff0055);
    opacity: 0.14;
    animation: pcAuroraSpin 24s linear infinite;
    filter: blur(70px);
}

.pc-aurora--2 {
    opacity: 0.1;
    animation-duration: 32s;
    animation-direction: reverse;
    filter: blur(90px);
}

@keyframes pcAuroraSpin {
    to { transform: rotate(360deg); }
}

.pc-scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.12;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.35) 2px,
        rgba(0, 0, 0, 0.35) 4px
    );
    animation: pcScanMove 6s linear infinite;
}

@keyframes pcScanMove {
    to { transform: translateY(4px); }
}

.pc-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 70% 65% at 50% 45%, transparent 35%, rgba(0, 0, 0, 0.75) 100%);
}

.pc-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.pc-particle {
    position: absolute;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 10px #00ffff, 0 0 18px #ff00aa;
    animation: pcParticleFly var(--dur, 2s) ease-out forwards;
}

.pc-particle--spark {
    width: 2px;
    height: 8px;
    border-radius: 2px;
    animation-name: pcSparkFly;
}

@keyframes pcParticleFly {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}

@keyframes pcSparkFly {
    0% { opacity: 1; transform: translate(0, 0) rotate(var(--rot, 0deg)) scaleY(1); }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)) rotate(var(--rot, 0deg)) scaleY(0.2); }
}

/* —— 階段容器 —— */
.pc-phase {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.pc-phase.active {
    opacity: 1;
    pointer-events: auto;
}

.pc-phase.hidden {
    display: none !important;
}

/* —— Phase 1：虛空傳送門 —— */
.pc-phase-portal .pc-portal-wrap {
    position: relative;
    width: min(340px, 72vw);
    height: min(340px, 72vw);
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 60px rgba(127, 0, 255, 0.5));
}

.pc-portal-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
}

.pc-ring-1 {
    inset: 0;
    border-top-color: rgba(0, 255, 255, 0.95);
    border-right-color: rgba(255, 0, 128, 0.7);
    animation: pcRingSpin 2.2s linear infinite;
    box-shadow:
        0 0 50px rgba(0, 255, 255, 0.35),
        inset 0 0 40px rgba(127, 0, 255, 0.2);
}

.pc-ring-2 {
    inset: 10%;
    border-bottom-color: rgba(255, 215, 0, 0.85);
    border-left-color: rgba(127, 0, 255, 0.75);
    animation: pcRingSpin 1.6s linear infinite reverse;
}

.pc-ring-3 {
    inset: 22%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.15);
    animation: pcRingPulse 1s ease-in-out infinite;
}

@keyframes pcRingSpin {
    to { transform: rotate(360deg); }
}

@keyframes pcRingPulse {
    0%, 100% { transform: scale(0.92); opacity: 0.5; }
    50% { transform: scale(1.06); opacity: 1; }
}

.pc-portal-core {
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, #00ffff 25%, #7f00ff 55%, #000 100%);
    box-shadow:
        0 0 40px #00ffff,
        0 0 80px #ff00aa,
        0 0 120px rgba(127, 0, 255, 0.9);
    animation: pcCorePulse 0.7s ease-in-out infinite alternate;
}

@keyframes pcCorePulse {
    from { transform: scale(0.88); filter: brightness(1); }
    to { transform: scale(1.12); filter: brightness(1.5); }
}

.pc-portal-text {
    position: absolute;
    bottom: -52px;
    left: 0;
    right: 0;
    margin: 0;
    font-family: Orbitron, 'Noto Sans TC', sans-serif;
    font-size: clamp(1.45rem, 5.5vw, 2.35rem);
    font-weight: 900;
    letter-spacing: 0.32em;
    text-align: center;
    background: linear-gradient(92deg, #00ffff, #ffd700, #ff6ec7, #a78bfa, #00ffff);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pcIridescent 2.5s linear infinite, pcTextSparkle 2.2s ease-in-out infinite;
}

.pc-portal-sub {
    position: absolute;
    bottom: -78px;
    margin: 0;
    width: 100%;
    text-align: center;
    font-family: Orbitron, monospace;
    font-size: clamp(12px, 1.8vw, 15px);
    font-weight: 700;
    color: rgba(0, 255, 255, 0.9);
    letter-spacing: 0.32em;
    text-shadow: 0 0 14px rgba(0, 255, 255, 0.75);
    animation: pcSubBlink 1.2s step-end infinite;
}

@keyframes pcSubBlink {
    50% { opacity: 0.35; }
}

@keyframes pcTextShine {
    to { background-position: 300% center; }
}

.pc-phase-portal.portal-burst .pc-portal-wrap {
    animation: pcPortalBurst 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes pcPortalBurst {
    0% { transform: scale(1); opacity: 1; filter: brightness(1); }
    40% { transform: scale(1.4); opacity: 1; filter: brightness(2); }
    100% { transform: scale(2.8); opacity: 0; filter: brightness(3); }
}

/* —— Phase 2：翻牌舞台（電子 HUD） —— */
.pc-phase-flip {
    justify-content: flex-start;
    padding-top: 28px;
    padding-bottom: max(96px, env(safe-area-inset-bottom, 0px) + 80px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.pc-flip-mythic-title {
    margin: 0 auto 10px;
    padding: 0 0.5rem;
    font-family: Orbitron, 'Noto Sans TC', sans-serif;
    font-size: clamp(1.35rem, 4.8vw, 2.1rem);
    font-weight: 900;
    letter-spacing: 0.28em;
    text-indent: 0.28em;
    text-align: center;
    line-height: 1.15;
    animation: pcIridescent 2.6s linear infinite, pcTextSparkle 2.4s ease-in-out infinite;
    background: linear-gradient(
        92deg,
        #e0f7ff 0%,
        #00ffff 15%,
        #ffd700 35%,
        #ff6ec7 55%,
        #c084fc 75%,
        #00ffff 100%
    );
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 18px rgba(0, 255, 255, 0.45));
}

.pc-flip-hud {
    width: 100%;
    max-width: 560px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 12px;
    padding: 10px 14px;
    border: 1px solid rgba(0, 255, 255, 0.25);
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.06), rgba(127, 0, 255, 0.08), rgba(0, 255, 255, 0.06));
    box-shadow: 0 0 24px rgba(0, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pc-flip-hud__left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pc-flip-label {
    font-family: Orbitron, 'Noto Sans TC', sans-serif;
    font-size: clamp(14px, 2vw, 18px);
    font-weight: 900;
    letter-spacing: 0.14em;
    animation: pcIridescent 3s linear infinite, pcTextSparkle 2.5s ease-in-out infinite;
    background: linear-gradient(92deg, #00ffff, #a78bfa, #ffd700, #00ffff);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pc-flip-sublabel {
    font-family: Orbitron, monospace;
    font-size: clamp(10px, 1.4vw, 12px);
    font-weight: 700;
    letter-spacing: 0.22em;
    color: rgba(180, 255, 255, 0.85);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.55);
}

.pc-flip-hud__right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pc-signal-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 18px;
}

.pc-signal-bars i {
    display: block;
    width: 4px;
    background: linear-gradient(180deg, #00ffff, #7f00ff);
    border-radius: 1px;
    animation: pcSignalPulse 0.8s ease-in-out infinite;
}

.pc-signal-bars i:nth-child(1) { height: 4px; animation-delay: 0s; }
.pc-signal-bars i:nth-child(2) { height: 7px; animation-delay: 0.1s; }
.pc-signal-bars i:nth-child(3) { height: 10px; animation-delay: 0.2s; }
.pc-signal-bars i:nth-child(4) { height: 14px; animation-delay: 0.3s; }
.pc-signal-bars i:nth-child(5) { height: 18px; animation-delay: 0.4s; }

@keyframes pcSignalPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; box-shadow: 0 0 8px #00ffff; }
}

.pc-flip-progress {
    font-family: Orbitron, monospace;
    font-size: clamp(22px, 3.2vw, 34px);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    min-width: 4.8em;
    text-align: right;
    animation: pcIridescent 2.8s linear infinite, pcTextSparkle 2s ease-in-out infinite;
    background: linear-gradient(92deg, #fff 0%, #ffd700 40%, #ff6ec7 70%, #00ffff 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pc-flip-frame {
    position: relative;
    width: 100%;
    max-width: min(1280px, 98vw);
    padding: 14px 10px;
    margin: 0 auto;
}

.pc-flip-stage--eleven ~ .pc-flip-hint,
.pc-phase-flip:has(.pc-flip-stage--eleven) .pc-flip-hud {
    max-width: min(1280px, 98vw);
}

.pc-corner {
    position: absolute;
    width: 28px;
    height: 28px;
    border-color: rgba(0, 255, 255, 0.7);
    border-style: solid;
    pointer-events: none;
    animation: pcCornerPulse 2s ease-in-out infinite;
}

.pc-corner--tl { top: 0; left: 0; border-width: 2px 0 0 2px; }
.pc-corner--tr { top: 0; right: 0; border-width: 2px 2px 0 0; }
.pc-corner--bl { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.pc-corner--br { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

@keyframes pcCornerPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; filter: drop-shadow(0 0 6px #00ffff); }
}

.pc-flip-beam {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 120%;
    height: 2px;
    transform: translate(-50%, -50%);
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.9), transparent);
    box-shadow: 0 0 20px #00ffff;
    animation: pcBeamSweep 2.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes pcBeamSweep {
    0%, 100% { opacity: 0.2; transform: translate(-50%, -50%) scaleX(0.3); }
    50% { opacity: 1; transform: translate(-50%, -50%) scaleX(1); }
}

.pc-flip-stage {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    perspective: 1400px;
}

.pc-flip-stage.pc-flip-stage--eleven .pc-card-slot {
    min-height: clamp(156px, 26vh, 228px);
}

.pc-flip-stage.pc-flip-stage--wide .pc-card-slot {
    min-height: clamp(148px, 22vh, 210px);
}

.pc-flip-stage.single-pull .pc-card-slot {
    min-height: clamp(200px, 52vh, 320px);
}

.pc-flip-stage.pc-flip-stage--eleven {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px 14px;
    max-width: min(1280px, 98vw);
    margin: 0 auto;
}

.pc-flip-stage.pc-flip-stage--wide {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    max-width: min(1100px, 96vw);
    margin: 0 auto;
}

.pc-flip-stage.single-pull {
    grid-template-columns: 1fr;
    max-width: min(240px, 48vw);
    margin: 0 auto;
}

.pc-flip-hint {
    margin: 14px 0 0;
    text-align: center;
    font-family: Orbitron, 'Noto Sans TC', monospace;
    font-size: clamp(12px, 1.6vw, 15px);
    font-weight: 700;
    letter-spacing: 0.18em;
    animation: pcIridescent 3.2s linear infinite, pcHintPulse 1.5s ease-in-out infinite;
    background: linear-gradient(92deg, rgba(0, 255, 255, 1), #ffd700, rgba(255, 110, 200, 1));
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.4));
}

@keyframes pcHintPulse {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

/* —— 卡槽 & 翻牌 —— */
.pc-card-slot {
    position: relative;
    aspect-ratio: 5 / 7;
    min-height: clamp(132px, 20vw, 192px);
    perspective: 900px;
    opacity: 0;
    transform: translateY(20px) scale(0.85);
    animation: pcSlotEnter 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(var(--slot-delay, 0) * 0.05s);
}

@keyframes pcSlotEnter {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.pc-card-slot.slot-charging .pc-card-flipper {
    animation: pcSlotCharge 0.35s ease-out;
}

@keyframes pcSlotCharge {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.6) drop-shadow(0 0 16px #00ffff); }
}

.pc-card-slot.slot-flash-rare .pc-card-flipper {
    animation: pcSlotFlash 0.55s ease-out;
}

.pc-card-slot.slot-flash-epic .pc-card-flipper {
    animation: pcSlotFlashEpic 0.65s ease-out;
}

.pc-card-slot.slot-flash-legend .pc-card-flipper {
    animation: pcSlotFlashLegend 0.75s ease-out;
}

.pc-card-slot.slot-flash-mythic .pc-card-flipper {
    animation: pcSlotFlashMythic 0.85s ease-out;
}

.pc-card-slot.slot-flash-secret .pc-card-flipper {
    animation: pcSlotFlashSecret 1s ease-out;
}

@keyframes pcSlotFlashMythic {
    50% {
        filter: brightness(2.2) drop-shadow(0 0 32px #ff6ec7) drop-shadow(0 0 48px #ff0055);
    }
}

@keyframes pcSlotFlashSecret {
    50% {
        filter: brightness(2.4) drop-shadow(0 0 40px #e9d5ff) drop-shadow(0 0 56px #a855f7);
    }
}

@keyframes pcSlotFlash {
    50% { filter: brightness(1.9) drop-shadow(0 0 22px #bb86fc); }
}

@keyframes pcSlotFlashEpic {
    50% { filter: brightness(2) drop-shadow(0 0 28px #ff6ec7); }
}

@keyframes pcSlotFlashLegend {
    50% { filter: brightness(2.3) drop-shadow(0 0 36px #ffd700); }
}

.pc-card-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.75s cubic-bezier(0.2, 0.85, 0.3, 1.15);
}

.pc-flip-stage--eleven .pc-card-flipper:not(.flipped) {
    transition-duration: 0.62s;
}

.pc-card-flipper.flipped {
    transform: rotateY(180deg);
    will-change: auto;
}

.pc-card-back,
.pc-card-front {
    position: absolute;
    inset: 0;
    border-radius: 8px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
}

/* 全息卡背 */
.pc-card-back {
    background:
        linear-gradient(135deg, #0c0820 0%, #1a0a3e 40%, #080612 100%);
    border: 2px solid transparent;
    background-clip: padding-box;
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.7),
        inset 0 0 40px rgba(127, 0, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pc-card-back--has-art {
    background-color: #06040f;
    background-image: var(--pc-card-back-url, none);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.pc-card-back-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: 6px;
    z-index: 1;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* 多連：減少 11 張卡背同時跑炫彩邊框動畫造成的卡頓 */
.pc-flip-stage--eleven .pc-card-back::before {
    animation: none;
    background-position: 50% 50%;
}

/* 十一連末段：降低未翻卡背光暈負擔 */
.pc-flip-stage--eleven.pc-flip-stage--compress .pc-card-slot:not(.revealed) .pc-card-back-holo {
    opacity: 0.35;
}

/* settle 後改平面顯示正面（勿保留 rotateY+flat，否則 backface 會讓立繪消失） */
.pc-card-slot--settled {
    perspective: none;
}

.pc-card-slot--settled .pc-card-flipper {
    transform: none !important;
    transform-style: flat;
    transition: none;
    filter: none;
}

.pc-card-slot--settled .pc-card-front {
    position: absolute;
    inset: 0;
    transform: none !important;
    visibility: visible !important;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
}

.pc-card-slot--settled .pc-card-back {
    display: none !important;
}

.pc-card-back::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 10px;
    padding: 2px;
    background: linear-gradient(
        120deg,
        #00ffff,
        #ff00aa,
        #ffd700,
        #7f00ff,
        #00ffff
    );
    background-size: 300% 300%;
    animation: pcHoloBorder 3s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 0;
}

@keyframes pcHoloBorder {
    to { background-position: 300% 50%; }
}

.pc-card-back::after {
    content: "VOID";
    position: relative;
    z-index: 2;
    font-family: Orbitron, sans-serif;
    font-size: clamp(11px, 2.6vw, 16px);
    font-weight: 900;
    letter-spacing: 0.28em;
    color: rgba(0, 255, 255, 0.95);
    text-shadow:
        0 0 14px rgba(0, 255, 255, 1),
        0 0 28px rgba(255, 0, 128, 0.75),
        0 0 40px rgba(255, 215, 0, 0.35);
    animation: pcVoidPulse 2s ease-in-out infinite;
}

.pc-card-back--has-art::after {
    content: none;
}

@keyframes pcVoidPulse {
    0%, 100% { opacity: 0.75; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.pc-card-back-holo {
    position: absolute;
    inset: 10%;
    border-radius: 4px;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 3px,
        rgba(0, 255, 255, 0.04) 3px,
        rgba(0, 255, 255, 0.04) 6px
    );
    z-index: 1;
    pointer-events: none;
}

.pc-card-back--has-art .pc-card-back-holo {
    inset: 0;
    border-radius: 6px;
    background: linear-gradient(
        125deg,
        rgba(0, 255, 255, 0.06) 0%,
        transparent 40%,
        rgba(255, 0, 170, 0.05) 60%,
        transparent 100%
    );
    mix-blend-mode: screen;
}

.pc-card-front {
    transform: rotateY(180deg) translateZ(1px);
    background: #06040f;
    border: 1px solid rgba(0, 255, 255, 0.35);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.15);
}

/* 翻開前不顯示正面（避免立繪搶先露出） */
.pc-card-slot:not(.revealed) .pc-card-front {
    visibility: hidden;
}

.pc-card-slot.revealed .pc-card-front {
    visibility: visible;
}

/* 翻牌正面 · 輕量靜態立繪（避免 3D 卡面造成末段卡頓／反白） */
.pc-flip-face-art {
    width: 100%;
    height: 100%;
    background: #06040f;
    border-radius: 6px;
    overflow: hidden;
}

.pc-flip-face-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    background: #06040f;
}

.pc-flip-face-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.pc-flip-face-fallback__icon {
    font-size: clamp(28px, 6vw, 42px);
    filter: drop-shadow(0 0 12px rgba(127, 0, 255, 0.65));
}

.pc-card-slot--settled .pc-card-back-holo,
.pc-card-slot--settled .pc-card-back-img {
    visibility: hidden;
    pointer-events: none;
}

.pc-card-front .card-3d-wrap,
.pc-card-front .pc-mini-mount {
    width: 100% !important;
    height: 100% !important;
    margin: 0;
}

.pc-card-front .card-3d,
.pc-card-front .card-face {
    width: 100%;
    height: 100%;
    border-radius: 6px;
}

.pc-card-front .card-3d-wrap.card-bag-fill .card-face {
    border-radius: 6px;
}

.pc-card-front .card-footer-ui,
.pc-card-front .card-name-float {
    display: none !important;
}

.pc-card-slot.revealed .pc-card-front {
    box-shadow:
        0 0 16px var(--slot-glow, rgba(0, 255, 255, 0.3)),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.pc-card-slot.tier-rare { --slot-glow: rgba(187, 134, 252, 0.6); }
.pc-card-slot.tier-epic { --slot-glow: rgba(255, 110, 199, 0.65); }
.pc-card-slot.tier-legend { --slot-glow: rgba(255, 215, 0, 0.75); }
.pc-card-slot.tier-mythic { --slot-glow: rgba(255, 0, 128, 0.7); }
.pc-card-slot.tier-secret { --slot-glow: rgba(192, 132, 252, 0.9); }

.pc-slot-rarity {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    font-family: Orbitron, 'Noto Sans TC', sans-serif;
    font-size: clamp(11px, 1.65vw, 15px);
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.88);
    letter-spacing: 0.1em;
    white-space: nowrap;
    transition: transform 0.4s cubic-bezier(0.34, 1.6, 0.64, 1);
    text-shadow: 0 0 12px currentColor;
    animation: pcTextSparkle 2.2s ease-in-out infinite;
}

.pc-card-slot.revealed .pc-slot-rarity {
    transform: translateX(-50%) scale(1);
}

.pc-slot-rarity.tier-legend {
    color: #ffe566;
    border: 1.5px solid #ffd700;
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.85);
    background: linear-gradient(180deg, rgba(60, 45, 0, 0.95), rgba(0, 0, 0, 0.92));
}
.pc-slot-rarity.tier-mythic {
    color: #ffb8e8;
    border: 1.5px solid #ff6ec7;
    box-shadow: 0 0 16px rgba(255, 0, 128, 0.75);
    background: linear-gradient(180deg, rgba(80, 0, 50, 0.9), rgba(0, 0, 0, 0.92));
}
.pc-slot-rarity.tier-secret {
    color: #f3e8ff;
    border: 1.5px solid #e9d5ff;
    box-shadow: 0 0 22px rgba(168, 85, 247, 1);
    background: linear-gradient(180deg, rgba(50, 20, 90, 0.95), rgba(0, 0, 0, 0.92));
    animation: pcSecretBadge 1.2s ease-in-out infinite, pcTextSparkle 1.8s ease-in-out infinite;
}

@keyframes pcSecretBadge {
    50% { box-shadow: 0 0 32px rgba(255, 255, 255, 1); transform: translateX(-50%) scale(1.06); }
}

.pc-slot-rarity.tier-rare {
    color: #ddd6fe;
    border: 1.5px solid #c4b5fd;
    box-shadow: 0 0 14px rgba(167, 139, 250, 0.7);
}
.pc-slot-rarity.tier-epic {
    color: #fbcfe8;
    border: 1.5px solid #f9a8d4;
    box-shadow: 0 0 14px rgba(244, 114, 182, 0.7);
}

.pc-slot-foot {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 22;
    padding: 4px 3px 3px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 70%, transparent 100%);
    border-radius: 0 0 6px 6px;
}

.pc-card-slot.revealed .pc-slot-foot,
.pc-card-slot--settled .pc-slot-foot {
    opacity: 1;
    transform: translateY(0);
}

.pc-slot-name {
    display: block;
    font-family: 'Noto Sans TC', Orbitron, sans-serif;
    font-size: clamp(9px, 1.35vw, 12px);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0.04em;
    animation: pcIridescent 3.5s linear infinite;
    background: linear-gradient(92deg, #fff, #ffd700, #ff9de2, #00ffff);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.9));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* —— Phase 3：極稀有獨立揭曉 —— */
.pc-phase-reveal {
    z-index: 30;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
}

.pc-phase-reveal.tier-legend,
#pull-overlay.pull-overlay--tier-legend { --pc-reveal-color: #ffd700; --pc-reveal-glow: rgba(255, 215, 0, 0.65); }
.pc-phase-reveal.tier-mythic,
#pull-overlay.pull-overlay--tier-mythic { --pc-reveal-color: #ff6ec7; --pc-reveal-glow: rgba(255, 0, 128, 0.6); }
.pc-phase-reveal.tier-secret,
#pull-overlay.pull-overlay--tier-secret { --pc-reveal-color: #e9d5ff; --pc-reveal-glow: rgba(168, 85, 247, 0.85); }

.pc-reveal-burst {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 42%, var(--pc-reveal-glow) 0%, transparent 58%);
    opacity: 0;
    animation: pcBurstIn 0.7s ease-out forwards;
}

@keyframes pcBurstIn {
    0% { opacity: 0; transform: scale(0.2); }
    35% { opacity: 1; }
    100% { opacity: 0.9; transform: scale(1.3); }
}

.pc-reveal-rays {
    position: absolute;
    width: 220vmax;
    height: 220vmax;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
    background: repeating-conic-gradient(
        from 0deg,
        transparent 0deg 6deg,
        rgba(255, 255, 255, 0.05) 6deg 12deg
    );
    animation: pcRaysSpin 10s linear infinite;
    pointer-events: none;
}

@keyframes pcRaysSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.pc-reveal-tag {
    position: relative;
    z-index: 5;
    margin: 0 0 6px;
    font-family: Orbitron, sans-serif;
    font-size: clamp(2.6rem, 10vw, 4rem);
    font-weight: 900;
    letter-spacing: 0.12em;
    color: var(--pc-reveal-color, #ffd700);
    text-shadow:
        0 0 28px var(--pc-reveal-glow),
        0 0 72px var(--pc-reveal-color),
        0 4px 0 #000;
    animation: pcRevealTagIn 0.55s cubic-bezier(0.22, 1.2, 0.36, 1) both, pcTextSparkle 2s ease-in-out infinite;
}

.pc-reveal-subtag {
    margin: 0 0 18px;
    font-family: Orbitron, monospace;
    font-size: clamp(11px, 1.8vw, 14px);
    font-weight: 700;
    letter-spacing: 0.32em;
    color: rgba(0, 255, 255, 0.9);
    text-shadow: 0 0 14px rgba(0, 255, 255, 0.65);
    animation: pcRevealTagIn 0.6s 0.08s cubic-bezier(0.22, 1.2, 0.36, 1) both, pcIridescent 3s linear infinite;
    background: linear-gradient(92deg, #00ffff, #ffd700, #ff6ec7);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes pcRevealTagIn {
    from { opacity: 0; transform: scale(0.4) translateY(24px); filter: blur(6px); }
    to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

.pc-reveal-title {
    position: relative;
    z-index: 5;
    margin: 0 0 14px;
    font-size: clamp(1.15rem, 4.5vw, 1.75rem);
    font-weight: 900;
    text-align: center;
    max-width: 90vw;
    animation: pcRevealTagIn 0.55s 0.12s both, pcIridescent 3.2s linear infinite;
    background: linear-gradient(92deg, #fff 0%, #ffd700 35%, #ff9de2 65%, #00ffff 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 16px var(--pc-reveal-glow));
}

.pc-reveal-card {
    position: relative;
    z-index: 6;
    width: min(300px, 62vw);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pcCardRevealPop 0.8s 0.15s cubic-bezier(0.22, 1.25, 0.36, 1) both;
}

@keyframes pcCardRevealPop {
    from { opacity: 0; transform: scale(0.15) rotateY(-50deg) rotateX(12deg); filter: blur(8px); }
    to { opacity: 1; transform: scale(1) rotateY(0) rotateX(0); filter: blur(0); }
}

.pc-reveal-card .card-3d-wrap,
.pc-reveal-card .void-card-tile {
    width: min(280px, 58vw) !important;
    height: auto !important;
    max-width: 100%;
    aspect-ratio: 5 / 7;
    filter: drop-shadow(0 0 60px var(--pc-reveal-glow));
}

.pc-reveal-art-bg {
    position: absolute;
    inset: -25%;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
}

.pc-reveal-quote {
    position: relative;
    z-index: 5;
    margin: 14px 0 0;
    font-size: 12px;
    font-style: italic;
    color: rgba(200, 240, 255, 0.85);
    max-width: 340px;
    text-align: center;
    animation: pcRevealTagIn 0.5s 0.35s both;
}

.pc-reveal-continue {
    display: none;
    position: fixed;
    left: 50%;
    bottom: max(24px, env(safe-area-inset-bottom, 0px) + 16px);
    z-index: 205;
    margin: 0;
    padding: 16px 42px;
    min-width: 160px;
    max-width: min(calc(100vw - 32px), 320px);
    width: auto;
    box-sizing: border-box;
    border: 2px solid var(--pc-reveal-color, #ffd700);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(0, 40, 48, 0.92), rgba(0, 0, 0, 0.88));
    color: #e8ffff;
    font-family: Orbitron, 'Noto Sans TC', sans-serif;
    font-size: clamp(16px, 2.2vw, 20px);
    font-weight: 900;
    letter-spacing: 0.22em;
    text-indent: 0.22em;
    white-space: nowrap;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    text-shadow:
        0 0 10px rgba(0, 255, 255, 0.9),
        0 0 20px var(--pc-reveal-glow, rgba(255, 215, 0, 0.5));
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    box-shadow:
        0 0 28px var(--pc-reveal-glow, rgba(255, 215, 0, 0.35)),
        0 8px 32px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: translateX(-50%);
}

#pull-overlay.pull-overlay--reveal .pc-reveal-continue:not(.hidden) {
    display: inline-flex;
}

#pull-overlay.pull-overlay--reveal .pc-reveal-continue:not(.hidden):hover,
#pull-overlay:has(.pc-phase-reveal.active) .pc-reveal-continue:not(.hidden):hover {
    transform: translateX(-50%) scale(1.04);
    box-shadow: 0 0 36px var(--pc-reveal-glow), 0 8px 32px rgba(0, 0, 0, 0.55);
    background: linear-gradient(180deg, rgba(0, 80, 96, 0.95), rgba(0, 30, 40, 0.92));
    border-color: var(--pc-reveal-color, #ffd700);
}

/* 極稀有揭曉：固定底部主按鈕，跳過鍵疊在上方 */
#pull-overlay.pull-overlay--reveal .pc-skip-btn:not(.hidden),
#pull-overlay:has(.pc-phase-reveal.active) .pc-skip-btn:not(.hidden) {
    bottom: calc(max(24px, env(safe-area-inset-bottom, 0px) + 16px) + 58px);
    z-index: 204;
}

#pull-overlay.pull-overlay--reveal .pc-phase-reveal.active,
#pull-overlay:has(.pc-phase-reveal.active) .pc-phase-reveal.active {
    padding-bottom: max(148px, env(safe-area-inset-bottom, 0px) + 132px);
}

#pull-overlay.shake-sec .pull-cinema {
    animation: secScreenShake 0.65s ease-in-out;
}

.pc-phase-reveal.active.tier-secret .pc-reveal-card {
    animation: pcCardRevealPop 0.8s 0.15s cubic-bezier(0.22, 1.25, 0.36, 1) both,
        pcSecretFloat 2.5s 1s ease-in-out infinite;
}

@keyframes pcSecretFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* —— Phase 4：總結 —— */
.pc-phase-summary {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    padding-top: 28px;
    padding-bottom: max(96px, env(safe-area-inset-bottom, 0px) + 80px);
    touch-action: pan-y;
}

.pc-phase-summary .pull-celebration {
    width: 100%;
    max-width: min(1180px, 96vw);
    padding: 16px 20px 24px;
    animation: pcSummaryIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pc-phase-summary .pull-results-grid.pull-results-grid--few {
    margin-bottom: 20px;
}

.pc-phase-summary .pull-results-grid.pull-results-grid--few .pull-rarity-badge {
    font-size: 12px;
}

.pc-phase-summary .pull-hero-spotlight.is-collapsed {
    display: none;
    min-height: 0;
    margin: 0;
}

.pc-phase-summary .pull-hero-spotlight--solo {
    max-width: min(280px, 82vw);
}

.pc-phase-summary .pull-hero-spotlight--solo .void-card-frame,
.pc-phase-summary .pull-hero-spotlight--solo .card-3d-wrap {
    max-width: 100%;
}

@keyframes pcSummaryIn {
    from { opacity: 0; transform: translateY(32px) scale(0.96); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.pc-phase-summary .pull-title {
    font-family: Orbitron, 'Noto Sans TC', sans-serif;
    letter-spacing: 0.15em;
}

.pull-results-grid .pull-result-slot {
    animation: pcGridSlotIn 0.45s cubic-bezier(0.22, 1.2, 0.36, 1) both;
    animation-delay: calc(var(--slot-i, 0) * 0.07s);
}

@keyframes pcGridSlotIn {
    from { opacity: 0; transform: scale(0.5) rotate(-12deg); filter: blur(4px); }
    to { opacity: 1; transform: scale(1) rotate(0); filter: blur(0); }
}

/* —— 跳過（底部置中，召喚全程可見） —— */
.pc-skip-btn {
    position: fixed;
    left: 50%;
    bottom: max(24px, env(safe-area-inset-bottom, 0px) + 16px);
    transform: translateX(-50%);
    z-index: 200;
    padding: 16px 42px;
    min-width: 140px;
    border: 2px solid rgba(0, 255, 255, 0.65);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(0, 40, 48, 0.92), rgba(0, 0, 0, 0.88));
    font-family: Orbitron, 'Noto Sans TC', sans-serif;
    font-size: clamp(16px, 2.2vw, 20px);
    font-weight: 900;
    cursor: pointer;
    letter-spacing: 0.28em;
    text-indent: 0.28em;
    color: #e8ffff;
    text-shadow:
        0 0 10px rgba(0, 255, 255, 0.9),
        0 0 20px rgba(255, 110, 200, 0.5),
        0 0 28px rgba(255, 215, 0, 0.35);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s, transform 0.2s;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    box-shadow:
        0 0 28px rgba(0, 255, 255, 0.35),
        0 8px 32px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    animation: pcSkipPulse 2.4s ease-in-out infinite;
}

@keyframes pcSkipPulse {
    0%, 100% {
        box-shadow:
            0 0 28px rgba(0, 255, 255, 0.35),
            0 8px 32px rgba(0, 0, 0, 0.55),
            inset 0 1px 0 rgba(255, 255, 255, 0.12);
        border-color: rgba(0, 255, 255, 0.55);
    }
    50% {
        box-shadow:
            0 0 40px rgba(0, 255, 255, 0.55),
            0 8px 32px rgba(0, 0, 0, 0.55),
            inset 0 1px 0 rgba(255, 255, 255, 0.18);
        border-color: rgba(0, 255, 255, 0.85);
    }
}

.pc-skip-btn:hover {
    background: linear-gradient(180deg, rgba(0, 80, 96, 0.95), rgba(0, 30, 40, 0.92));
    color: #fff;
    border-color: #00ffff;
    box-shadow: 0 0 36px rgba(0, 255, 255, 0.6), 0 8px 32px rgba(0, 0, 0, 0.55);
    animation: none;
    transform: translateX(-50%) scale(1.04);
}

.pc-skip-btn.hidden {
    display: none;
}

#pull-overlay.pc-flash-white {
    animation: pcFlashWhite 0.4s ease-out;
}

@keyframes pcFlashWhite {
    0% { background-color: rgba(255, 255, 255, 0.95); }
    100% { background-color: transparent; }
}

.pc-phase-summary #btn-close-pull {
    font-family: Orbitron, 'Noto Sans TC', sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.22em;
    padding: 14px 36px;
    border: 1px solid rgba(0, 255, 255, 0.5);
    border-radius: 4px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(127, 0, 255, 0.45));
    box-shadow: 0 0 24px rgba(0, 255, 255, 0.25);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: transform 0.2s, box-shadow 0.2s;
}

.pc-phase-summary #btn-close-pull:hover {
    transform: scale(1.04);
    box-shadow: 0 0 32px rgba(0, 255, 255, 0.45);
}

@media (max-width: 720px) {
    .pull-cinema {
        padding-bottom: max(100px, calc(var(--void-mobile-nav-h, 54px) + env(safe-area-inset-bottom, 0px) + 72px));
    }

    .pc-skip-btn {
        bottom: calc(var(--void-mobile-nav-h, 54px) + env(safe-area-inset-bottom, 0px) + 12px);
        z-index: 960;
        padding: 12px 28px;
        min-width: 120px;
        font-size: 14px;
        letter-spacing: 0.2em;
        text-indent: 0.2em;
    }

    .pc-phase-summary {
        padding-bottom: max(24px, calc(var(--void-mobile-nav-h, 54px) + 16px));
    }

    #pull-overlay.pull-overlay--reveal .pc-reveal-continue:not(.hidden),
    #pull-overlay:has(.pc-phase-reveal.active) .pc-reveal-continue:not(.hidden) {
        bottom: calc(var(--void-mobile-nav-h, 54px) + env(safe-area-inset-bottom, 0px) + 12px);
        padding: 12px 28px;
        min-width: 140px;
        font-size: 14px;
        letter-spacing: 0.2em;
        text-indent: 0.2em;
    }

    #pull-overlay.pull-overlay--reveal .pc-skip-btn:not(.hidden),
    #pull-overlay:has(.pc-phase-reveal.active) .pc-skip-btn:not(.hidden) {
        bottom: calc(var(--void-mobile-nav-h, 54px) + env(safe-area-inset-bottom, 0px) + 12px + 56px);
    }

    #pull-overlay.pull-overlay--reveal .pc-phase-reveal.active,
    #pull-overlay:has(.pc-phase-reveal.active) .pc-phase-reveal.active {
        padding: 12px 10px max(168px, calc(var(--void-mobile-nav-h, 54px) + env(safe-area-inset-bottom, 0px) + 128px));
    }

    .pc-phase-reveal:not(.active) {
        padding: 12px 10px max(80px, calc(var(--void-mobile-nav-h, 54px) + 24px));
    }
}

@media (max-width: 520px) {
    .pc-flip-stage {
        gap: 6px;
    }
    .pc-flip-frame {
        padding: 10px 8px;
    }
    .pc-corner {
        width: 18px;
        height: 18px;
    }
    .pc-flip-hud {
        padding: 8px 10px;
    }
    .pc-flip-label {
        font-size: 10px;
    }
    .pc-flip-progress {
        font-size: 14px;
    }
}
