*, *::before, *::after {
            box-sizing: border-box;
        }

        :root {
            --primary: #F48C06;
            --accent: #D00000;
            --bg: #FFF8E1;
            --card-bg: rgba(255, 255, 255, 0.95);
            --text: #370617;
            --sub-text: #6a4c93;
            --btn-text: #fff;
            --shadow: rgba(0,0,0,0.1);
        }

        [data-theme="dark"] {
            --primary: #FFBA08;
            --accent: #FF6B6B;
            --bg: #1a1a1a;
            --card-bg: rgba(40, 40, 40, 0.95);
            --text: #f0f0f0;
            --sub-text: #b0b0b0;
            --btn-text: #1a1a1a;
            --shadow: rgba(0,0,0,0.5);
        }

        body {
            font-family: 'Poppins', sans-serif;
            background-color: var(--bg);
            background-image: radial-gradient(var(--primary) 1px, transparent 1px);
            background-size: 20px 20px;
            color: var(--text);
            margin: 0;
            padding: 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
            min-height: 100vh;
            transition: background 0.3s, color 0.3s;
            overflow-x: hidden;
        }

        .top-bar {
            width: 100%; max-width: 500px; display: flex; justify-content: center; gap: 10px; margin-bottom: 20px;
        }
        .icon-btn {
            background: var(--card-bg); border: 2px solid var(--primary); color: var(--text);
            padding: 8px 15px; border-radius: 20px; cursor: pointer; font-weight: 600; transition: all 0.2s;
        }
        .icon-btn:hover { background: var(--primary); color: var(--btn-text); }

        .container {
            width: 100%; max-width: 500px; text-align: center; position: relative;
            background: var(--card-bg); padding: 30px 20px; border-radius: 25px;
            box-shadow: 0 10px 30px var(--shadow); backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,0.1);
        }
        
        .screen { display: none; }
        .screen.active { display: block; animation: fadeIn 0.5s ease-out; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

        .title { font-size: 2rem; font-weight: 900; color: var(--accent); margin: 0 0 10px 0; line-height: 1.1; }
        .subtitle { font-size: 1rem; color: var(--sub-text); margin-bottom: 30px; }
        
        .btn {
            background-color: var(--primary); color: var(--btn-text); border: none; padding: 15px;
            font-size: 1rem; font-weight: 600; border-radius: 15px; cursor: pointer; width: 100%;
            transition: transform 0.2s, box-shadow 0.2s; box-shadow: 0 4px 0 rgba(0,0,0,0.2);
            margin-bottom: 10px; min-height: 60px; display: flex; align-items: center; justify-content: center;
        }
        .btn:active { transform: translateY(4px); box-shadow: none; }
        .btn-start { font-size: 1.3rem; padding: 20px; border-radius: 50px; background-color: var(--accent); color: white; }

        .btn-back {
            background-color: transparent;
            border: 2px solid var(--primary);
            color: var(--primary);
            box-shadow: none;
            margin-top: 10px; /* Add some space from the answer buttons */
        }

        .btn-back:hover {
            background-color: var(--primary);
            color: var(--btn-text);
            box-shadow: none;
        }

        /* 버튼 색상 */
        #opt-0 { background-color: #2e7d32; color: white; }
        #opt-1 { background-color: #81c784; color: #1a1a1a; }
        #opt-2 { background-color: #ffb74d; color: #1a1a1a; }
        #opt-3 { background-color: #c62828; color: white; }
        #opt-0:hover, #opt-1:hover, #opt-2:hover, #opt-3:hover { filter: brightness(1.1); }

        .loader-container { margin: 40px 0; }
        .percentage { font-size: 3.5rem; font-weight: 900; color: var(--primary); font-variant-numeric: tabular-nums; }
        .loader-bar { width: 100%; height: 10px; background: #ddd; border-radius: 5px; overflow: hidden; margin-top: 10px; }
        .loader-fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.1s; }
        
        .mbti-badge { 
            background: var(--text); color: var(--bg); padding: 5px 15px; border-radius: 20px; 
            font-weight: bold; display: inline-block; margin-bottom: 10px; letter-spacing: 2px;
        }
        
        .food-name {
            font-size: 3.2rem; font-weight: 900; color: var(--accent);
            margin: 5px 0 25px 0; line-height: 1.1;
            text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
            overflow-wrap: break-word;
            word-break: break-word;
        }
        
        .info-box {
            background: rgba(0,0,0,0.03); border-left: 5px solid var(--primary);
            padding: 20px; text-align: left; border-radius: 10px; margin-bottom: 15px;
        }
        .info-title { font-weight: 900; color: var(--text); display: flex; align-items: center; gap: 5px; margin-bottom: 8px; font-size: 1.1rem; }
        .info-content { font-size: 0.95rem; color: var(--text); line-height: 1.7; text-align: justify; }

        .k-star-box { border-color: #d63384; background: rgba(214, 51, 132, 0.05); }
        .mission-box { border-color: #20c997; background: rgba(32, 201, 151, 0.05); }

        .progress-container { width: 100%; background: rgba(0,0,0,0.1); height: 8px; border-radius: 4px; margin-bottom: 20px; }
        .progress-bar { height: 100%; background: var(--primary); width: 0%; transition: width 0.1s; border-radius: 4px; }

        #start-screen-emoji {
            font-size: 5rem;
            margin-bottom: 20px;
        }

        #q-counter {
            text-align: right;
            font-size: 0.8rem;
            margin-bottom: 10px;
            font-weight: bold;
            color: var(--sub-text);
        }

        #question-text {
            margin-bottom: 30px;
            min-height: 80px;
            font-size: 1.3rem;
        }

        #result-label {
            font-size: 1rem;
            font-weight: bold;
            color: var(--sub-text);
        }

        #share-btn {
            background-color: var(--text);
            color: var(--bg);
        }

        #retry-btn {
            background-color: transparent;
            border: 2px solid var(--text);
            color: var(--text);
        }

        #facebook-share-btn {
            background-color: #3b5998;
            margin-top: 20px;
        }

        #contact-form input,
        #contact-form textarea {
            width: calc(100% - 20px);
            padding: 10px;
            margin-bottom: 10px;
            border-radius: 8px;
            border: 1px solid #ddd;
        }

        #contact-message {
            height: 120px;
            resize: vertical;
        }

        #contact-submit {
            background-color: #4CAF50;
        }

        #contact-back,
        #about-back,
        #privacy-back,
        #terms-back {
            background-color: #ccc;
            margin-top: 10px;
        }

        /* Responsive adjustments */
        @media (max-width: 600px) {
            body {
                padding: 15px;
            }

            .container {
                padding: 20px 15px;
                border-radius: 20px;
            }

            .title {
                font-size: 1.8rem;
            }

            .subtitle {
                font-size: 0.9rem;
                margin-bottom: 20px;
            }

            .btn {
                padding: 12px;
                font-size: 0.9rem;
                border-radius: 12px;
            }

            .btn-start {
                font-size: 1.1rem;
                padding: 15px;
                border-radius: 40px;
            }

            .percentage {
                font-size: 3rem;
            }

            .food-name {
                font-size: 2.8rem;
            }

            .info-title {
                font-size: 1rem;
            }

            .info-content {
                font-size: 0.9rem;
            }
        }

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

            .container {
                padding: 15px 10px;
                border-radius: 15px;
            }

            .title {
                font-size: 1.5rem;
            }

            .subtitle {
                font-size: 0.8rem;
                margin-bottom: 15px;
            }

            .btn {
                padding: 10px;
                font-size: 0.8rem;
                border-radius: 10px;
            }

            .btn-start {
                font-size: 1rem;
                padding: 12px;
                border-radius: 30px;
            }

            .percentage {
                font-size: 2.5rem;
            }

            .food-name {
                font-size: 2.2rem;
            }

            .info-title {
                font-size: 0.9rem;
            }

            .info-content {
                font-size: 0.8rem;
            }
        }
