/* ============ 抽卡页面样式 ============ */

.card-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    position: relative;
    min-height: 420px;
}

/* 3D卡片容器 */
.card-3d {
    perspective: 1200px;
    width: 280px;
    height: 400px;
    position: absolute;
    top: 10px;
}

/* 卡片翻转器 - 包含正反面 */
.card-flipper {
    width: 280px;
    height: 400px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0s;
}

.card-flipper.flipping {
    transition: transform 1.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.card {
    width: 280px;
    height: 400px;
    background: linear-gradient(145deg, #1a1a1a, #0a0a0a);
    border: 2px solid var(--terminal-green);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
    cursor: pointer;
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.card-front {
    /* 入场动画 - 默认隐藏 */
    opacity: 0;
    animation: cardEntry 0.8s ease-out forwards, cardPulse 2s infinite 0.8s;
}

@keyframes cardEntry {
    0% {
        opacity: 0;
        transform: scale(0.95);
        filter: blur(5px);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

@keyframes cardPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(0, 255, 0, 0.3), 0 0 30px rgba(0, 255, 0, 0.1); }
    50% { box-shadow: 0 0 30px rgba(0, 255, 0, 0.5), 0 0 60px rgba(0, 255, 0, 0.2); }
}

.card-front:hover {
    border-color: var(--terminal-gold);
    box-shadow: 0 0 40px rgba(255, 155, 21, 0.5);
    animation: none;
    opacity: 1;
    filter: blur(0);
    transform: scale(1.05);
}

/* 卡片背面样式 */
.card-back {
    background: linear-gradient(145deg, #0a0a0a, #1a1a1a);
    border: 2px solid var(--terminal-gold);
    transform: rotateY(180deg);
    box-shadow: 0 0 30px rgba(255, 155, 21, 0.4);
}

.card-back-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

/* 卡片翻转动画 - 3D整体翻转正反面 */
.card-flipper.flipping {
    animation: cardFlip3DFull 1.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

@keyframes cardFlip3DFull {
    0% { 
        transform: rotateY(0deg); 
    }
    12.5% { 
        transform: rotateY(90deg); 
    }
    25% { 
        transform: rotateY(180deg); 
    }
    37.5% { 
        transform: rotateY(270deg); 
    }
    50% { 
        transform: rotateY(360deg); 
    }
    62.5% { 
        transform: rotateY(450deg); 
    }
    75% { 
        transform: rotateY(540deg); 
    }
    87.5% { 
        transform: rotateY(630deg); 
    }
    100% { 
        transform: rotateY(720deg); 
    }
}

.card-date {
    position: absolute;
    top: 25px;
    color: var(--terminal-green);
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    width: 100%;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.card-img {
    width: 200px;
    height: 250px;
    border-radius: 0;
    box-shadow: none;
    animation: catBounce 1s ease-in-out infinite;
    margin-top: 30px;
}

.card-name {
    position: absolute;
    top: 55px;
    z-index: 10;
    color: var(--terminal-green);
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

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

/* 初始卡点击提示框 */
.card-hint {
    position: relative;
    background: rgba(0, 255, 136, 0.15);
    border: 1px solid var(--terminal-green);
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 14px;
    color: var(--terminal-green);
    white-space: nowrap;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* 卡片内容 */
.card-content {
    position: absolute;
    top: 40px;
    left: 0;
    right: 0;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* 卡片内Loading */
.card-loading-inner {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    height: 400px;
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.85), rgba(10, 10, 10, 0.85)),
                url('/static/images/catbg.webp') center/cover no-repeat;
    border: 2px solid var(--terminal-gold);
    border-radius: 12px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 0 30px rgba(255, 155, 21, 0.4);
    z-index: 10;
}

.card-loading-circle {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 255, 136, 0.2);
    border-top-color: var(--terminal-green);
    border-radius: 50%;
    animation: cardSpin 0.8s linear infinite;
}

@keyframes cardSpin {
    to { transform: rotate(360deg); }
}

.card-loading-text {
    color: var(--terminal-green);
    font-size: 14px;
    text-align: center;
}

.card-loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(0, 255, 136, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.card-loading-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--terminal-green);
    border-radius: 2px;
    transition: width 0.3s ease;
}

@keyframes cardLoadingProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.spinning-text {
    color: var(--terminal-gold);
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(255, 155, 21, 0.5);
    text-align: center;
}

.card-result {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    border-color: var(--terminal-gold);
    box-shadow: 0 0 30px rgba(255, 155, 21, 0.4);
    animation: resultAppear 0.5s ease-out;
}

@keyframes resultAppear {
    0% { transform: translateX(-50%) scale(0.8); opacity: 0; }
    50% { transform: translateX(-50%) scale(1.05); }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

#resultEmoji {
    font-size: 120px;
    line-height: 1;
}

.result-text {
    margin: 10px 0;
    padding: 0 15px;
    color: var(--terminal-yellow);
    font-size: 14px;
    line-height: 1.8;
    text-align: justify;
    max-height: 360px;
    overflow-y: auto;
}

/* 二维码容器样式 */
.qr-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5px;
    padding: 5px 0;
    border-top: 1px dashed var(--terminal-gray);
}

.qr-text {
    color: var(--terminal-gray);
    font-size: 12px;
}

.qr-code {
    width: 50px;
    height: 50px;
    margin-left: 10px;
    border: 1px solid var(--terminal-gray);
    padding: 2px;
    border-radius: 4px;
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1000;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid var(--terminal-gold);
    border-radius: 50%;
    animation: particleFly 1s ease-out forwards;
}

@keyframes particleFly {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}

.flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--terminal-green);
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    animation: flash 0.3s ease-out;
}

@keyframes flash {
    0% { opacity: 0.3; }
    100% { opacity: 0; }
}

/* 限制弹窗 */
.limit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.limit-modal-content {
    background: linear-gradient(145deg, #1a1a1a, #0a0a0a);
    border: 2px solid var(--terminal-red);
    border-radius: 12px;
    padding: 30px 40px;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.3);
}

.limit-modal-text {
    color: var(--terminal-red);
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.limit-modal-btn {
    background: transparent;
    border: 1px solid var(--terminal-red);
    color: var(--terminal-red);
    padding: 10px 30px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.limit-modal-btn:hover {
    background: var(--terminal-red);
    color: var(--terminal-bg);
}
