* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

/* 반짝이는 별 배경 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: twinkle 10s ease-in-out infinite;
    opacity: 0.6;
    pointer-events: none;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* 글래스모피즘 카드 */
.card-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 3rem 2rem;
    border-radius: 40px;
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.37),
        inset 0 0 60px rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.6s ease-out;
}

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

.header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #fff 0%, #f0f0ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 500;
}

/* 모드 선택 카드 */
.mode-select {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.mode-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.4);
    padding: 2.5rem 2rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    display: block;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.mode-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 70%);
    transform: rotate(45deg);
    transition: all 0.6s;
}

.mode-card:hover::before {
    left: 100%;
}

.mode-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
}

.mode-card:active {
    transform: translateY(-5px) scale(1.01);
}

.mode-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

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

.mode-card:nth-child(1) .mode-icon {
    animation-delay: 0s;
}

.mode-card:nth-child(2) .mode-icon {
    animation-delay: 0.2s;
}

.mode-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.mode-card p {
    font-size: 1rem;
    opacity: 0.95;
    line-height: 1.6;
}

/* 타로 결과 화면 */
.tarot-result {
    text-align: center;
    margin-top: 2rem;
    display: none;
}

.tarot-result.show {
    display: block;
    animation: fadeIn 0.8s ease-out;
}

.intro-text {
    color: white;
    font-size: 1.2rem;
    line-height: 1.8;
    margin: 2rem 0;
    font-weight: 500;
}

/* 카드 이미지 */
.card-image-container {
    position: relative;
    margin: 2rem auto;
    max-width: 350px;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

.card-image {
    width: 100%;
    border-radius: 25px;
    border: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-image:hover {
    transform: scale(1.05) rotate(2deg);
}

.card-name {
    font-size: 2.5rem;
    color: white;
    margin: 2rem 0 1rem;
    font-weight: 800;
    text-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
}

.card-keywords {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.3rem;
    margin-bottom: 2rem;
    font-style: italic;
    font-weight: 500;
}

/* 3카드 스프레드 */
.three-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2.5rem;
    margin: 3rem 0;
}

.card-slot {
    text-align: center;
}

.card-position {
    font-size: 1.4rem;
    color: white;
    font-weight: 700;
    margin-bottom: 2.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.card-slot .card-image {
    max-width: 220px;
    border-radius: 20px;
    border: none;
}

.card-slot .card-name {
    font-size: 1.5rem;
    margin: 1.5rem 0 0.8rem;
}

.card-slot .card-keywords {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* 버튼 */
.btn {
    background: linear-gradient(135deg, #ff6ec7 0%, #7873f5 100%);
    color: white;
    border: none;
    padding: 1.2rem 3rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1rem 0.5rem;
    box-shadow: 0 10px 30px rgba(255, 110, 199, 0.4);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 110, 199, 0.6);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #b3b3ff 0%, #8080ff 100%);
    box-shadow: 0 10px 30px rgba(128, 128, 255, 0.4);
}

.btn-secondary:hover {
    box-shadow: 0 15px 40px rgba(128, 128, 255, 0.6);
}

.btn-container {
    text-align: center;
    margin-top: 3rem;
}

/* 카드 뒷면 */
.card-back {
    width: 100%;
    max-width: 350px;
    margin: 2rem auto;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(255, 110, 199, 0.3) 0%, rgba(120, 115, 245, 0.3) 100%);
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 450px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-back:hover {
    transform: scale(1.05) rotate(-2deg);
    box-shadow: 0 20px 60px rgba(255, 110, 199, 0.5);
    border-color: rgba(255, 255, 255, 0.7);
}

.card-back-icon {
    font-size: 6rem;
    color: #fff;
    margin-bottom: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 5px 20px rgba(255, 255, 255, 0.5));
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.card-back-text {
    color: white;
    font-size: 1.3rem;
    text-align: center;
    font-weight: 600;
    line-height: 1.8;
}

/* 반응형 */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .card-container {
        padding: 2rem 1.5rem;
        border-radius: 30px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .logo {
        font-size: 4rem;
    }
    
    .mode-select {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .three-cards {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .btn {
        padding: 1rem 2.5rem;
        font-size: 1.1rem;
    }
    
    .card-name {
        font-size: 2rem;
    }
}

/* 추가 애니메이션 */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
}
