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

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

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

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

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

.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

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

.tab-content {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.tab-content.active {
    display: block;
}

/* 게임 설정 */
.game-setup {
    text-align: center;
    margin-bottom: 30px;
}

.setup-group {
    margin: 20px 0;
}

.setup-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #555;
}

select, button {
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

select:focus, button:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.start-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
}

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

/* 게임 화면 */
.game-container {
    display: none;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

.progress-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.progress-bar {
    width: 200px;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

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

.timer-gauge {
    width: 100%;
    height: 10px;
    background: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}

.timer-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A); /* 왼쪽에서 오른쪽으로 채워지는 그라데이션 */
    transition: width linear; /* 왼쪽에서 오른쪽으로 채워지는 그라데이션 */
    transition: width linear;
    
}

.question-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    border: 3px solid #e9ecef;
}

.question-word {
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.question-meaning {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 20px;
}

.hint-section {
    margin: 20px 0;
}

.hint-btn {
    background: #ffc107;
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 10px;
}

.hint-btn:disabled {
    background: #ddd;
    cursor: not-allowed;
}

.hint-text {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    font-style: italic;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.option-btn {
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.option-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

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

.option-btn.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.next-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    font-size: 16px;
}

/* 결과 화면 */
.result-container {
    text-align: center;
}

.score-display {
    font-size: 3rem;
    font-weight: bold;
    color: #28a745;
    margin: 20px 0;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    color: #666;
    margin-top: 5px;
}

/* 단어장 */
.wordbook-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.word-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.word-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.word-english {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.word-korean {
    color: #666;
    font-size: 1.1rem;
}

/* 오답노트 */
.wrong-answers {
    margin-top: 20px;
}

.wrong-word {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.wrong-word-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.wrong-word-english {
    font-weight: bold;
    color: #c53030;
}

.wrong-count {
    background: #c53030;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* PDF 다운로드 */
.download-section {
    text-align: center;
    margin: 30px 0;
}

.download-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    margin: 10px;
}

.download-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .question-word {
        font-size: 2rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .game-header {
        flex-direction: column;
        gap: 15px;
    }

    .progress-bar {
        width: 100%;
    }
}

.loading {
    text-align: center;
    padding: 50px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}