.tarot-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 主五芒星背景 */
.tarot-container::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cdefs%3E%3CradialGradient id='glow'%3E%3Cstop offset='0%25' style='stop-color:rgba(138,116,249,0.3)'/%3E%3Cstop offset='100%25' style='stop-color:rgba(138,116,249,0)'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='100' cy='100' r='95' fill='url(%23glow)'/%3E%3Cpath d='M 100 20 L 115 75 L 175 75 L 125 110 L 145 165 L 100 130 L 55 165 L 75 110 L 25 75 L 85 75 Z' fill='none' stroke='rgba(138,116,249,0.25)' stroke-width='2.5'/%3E%3Ccircle cx='100' cy='100' r='85' fill='none' stroke='rgba(138,116,249,0.15)' stroke-width='1.5' stroke-dasharray='5,3'/%3E%3Ccircle cx='100' cy='100' r='70' fill='none' stroke='rgba(138,116,249,0.12)' stroke-width='1'/%3E%3Cpath d='M 100 20 L 115 75 L 175 75 L 125 110 L 145 165 L 100 130 L 55 165 L 75 110 L 25 75 L 85 75 Z' fill='none' stroke='rgba(138,116,249,0.15)' stroke-width='1.5' transform='rotate(36 100 100)'/%3E%3Ccircle cx='100' cy='20' r='3' fill='rgba(255,215,0,0.4)'/%3E%3Ccircle cx='175' cy='75' r='3' fill='rgba(255,215,0,0.4)'/%3E%3Ccircle cx='145' cy='165' r='3' fill='rgba(255,215,0,0.4)'/%3E%3Ccircle cx='55' cy='165' r='3' fill='rgba(255,215,0,0.4)'/%3E%3Ccircle cx='25' cy='75' r='3' fill='rgba(255,215,0,0.4)'/%3E%3Ctext x='100' y='105' text-anchor='middle' font-size='12' fill='rgba(138,116,249,0.3)' font-family='serif'%3E✦%3C/text%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.7;
    animation: rotatePentagram 60s linear infinite;
    pointer-events: none;
    z-index: 0;
}

/* 次级五芒星（反向旋转） */
.tarot-container::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath d='M 100 30 L 112 70 L 155 70 L 120 95 L 135 140 L 100 115 L 65 140 L 80 95 L 45 70 L 88 70 Z' fill='none' stroke='rgba(255,215,0,0.15)' stroke-width='2'/%3E%3Ccircle cx='100' cy='100' r='60' fill='none' stroke='rgba(255,215,0,0.1)' stroke-width='1' stroke-dasharray='3,2'/%3E%3Ctext x='100' y='50' text-anchor='middle' font-size='10' fill='rgba(138,116,249,0.25)' font-family='serif'%3E☽%3C/text%3E%3Ctext x='155' y='80' text-anchor='middle' font-size='10' fill='rgba(138,116,249,0.25)' font-family='serif'%3E☉%3C/text%3E%3Ctext x='135' y='150' text-anchor='middle' font-size='10' fill='rgba(138,116,249,0.25)' font-family='serif'%3E★%3C/text%3E%3Ctext x='65' y='150' text-anchor='middle' font-size='10' fill='rgba(138,116,249,0.25)' font-family='serif'%3E✧%3C/text%3E%3Ctext x='45' y='80' text-anchor='middle' font-size='10' fill='rgba(138,116,249,0.25)' font-family='serif'%3E✦%3C/text%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.5;
    animation: rotatePentagramReverse 45s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes rotatePentagram {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes rotatePentagramReverse {
    from {
        transform: translate(-50%, -50%) rotate(360deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(0deg);
    }
}

/* 神秘粒子容器 */
.mystic-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.mystic-particle {
    position: absolute;
    font-size: 14px;
    color: rgba(138, 116, 249, 0.4);
    animation: floatParticle linear infinite;
    text-shadow: 0 0 10px rgba(138, 116, 249, 0.6);
}

@keyframes floatParticle {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) translateX(var(--drift, 0px)) rotate(360deg);
        opacity: 0;
    }
}

