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

:root {
    /* 기본 테마 - 모던 블루 */
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 다크 테마 */
[data-theme="dark"] {
    --primary-color: #818cf8;
    --primary-dark: #6366f1;
    --primary-light: #a5b4fc;
    --secondary-color: #94a3b8;
    --bg-primary: #1e293b;
    --bg-secondary: #0f172a;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #334155;
    --success-color: #34d399;
    --danger-color: #f87171;
}

/* 네온 테마 */
[data-theme="neon"] {
    --primary-color: #a855f7;
    --primary-dark: #9333ea;
    --primary-light: #c084fc;
    --secondary-color: #ec4899;
    --bg-primary: #18181b;
    --bg-secondary: #09090b;
    --bg-tertiary: #27272a;
    --text-primary: #fafafa;
    --text-secondary: #e4e4e7;
    --text-tertiary: #a1a1aa;
    --border-color: #3f3f46;
    --success-color: #4ade80;
    --danger-color: #f43f5e;
}

/* 민트 테마 */
[data-theme="mint"] {
    --primary-color: #14b8a6;
    --primary-dark: #0d9488;
    --primary-light: #2dd4bf;
    --secondary-color: #06b6d4;
    --bg-primary: #ffffff;
    --bg-secondary: #f0fdfa;
    --bg-tertiary: #ccfbf1;
    --text-primary: #134e4a;
    --text-secondary: #0f766e;
    --text-tertiary: #14b8a6;
    --border-color: #5eead4;
    --success-color: #10b981;
    --danger-color: #f43f5e;
}

/* 선셋 테마 */
[data-theme="sunset"] {
    --primary-color: #f97316;
    --primary-dark: #ea580c;
    --primary-light: #fb923c;
    --secondary-color: #f43f5e;
    --bg-primary: #ffffff;
    --bg-secondary: #fff7ed;
    --bg-tertiary: #fed7aa;
    --text-primary: #7c2d12;
    --text-secondary: #c2410c;
    --text-tertiary: #ea580c;
    --border-color: #fdba74;
    --success-color: #65a30d;
    --danger-color: #dc2626;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
    color: var(--text-primary);
    line-height: 1.6;
}

.screen {
    display: none;
    width: 100%;
    max-width: 500px;
    animation: fadeIn 0.3s ease-in-out;
}

.screen.active {
    display: block;
}

.container {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 48px 32px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

/* 시작 화면 */
.main-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 24px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.description {
    font-size: 16px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.7;
    margin-bottom: 48px;
}

/* 통계 섹션 */
.stats-section {
    display: flex;
    justify-content: space-around;
    margin-bottom: 40px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.stat-label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 캐릭터 프리뷰 섹션 */
.characters-preview {
    margin-bottom: 40px;
}

.preview-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.preview-item {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.preview-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.preview-item:hover::before {
    opacity: 0.1;
}

.preview-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.preview-emoji {
    font-size: 48px;
    margin-bottom: 8px;
    display: block;
    position: relative;
    z-index: 1;
    animation: float 3s ease-in-out infinite;
}

.preview-item:nth-child(2) .preview-emoji { animation-delay: 0.2s; }
.preview-item:nth-child(3) .preview-emoji { animation-delay: 0.4s; }
.preview-item:nth-child(4) .preview-emoji { animation-delay: 0.6s; }
.preview-item:nth-child(5) .preview-emoji { animation-delay: 0.8s; }
.preview-item:nth-child(6) .preview-emoji { animation-delay: 1s; }
.preview-item:nth-child(7) .preview-emoji { animation-delay: 1.2s; }

.preview-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.preview-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

/* 추가 정보 섹션 */
.extra-info {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.info-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.6;
}

.info-text:last-child {
    margin-bottom: 0;
}

/* 플로팅 애니메이션 */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.character-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 48px;
}

.preview-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    transition: all 0.2s ease;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: keep-all;
    line-height: 1.4;
}

.preview-card:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-start {
    width: 100%;
    padding: 16px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}

.btn-start:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

/* 테마 선택 */
.theme-section {
    margin-bottom: 32px;
}

.theme-label {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 500;
}

.theme-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.theme-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px;
    position: relative;
    overflow: hidden;
}

.theme-color {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.theme-btn:hover .theme-color {
    transform: scale(1.1);
}

.theme-btn.active {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
}

.theme-btn:hover {
    border-color: var(--border-color);
    transform: translateY(-2px);
}

/* 질문 화면 */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    margin-bottom: 32px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.question-number {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
    margin-bottom: 24px;
    font-weight: 500;
}

.question-text {
    font-size: 20px;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.7;
    margin-bottom: 48px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

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

.btn-answer {
    flex: 1;
    padding: 24px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-answer:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-answer.btn-yes:hover {
    border-color: var(--success-color);
    color: var(--success-color);
}

.btn-answer.btn-no:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* 홈 화면 상단 여백 - 모바일에서 선택기와 겹치지 않도록 */
#home-screen .container {
    margin-top: 20px;
}

/* 결과 화면 */
#result-screen .container {
    margin-top: 20px;
}

.result-title {
    font-size: 24px;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 32px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.result-character {
    text-align: center;
    margin-bottom: 40px;
    padding: 32px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.character-emoji {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 120px;
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 20px;
}

.character-emoji img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.character-name {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.character-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.result-content {
    margin-bottom: 32px;
}

.description-box,
.recommendation-box,
.quote-box,
.tips-box {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.description-box h4,
.recommendation-box h4,
.quote-box h4,
.tips-box h4 {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.description-box p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.recommendation-box p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
    white-space: pre-line;
}

.tips-box p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.quote-box {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.quote-box h4 {
    color: rgba(255, 255, 255, 0.9);
}

.quote-box p {
    font-size: 18px;
    color: white;
    text-align: center;
    font-weight: 500;
    letter-spacing: -0.01em;
}

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

.btn-share,
.btn-restart {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}

.btn-share {
    background: var(--primary-color);
    color: white;
}

.btn-share:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-restart {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-restart:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 토스트 알림 */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary-color);
    color: var(--text-on-primary);
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 90%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 기본 테마 토스트 */
.toast {
    --text-on-primary: white;
}

/* 다크 테마 토스트 */
[data-theme="dark"] .toast {
    background: #374151;
    color: #f3f4f6;
    border: 1px solid rgba(156, 163, 175, 0.2);
}

/* 네온 테마 토스트 */
[data-theme="neon"] .toast {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: white;
    border: 1px solid rgba(236, 72, 153, 0.3);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}

/* 민트 테마 토스트 */
[data-theme="mint"] .toast {
    background: linear-gradient(135deg, #14b8a6, #06b6d4);
    color: white;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* 선셋 테마 토스트 */
[data-theme="sunset"] .toast {
    background: linear-gradient(135deg, #f97316, #f43f5e);
    color: white;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

/* 언어 선택 */
.language-selector {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 8px;
    background: var(--bg-primary);
    padding: 8px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 100;
}

/* 고정 테마 선택 */
.theme-selector-fixed {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 6px;
    background: var(--bg-primary);
    padding: 6px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 100;
    border: 1px solid var(--border-color);
}

.theme-btn-fixed {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid transparent;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 2px;
    position: relative;
    overflow: hidden;
}

.theme-btn-fixed .theme-color {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.theme-btn-fixed:hover .theme-color {
    transform: scale(1.1);
}

.theme-btn-fixed.active {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.theme-btn-fixed:hover {
    border-color: var(--border-color);
    transform: translateY(-1px);
}

/* 결과 화면에서는 기본 언어 선택과 테마 선택 숨기기 */
#result-screen.active ~ .language-selector,
#result-screen.active ~ .theme-selector-fixed {
    display: none;
}

/* 결과 화면 전용 언어/테마 선택기 */
.result-language-selector {
    position: fixed;
    top: 20px;
    left: 20px;
    display: none !important; /* 기본적으로 숨김 */
    flex-direction: row;
    gap: 8px;
    background: var(--bg-primary);
    padding: 8px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 100;
}

.result-theme-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    display: none !important; /* 기본적으로 숨김 */
    flex-direction: row;
    gap: 6px;
    background: var(--bg-primary);
    padding: 6px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 100;
    border: 1px solid var(--border-color);
}

/* 결과 화면이 활성화되었을 때만 표시 */
.result-language-selector.show {
    display: flex !important;
}

.result-theme-selector.show {
    display: flex !important;
}

.result-lang-btn {
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.result-lang-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.result-lang-btn.active {
    background: var(--primary-color);
    color: white;
}

.result-theme-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid transparent;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 2px;
    position: relative;
    overflow: hidden;
}

.result-theme-btn .theme-color {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.result-theme-btn:hover .theme-color {
    transform: scale(1.1);
}

.result-theme-btn.active {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.result-theme-btn:hover {
    border-color: var(--border-color);
    transform: translateY(-1px);
}

.lang-btn {
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
    z-index: 101;
}

.lang-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.lang-btn.active {
    background: var(--primary-color);
    color: white;
}

/* 결과 화면 설정 컨테이너 - 삭제함 */

/* 결과 화면 선택기 반응형 */
@media (max-width: 768px) {
    .result-language-selector.show {
        top: 10px;
        left: 10px;
        padding: 6px;
        gap: 4px;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        max-width: 150px;
    }
    
    .result-theme-selector.show {
        top: 10px;
        right: 10px;
        padding: 5px;
        gap: 3px;
        display: grid !important;
        grid-template-columns: repeat(6, 1fr);
    }
    
    .result-theme-selector .result-theme-btn:nth-child(1),
    .result-theme-selector .result-theme-btn:nth-child(2),
    .result-theme-selector .result-theme-btn:nth-child(3) {
        grid-column: span 2;
    }
    
    .result-theme-selector .result-theme-btn:nth-child(4) {
        grid-column: 2 / span 2;
    }
    
    .result-theme-selector .result-theme-btn:nth-child(5) {
        grid-column: 4 / span 2;
    }
    
    .result-theme-btn {
        width: 28px;
        height: 28px;
        padding: 2px;
        border-radius: 5px;
    }
    
    .result-lang-btn {
        padding: 5px 8px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .result-language-selector.show {
        top: 8px;
        left: 8px;
        padding: 4px;
        gap: 2px;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        max-width: 120px;
    }
    
    .result-theme-selector.show {
        top: 8px;
        right: 8px;
        gap: 2px;
        padding: 3px;
        display: grid !important;
        grid-template-columns: repeat(6, 1fr);
    }
    
    .result-theme-selector .result-theme-btn:nth-child(1),
    .result-theme-selector .result-theme-btn:nth-child(2),
    .result-theme-selector .result-theme-btn:nth-child(3) {
        grid-column: span 2;
    }
    
    .result-theme-selector .result-theme-btn:nth-child(4) {
        grid-column: 2 / span 2;
    }
    
    .result-theme-selector .result-theme-btn:nth-child(5) {
        grid-column: 4 / span 2;
    }
    
    .result-theme-btn {
        width: 24px;
        height: 24px;
        padding: 1px;
        border-radius: 4px;
    }
    
    .result-lang-btn {
        padding: 4px 6px;
        font-size: 11px;
    }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    /* 태블릿에서 컨테이너 더 아래로 */
    #home-screen .container {
        margin-top: 80px;
    }
    
    #result-screen .container {
        margin-top: 100px;
    }
    
    .stats-section {
        flex-direction: column;
        gap: 20px;
        padding: 16px;
    }
    
    .stat-item {
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .stat-item:last-child {
        border-bottom: none;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .preview-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .preview-emoji {
        font-size: 36px;
    }
    
    .preview-name {
        font-size: 13px;
    }
    
    .preview-desc {
        font-size: 11px;
    }
    
    /* 모바일에서 선택기 위치 조정 */
    .language-selector {
        top: 10px;
        left: 10px;
        padding: 6px;
        gap: 4px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        width: auto;
        max-width: 150px;
    }
    
    .theme-selector-fixed {
        top: 10px;
        right: 10px;
        padding: 5px;
        gap: 3px;
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        width: auto;
    }
    
    .theme-selector-fixed .theme-btn-fixed:nth-child(1),
    .theme-selector-fixed .theme-btn-fixed:nth-child(2),
    .theme-selector-fixed .theme-btn-fixed:nth-child(3) {
        grid-column: span 2;
    }
    
    .theme-selector-fixed .theme-btn-fixed:nth-child(4) {
        grid-column: 2 / span 2;
    }
    
    .theme-selector-fixed .theme-btn-fixed:nth-child(5) {
        grid-column: 4 / span 2;
    }
    
    #home-screen.active ~ .language-selector .lang-btn {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    #home-screen.active ~ .theme-selector-fixed .theme-btn-fixed {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 768px) {
    .theme-btn-fixed {
        width: 28px;
        height: 28px;
        padding: 2px;
        border-radius: 5px;
    }
    
    body {
        padding: 16px;
    }
    
    .container {
        padding: 32px 24px;
    }
    
    #result-screen .container {
        margin-top: 0;
    }
    
    .main-title {
        font-size: 28px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .description {
        font-size: 15px;
    }
    
    .character-preview {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .preview-card {
        padding: 14px 10px;
        font-size: 12px;
        min-height: 50px;
    }
    
    .question-text {
        font-size: 18px;
        margin-bottom: 32px;
    }
    
    .answer-buttons {
        flex-direction: column;
    }
    
    .btn-answer {
        padding: 20px;
    }
    
    .character-name {
        font-size: 24px;
    }
    
    .character-subtitle {
        font-size: 15px;
    }
    
    .description-box,
    .recommendation-box,
    .quote-box,
    .tips-box {
        padding: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .language-selector {
        top: 10px;
        left: 10px;
        padding: 5px;
        gap: 3px;
    }
    
    .lang-btn {
        padding: 5px 8px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    /* 작은 모바일에서 컨테이너 더 많이 아래로 */
    #home-screen .container {
        margin-top: 100px;
    }
    
    #result-screen .container {
        margin-top: 120px;
    }
    
    .stats-section {
        margin-bottom: 24px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .preview-title {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .preview-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .preview-item {
        padding: 12px;
    }
    
    .preview-emoji {
        font-size: 32px;
        margin-bottom: 4px;
    }
    
    .preview-name {
        font-size: 12px;
    }
    
    .preview-desc {
        font-size: 10px;
    }
    
    .extra-info {
        margin-top: 24px;
        padding-top: 16px;
    }
    
    .info-text {
        font-size: 12px;
    }
    
    /* 작은 모바일에서 선택기 위치 조정 */
    .language-selector {
        top: 8px;
        left: 8px;
        padding: 4px;
        gap: 2px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        max-width: 120px;
    }
    
    .theme-selector-fixed {
        top: 8px;
        right: 8px;
        gap: 2px;
        padding: 3px;
        display: grid;
        grid-template-columns: repeat(6, 1fr);
    }
    
    .theme-selector-fixed .theme-btn-fixed:nth-child(1),
    .theme-selector-fixed .theme-btn-fixed:nth-child(2),
    .theme-selector-fixed .theme-btn-fixed:nth-child(3) {
        grid-column: span 2;
    }
    
    .theme-selector-fixed .theme-btn-fixed:nth-child(4) {
        grid-column: 2 / span 2;
    }
    
    .theme-selector-fixed .theme-btn-fixed:nth-child(5) {
        grid-column: 4 / span 2;
    }
    
    .theme-btn-fixed {
        width: 24px;
        height: 24px;
        padding: 1px;
        border-radius: 4px;
    }
    
    #home-screen.active ~ .language-selector .lang-btn {
        padding: 4px 6px;
        font-size: 10px;
    }
    
    #home-screen.active ~ .theme-selector-fixed .theme-btn-fixed {
        width: 26px;
        height: 26px;
    }
    
    
    .theme-btn-fixed {
        width: 28px;
        height: 28px;
    }
    .container {
        padding: 24px 20px;
    }
    
    
    .theme-selector {
        gap: 8px;
        margin-bottom: 24px;
    }
    
    .theme-btn {
        width: 40px;
        height: 40px;
    }
    
    .main-title {
        font-size: 24px;
    }
    
    .character-preview {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .preview-card {
        padding: 12px 8px;
        font-size: 11px;
        min-height: 45px;
    }
    
    .question-number {
        font-size: 13px;
    }
    
    .question-text {
        font-size: 16px;
    }
    
    .character-name {
        font-size: 20px;
    }
    
    .quote-box p {
        font-size: 16px;
    }
    
    .description-box h4,
    .recommendation-box h4,
    .quote-box h4 {
        font-size: 13px;
    }
    
    .description-box p,
    .recommendation-box p {
        font-size: 14px;
    }
    
    
    .lang-btn {
        padding: 6px 8px;
        font-size: 11px;
        text-align: center;
        min-width: 0;
        white-space: nowrap;
    }
}

/* 태블릿 가로 모드 */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
    .character-preview {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 대형 화면 */
@media (min-width: 1024px) {
    .screen {
        max-width: 600px;
    }
    
    .container {
        padding: 56px 48px;
    }
    
    .main-title {
        font-size: 42px;
    }
    
    .character-preview {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
    
    .preview-card {
        padding: 20px;
        font-size: 14px;
        min-height: 65px;
    }
}

/* 매칭도 상세 정보 스타일 */
.matching-details {
    margin-top: 32px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.matching-section {
    margin-bottom: 24px;
}

.matching-section:last-child {
    margin-bottom: 0;
}

.matching-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

/* 성향 분석 차트 */
.personality-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trait-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.trait-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 80px;
    text-align: left;
}

.trait-progress {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.trait-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.trait-score {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 40px;
    text-align: right;
}

/* 매칭 타입 목록 */
.type-matches {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.match-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.match-item.selected {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.match-item:not(.selected):hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-light);
}

.match-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--text-tertiary);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    margin-right: 12px;
}

.match-item.selected .match-rank {
    background: rgba(255, 255, 255, 0.3);
}

.match-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.match-item.selected .match-name {
    color: white;
}

.match-score {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

.match-item.selected .match-score {
    color: white;
}

/* 반응형 매칭 상세 정보 */
@media (max-width: 480px) {
    .matching-details {
        margin-top: 24px;
        padding: 20px;
    }
    
    .matching-section h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .trait-name {
        min-width: 70px;
        font-size: 13px;
    }
    
    .match-item {
        padding: 10px 12px;
    }
    
    .match-rank {
        width: 20px;
        height: 20px;
        font-size: 11px;
        margin-right: 10px;
    }
    
    .match-name {
        font-size: 13px;
    }
    
    .match-score {
        font-size: 14px;
    }
}