/* ===== 기본 스타일 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FFB800;
    --secondary-color: #FF6B35;
    --success-color: #4CAF50;
    --danger-color: #FF5252;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 15px 60px rgba(0, 0, 0, 0.25);
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* ===== 배경 효과 ===== */
.background-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 184, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ===== 컨테이너 ===== */
.container {
    max-width: 900px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ===== 화면 전환 ===== */
.screen {
    display: none;
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

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

/* ===== 시작 화면 ===== */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.sunny-icon {
    font-size: 100px;
    color: var(--primary-color);
    animation: sunRotate 10s linear infinite;
    display: inline-block;
    filter: drop-shadow(0 5px 20px rgba(255, 184, 0, 0.4));
}

@keyframes sunRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.game-title {
    font-family: 'Baloo 2', cursive;
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 20px 0 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-subtitle {
    font-size: 1.3rem;
    color: #666;
    font-weight: 500;
}

.welcome-message {
    text-align: center;
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    border-left: 5px solid var(--primary-color);
}

.welcome-message p {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin: 10px 0;
    line-height: 1.6;
}

.game-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 30px;
}

.info-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    font-weight: 500;
    transition: transform 0.3s ease;
}

.info-item:hover {
    transform: translateY(-5px);
}

.info-item i {
    font-size: 1.5rem;
    margin-bottom: 10px;
    display: block;
}

/* ===== 버튼 스타일 ===== */
.btn {
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

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

.btn-start {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    width: 100%;
    margin-top: 20px;
    font-size: 1.4rem;
    padding: 22px;
}

.btn-next {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 100%;
    margin-top: 30px;
}

.btn-restart {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    flex: 1;
}

.btn-home {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    flex: 1;
}

.btn-close-modal {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 100%;
    margin-top: 20px;
}

/* ===== 게임 화면 ===== */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 3px solid #f0f0f0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sunny-icon-small {
    font-size: 2rem;
    color: var(--primary-color);
    animation: sunRotate 8s linear infinite;
}

.game-name {
    font-family: 'Baloo 2', cursive;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-display {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 5px 15px rgba(255, 184, 0, 0.3);
}

/* ===== 진행 상황 ===== */
.progress-container {
    margin-bottom: 30px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.time-display {
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.progress-bar {
    height: 12px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(255, 184, 0, 0.5);
}

/* ===== 문제 영역 ===== */
.question-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    border-left: 6px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.question-header {
    margin-bottom: 15px;
}

.question-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    display: inline-block;
}

.question-text {
    font-size: 1.3rem;
    line-height: 1.8;
    color: var(--text-dark);
    font-weight: 500;
}

/* ===== 선택지 영역 ===== */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-btn {
    background: white;
    border: 3px solid #e0e0e0;
    padding: 20px 25px;
    border-radius: 15px;
    font-size: 1.1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 500;
    color: var(--text-dark);
    position: relative;
    overflow: hidden;
}

.option-btn:hover:not(.disabled) {
    border-color: var(--primary-color);
    background: #fff8e1;
    transform: translateX(10px);
    box-shadow: 0 5px 20px rgba(255, 184, 0, 0.2);
}

.option-btn.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #fff8e1, #ffe082);
    font-weight: 700;
}

.option-btn.correct {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #e8f5e9, #a5d6a7);
    color: #2e7d32;
    font-weight: 700;
}

.option-btn.wrong {
    border-color: var(--danger-color);
    background: linear-gradient(135deg, #ffebee, #ef9a9a);
    color: #c62828;
    font-weight: 700;
}

.option-btn.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.option-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    margin-right: 15px;
    font-weight: 700;
    font-size: 0.95rem;
}

.option-btn.correct .option-number {
    background: var(--success-color);
}

.option-btn.wrong .option-number {
    background: var(--danger-color);
}

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

.result-icon {
    font-size: 120px;
    margin-bottom: 20px;
    animation: scaleIn 0.6s ease;
}

.result-icon i {
    color: var(--primary-color);
    filter: drop-shadow(0 10px 30px rgba(255, 184, 0, 0.4));
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.result-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 30px;
    font-family: 'Baloo 2', cursive;
}

.result-score {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.score-item {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-label {
    font-size: 0.95rem;
    color: #666;
    font-weight: 600;
}

.score-value {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 20px 0;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 600;
}

.stat-item.correct {
    color: var(--success-color);
}

.stat-item.wrong {
    color: var(--danger-color);
}

.stat-item i {
    font-size: 1.5rem;
}

.result-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* ===== 모달 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 30px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
    z-index: 1001;
}

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

/* ===== 오답 모달 ===== */
.wrong-modal {
    border-top: 6px solid var(--danger-color);
}

.modal-image-container {
    text-align: center;
    margin-bottom: 25px;
}

.sunny-image {
    width: 280px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 5px solid var(--danger-color);
}

.shake {
    animation: shake 0.6s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.wrong-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--danger-color);
    margin-bottom: 20px;
    font-family: 'Baloo 2', cursive;
    text-align: center;
}

.explanation-box {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 15px;
    margin: 20px 0;
    border-left: 5px solid var(--danger-color);
}

.explanation-box h3 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.explanation-box h3 i {
    color: var(--primary-color);
}

.explanation-box p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 15px;
}

.correct-answer {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    border: 2px solid var(--success-color);
}

.correct-answer strong {
    color: var(--success-color);
    margin-right: 8px;
}

/* ===== 정답 모달 ===== */
.correct-modal {
    border-top: 6px solid var(--success-color);
}

.correct-animation {
    text-align: center;
    margin-bottom: 20px;
}

.correct-animation i {
    font-size: 100px;
    color: var(--success-color);
    animation: checkPop 0.6s ease;
}

@keyframes checkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.correct-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--success-color);
    margin-bottom: 15px;
    font-family: 'Baloo 2', cursive;
    text-align: center;
}

.correct-message {
    font-size: 1.3rem;
    color: #666;
    text-align: center;
    margin-bottom: 20px;
}

.correct-modal .explanation-box {
    border-left-color: var(--success-color);
}

.correct-modal .correct-answer {
    display: none;
}

/* ===== 반응형 디자인 ===== */
@media (max-width: 768px) {
    .screen {
        padding: 25px;
        border-radius: 20px;
    }

    .game-title {
        font-size: 2.8rem;
    }

    .game-subtitle {
        font-size: 1.1rem;
    }

    .sunny-icon {
        font-size: 70px;
    }

    .welcome-message {
        padding: 20px;
    }

    .welcome-message p {
        font-size: 1rem;
    }

    .game-info {
        grid-template-columns: 1fr;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .option-btn {
        padding: 15px 20px;
        font-size: 1rem;
    }

    .result-score {
        grid-template-columns: 1fr;
    }

    .result-title {
        font-size: 2rem;
    }

    .result-buttons {
        flex-direction: column;
    }

    .modal-content {
        padding: 25px;
    }

    .sunny-image {
        width: 200px;
    }

    .wrong-title,
    .correct-title {
        font-size: 1.6rem;
    }

    .btn {
        padding: 15px 30px;
        font-size: 1.1rem;
    }

    .game-name {
        font-size: 1.2rem;
    }

    .score-display {
        padding: 10px 20px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .screen {
        padding: 20px;
    }

    .game-title {
        font-size: 2.2rem;
    }

    .sunny-icon {
        font-size: 60px;
    }

    .option-number {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
        margin-right: 10px;
    }

    .sunny-image {
        width: 150px;
    }
}

/* ===== 스크롤바 스타일 ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}