#loading-messages {
    margin-top: 20px;
    font-size: 1.1rem;
    color: var(--sub-text);
    min-height: 30px;
    font-weight: 600;
}

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

.loader-fill {
    transition: width 0.03s linear;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    box-shadow: 0 0 10px var(--primary);
}

.percentage {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Try Again 버튼 */
.btn-retry {
    padding: 18px 30px;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

/* 공유 라벨 */
.share-label {
    font-size: 0.9rem;
    color: var(--sub-text);
    margin-bottom: 10px;
    font-weight: 600;
}

/* 소셜 아이콘 컨테이너 */
.social-icons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: nowrap;
    margin-bottom: 20px;
}

/* 소셜 아이콘 버튼 */
.social-icon {
    flex: 1;
    max-width: 55px;
    aspect-ratio: 1;
    border: none;
    border-radius: 12px;
    font-size: 1.8rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 3px 0 rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 rgba(0,0,0,0.2);
}

.social-icon:active {
    transform: translateY(3px);
    box-shadow: none;
}

/* 소셜 아이콘 색상 */
.social-icon i {
    font-size: 1.6rem;
}

.social-icon.messenger { background-color: #0084FF; color: white; }
.social-icon.facebook { background-color: #1877F2; color: white; }
.social-icon.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
}
.social-icon.twitter { background-color: #000000; color: white; }
.social-icon.tiktok { background-color: #000000; color: white; }
.social-icon.copy { background-color: #6c757d; color: white; }

@media (max-width: 400px) {
    .social-icon {
        max-width: 45px;
        border-radius: 10px;
    }
    .social-icon i {
        font-size: 1.3rem;
    }
}

/* 이전 결과 박스 */
.previous-result-box {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0,0,0,0.03);
    border-radius: 15px;
    border: 2px dashed var(--primary);
}

.previous-result-box a div:hover {
    transform: scale(1.02);
    transition: transform 0.2s;
}

/* Site-wide top navigation */
.site-nav {
    width: 100%;
    background: var(--card-bg);
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}
.site-nav-logo {
    font-weight: 900;
    font-size: 1rem;
    color: var(--accent);
    text-decoration: none;
}
.site-nav-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.site-nav-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.2s;
}
.site-nav-links a:hover {
    color: var(--primary);
}

/* Site-wide footer */
.site-footer {
    width: 100%;
    text-align: center;
    padding: 20px 15px;
    font-size: 0.85rem;
    color: var(--sub-text);
    border-top: 1px solid rgba(0,0,0,0.1);
    margin-top: 30px;
}
.site-footer a {
    color: var(--sub-text);
    text-decoration: none;
}
.site-footer a:hover {
    color: var(--primary);
}

/* Result footer links */
.result-footer-links {
    width: 100%;
    max-width: 500px;
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--sub-text);
}

.result-footer-links a {
    color: var(--sub-text);
    text-decoration: none;
}

.result-footer-links a:hover {
    color: var(--primary);
}

/* Mobile top-bar fix */
@media (max-width: 600px) {
    .top-bar {
        justify-content: center;
        gap: 8px;
        padding: 0 10px;
    }
    .icon-btn {
        min-width: 80px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* ====== Content Enhancement Styles ====== */

/* Intro Section (index.html) */
.intro-section {
    width: 100%;
    max-width: 500px;
    margin-top: 20px;
    text-align: left;
}

.intro-section .info-box {
    background: var(--card-bg);
    border-left: 5px solid var(--primary);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px var(--shadow);
}

.intro-section h3 {
    color: var(--accent);
    font-size: 1.1rem;
    margin: 0 0 10px 0;
}

.intro-section p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text);
    margin: 0 0 10px 0;
}

/* How It Works Steps */
.how-it-works {
    width: 100%;
    max-width: 500px;
    margin-top: 15px;
}

.how-it-works h3 {
    text-align: center;
    color: var(--accent);
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 15px var(--shadow);
}

.step-number {
    background: var(--primary);
    color: var(--btn-text);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.step-content {
    text-align: left;
}

.step-content strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text);
}

.step-content span {
    font-size: 0.85rem;
    color: var(--sub-text);
}

/* FAQ Section */
.faq-section {
    margin-top: 20px;
}

.faq-section h3 {
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.faq-item {
    background: rgba(0,0,0,0.03);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Poppins', sans-serif;
}

.faq-question::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    transition: transform 0.3s;
}

.faq-item.active .faq-question::after {
    content: '−';
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 15px;
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding: 0 15px 15px;
}

.faq-answer p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--sub-text);
    margin: 0;
}

