/* K-POP Position Test - Styles */
/* Micro-copy */
.micro-copy { font-size:12px; color:var(--text-dim, rgba(255,255,255,0.4)); text-align:center; margin-top:8px; }
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;600;700;800;900&display=swap');

:root {
    --primary: #ff2d78;
    --primary-light: #ff6ba0;
    --bg: #0d0a1a;
    --surface: rgba(255,255,255,0.06);
    --border: rgba(255,255,255,0.08);
    --text: #f0f0f5;
    --text-sec: #a0a0b8;
    --text-dim: #5a5a70;
    --result-color: #ff2d78;
}

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

/* 터치 최적화 */
button, a, input, [role="button"], [role="link"] {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

input[type="text"], textarea {
    -webkit-user-select: text;
    user-select: text;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Loader */
.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.app-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.loader-emoji {
    font-size: 48px;
    animation: loader-bounce 1s ease-in-out infinite;
}
.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: loader-spin 0.8s linear infinite;
}
.loader-text {
    font-size: 14px;
    color: var(--text-sec);
    letter-spacing: 1px;
    font-weight: 500;
}
@keyframes loader-spin {
    to { transform: rotate(360deg); }
}
@keyframes loader-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Language Selector */
.language-selector { position: fixed; top: 20px; right: 20px; z-index: 1000; }
.lang-btn { background: rgba(233,30,99,0.3); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(233,30,99,0.4); color: #fff; font-size: 20px; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; transition: all 0.2s ease; }
.lang-btn:hover { background: rgba(233,30,99,0.5); transform: scale(1.05); }
.lang-menu { position: absolute; top: 52px; right: 0; background: rgba(15,10,25,0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(233,30,99,0.3); border-radius: 12px; padding: 8px; min-width: 150px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.lang-menu.hidden { display: none; }
.lang-option { width: 100%; padding: 10px 14px; background: transparent; border: none; text-align: left; cursor: pointer; border-radius: 8px; font-size: 14px; color: #f0d8e8; transition: background 0.2s; }
.lang-option:hover { background: rgba(233,30,99,0.2); }
.lang-option.active { background: rgba(233,30,99,0.3); font-weight: 600; }

/* Screen System */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    max-width: 480px;
    margin: 0 auto;
}
.screen.active { display: flex; flex-direction: column; align-items: center; }

/* ===================== INTRO ===================== */
@keyframes scaleInUp { 0% { opacity: 0; transform: scale(0.8) translateY(20px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes slideInDown { 0% { opacity: 0; transform: translateY(-20px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes slideInUp { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.intro-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    gap: 16px;
}

.intro-icon {
    font-size: 80px;
    animation: micBounce 2s ease-in-out infinite;
    animation: micBounce 2s ease-in-out 0s forwards;
}

@keyframes micBounce {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-12px) rotate(5deg); }
}

.intro-title {
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), #ff6ba0, #ffd93d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
    animation: slideInDown 0.4s ease-out 0.05s both;
}

.intro-subtitle {
    font-size: 16px;
    color: var(--text-sec);
    line-height: 1.6;
    animation: slideInUp 0.4s ease-out 0.1s both;
}

.intro-meta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 8px 0;
    animation: slideInUp 0.4s ease-out 0.12s both;
}
.meta-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-sec);
}

.btn-start {
    width: 100%;
    max-width: 360px;
    padding: 22px 36px;
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), #ff6ba0, #ff2d78);
    background-size: 200% 200%;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    margin-top: 16px;
    font-family: inherit;
    animation: scaleInUp 0.4s ease-out 0.15s both;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(255, 45, 120, 0.4), 0 0 0 0 rgba(255, 45, 120, 0.4);
    letter-spacing: 0.5px;
}
.btn-start::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}
.btn-start:hover::before { opacity: 1; }
.btn-start:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(255,45,120,0.4), inset 0 0 20px rgba(255,255,255,0.1);
}
.btn-start:active { transform: scale(0.98); }

/* Pulse animation for start button */
.btn-start-pulse {
    animation: scaleInUp 0.4s ease-out 0.15s both, btnPulse 2s ease-in-out 1s infinite;
}
@keyframes btnPulse {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(255, 45, 120, 0.4), 0 0 0 0 rgba(255, 45, 120, 0.4);
    }
    50% {
        box-shadow: 0 8px 32px rgba(255, 45, 120, 0.4), 0 0 0 12px rgba(255, 45, 120, 0);
    }
}
.btn-start-pulse:hover {
    animation: none;
}