/* 页面免责声明样式 */
.page-disclaimer {
    background: rgba(255, 193, 7, 0.12);
    border: 1px solid rgba(255, 193, 7, 0.25);
    border-radius: 8px;
    padding: 10px 15px;
    margin: 15px 20px;
    text-align: center;
    color: #FFD700;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(5px);
    position: relative;
    z-index: 10;
    animation: disclaimerGlow 3s ease-in-out infinite;
}

.page-disclaimer .disclaimer-icon {
    font-size: 16px;
}

@keyframes disclaimerGlow {
    0%, 100% {
        box-shadow: 0 0 8px rgba(255, 193, 7, 0.15);
    }
    50% {
        box-shadow: 0 0 16px rgba(255, 193, 7, 0.3);
    }
}

@media (max-width: 768px) {
    .page-disclaimer {
        margin: 10px 15px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .page-disclaimer .disclaimer-icon {
        font-size: 14px;
    }
}

.tarot-container .header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
}

.tarot-container .header h1 {
    color: #fff;
}

.tarot-step {
    display: none;
    padding: 20px;
    animation: fadeIn 0.5s ease-in;
    position: relative;
    z-index: 5;
}

/* 步骤4需要额外的底部内边距，为固定按钮留空间 */
#step4.tarot-step {
    padding-bottom: 120px;
}

/* 飘浮的神秘符号 */
.tarot-step::before {
    content: '✦ ☽ ☉ ★ ✧ ◈ ☆ ✺';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-size: 20px;
    color: rgba(138, 116, 249, 0.15);
    pointer-events: none;
    white-space: pre;
    word-spacing: 80px;
    line-height: 150px;
    animation: floatSymbols 30s linear infinite;
    z-index: -1;
}

@keyframes floatSymbols {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0.15;
    }
    50% {
        transform: translateY(-50px) translateX(30px);
        opacity: 0.25;
    }
    100% {
        transform: translateY(-100px) translateX(0);
        opacity: 0.15;
    }
}

.tarot-step.active {
    display: block;
}

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

.question-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    margin: 40px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.question-box h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.question-box textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    margin-bottom: 20px;
}

.tarot-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s;
}

.tarot-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.tarot-btn.secondary {
    background: linear-gradient(135deg, #888 0%, #555 100%);
    margin-bottom: 10px;
}

/* 步骤4: 翻牌展示 */
#step4 {
    display: flex;
    flex-direction: column;
    padding-top: 20px;
}

#step4 .tarot-guide {
    margin-bottom: 30px;
    text-align: center;
    color: #fff;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

#step4 .selected-cards {
    flex: 0 0 auto;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    padding: 60px 20px 40px;
    flex-wrap: wrap;
    min-height: 320px;
    position: relative;
    z-index: 1;
}

.reveal-narration {
    min-height: 1.6em;
    margin-top: 12px !important;
    font-style: italic;
    letter-spacing: 2px;
    color: #ffd700 !important;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.reveal-narration.show {
    opacity: 1;
}

.flip-card {
    width: 160px;
    height: 240px;
    perspective: 1000px;
    position: relative;
    flex-shrink: 0;
    opacity: 0;
    transform: translateY(-120vh) rotate(-220deg) scale(0.6);
    transition: opacity 0.6s ease, transform 0.9s cubic-bezier(0.22, 1.2, 0.36, 1);
}

/* 三张牌微弧形 + 飞入落位 */
.flip-card.landed {
    opacity: 1;
}
.flip-card.landed[data-pos="0"] { transform: translateY(0) rotate(-6deg) scale(1); }
.flip-card.landed[data-pos="1"] { transform: translateY(-12px) rotate(0deg) scale(1.04); }
.flip-card.landed[data-pos="2"] { transform: translateY(0) rotate(6deg) scale(1); }

