/* 기본 스타일 */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden; 
}

/* 카드 오버레이: 화면 전체를 덮는 검은 배경 */
#cardOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    cursor: pointer;
}

/* 3D 효과를 위한 부모 컨테이너 */
.card-container {
    perspective: 1000px;
}

/* 포켓몬 카드 기본 스타일 */
.card {
    width: 280px;
    height: 380px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    transform-style: preserve-3d;
    cursor: pointer;
    overflow: hidden;
}

/* 카드 앞면 스타일 */
.card-front {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/card-image.png');
    background-size: cover;
    background-position: center;
    border-radius: 15px;
    backface-visibility: hidden;
    transform: rotateY(0deg) translateZ(1px);
    transform-style: preserve-3d; 
}

/* 카드 뒷면 스타일 */
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://tcg.pokemon.com/assets/img/global/tcg-card-back-2x.jpg') !important;
    background-size: cover;
    background-position: center;
    border-radius: 15px;
    backface-visibility: hidden;
    transform: rotateY(180deg) translateZ(1px);
}

/* 카드 등장 애니메이션 정의 */
@keyframes enterAnimation {
    0% {
        opacity: 0;
        transform: scale(0.5) rotateY(-720deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

/* .entering 클래스가 추가될 때 애니메이션 실행 */
.card.entering {
    animation: enterAnimation 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* --- 이하 홀로그램 및 반사 효과 --- */

.card-holo {
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background-image: repeating-linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.3) 15%, rgba(255, 255, 255, 0.6) 25%, rgba(255, 255, 255, 0.3) 35%, transparent 50%);
    background-size: 200% 200%; 
    mix-blend-mode: overlay;
    opacity: 0;
    transition: opacity 0.2s ease-out, background-position 0.1s ease-out;
    pointer-events: none;
    filter: blur(0.5px);
    z-index: 2;
}

.card-reflection {
    position: absolute; 
    top: -100%; left: -100%;
    width: 300%; height: 300%;
    background: linear-gradient(45deg, transparent 0%, transparent 35%, rgba(255, 255, 255, 0.1) 40%, rgba(255, 255, 255, 0.3) 45%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0.3) 55%, rgba(255, 255, 255, 0.1) 60%, transparent 65%, transparent 100%);
    background-size: 200% 200%; 
    mix-blend-mode: soft-light;
    opacity: 0;
    transition: opacity 0.4s ease-out, background-position 0.3s ease-out;
    pointer-events: none;
    filter: blur(0.8px);
    animation: reflectionMove 4s ease-in-out infinite;
    z-index: 3;
}

.card-glow {
    position: absolute; 
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.2) 40%, rgba(255, 255, 255, 0) 70%);
    opacity: 0; 
    mix-blend-mode: color-dodge;
    transition: opacity 0.2s ease-out, transform 0.1s ease-out;
    pointer-events: none;
    z-index: 4;
}

@keyframes reflectionMove {
    0%, 100% { 
        background-position: 0% 0%; 
        opacity: 0.3; 
    }
    50% { 
        background-position: 100% 100%;
        opacity: 0.8; 
    }
}

.card.rotating .card-reflection {
    animation-duration: 2s;
    opacity: 0.8;
}

#closeButton {
    position: absolute; 
    top: 20px; 
    right: 20px; 
    color: white; 
    font-size: 24px;
    cursor: pointer; 
    background: rgba(0, 0, 0, 0.5); 
    padding: 10px; 
    border-radius: 50%;
    width: 40px; 
    height: 40px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
}