/* Preview question teaser */
.intro-preview-question {
    width: 100%;
    max-width: 360px;
    background: rgba(255, 45, 120, 0.06);
    border: 1px solid rgba(255, 45, 120, 0.18);
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInUp 0.4s ease-out 0.13s both;
    margin-top: 4px;
}
.preview-label {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
    flex-shrink: 0;
}
.preview-text {
    font-size: 14px;
    color: var(--text-sec);
    line-height: 1.4;
}

[data-theme="light"] .intro-preview-question {
    background: rgba(255, 45, 120, 0.08);
    border-color: rgba(255, 45, 120, 0.2);
}

.test-count {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 8px;
    animation: slideInUp 0.4s ease-out 0.2s both;
}

.social-proof {
    animation: slideInUp 0.4s ease-out 0.22s both;
    font-size: 13px;
    color: var(--text-sec);
}
.social-proof .count {
    color: var(--primary-light);
    font-weight: 700;
}

.time-estimate {
    animation: slideInUp 0.4s ease-out 0.25s both;
    font-size: 14px;
    color: var(--text-sec);
    background: rgba(255,45,120,0.08);
    padding: 8px 16px;
    border-radius: 12px;
    display: inline-block;
    border: 1px solid rgba(255,45,120,0.15);
}

.scroll-hint {
    animation: slideInUp 0.4s ease-out 0.28s both, bounce 2s ease-in-out 0.8s infinite;
    font-size: 24px;
    margin-top: 12px;
}

.ad-banner {
    width: 100%;
    max-width: 320px;
    height: 50px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 16px;
}

/* ===================== QUESTION ===================== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--surface);
    border-radius: 4px;
    margin: 16px 0 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px rgba(255,45,120,0.15);
    animation: slideInDown 0.5s ease-out;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ff6ba0, #ffd93d);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 0%;
    position: relative;
}
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.progress-text {
    font-size: 13px;
    color: var(--text-dim);
    text-align: right;
    margin-bottom: 20px;
    font-weight: 600;
}

.question-card {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px 20px;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.q-text {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 24px;
    color: var(--text);
}

.q-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-align: left;
    font-family: inherit;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}
.option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,45,120,0.2) 0%, transparent 70%);
    transition: left 0.3s ease;
}
.option-btn:hover {
    background: rgba(255,45,120,0.08);
    border-color: rgba(255,45,120,0.3);
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(255,45,120,0.15);
}
.option-btn:hover::before { left: 100%; }
.option-btn.selected {
    background: rgba(255,45,120,0.15);
    border-color: var(--primary);
    transform: scale(0.97);
    box-shadow: 0 0 20px rgba(255,45,120,0.25);
}
.option-btn:disabled {
    opacity: 0.5;
    cursor: default;
    background: rgba(255,255,255,0.02);
}

.opt-emoji { font-size: 22px; flex-shrink: 0; }
.opt-text { flex: 1; }

/* ===================== LOADING ===================== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    gap: 20px;
}

.loading-icon {
    font-size: 72px;
    animation: micBounce 1.5s ease-in-out infinite;
}

.loading-bar {
    width: 280px;
    height: 6px;
    background: var(--surface);
    border-radius: 3px;
    overflow: hidden;
}
.loading-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ff6ba0, #ffd93d);
    border-radius: 3px;
    transition: width 0.3s;
    width: 0%;
}
.loading-text {
    font-size: 14px;
    color: var(--text-sec);
}

/* ===================== RESULT ===================== */
.result-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-bottom: 40px;
}

.result-header {
    text-align: center;
    padding: 32px 0 16px;
}

.result-emoji-large {
    font-size: 80px;
    display: block;
    margin-bottom: 12px;
    animation: resultPop 0.6s ease;
}

@keyframes resultPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.result-title-text {
    font-size: 36px;
    font-weight: 900;
    color: var(--result-color);
    margin-bottom: 4px;
}

.result-en {
    font-size: 16px;
    color: var(--text-dim);
    font-weight: 400;
    margin-bottom: 8px;
}

.result-subtitle-text {
    font-size: 16px;
    color: var(--text-sec);
    font-style: italic;
}

/* Result Card */
.result-card {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px 20px;
    animation: fadeUp 0.5s ease;
    animation-fill-mode: both;
}
.result-card:nth-child(2) { animation-delay: 0.1s; }
.result-card:nth-child(3) { animation-delay: 0.2s; }
.result-card:nth-child(4) { animation-delay: 0.3s; }
.result-card:nth-child(5) { animation-delay: 0.4s; }
.result-card:nth-child(6) { animation-delay: 0.5s; }

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

