/* 炉石传说风格卡片容器 */
.hearthstone-card-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    perspective: 1200px;
}

/* 卡片堆叠区域 */
.hearthstone-card-stack {
    position: relative;
    height: 450px;
    width: 100%;
    transform-style: preserve-3d;
    margin-left:-180px;
}

/* 单个卡片样式 */
.hearthstone-card {
    position: absolute;
    top: 0;
    left: 50%;
    width: 85%;
    height: 100%;
    transform-origin: center 500px;
    transform: translateX(-50%) rotate(calc((var(--card-index) - 2) * 12deg)) translateY(calc(var(--card-index) * 5px)) translateZ(calc(var(--card-index) * -30px));
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: var(--card-index);
    cursor: pointer;
    will-change: transform, z-index;
}

    /* 卡片索引变量 */
    .hearthstone-card[data-card="1"] {
        --card-index: 1;
    }

    .hearthstone-card[data-card="2"] {
        --card-index: 2;
    }

    .hearthstone-card[data-card="3"] {
        --card-index: 3;
    }

    .hearthstone-card[data-card="4"] {
        --card-index: 4;
    }

    .hearthstone-card[data-card="5"] {
        --card-index: 5;
    }

/* 卡片框架 - 炉石风格边框 */
.card-frame {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(145deg, #1a1a1a, #2d2d2d);
    border: 8px solid #8B7355;
    box-shadow: 0 0 0 2px #D4AF37, 0 10px 30px rgba(0,0,0,0.4), inset 0 0 20px rgba(0,0,0,0.3);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 图片容器 */
.card-image-container {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

/* 图片样式 - 等比缩放填充 */
.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s ease;
}

/* 卡片标签 */
.card-label {
    position: absolute;
    bottom: 15px;
    right: 15px;
    opacity: 0.9;
    transform: translateY(10px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

    .card-label .badge {
        font-size: 0.8rem;
        padding: 6px 12px;
        border-radius: 20px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    }

/* 卡片发光效果 */
.card-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 18px;
    background: linear-gradient( 45deg, transparent 30%, rgba(255, 215, 0, 0.15) 50%, transparent 70% );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    filter: blur(8px);
}

/* 默认状态卡片布局 - 扇形展开 */
.hearthstone-card-stack .hearthstone-card {
    /* 扇形布局 */
    transform: translateX(-50%) rotate(calc((var(--card-index) - 3) * 15deg)) translateY(calc(var(--card-index) * 3px)) translateZ(calc(var(--card-index) * -20px));
}

/* 激活状态卡片（被点击的卡片） */
.hearthstone-card.active {
    z-index: 100;
}

    .hearthstone-card.active .card-frame {
        border-color: #FFD700;
        box-shadow: 0 0 0 3px #FFD700, 0 15px 40px rgba(255, 215, 0, 0.3), 0 5px 20px rgba(0,0,0,0.4), inset 0 0 30px rgba(255, 215, 0, 0.1);
        transform: scale(1.02);
    }

/* 悬停效果 - 抽牌动画 */
/*.hearthstone-card:hover {
    transform: translateX(-50%) translateY(-40px) translateZ(50px) rotate(0deg) !important;
    z-index: 200 !important;
}

    .hearthstone-card:hover .card-frame {
        border-color: #FFD700;
        box-shadow: 0 0 0 4px #FFD700, 0 25px 60px rgba(255, 215, 0, 0.5), 0 15px 40px rgba(0,0,0,0.6), inset 0 0 50px rgba(255, 215, 0, 0.2);
        transform: scale(1.08);
    }

    .hearthstone-card:hover .card-image {
        transform: scale(1.1);
    }

    .hearthstone-card:hover .card-label {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    .hearthstone-card:hover .card-glow {
        opacity: 1;
        animation: cardGlow 2s ease-in-out infinite;
    }*/

/* 当卡片被悬停时，两侧卡片张开 */
/*.hearthstone-card-stack:hover .hearthstone-card:not(:hover) {*/
    /* 左侧卡片向左张开 */
    /*&[data-card="1"]:not(:hover) {
        transform: translateX(-50%) rotate(-25deg) translateY(10px) translateZ(-10px) !important;
    }

    &[data-card="2"]:not(:hover) {
        transform: translateX(-50%) rotate(-12deg) translateY(5px) translateZ(-5px) !important;
    }*/
    /* 中间卡片已经在悬停状态处理 */
    /* 右侧卡片向右张开 */
    /*&[data-card="4"]:not(:hover) {
        transform: translateX(-50%) rotate(12deg) translateY(5px) translateZ(-5px) !important;
    }

    &[data-card="5"]:not(:hover) {
        transform: translateX(-50%) rotate(25deg) translateY(10px) translateZ(-10px) !important;
    }
}*/

/* 控制面板 */
.hearthstone-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 40px;
}

.hs-control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(145deg, #8B7355, #6B5B4D);
    border: 3px solid #D4AF37;
    color: #FFD700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3), inset 0 2px 5px rgba(255,255,255,0.1);
}

    .hs-control-btn:hover {
        background: linear-gradient(145deg, #D4AF37, #B3973A);
        border-color: #FFD700;
        color: white;
        transform: scale(1.1) rotate(5deg);
        box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4), inset 0 3px 8px rgba(255,255,255,0.2);
    }

    .hs-control-btn:active {
        transform: scale(0.95) rotate(0deg);
    }

/* 卡片计数器 */
.card-counter {
    font-family: 'Arial', sans-serif;
    font-size: 1.2rem;
    font-weight: bold;
    color: #D4AF37;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    padding: 8px 20px;
    background: rgba(0,0,0,0.5);
    border-radius: 20px;
    border: 2px solid #8B7355;
    min-width: 80px;
    text-align: center;
}

.current-card {
    color: #FFD700;
    font-size: 1.4rem;
}

/* 动画效果 */
@keyframes cardGlow {
    0%, 100% {
        opacity: 0.5;
        filter: blur(8px);
    }

    50% {
        opacity: 0.8;
        filter: blur(12px);
    }
}

@keyframes drawCard {
    0% {
        transform: translateX(-50%) translateY(0) translateZ(0) rotate(0deg);
    }

    40% {
        transform: translateX(-50%) translateY(-60px) translateZ(80px) rotate(0deg);
    }

    100% {
        transform: translateX(-50%) translateY(-40px) translateZ(50px) rotate(0deg);
    }
}

@keyframes fanOutLeft {
    from {
        transform: translateX(-50%) rotate(0deg) translateY(0) translateZ(0);
    }

    to {
        transform: translateX(-50%) rotate(-25deg) translateY(10px) translateZ(-10px);
    }
}

@keyframes fanOutRight {
    from {
        transform: translateX(-50%) rotate(0deg) translateY(0) translateZ(0);
    }

    to {
        transform: translateX(-50%) rotate(25deg) translateY(10px) translateZ(-10px);
    }
}

/* 悬停时的动画 */
/*.hearthstone-card:hover {
    animation: drawCard 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}*/

/* 响应式调整 */
@media (max-width: 768px) {
    .hearthstone-card-container {
        max-width: 320px;
    }

    .hearthstone-card-stack {
        height: 380px;
    }

    .card-frame {
        border-width: 6px;
    }

    .hearthstone-card {
        width: 90%;
    }

    .hs-control-btn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .card-counter {
        font-size: 1rem;
        min-width: 70px;
    }
}

/* 移动端触摸优化 */
@media (max-width: 576px) {
    .hearthstone-card-container {
        max-width: 280px;
    }

    .hearthstone-card-stack {
        height: 350px;
    }

    .hearthstone-controls {
        gap: 20px;
        margin-top: 30px;
    }
}

/* 确保图片容器大小固定 */
.card-image-container {
    aspect-ratio: 3/4;
}

/* 流畅的过渡效果 */
.hearthstone-card,
.card-frame,
.card-image,
.card-label {
    transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-duration: 0.5s;
}

/* 添加3D效果增强 */
.hearthstone-card-stack {
    transform: perspective(1200px) rotateX(5deg);
}