/* Legal Pages (privacy, terms) */
.legal-content {
    text-align: left;
}

.legal-content h3 {
    color: var(--accent);
    font-size: 1rem;
    margin: 20px 0 8px 0;
}

.legal-content h3:first-child {
    margin-top: 0;
}

.legal-content p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text);
    margin: 0 0 10px 0;
}

.legal-content ul {
    padding-left: 20px;
    margin: 5px 0 10px 0;
}

.legal-content li {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 5px;
}

.legal-content .update-date {
    margin-top: 20px;
    font-style: italic;
    color: var(--sub-text);
    font-size: 0.85rem;
}

/* Contact guidance */
.contact-guidance {
    text-align: left;
    margin-bottom: 20px;
}

.contact-guidance p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--sub-text);
    margin: 0 0 8px 0;
}

/* Noscript content */
.noscript-content {
    text-align: left;
    padding: 20px;
}

.noscript-content h2 {
    color: var(--accent);
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.noscript-content h3 {
    color: var(--primary);
    font-size: 1rem;
    margin: 15px 0 5px 0;
}

.noscript-content p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 8px 0;
}

/* Food matches grid for result page */
.food-matches-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 15px;
}

.food-match-item {
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.food-match-item strong {
    color: var(--accent);
    font-size: 0.95rem;
}

.food-match-item p {
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 5px 0 0 0;
    color: var(--sub-text);
}

.breadcrumb {
    max-width: 500px;
    margin: 10px auto 0;
    padding: 8px 20px;
    font-size: 0.8rem;
    color: var(--sub-text);
}

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

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Related personality types grid */
.related-types-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.related-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 8px;
    background: var(--bg);
    border-radius: 10px;
    text-decoration: none;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
}

.related-type-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.related-type-badge {
    background: var(--text);
    color: var(--bg);
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.related-type-food {
    color: var(--sub-text);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Blog card styles */
.blog-card {
    background: var(--bg);
    border-radius: 10px;
    padding: 15px;
    border-left: 3px solid var(--primary);
    margin-bottom: 12px;
}

.blog-card h3 {
    margin: 0 0 8px 0;
    font-size: 1rem;
}

.blog-card h3 a {
    color: var(--accent);
    text-decoration: none;
}

.blog-card h3 a:hover {
    text-decoration: underline;
}

.blog-card p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--sub-text);
    margin: 0;
}

.blog-card .blog-meta {
    font-size: 0.75rem;
    color: var(--sub-text);
    margin-top: 8px;
}

/* Popular results grid on homepage */
.popular-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.popular-result-card {
    display: block;
    padding: 12px;
    background: var(--bg);
    border-radius: 10px;
    text-decoration: none;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
    text-align: center;
}

.popular-result-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.popular-result-card .popular-emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 5px;
}

.popular-result-card .popular-type {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text);
    display: block;
}

.popular-result-card .popular-food {
    font-size: 0.8rem;
    color: var(--sub-text);
    display: block;
    margin-top: 3px;
}
