/* --- 공통 스타일 --- */
.app-screen, .app-sub-screen { display: none; }
.action-button { transition: all 0.2s ease-in-out; }
.action-button:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
.action-button:disabled { transform: none; box-shadow: none; cursor: not-allowed; opacity: 0.6; }
.action-button:active { transform: translateY(0px) scale(0.98); box-shadow: inset 0 2px 4px rgba(0,0,0,0.06); }
.hanja-char-display, .hanja-char { font-size: 10rem; line-height: 1; font-weight: 900; }
@media (max-width: 640px) { .hanja-char-display, .hanja-char { font-size: 8rem; } }
.spinner { border: 5px solid #f3f3f3; border-top: 5px solid #3b82f6; border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- [수정된 부분] 사용자 정보 바 스타일 --- */
.hanja-quiz-user-bar {
    position: fixed;
    top: 0;
    right: 0;
    padding: 0.75rem 1.5rem;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    border-bottom-left-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 10001; /* 스플래시 화면보다 위에 있도록 설정 */
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* --- 로그인 스플래시 스크린 --- */
.hanja-app-splash-screen {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    color: white;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.splash-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6, #60a5fa);
    animation: gradient-animation 15s ease infinite;
    background-size: 200% 200%;
}
@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.splash-overlay {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 0);
    background-size: 20px 20px;
    opacity: 0.5;
}
.splash-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 900px;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.2);
    animation: fadeIn 0.8s ease-out forwards;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .splash-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        height: 500px;
    }
    .splash-right {
        border-radius: 0 1rem 1rem 0;
    }
    .splash-mobile-header {
        display: none;
    }
}

@media (max-width: 1023px) {
    .splash-container {
        max-width: 420px;
    }
    .splash-left {
        display: none;
    }
    .splash-right {
        border-radius: 1rem;
    }
}

.splash-left {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.splash-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: rgba(255,255,255,0.9);
}
.splash-right {
    background-color: white;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem;
    color: #333;
}
.splash-mobile-header {
    text-align: center;
    margin-bottom: 2rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.splash-button {
    background: linear-gradient(to right, #3b82f6, #2563eb);
    color: white;
    font-weight: bold;
    padding: 0.85rem 2rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    text-align: center;
}
.splash-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}
.splash-button-secondary {
    background-color: #e5e7eb;
    color: #374151;
    font-weight: bold;
    padding: 0.85rem 2rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-align: center;
}
.splash-button-secondary:hover {
    background-color: #d1d5db;
    transform: translateY(-2px);
}
.splash-footer {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    z-index: 5;
    text-align: center;
}

/* --- 모드 선택 화면 --- */
.mode-select-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; border: 2px solid #e5e7eb; border-radius: 1rem; background-color: white; text-align: center; transition: all 0.2s ease-in-out; }
.mode-select-btn:hover { border-color: #3b82f6; background-color: #eff6ff; transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }

/* --- 모달 스타일 --- */
#modal-backdrop { display: none; position: fixed; inset: 0; background-color: rgba(0,0,0,0.5); z-index: 99998; }
#modal-backdrop.active { display: block; }
.modal { display: none; position: fixed; z-index: 99999; left: 50%; top: 50%; transform: translate(-50%, -50%); background-color: white; padding: 2rem; border-radius: 0.5rem; box-shadow: 0 10px 25px rgba(0,0,0,0.1); width: 90%; max-width: 400px; }
.modal.active { display: block; animation: modal-fade-in 0.3s ease-out; }
@keyframes modal-fade-in { from { opacity: 0; transform: translate(-50%, -48%); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* --- 테스트 모드 UI --- */
#test-mode-container .correct { background-color: #22c55e !important; color: white !important; border-color: #16a34a !important; }
#test-mode-container .incorrect { background-color: #ef4444 !important; color: white !important; border-color: #dc2626 !important; }
#tm-score-circle { transform-origin: center; transform: rotate(-90deg); }

/* --- 학습 모드 UI --- */
#learning-mode-container .level-btn:active { background-color: #e0f2fe; border-color: #38bdf8; }
#lm-test-body .choice-btn.correct { background-color: #22c55e !important; color: white !important; border-color: #16a34a !important; }
#lm-test-body .choice-btn.incorrect { background-color: #ef4444 !important; color: white !important; border-color: #dc2626 !important; }

#pdf-printable-area { position: absolute; left: -9999px; top: -9999px; }