* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.screen {
    display: none;
    padding: 40px;
    min-height: 400px;
}

.screen.active {
    display: block;
}

/* 시작 화면 */
#start-screen {
    text-align: center;
}

#start-screen h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 20px;
}

#start-screen p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 30px;
}

/* 로딩 화면 */
#loading-screen {
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#loading-screen.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 버튼 */
.btn {
    padding: 15px 40px;
    font-size: 1.1em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn-nav {
    background: #f0f0f0;
    color: #333;
    padding: 10px 20px;
    font-size: 1em;
}

.btn-nav:hover {
    background: #e0e0e0;
}

.btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 퀴즈 화면 */
.quiz-header {
    margin-bottom: 30px;
}

#quiz-screen {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: grab;
}

#quiz-screen:active {
    cursor: grabbing;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.question-counter {
    text-align: center;
    font-size: 1.2em;
    color: #666;
    font-weight: bold;
}

.quiz-content {
    min-height: 300px;
    touch-action: pan-y;
}

.importance-stars {
    margin-bottom: 15px;
    font-size: 1.5em;
}

.star {
    color: #ffd700;
    margin-right: 5px;
}

.question-text {
    font-size: 1.3em;
    color: #333;
    line-height: 1.6;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.option {
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1em;
    position: relative;
}

.option:hover {
    border-color: #667eea;
    transform: translateX(5px);
}

.option.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.option.correct {
    border-color: #4caf50;
    background: #e8f5e9;
    animation: correctPulse 0.5s ease;
}

.option.wrong {
    border-color: #f44336;
    background: #ffebee;
    animation: wrongShake 0.5s ease;
}

.option.disabled {
    pointer-events: none;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.explanation {
    display: none;
    padding: 20px;
    background: #fff3cd;
    border-radius: 10px;
    border-left: 4px solid #ffc107;
    margin-top: 20px;
    line-height: 1.6;
}

.explanation.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navigation-buttons {
    display: none;
    justify-content: space-between;
    margin-top: 20px;
}

.navigation-buttons.show {
    display: flex;
}

/* 결과 화면 */
#result-screen h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.score-summary {
    display: flex;
    justify-content: space-around;
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.score-item {
    text-align: center;
}

.score-label {
    font-size: 1em;
    color: #666;
    margin-bottom: 10px;
}

.score-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #333;
}

.score-value.correct {
    color: #4caf50;
}

.score-value.wrong {
    color: #f44336;
}

.wrong-questions {
    margin-bottom: 30px;
}

.wrong-questions h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.wrong-item {
    padding: 15px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #f44336;
}

.wrong-item-question {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.wrong-item-answer {
    color: #666;
    margin-bottom: 5px;
}

.wrong-item-answer.correct {
    color: #4caf50;
    font-weight: bold;
}

.wrong-item-answer.user {
    color: #f44336;
}

#restart-btn {
    display: block;
    margin: 0 auto;
}

/* 모바일 대응 */
@media (max-width: 600px) {
    .container {
        border-radius: 0;
    }

    .screen {
        padding: 20px;
    }

    #start-screen h1 {
        font-size: 2em;
    }

    .question-text {
        font-size: 1.1em;
    }

    .option {
        font-size: 1em;
        padding: 15px;
    }

    .score-value {
        font-size: 2em;
    }
}

/* 스와이프 효과 */
.swipe-transition {
    transition: transform 0.3s ease;
}