/* 落位时的余震晃动 */
.flip-card.settling[data-pos="0"] { animation: settleLeft 0.5s ease-out; }
.flip-card.settling[data-pos="1"] { animation: settleMid 0.5s ease-out; }
.flip-card.settling[data-pos="2"] { animation: settleRight 0.5s ease-out; }

@keyframes settleLeft {
    0%   { transform: translateY(-10px) rotate(-14deg) scale(1.05); }
    40%  { transform: translateY(2px)   rotate(-2deg)  scale(0.98); }
    70%  { transform: translateY(-2px)  rotate(-8deg)  scale(1.01); }
    100% { transform: translateY(0)     rotate(-6deg)  scale(1); }
}
@keyframes settleMid {
    0%   { transform: translateY(-22px) rotate(-8deg) scale(1.08); }
    40%  { transform: translateY(-4px)  rotate(4deg)  scale(1); }
    70%  { transform: translateY(-16px) rotate(-2deg) scale(1.05); }
    100% { transform: translateY(-12px) rotate(0deg)  scale(1.04); }
}
@keyframes settleRight {
    0%   { transform: translateY(-10px) rotate(14deg) scale(1.05); }
    40%  { transform: translateY(2px)   rotate(2deg)  scale(0.98); }
    70%  { transform: translateY(-2px)  rotate(8deg)  scale(1.01); }
    100% { transform: translateY(0)     rotate(6deg)  scale(1); }
}

/* 选中聚焦：当前要翻的牌轻微抬起 + 蓄力抖动 + 金光晕 */
.flip-card.focusing .flip-card-inner {
    animation: focusShake 0.6s ease-in-out;
}
.flip-card.focusing::after {
    content: '';
    position: absolute;
    inset: -18px;
    border-radius: 22px;
    background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.55) 0%, rgba(255, 215, 0, 0) 65%);
    animation: focusGlow 0.9s ease-out forwards;
    pointer-events: none;
    z-index: -1;
}

@keyframes focusShake {
    0%, 100% { transform: translateZ(0) rotate(0); }
    20%      { transform: translateZ(0) rotate(-1.5deg) translateX(-2px); }
    40%      { transform: translateZ(0) rotate(1.5deg)  translateX(2px); }
    60%      { transform: translateZ(0) rotate(-1deg)   translateX(-1px); }
    80%      { transform: translateZ(0) rotate(1deg)    translateX(1px); }
}

@keyframes focusGlow {
    0%   { opacity: 0; transform: scale(0.7); }
    60%  { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0; transform: scale(1.3); }
}

.flip-card-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.9s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
    position: relative;
    transform-origin: center center;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card.flipped {
    animation: flippedRise 0.6s ease-out 0.6s both;
}
@keyframes flippedRise {
    0%   { filter: brightness(1); }
    50%  { filter: brightness(1.4) drop-shadow(0 0 20px rgba(255, 215, 0, 0.8)); }
    100% { filter: brightness(1); }
}

/* 翻牌时溅起的金色粒子 */
.flip-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}
.flip-sparkles span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, #ffd700 60%, rgba(255, 215, 0, 0) 100%);
    box-shadow: 0 0 8px #ffd700;
    transform: translate(-50%, -50%);
    animation: sparkleFly 0.9s ease-out forwards;
}
@keyframes sparkleFly {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.4); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2); }
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    top: 0;
    left: 0;
}

.flip-card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid #ffd700;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.flip-card-front::before {
    content: '';
    width: 85%;
    height: 85%;
    background-image: url('/images/constellations/tarot.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.95;
}