.result-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.result-desc {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-sec);
    margin-bottom: 16px;
}

.traits-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.traits-list li {
    background: rgba(255,45,120,0.1);
    border: 1px solid rgba(255,45,120,0.2);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--primary-light);
}

/* Idol chips */
.idol-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.idol-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.idol-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.idol-group {
    font-size: 11px;
    color: var(--text-dim);
}

/* Real life section */
.reallife-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-sec);
}

/* Best match */
.best-match-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,45,120,0.06);
    border: 1px solid rgba(255,45,120,0.15);
    border-radius: 16px;
    padding: 16px;
    margin-top: 8px;
}
.match-emoji { font-size: 36px; }
.match-info { flex: 1; }
.match-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.match-reason {
    font-size: 13px;
    color: var(--text-sec);
    margin-top: 2px;
}

/* Tip */
.tip-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-sec);
    font-style: italic;
    text-align: center;
    padding: 12px;
    background: rgba(255,215,61,0.06);
    border-radius: 12px;
    border: 1px solid rgba(255,215,61,0.15);
}

/* Spectrum Bars */
.spectrum-section {
    width: 100%;
}
.spectrum-bars {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 160px;
    padding: 16px 0;
    gap: 4px;
}
.spectrum-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.spectrum-bar.active .bar-label { transform: scale(1.2); }
.bar-label { font-size: 16px; transition: transform 0.3s; }
.bar-track {
    width: 20px;
    height: 100px;
    background: var(--surface);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}
.bar-fill {
    width: 100%;
    border-radius: 10px;
    height: 0%;
    transition: height 0.8s ease;
}
.bar-fill.animated { /* triggered by JS */ }
.bar-pct {
    font-size: 10px;
    color: var(--text-dim);
    font-weight: 600;
}

/* Group Match */
.group-match-section {
    width: 100%;
}
.group-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.group-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.group-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-light);
}
.group-member {
    font-size: 14px;
    color: var(--text);
}

/* Premium button */
.btn-premium {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-family: inherit;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.6s ease-out 0.15s both;
}
.btn-premium::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}
.btn-premium:hover::before { opacity: 1; }
.btn-premium:hover {
    transform: scale(1.04);
    box-shadow: 0 10px 35px rgba(243,156,18,0.5), inset 0 0 20px rgba(255,255,255,0.15);
}
.btn-premium:active { transform: scale(0.98); }

/* Premium Content */
.premium-content {
    display: none;
    width: 100%;
}

.detail-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
    animation: fadeUp 0.5s ease;
}
.detail-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}
.detail-section ul {
    list-style: none;
    padding: 0;
}
.detail-section li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-sec);
    line-height: 1.5;
    border-bottom: 1px solid var(--border);
}
.detail-section li:last-child { border-bottom: none; }
.detail-section li::before {
    content: '•';
    color: var(--primary);
    margin-right: 8px;
}

/* Compat grid */
.compat-grid { display: flex; flex-direction: column; gap: 8px; }
.compat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}
.compat-emoji { font-size: 18px; width: 28px; text-align: center; }
.compat-label { font-size: 12px; color: var(--text-sec); width: 56px; }
.compat-bar-bg {
    flex: 1;
    height: 8px;
    background: var(--surface);
    border-radius: 4px;
    overflow: hidden;
}
.compat-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}
.compat-score { font-size: 13px; font-weight: 700; color: var(--text); width: 36px; text-align: right; }
.compat-level { font-size: 11px; width: 52px; text-align: center; border-radius: 8px; padding: 2px 6px; }
.compat-item.perfect .compat-level { background: rgba(255,45,120,0.15); color: var(--primary-light); }
.compat-item.good .compat-level { background: rgba(46,204,113,0.15); color: #2ecc71; }
.compat-item.normal .compat-level { background: rgba(241,196,15,0.15); color: #f1c40f; }
.compat-item.low .compat-level { background: rgba(231,76,60,0.15); color: #e74c3c; }

/* Career chips */
.career-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.career-chip {
    background: rgba(255,45,120,0.1);
    border: 1px solid rgba(255,45,120,0.2);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--primary-light);
}

/* Idol advice */
.idol-advice {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-sec);
    font-style: italic;
    text-align: center;
    padding: 12px;
    background: rgba(255,45,120,0.05);
    border-radius: 12px;
}

/* Action buttons */
.action-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: slideInUp 0.6s ease-out 0.2s both;
}
.btn-action {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-family: inherit;
    position: relative;
}
.btn-action:hover {
    background: rgba(255,45,120,0.08);
    border-color: rgba(255,45,120,0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,45,120,0.15);
}

