/* 전체 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 헤더 스타일 */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.2rem;
    font-weight: bold;
}

/* 메인 게임 영역 */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.game-area {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

/* 카드 스타일 */
.card-container {
    perspective: 1000px;
    margin-bottom: 30px;
}

.card {
    width: 300px;
    height: 200px;
    margin: 0 auto;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.card-back {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    transform: rotateY(180deg);
}

.card h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.word-type {
    font-size: 0.9rem;
    opacity: 0.8;
    background: rgba(255,255,255,0.2);
    padding: 5px 15px;
    border-radius: 20px;
}

.pronunciation {
    font-size: 1rem;
    opacity: 0.9;
    font-style: italic;
    margin-top: 10px;
}

/* 버튼 스타일 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn.secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e9ecef;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn.primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.btn.secondary:hover {
    background: #e9ecef;
}

/* 게임 모드 버튼 */
.game-modes {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.mode-btn {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e9ecef;
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* 퀴즈 섹션 */
.quiz-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.quiz-section h3 {
    color: #333;
    margin-bottom: 15px;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.quiz-option {
    padding: 15px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.quiz-option.correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.quiz-option.wrong {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.quiz-result {
    margin-top: 15px;
    font-weight: bold;
    font-size: 1.1rem;
}

/* 진행률 바 */
.progress-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-weight: bold;
    color: #666;
}

/* 통계 */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-item {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-item h4 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.stat-item span {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

/* 푸터 */
footer {
    text-align: center;
    margin-top: 30px;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.modal h3 {
    margin-bottom: 20px;
    color: #333;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #666;
}

.setting-item select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .score-board {
        flex-direction: column;
        gap: 10px;
    }
    
    .card {
        width: 250px;
        height: 160px;
    }
    
    .card h2 {
        font-size: 1.5rem;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .quiz-options {
        grid-template-columns: 1fr;
    }
    
    .game-modes {
        flex-direction: column;
        align-items: center;
    }
    
    .mode-btn {
        width: 200px;
    }
}

/* 애니메이션 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.card:hover {
    animation: pulse 0.3s ease;
}

.game-area {
    animation: fadeIn 0.5s ease;
}

/* 성공/실패 효과 */
.success-effect {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    animation: pulse 0.5s ease;
}

.error-effect {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%) !important;
    animation: pulse 0.5s ease;
}