.flip-card-back {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transform: rotateY(180deg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    border: 4px solid #ffd700;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3), inset 0 0 30px rgba(255, 215, 0, 0.1);
}

.card-image {
    font-size: 80px;
    margin: 10px 0;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
    animation: floatEmoji 3s ease-in-out infinite;
}

@keyframes floatEmoji {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

.card-name {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin: 8px 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.card-position {
    font-size: 14px;
    color: #8B7355;
    font-style: italic;
    font-weight: 600;
    padding: 6px 16px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

/* 步骤4按钮：居中内联展示 */
#step4 .tarot-btn {
    display: none;
    margin: 30px auto 60px;
    max-width: 500px;
    width: calc(100% - 40px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
    position: relative;
    z-index: 200;
    pointer-events: auto;
}

#step4 .tarot-btn.show {
    display: block;
    animation: btnReveal 0.6s ease both;
}

@keyframes btnReveal {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tarot-guide {
    text-align: center;
    color: #fff;
    margin-bottom: 30px;
}

.tarot-guide h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.tarot-guide p {
    font-size: 16px;
    opacity: 0.9;
}

.card-meaning {
    color: #ffd700 !important;
    font-style: italic;
}

/* 步骤3抽牌样式 */
.tarot-deck {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.tarot-card {
    width: 100px;
    height: 160px;
    position: relative;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
}

.tarot-card:hover {
    transform: translateY(-15px) scale(1.08);
    z-index: 10;
}

.tarot-card:active {
    transform: translateY(-5px) scale(0.98);
    transition: all 0.1s;
}

.tarot-card.selected {
    transform: translateY(-25px) scale(1.15) rotate(2deg);
    z-index: 20;
}

.tarot-card.selected:hover {
    transform: translateY(-28px) scale(1.18) rotate(2deg);
}

.tarot-card.disabled {
    opacity: 0.2;
    cursor: not-allowed;
    filter: grayscale(100%);
    transform: scale(0.9);
}

.tarot-card.disabled:hover {
    transform: scale(0.9);
}

.card-back {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    border: 3px solid #ffd700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.tarot-card:hover .card-back {
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.6), 0 0 25px rgba(255, 215, 0, 0.4);
    border-color: #fff;
}

.tarot-card.selected .card-back {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-color: #fff;
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.6);
}

.card-back::before {
    content: '';
    width: 85%;
    height: 85%;
    background-image: url('/images/constellations/tarot.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    transition: all 0.3s;
    opacity: 0.95;
}

.tarot-card:hover .card-back::before {
    opacity: 1;
    transform: scale(1.05);
}

.tarot-card.selected .card-back::before {
    opacity: 1;
    transform: scale(1.08);
    filter: brightness(1.2);
}

.card-back::after {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
}

.result-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    max-width: 800px;
    margin: 20px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.result-box h3 {
    color: #333;
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
}

.result-box .fortune-result {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.result-actions {
    display: flex;
    gap: 10px;
    flex-direction: column;
}

#confirmBtn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 500px;
    width: calc(100% - 40px);
    margin: 0;
    padding: 18px 30px;
    font-size: 18px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
    animation: slideUp 0.5s ease-out, pulse 2s ease-in-out infinite;
}

/* 当 step3 不是 active 时，确保确认按钮也隐藏 */
#step3:not(.active) #confirmBtn {
    display: none !important;
}

#confirmBtn:hover {
    transform: translateX(-50%) translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.8);
}

#confirmBtn:active {
    transform: translateX(-50%) translateY(0) scale(0.98);
}

@keyframes slideUp {
    from {
        bottom: -100px;
        opacity: 0;
    }
    to {
        bottom: 20px;
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
    }
    50% {
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.9), 0 0 20px rgba(255, 215, 0, 0.5);
    }
}

