:root {
    --primary: oklch(65% 0.2 var(--hue, 250));
    --primary-light: oklch(92% 0.04 var(--hue, 250));
    --primary-dark: oklch(45% 0.2 var(--hue, 250));
    --surface: oklch(99% 0.01 250);
    --text: oklch(20% 0.03 250);
    --text-muted: oklch(50% 0.03 250);
    --white: #ffffff;
    --ad-bg: oklch(95% 0.01 250);
    
    --hue: 250;
    --radius-lg: 2rem;
    --radius-md: 1rem;
    --shadow: 0 20px 40px -15px oklch(0% 0 0 / 0.1);
    --max-width: 1100px;
}

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

body {
    font-family: 'Pretendard', system-ui, -apple-system, sans-serif;
    background-color: var(--surface);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid oklch(90% 0.01 250);
    padding: 0.8rem 0;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { font-size: 1.4rem; font-weight: 800; text-decoration: none; color: var(--text); }
.logo span { color: var(--primary); }

.nav-links { display: flex; gap: 1.5rem; list-style: none; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-weight: 600; font-size: 0.95rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--primary); }

/* Ad Slots */
.ad-slot {
    background: var(--ad-bg);
    margin: 1.5rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px dashed oklch(80% 0.01 250);
    border-radius: 8px;
    min-height: 100px;
    max-width: 728px;
    width: calc(100% - 3rem);
}

.ad-label { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.5rem; font-weight: 700; }

/* Main App Area */
.app-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    min-height: 60vh;
}

.screen { display: none; opacity: 0; transform: translateY(20px); transition: all 0.5s ease; }
.screen.active { display: flex; flex-direction: column; opacity: 1; transform: translateY(0); }

.card {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid oklch(95% 0.01 250);
    position: relative;
    overflow: hidden;
}

.hero-card { background: linear-gradient(135deg, white, var(--primary-light)); }

h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); font-weight: 900; line-height: 1.2; margin-bottom: 1.5rem; }
h1 span { color: var(--primary); }

.badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.primary-btn {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 1.2rem;
    font-size: 1.1rem;
    font-weight: 800;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s;
}

.primary-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 25px oklch(65% 0.2 var(--hue) / 0.4); }

.secondary-btn {
    width: 100%;
    max-width: 400px;
    margin: 1rem auto 0;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 700;
    background: var(--primary-light);
    color: var(--primary-dark);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
}

/* Quiz UI */
.quiz-header { margin-bottom: 2.5rem; display: flex; align-items: center; gap: 1.5rem; }
.progress-container { flex-grow: 1; height: 12px; background: var(--primary-light); border-radius: 50px; overflow: hidden; }
.progress-bar { width: 0%; height: 100%; background: var(--primary); transition: width 0.4s ease; }
#question-number { font-weight: 800; color: var(--primary); }

.options-grid { display: grid; gap: 1rem; width: 100%; max-width: 500px; margin: 0 auto; }
.option-btn {
    padding: 1.2rem;
    text-align: left;
    background: var(--surface);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
}
.option-btn:hover { background: var(--white); border-color: var(--primary); transform: translateX(5px); }

/* Result UI */
.result-card { background-position: center; background-size: cover; position: relative; z-index: 1; }
.result-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.92);
    z-index: -1;
}
.result-emoji { font-size: 6rem; margin: 1.5rem 0; animation: float 3s infinite ease-in-out; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

.recommendation-box {
    background: var(--primary-light);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin: 2rem 0;
    text-align: left;
}
.text-link { color: var(--primary-dark); font-weight: 800; text-decoration: none; }

/* Library Section */
.library-section { margin-top: 6rem; padding: 4rem 1.5rem; background: white; border-radius: var(--radius-lg); }
.section-title { font-size: 2rem; font-weight: 800; text-align: center; margin-bottom: 1rem; }
.section-desc { text-align: center; color: var(--text-muted); margin-bottom: 3.5rem; }

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.lib-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid oklch(95% 0.01 250);
    text-align: center;
    transition: all 0.3s;
}
.lib-card:hover { transform: translateY(-10px); box-shadow: var(--shadow); background: white; }
.lib-emoji { font-size: 3.5rem; margin-bottom: 1.2rem; }
.lib-link { display: inline-block; margin-top: 1rem; color: var(--primary); text-decoration: none; font-weight: 800; }

/* Footer */
.main-footer { background: oklch(15% 0.02 250); color: white; padding: 5rem 1.5rem 2rem; margin-top: 8rem; }
.footer-container { max-width: var(--max-width); margin: 0 auto; display: grid; grid-template-columns: 1fr 2fr; gap: 4rem; }
.footer-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.footer-col h4 { color: white; margin-bottom: 1.5rem; font-size: 1.1rem; }
.footer-col a { display: block; color: oklch(70% 0.01 250); text-decoration: none; margin-bottom: 0.8rem; font-size: 0.95rem; }
.footer-col a:hover { color: white; }
.footer-bottom { max-width: var(--max-width); margin: 4rem auto 0; padding-top: 2rem; border-top: 1px solid oklch(25% 0.02 250); text-align: center; color: oklch(50% 0.01 250); font-size: 0.9rem; }

/* PC & Large Screen Optimization */
@media (min-width: 1024px) {
    .app-container { margin-top: 4rem; }
    .card { padding: 4rem; }
    .library-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Tablet & Mobile Optimization */
@media (max-width: 768px) {
    .footer-container { grid-template-columns: 1fr; gap: 3rem; text-align: center; }
    .footer-nav { grid-template-columns: 1fr; gap: 2.5rem; }
    .footer-col a { font-size: 1rem; }
    .nav-links { display: none; } /* Mobile Menu simple hide for now */
    .card { padding: 2rem 1.5rem; }
    .ad-slot { width: 100%; }
}

@media (max-width: 480px) {
    h1 { font-size: 1.8rem; }
    .primary-btn { padding: 1rem; font-size: 1rem; }
    .option-btn { padding: 1rem; font-size: 0.95rem; }
}
