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

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --korea-color: #0047a0;
    --china-color: #de2910;
    --japan-color: #bc002d;
    --success-color: #22c55e;
    --error-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.lang-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100;
    padding: 8px 14px;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.lang-toggle:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.screen {
    display: none;
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    border-radius: 24px;
    padding: 40px 24px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.3s ease-out;
}

.screen.active {
    display: block;
}

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

.flag-icons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.flag {
    font-size: 48px;
    animation: bounce 2s infinite;
}

.flag:nth-child(2) {
    animation-delay: 0.2s;
}

.flag:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.title {
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    line-height: 1.2;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary-color), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 32px;
}

.quiz-info {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 32px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.info-icon {
    font-size: 1.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), #a855f7);
    color: white;
    font-size: 1.125rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

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

.disclaimer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.quiz-header {
    margin-bottom: 24px;
}

.progress-info {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

#current-question {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #a855f7);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.quiz-instruction {
    text-align: center;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.photo-container {
    width: 100%;
    aspect-ratio: 3 / 4;
    max-height: 350px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.person-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.answer-buttons {
    display: flex;
    gap: 12px;
}

.btn-answer {
    flex: 1;
    flex-direction: column;
    padding: 16px 8px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.btn-answer:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
}

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

.btn-answer.selected {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.btn-answer.correct {
    border-color: var(--success-color);
    background: rgba(34, 197, 94, 0.1);
}

.btn-answer.wrong {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
}

.btn-flag {
    font-size: 2rem;
    margin-bottom: 4px;
}

.btn-text {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.result-content {
    text-align: center;
}

.result-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.score-container {
    margin-bottom: 32px;
}

.score-circle {
    width: 160px;
    height: 160px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #a855f7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.score-number {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
}

.score-total {
    font-size: 1.25rem;
    opacity: 0.9;
}

.score-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--primary-color), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-message {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.result-breakdown {
    background: var(--bg-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 32px;
    text-align: left;
}

.result-breakdown h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    text-align: center;
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.answer-item {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    border: 2px solid transparent;
}

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

.answer-item.wrong {
    border-color: var(--error-color);
}

.answer-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 4px;
}

.answer-item .answer-flag {
    font-size: 1.25rem;
}

.answer-item .answer-result {
    font-size: 0.75rem;
    font-weight: 600;
}

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

.answer-item.wrong .answer-result {
    color: var(--error-color);
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.result-actions .btn-primary {
    flex: 1;
    min-width: 0;
}

.result-actions .btn-secondary {
    width: 100%;
}

.btn-secondary {
    width: 100%;
    background: var(--card-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    font-size: 1.125rem;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
}

.ad-slot {
    margin-top: 24px;
    min-height: 100px;
    text-align: center;
}

.copy-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.copy-toast.show {
    opacity: 1;
}

.site-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.site-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer-divider {
    margin: 0 8px;
    color: var(--border-color);
}

.policy-page {
    text-align: left;
}

.policy-page .back-link {
    display: inline-block;
    margin-bottom: 24px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: opacity 0.2s ease;
}

.policy-page .back-link:hover {
    opacity: 0.7;
}

.policy-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-color), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.policy-content .policy-date {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.policy-content h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 24px 0 8px;
    color: var(--text-primary);
}

.policy-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 8px;
}

.policy-content ul {
    padding-left: 20px;
    margin-bottom: 8px;
}

.policy-content li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 4px;
}

.policy-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.policy-content a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    .screen {
        padding: 32px 20px;
        border-radius: 20px;
    }
    
    .flag {
        font-size: 40px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .photo-container {
        max-height: 300px;
    }
    
    .btn-flag {
        font-size: 1.75rem;
    }
    
    .btn-text {
        font-size: 0.75rem;
    }
    
    .answers-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .score-circle {
        width: 140px;
        height: 140px;
    }
    
    .score-number {
        font-size: 3rem;
    }
}

@media (max-width: 360px) {
    .title {
        font-size: 1.75rem;
    }
    
    .quiz-info {
        gap: 16px;
    }
    
    .answer-buttons {
        gap: 8px;
    }
    
    .btn-answer {
        padding: 12px 4px;
    }
    
    .btn-flag {
        font-size: 1.5rem;
    }
}

@media (min-width: 768px) {
    .screen {
        padding: 48px 40px;
    }
    
    .title {
        font-size: 3rem;
    }
    
    .photo-container {
        max-height: 400px;
    }
}