@media (max-width: 768px) {
    .tarot-card {
        width: 80px;
        height: 128px;
    }

    .flip-card {
        width: 100px;
        height: 156px;
    }

    .flip-card.landed[data-pos="0"] { transform: translateY(0) rotate(-4deg) scale(1); }
    .flip-card.landed[data-pos="1"] { transform: translateY(-8px) rotate(0deg) scale(1.03); }
    .flip-card.landed[data-pos="2"] { transform: translateY(0) rotate(4deg) scale(1); }

    .card-image {
        font-size: 48px;
    }

    .card-name {
        font-size: 14px;
    }

    .card-position {
        font-size: 11px;
        padding: 4px 10px;
    }

    .selected-cards {
        gap: 12px;
    }

    .reveal-narration {
        font-size: 13px;
        letter-spacing: 1px;
    }

    #confirmBtn {
        bottom: 15px;
        width: calc(100% - 30px);
        padding: 16px 25px;
        font-size: 16px;
    }

    /* 步骤4的固定按钮在移动端 */
    #step4 .tarot-btn {
        bottom: 20px;
        width: calc(100% - 30px);
        padding: 16px 25px;
        font-size: 16px;
    }

    #step4.tarot-step {
        padding-bottom: 100px;
    }
}

/* 选中卡片的数字标记 */
.tarot-card.selected::after {
    content: attr(data-select-order);
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: white;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.6);
    animation: popIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* 点击波纹效果 */
.tarot-card {
    overflow: visible;
}

.tarot-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.4);
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: width 0.6s, height 0.6s, opacity 0.6s;
    opacity: 0;
}

.tarot-card:active::before {
    width: 200px;
    height: 200px;
    opacity: 1;
    transition: width 0s, height 0s, opacity 0s;
}

/* 卡片组容器添加底部留白，避免被固定按钮遮挡 */
.tarot-deck {
    padding-bottom: 100px;
}

/* 为确认按钮添加成功反馈动画 */
@keyframes successPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
    }
}

/* 动画效果 */
@keyframes cardGlow {
    0%, 100% {
        box-shadow: 0 15px 40px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.6);
    }
    50% {
        box-shadow: 0 15px 50px rgba(255, 215, 0, 1), 0 0 40px rgba(255, 215, 0, 0.9);
    }
}

.tarot-card.selected .card-back {
    animation: cardGlow 1.5s ease-in-out infinite;
}

@keyframes selectPop {
    0% {
        transform: translateY(-25px) scale(1.15) rotate(2deg);
    }
    50% {
        transform: translateY(-30px) scale(1.2) rotate(2deg);
    }
    100% {
        transform: translateY(-25px) scale(1.15) rotate(2deg);
    }
}

.tarot-card.selected {
    animation: selectPop 0.5s ease-out;
}

@keyframes flipIn {
    from {
        opacity: 1;
    }
    to {
        opacity: 1;
    }
}

/* 支付选择样式 */
.payment-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.payment-modal.open {
    display: flex;
    animation: modalFadeIn 0.25s ease both;
}

.payment-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 5, 30, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.payment-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    z-index: 1;
    animation: modalRise 0.35s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

.payment-modal-dialog .payment-box {
    margin: 0 auto;
}

.payment-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    color: #555;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s ease, transform 0.2s ease;
}

