:root {
    --purple: #667eea;
    --pink: #ff758c;
    --mint: #43cea2;
    --yellow: #fae100;
    --text-dark: #2d3436;
    --text-muted: #636e72;
    --bg-light: #fcfcfc;
    --bg-grad: linear-gradient(135deg, #fcfcfc 0%, #f0f4f8 100%);
    --card-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    --radius: 24px;
    --font-main: 'Pretendard', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background: var(--bg-grad);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1.logo {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-top: 40px;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

h1.logo span {
    color: var(--purple);
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* Page Navigation */
.page {
    display: none;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out;
}

.page.active {
    display: flex;
}

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

/* Cards */
.hero-card, .question-card, .result-card, .compat-result-card {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
    text-align: center;
}

.hero-card h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.hero-card p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
    font-family: var(--font-main);
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background-color: var(--purple);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background-color: #f0f2f5;
    color: var(--text-dark);
}

.btn-answer {
    background-color: white;
    border: 2px solid #f0f2f5;
    color: var(--text-dark);
    margin-bottom: 16px;
    text-align: left;
    padding: 20px 24px;
}

.btn-answer:hover, .btn-answer.active {
    border-color: var(--purple);
    background-color: rgba(102, 126, 234, 0.05);
}

.btn-text {
    background: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: underline;
}

/* Popular Section */
.popular-section {
    margin-top: 20px;
}

.popular-section h3 {
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.mbti-mini-card {
    padding: 20px;
    border-radius: 16px;
    color: white;
    font-weight: 800;
    text-align: center;
    font-size: 1.2rem;
}

/* Test Section */
.progress-wrapper {
    margin-bottom: 30px;
}

.progress-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--mint);
    width: 0%;
    transition: width 0.3s ease;
}

#progress-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.question-card h2 {
    font-size: 1.4rem;
    word-break: keep-all;
}

/* Result Section */
.result-header {
    margin-bottom: 30px;
}

.result-label {
    font-size: 0.9rem;
    color: var(--purple);
    font-weight: 600;
}

#result-mbti-type {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
    margin: 10px 0;
    background: linear-gradient(to right, var(--purple), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#result-mbti-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-muted);
}

.result-section {
    text-align: left;
    background: #f8faff;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.result-section h4 {
    margin-bottom: 8px;
    color: var(--purple);
    font-size: 1rem;
}

.result-section p {
    font-size: 0.95rem;
    color: var(--text-dark);
}

/* Compatibility Section */
.compat-selectors {
    display: flex;
    gap: 12px;
    margin: 30px 0;
}

.selector {
    flex: 1;
    text-align: left;
}

.selector span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

select {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #ddd;
    font-family: var(--font-main);
    font-size: 1rem;
}

.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--yellow);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
}

.score-circle small {
    font-size: 1rem;
}

/* Compatibility Analysis */
.compat-analysis {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}

.analysis-box {
    text-align: left;
    background: #f8faff;
    padding: 18px;
    border-radius: 16px;
    border-left: 4px solid var(--purple);
}

.analysis-box h4 {
    font-size: 0.9rem;
    color: var(--purple);
    margin-bottom: 6px;
}

.analysis-box p {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.5;
}

.advice-box {
    border-left-color: var(--mint);
    margin-top: 10px;
}

.advice-box h4 {
    color: var(--mint);
}

/* AdSense Containers */
.adsense-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    min-height: 50px;
    background: transparent;
}

.adsense-top-banner { margin-top: 20px; }
.adsense-middle-rectangle { margin: 30px 0; }
.adsense-result-inline { margin: 24px 0; }

.adsense-sticky-bottom {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 480px;
    height: 60px;
    margin: 0;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #eee;
    z-index: 100;
    backdrop-filter: blur(10px);
}

/* Footer */
footer.disclaimer {
    margin-top: auto;
    padding: 40px 0 80px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

footer.disclaimer p {
    margin-bottom: 8px;
    word-break: keep-all;
}

.hidden {
    display: none;
}

/* Toast styles */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    z-index: 1000;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

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