/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', 'Arial', sans-serif;
    background: linear-gradient(135deg, #a7d7ff, #ffe0e7);
    min-height: 100vh;
    color: #333;
    position: relative;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 100vh;
}

/* 헤더 스타일 */
header {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
    animation: bounce 1s ease-in-out;
}

h1 {
    font-family: 'Gaegu', cursive;
    font-size: 2.5rem;
    color: #ff5a87;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 10px;
}

/* 게임 컨테이너 */
.game-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-grow: 1;
}

/* 카드 스타일 */
.card-wrapper {
    perspective: 1000px;
    width: 280px;
    height: 180px;
    margin: 20px 0;
    position: relative;
}

.card {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: bold;
    padding: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.5s;
}

.card-front {
    background: linear-gradient(to bottom right, #74ccf4, #5456d3);
    color: white;
    transform: rotateY(0deg);
    z-index: 2;
}

.card-back {
    background: linear-gradient(to bottom right, #ffb347, #ff6b6b);
    color: white;
    transform: rotateY(180deg);
    font-size: 2rem;
    font-family: 'Gaegu', cursive;
}

.card.rotating .card-front {
    transform: rotateY(-180deg);
}

.card.rotating .card-back {
    transform: rotateY(0deg);
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    animation: point 1.5s infinite;
}

/* 카운트다운 스타일 */
.countdown {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    font-weight: bold;
    color: #ff5a87;
    background-color: rgba(255, 255, 255, 0.8);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(255, 90, 135, 0.5);
    z-index: 10;
    animation: pulse 1s infinite alternate;
}

/* 게임 방법 */
.instructions {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    max-width: 100%;
    width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.instructions h2 {
    font-family: 'Gaegu', cursive;
    color: #ff5a87;
    margin-bottom: 10px;
    text-align: center;
}

.instructions ol {
    padding-left: 25px;
}

.instructions li {
    margin-bottom: 10px;
    position: relative;
    line-height: 1.4;
}

.highlight {
    background-color: #fff2cc;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: bold;
    color: #ff5a87;
}

/* 이모지 장식 */
.emoji-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -1;
    opacity: 0.6;
}

.emoji {
    position: absolute;
    font-size: 2rem;
    animation: float 8s infinite ease-in-out;
    opacity: 0.7;
}

.emoji:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 7s;
}

.emoji:nth-child(2) {
    top: 15%;
    right: 10%;
    animation-delay: 1s;
    animation-duration: 6s;
}

.emoji:nth-child(3) {
    bottom: 30%;
    left: 15%;
    animation-delay: 2s;
    animation-duration: 9s;
}

.emoji:nth-child(4) {
    bottom: 20%;
    right: 15%;
    animation-delay: 3s;
    animation-duration: 8s;
}

.emoji:nth-child(5) {
    top: 40%;
    left: 5%;
    animation-delay: 4s;
    animation-duration: 10s;
}

.emoji:nth-child(6) {
    top: 45%;
    right: 5%;
    animation-delay: 5s;
    animation-duration: 7s;
}

/* 푸터 스타일 */
footer {
    text-align: center;
    padding: 20px 0;
    color: #666;
    font-size: 0.9rem;
    width: 100%;
}

/* 애니메이션 */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* 단어 선택 스타일 */
.word-choice {
    padding: 5px 8px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: bold;
    transition: all 0.3s;
}

.word-choice:hover, .word-choice:active {
    background-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.vs {
    font-size: 1rem;
    margin: 0 5px;
    opacity: 0.7;
}

/* 터치 효과 */
.touch-effect {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: touchPulse 0.5s forwards;
    z-index: 9999;
}

@keyframes point {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-15px) rotate(5deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(15px) rotate(-5deg);
    }
}

@keyframes touchPulse {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* 모바일 최적화 */
@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    .card-wrapper {
        width: 260px;
        height: 160px;
    }
    
    .card-back {
        font-size: 2rem;
    }
    
    .countdown {
        font-size: 4rem;
        width: 100px;
        height: 100px;
    }
    
    .instructions {
        width: 100%;
        font-size: 0.95rem;
    }
}

/* 회전 효과를 위한 추가 클래스 */
.rotating .card-front {
    transform: rotateY(180deg);
}

.rotating .card-back {
    transform: rotateY(0deg);
}