.payment-modal-close:hover {
    background: rgba(0, 0, 0, 0.18);
    transform: rotate(90deg);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modalRise {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

body.modal-open {
    overflow: hidden;
}

.payment-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    max-width: 700px;
    margin: 20px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.payment-box h3 {
    color: #333;
    text-align: center;
    margin-bottom: 10px;
    font-size: 28px;
}

.payment-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.payment-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.payment-option {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 3px solid #ddd;
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.payment-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.payment-option.recommended {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #FFD700;
}

.payment-option.recommended h4,
.payment-option.recommended p {
    color: white;
}

.option-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: #FFD700;
    color: #333;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.option-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.payment-option h4 {
    font-size: 22px;
    margin: 0 0 10px 0;
    color: #333;
}

.payment-option p {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px 0;
}

.price {
    font-size: 36px;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 20px;
}

.price span {
    font-size: 48px;
}

.payment-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-btn.free {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    color: white;
}

.payment-btn.free:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(86, 171, 47, 0.4);
}

.payment-btn.paid {
    background: #FFD700;
    color: #333;
}

.payment-btn.paid:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

@media (max-width: 768px) {
    .payment-options {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .payment-box {
        padding: 25px;
    }

    .option-icon {
        font-size: 50px;
    }

    .price {
        font-size: 28px;
    }

    .price span {
        font-size: 36px;
    }
}

/* 广告播放样式 */
.ad-player {
    background: rgba(0, 0, 0, 0.95);
    padding: 40px;
    border-radius: 15px;
    max-width: 600px;
    margin: 20px auto;
    text-align: center;
    color: white;
}

.ad-player h3 {
    margin-bottom: 20px;
    font-size: 24px;
}

.ad-countdown {
    font-size: 48px;
    font-weight: bold;
    color: #FFD700;
    margin: 30px 0;
}

.ad-video {
    width: 100%;
    max-width: 500px;
    height: 300px;
    background: #333;
    border-radius: 10px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}

/* 洗牌动画样式 */
.shuffle-container {
    text-align: center;
    padding: 40px 20px;
}

.shuffle-container h3 {
    color: #fff;
    font-size: 28px;
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

.shuffle-tip {
    color: #B0C4DE;
    font-size: 16px;
    margin-bottom: 40px;
}

.shuffle-cards {
    position: relative;
    width: 400px;
    height: 200px;
    margin: 0 auto 40px;
}

.shuffle-card {
    position: absolute;
    width: 70px;
    height: 105px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid #FFD700;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.shuffle-card::before {
    content: '';
    width: 85%;
    height: 85%;
    background-image: url('/images/constellations/tarot.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.95;
}

/* 左边牌堆 */
.shuffle-card.left-deck {
    left: 80px;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: shuffleLeft 5s ease-in-out infinite;
}

/* 右边牌堆 */
.shuffle-card.right-deck {
    right: 80px;
    top: 50%;
    transform: translate(50%, -50%);
    animation: shuffleRight 5s ease-in-out infinite;
}

/* 扑克牌式洗牌动画 - 左边牌堆 */
@keyframes shuffleLeft {
    0% {
        left: 80px;
        top: 50%;
        transform: translate(-50%, -50%) rotate(0deg) rotateY(0deg);
    }
    10% {
        left: 80px;
        top: 50%;
        transform: translate(-50%, -50%) rotate(-5deg) translateY(-20px) rotateY(0deg);
    }
    25% {
        left: 45%;
        top: 50%;
        transform: translate(-50%, -50%) rotate(-15deg) translateY(-12px) rotateY(180deg);
    }
    40% {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) rotate(5deg) translateY(5px) rotateY(360deg);
    }
    55% {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) rotate(-8deg) translateY(-8px) rotateY(360deg);
    }
    70% {
        left: 55%;
        top: 50%;
        transform: translate(-50%, -50%) rotate(12deg) translateY(-15px) rotateY(540deg);
    }
    85% {
        left: 80px;
        top: 50%;
        transform: translate(-50%, -50%) rotate(3deg) translateY(-10px) rotateY(720deg);
    }
    100% {
        left: 80px;
        top: 50%;
        transform: translate(-50%, -50%) rotate(0deg) rotateY(720deg);
    }
}

/* 扑克牌式洗牌动画 - 右边牌堆 */
@keyframes shuffleRight {
    0% {
        right: 80px;
        top: 50%;
        transform: translate(50%, -50%) rotate(0deg) rotateY(0deg);
    }
    10% {
        right: 80px;
        top: 50%;
        transform: translate(50%, -50%) rotate(5deg) translateY(-20px) rotateY(0deg);
    }
    25% {
        right: 45%;
        top: 50%;
        transform: translate(50%, -50%) rotate(15deg) translateY(-12px) rotateY(-180deg);
    }
    40% {
        right: 50%;
        top: 50%;
        transform: translate(50%, -50%) rotate(-5deg) translateY(5px) rotateY(-360deg);
    }
    55% {
        right: 50%;
        top: 50%;
        transform: translate(50%, -50%) rotate(8deg) translateY(-8px) rotateY(-360deg);
    }
    70% {
        right: 55%;
        top: 50%;
        transform: translate(50%, -50%) rotate(-12deg) translateY(-15px) rotateY(-540deg);
    }
    85% {
        right: 80px;
        top: 50%;
        transform: translate(50%, -50%) rotate(-3deg) translateY(-10px) rotateY(-720deg);
    }
    100% {
        right: 80px;
        top: 50%;
        transform: translate(50%, -50%) rotate(0deg) rotateY(-720deg);
    }
}


@keyframes pulse {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
    50% {
        opacity: 0.7;
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }
}

.shuffle-progress {
    width: 100%;
    max-width: 400px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin: 0 auto;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
    border-radius: 10px;
    width: 0;
    animation: progress 3s ease-out forwards;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

@keyframes progress {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .shuffle-cards {
        width: 300px;
        height: 180px;
    }

    .shuffle-card {
        width: 60px;
        height: 90px;
    }

    .shuffle-card.left-deck {
        left: 60px;
    }

    .shuffle-card.right-deck {
        right: 60px;
    }

    @keyframes shuffleLeft {
        0% {
            left: 60px;
            top: 50%;
            transform: translate(-50%, -50%) rotate(0deg) rotateY(0deg);
        }
        10% {
            left: 60px;
            top: 50%;
            transform: translate(-50%, -50%) rotate(-5deg) translateY(-15px) rotateY(0deg);
        }
        25% {
            left: 45%;
            top: 50%;
            transform: translate(-50%, -50%) rotate(-15deg) translateY(-10px) rotateY(180deg);
        }
        40% {
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%) rotate(5deg) translateY(4px) rotateY(360deg);
        }
        55% {
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%) rotate(-8deg) translateY(-6px) rotateY(360deg);
        }
        70% {
            left: 55%;
            top: 50%;
            transform: translate(-50%, -50%) rotate(12deg) translateY(-12px) rotateY(540deg);
        }
        85% {
            left: 60px;
            top: 50%;
            transform: translate(-50%, -50%) rotate(3deg) translateY(-8px) rotateY(720deg);
        }
        100% {
            left: 60px;
            top: 50%;
            transform: translate(-50%, -50%) rotate(0deg) rotateY(720deg);
        }
    }

    @keyframes shuffleRight {
        0% {
            right: 60px;
            top: 50%;
            transform: translate(50%, -50%) rotate(0deg) rotateY(0deg);
        }
        10% {
            right: 60px;
            top: 50%;
            transform: translate(50%, -50%) rotate(5deg) translateY(-15px) rotateY(0deg);
        }
        25% {
            right: 45%;
            top: 50%;
            transform: translate(50%, -50%) rotate(15deg) translateY(-10px) rotateY(-180deg);
        }
        40% {
            right: 50%;
            top: 50%;
            transform: translate(50%, -50%) rotate(-5deg) translateY(4px) rotateY(-360deg);
        }
        55% {
            right: 50%;
            top: 50%;
            transform: translate(50%, -50%) rotate(8deg) translateY(-6px) rotateY(-360deg);
        }
        70% {
            right: 55%;
            top: 50%;
            transform: translate(50%, -50%) rotate(-12deg) translateY(-12px) rotateY(-540deg);
        }
        85% {
            right: 60px;
            top: 50%;
            transform: translate(50%, -50%) rotate(-3deg) translateY(-8px) rotateY(-720deg);
        }
        100% {
            right: 60px;
            top: 50%;
            transform: translate(50%, -50%) rotate(0deg) rotateY(-720deg);
        }
    }
}