/* Ad Overlay */
.ad-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 100;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
}
.ad-overlay.active { display: flex; }

.ad-box {
    width: 300px;
    height: 250px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 14px;
}
.ad-countdown {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}
.ad-close {
    display: none;
    padding: 12px 32px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

/* Share canvas (hidden) */
#share-canvas {
    display: none;
    width: 1080px;
    height: 1080px;
}

/* Responsive */
@media (max-width: 480px) {
    .screen { padding: 16px; }
    .intro-title { font-size: 28px; }
    .result-title-text { font-size: 30px; }
    .result-emoji-large { font-size: 64px; }
    .bar-track { width: 16px; height: 80px; }
}

@media (max-width: 360px) {
    .intro-title { font-size: 24px; }
    .q-text { font-size: 16px; }
    .option-btn { font-size: 13px; min-height: 48px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* === RECOMMENDATIONS === */
.recommendations-section {
    margin-top: 24px;
    padding: 0 4px;
    animation: slideInUp 0.6s ease-out 0.25s both;
}
.rec-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-sec);
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 0.5px;
}
.rec-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rec-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.rec-card:hover, .rec-card:active {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255,45,120,0.2);
}
.rec-icon {
    font-size: 28px;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
    transition: transform 0.3s;
}
.rec-card:hover .rec-icon { transform: scale(1.2) rotate(10deg); }
.rec-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.rec-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rec-desc {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === SHARE MODAL === */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 100; }
.overlay.hidden { display: none; }
.share-modal-content { background: linear-gradient(135deg,#1a1a35 0%,#0f0f2e 100%); border: 1px solid rgba(255,45,120,0.2); border-radius: 16px; padding: 28px 24px; width: 85%; max-width: 360px; position: relative; animation: slideUp 0.3s ease-out; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.share-modal-close { position: absolute; top: 12px; right: 12px; background: none; border: none; color: var(--text-sec); font-size: 28px; cursor: pointer; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all 0.2s; }
.share-modal-close:hover { background: rgba(255,45,120,0.1); color: var(--text); }
.share-modal-title { font-size: 20px; font-weight: 800; margin-bottom: 8px; background: linear-gradient(135deg,#ff2d78,#ff6ba0); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.share-modal-subtitle { font-size: 13px; color: var(--text-sec); margin-bottom: 20px; line-height: 1.5; }
.share-buttons { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 16px; }
.share-btn { width: 100%; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 56px; justify-content: center; }
.share-btn:hover { background: rgba(255,45,120,0.15); border-color: rgba(255,45,120,0.3); transform: translateY(-2px); }
.share-icon { font-size: 20px; }
.share-label { font-size: 12px; }
.share-native-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; opacity: 0.4; }
.share-native-divider::before,.share-native-divider::after { flex: 1; content: ''; height: 1px; background: var(--border); }
.share-divider-text { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.share-btn-native { width: 100%; padding: 12px; background: linear-gradient(135deg,#ff2d78,#ff6ba0); color: #fff; border: none; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; min-height: 48px; }
.share-btn-native:hover { transform: scale(1.02); box-shadow: 0 4px 16px rgba(255,45,120,0.3); }

/* SHARE CTA SECTION */
.share-cta-section { background: linear-gradient(135deg,rgba(255,45,120,0.08),rgba(255,107,160,0.08)); border: 1px solid rgba(255,45,120,0.15); border-radius: 16px; padding: 16px; text-align: center; margin-top: 16px; }
.compare-invite { font-size: 14px; color: var(--text-sec); font-weight: 600; margin: 0; line-height: 1.5; }

/* === FOOTER === */
.game-footer { text-align: center; padding: 20px 0; margin-top: 20px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,0.4); text-decoration: none; font-size: 13px; padding: 12px 0; transition: color 0.2s; }
.back-link:hover { color: rgba(255,255,255,0.7); }

/* === Accessibility Improvements === */
button:focus-visible,a:focus-visible,input:focus-visible,[role="button"]:focus-visible{outline:3px solid #ff6ba0;outline-offset:2px;}
button,a[href],input[type="button"],input[type="submit"],[role="button"]{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;}
.skip-link{position:absolute;top:-40px;left:0;background:#ff6ba0;color:white;padding:8px;text-decoration:none;z-index:100;}
.skip-link:focus{top:0;}
[role="dialog"]{z-index:1000;}
@media (prefers-reduced-motion: reduce){*{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important;}}
@media (prefers-contrast: more){button{border:2px solid #ff6ba0;}}
.rec-card:focus-visible,.group-card:focus-visible{outline:3px solid #ff6ba0;outline-offset:4px;}

/* Enhanced button accessibility */
button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
[role="button"]:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 2px;
}

button:active,
input[type="button"]:active,
input[type="submit"]:active,
[role="button"]:active {
    transform: scale(0.98);
}

/* High contrast mode */
@media (prefers-contrast: more) {
    button,
    input[type="button"],
    input[type="submit"],
    [role="button"] {
        border: 2px solid currentColor;
        font-weight: bold;
    }
}

/* Enhanced form accessibility */
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    font-size: 16px;
    min-height: 44px;
    padding: 10px 12px;
}

input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="password"]:focus-visible,
input[type="number"]:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

/* Error handling accessibility */
.error-message,
[aria-invalid="true"] {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

[aria-invalid="true"] {
    border-color: #dc2626;
}

/* Non-color focus indicators */
:focus-visible {
    outline-width: 3px;
}

/* Icon patterns for colorblind users */
.error::before {
    content: "x ";
}

.success::before {
    content: "✓ ";
}

.warning::before {
    content: "! ";
}

.info::before {
    content: "i ";
}

/* High contrast scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark, #f1f5f9);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color, #3b82f6);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark, #1e40af);
}

/* Firefox scrollbar */
* {
    scrollbar-color: var(--primary-color, #3b82f6) var(--bg-dark, #f1f5f9);
    scrollbar-width: thin;
}

/* Selection Color */
::selection {
    background: #ff2d78;
    color: white;
}

::-moz-selection {
    background: #ff2d78;
    color: white;
}

/* ===================== LIGHT MODE ===================== */
[data-theme="light"] {
    --primary: #ff2d78;
    --primary-light: #ff6ba0;
    --bg: #f5f5fa;
    --surface: rgba(255, 255, 255, 0.8);
    --border: rgba(0, 0, 0, 0.08);
    --text: #1a1a2e;
    --text-sec: #4a4a6e;
    --text-dim: #8a8a9e;
    --result-color: #ff2d78;
}

[data-theme="light"] body {
    background: var(--bg);
    color: var(--text);
}

[data-theme="light"] .app-loader {
    background: var(--bg);
}

[data-theme="light"] .lang-btn {
    background: rgba(255, 45, 120, 0.15);
    border-color: rgba(255, 45, 120, 0.25);
    color: var(--primary);
}

[data-theme="light"] .lang-btn:hover {
    background: rgba(255, 45, 120, 0.25);
}

[data-theme="light"] .lang-menu {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(255, 45, 120, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .lang-option {
    color: #4a4a6e;
}

[data-theme="light"] .lang-option:hover {
    background: rgba(255, 45, 120, 0.1);
}

[data-theme="light"] .lang-option.active {
    background: rgba(255, 45, 120, 0.15);
    color: var(--primary);
}

[data-theme="light"] .intro-subtitle,
[data-theme="light"] .meta-item,
[data-theme="light"] .test-count,
[data-theme="light"] .social-proof,
[data-theme="light"] .time-estimate {
    color: var(--text-sec);
}

[data-theme="light"] .meta-item {
    background: rgba(255, 45, 120, 0.08);
    border-color: rgba(255, 45, 120, 0.15);
    color: var(--text-sec);
}

[data-theme="light"] .time-estimate {
    background: rgba(255, 45, 120, 0.1);
    border-color: rgba(255, 45, 120, 0.2);
}

[data-theme="light"] .ad-banner {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-dim);
}

[data-theme="light"] .progress-bar {
    background: rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(255, 45, 120, 0.1);
}

[data-theme="light"] .progress-text {
    color: var(--text-dim);
}

[data-theme="light"] .question-card {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .q-text {
    color: var(--text);
}

[data-theme="light"] .option-btn {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text);
}

[data-theme="light"] .option-btn:hover {
    background: rgba(255, 45, 120, 0.1);
    border-color: rgba(255, 45, 120, 0.3);
    box-shadow: 0 4px 15px rgba(255, 45, 120, 0.15);
}

[data-theme="light"] .option-btn.selected {
    background: rgba(255, 45, 120, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(255, 45, 120, 0.2);
}

[data-theme="light"] .option-btn:disabled {
    background: rgba(0, 0, 0, 0.04);
    opacity: 0.6;
}

[data-theme="light"] .loading-bar {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .loading-text {
    color: var(--text-sec);
}

[data-theme="light"] .result-card {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .result-card h3 {
    color: var(--text);
}

[data-theme="light"] .result-desc {
    color: var(--text-sec);
}

[data-theme="light"] .traits-list li {
    background: rgba(255, 45, 120, 0.12);
    border-color: rgba(255, 45, 120, 0.25);
    color: var(--primary);
}

[data-theme="light"] .idol-chip {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .idol-name {
    color: var(--text);
}

[data-theme="light"] .idol-group {
    color: var(--text-dim);
}

[data-theme="light"] .reallife-text {
    color: var(--text-sec);
}

[data-theme="light"] .best-match-card {
    background: rgba(255, 45, 120, 0.08);
    border-color: rgba(255, 45, 120, 0.2);
}

[data-theme="light"] .match-name {
    color: var(--text);
}

[data-theme="light"] .match-reason {
    color: var(--text-sec);
}

[data-theme="light"] .tip-text {
    background: rgba(255, 215, 61, 0.1);
    border-color: rgba(255, 215, 61, 0.2);
    color: var(--text-sec);
}

[data-theme="light"] .bar-track {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .bar-pct {
    color: var(--text-dim);
}

[data-theme="light"] .group-chip {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .group-member {
    color: var(--text);
}

[data-theme="light"] .detail-section {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="light"] .detail-section li {
    color: var(--text-sec);
    border-bottom-color: var(--border);
}

[data-theme="light"] .compat-bar-bg {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .compat-score {
    color: var(--text);
}

[data-theme="light"] .career-chip {
    background: rgba(255, 45, 120, 0.12);
    border-color: rgba(255, 45, 120, 0.25);
    color: var(--primary);
}

[data-theme="light"] .idol-advice {
    background: rgba(255, 45, 120, 0.08);
    color: var(--text-sec);
}

[data-theme="light"] .btn-action {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="light"] .btn-action:hover {
    background: rgba(255, 45, 120, 0.1);
    border-color: rgba(255, 45, 120, 0.3);
}

[data-theme="light"] .ad-overlay {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] .ad-box {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-dim);
}

[data-theme="light"] .ad-countdown {
    color: var(--text);
}

[data-theme="light"] .share-modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f5f5fa 100%);
    border-color: rgba(255, 45, 120, 0.2);
}

[data-theme="light"] .share-modal-close {
    color: var(--text-sec);
}

[data-theme="light"] .share-modal-close:hover {
    background: rgba(255, 45, 120, 0.1);
    color: var(--text);
}

[data-theme="light"] .share-btn {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="light"] .share-btn:hover {
    background: rgba(255, 45, 120, 0.12);
    border-color: rgba(255, 45, 120, 0.3);
}

[data-theme="light"] .share-divider-text {
    color: var(--text-dim);
}

[data-theme="light"] .share-native-divider::before,
[data-theme="light"] .share-native-divider::after {
    background: var(--border);
}

[data-theme="light"] .share-cta-section {
    background: linear-gradient(135deg, rgba(255, 45, 120, 0.1), rgba(255, 107, 160, 0.08));
    border-color: rgba(255, 45, 120, 0.2);
}

[data-theme="light"] .compare-invite {
    color: var(--text-sec);
}

[data-theme="light"] .back-link {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .back-link:hover {
    color: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] .rec-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text);
}

[data-theme="light"] .rec-card:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary);
}

[data-theme="light"] .rec-name {
    color: var(--text);
}

[data-theme="light"] .rec-desc {
    color: var(--text-dim);
}

[data-theme="light"] .rec-title {
    color: var(--text-sec);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 12px;
    right: 56px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

[data-theme="light"] .theme-toggle {
    background: rgba(255, 45, 120, 0.1);
    border-color: rgba(255, 45, 120, 0.2);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(255, 45, 120, 0.2);
}

/* Scrollbar for light mode */
[data-theme="light"] ::-webkit-scrollbar-track {
    background: #f5f5fa;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 45, 120, 0.3);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 45, 120, 0.5);
}

[data-theme="light"] * {
    scrollbar-color: rgba(255, 45, 120, 0.3) #f5f5fa;
}

/* Selection color for light mode */
[data-theme="light"] ::selection {
    background: #ff2d78;
    color: white;
}

[data-theme="light"] ::-moz-selection {
    background: #ff2d78;
    color: white;
}
