:root {
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #0f172a;
    --sub-text: #475569;
    --accent: #0f172a;
    --neon: #39FF14;
    --purple: #9D00FF;
    --mint: #00FFD1;
    --border: #e2e8f0;
    --chip-bg: #ffffff;
    --feature-bg: #f1f5f9;
    --option-bg: #f8fafc;
    --option-border: #e2e8f0;
    --btn-shadow: rgba(57, 255, 20, 0.25);
    --anime-card-bg: rgba(57, 255, 20, 0.08);
    --anime-card-border: #16a34a;
    --toast-bg: rgba(15, 23, 42, 0.92);
    --toast-text: #39FF14;
}

body.dark-mode {
    --bg: #0a1128;
    --card-bg: #111827;
    --text: #EAEAEA;
    --sub-text: #A8A8A8;
    --accent: #39FF14;
    --neon: #39FF14;
    --border: #1e293b;
    --chip-bg: #111827;
    --feature-bg: rgba(255, 255, 255, 0.04);
    --option-bg: rgba(255, 255, 255, 0.05);
    --option-border: rgba(255, 255, 255, 0.1);
    --btn-shadow: rgba(57, 255, 20, 0.35);
    --anime-card-bg: rgba(57, 255, 20, 0.06);
    --anime-card-border: rgba(57, 255, 20, 0.35);
    --toast-bg: rgba(0, 0, 0, 0.92);
    --toast-text: #39FF14;
}

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

html {
    scrollbar-gutter: stable;
    overflow-y: scroll;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100svh;
    display: flex;
    justify-content: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-container {
    width: 100% !important;
    max-width: 420px !important;
    height: 100svh !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    position: relative;
    z-index: 1;
}

/* 1. 상단 헤더 정렬 및 높이 고정 (전체 페이지 수직 점프 방지) */
header, .header, .site-header, .header-container {
    padding-top: calc(env(safe-area-inset-top, 0px) + 22px) !important;
    padding-bottom: 12px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    height: auto !important;
    min-height: calc(46px + env(safe-area-inset-top, 0px) + 22px) !important;
    max-height: none !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    width: 100% !important;
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    order: -1 !important;
    background-color: var(--bg);
}

/* 2. 로고 크기 및 세로 중앙 정렬 박제 */
.logo, .brand, a.logo {
    font-size: 17px !important;
    letter-spacing: -0.6px !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    margin: 0 6px 0 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    height: 24px !important;
    cursor: pointer !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    color: var(--text);
}

.logo:hover {
    transform: scale(1.08) translateY(-1px);
    text-shadow:
        0 0 8px rgba(57, 255, 20, 0.9),
        0 0 20px rgba(157, 0, 255, 0.5);
    color: var(--text);
}

.logo.clicked {
    transform: scale(0.96) translateY(1px);
    text-shadow:
        0 0 12px rgba(57, 255, 20, 1),
        0 0 28px rgba(157, 0, 255, 0.7);
    transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1), text-shadow 0.1s ease;
}

/* 3. 우측 컨트롤 그룹 간격 */
.controls, .nav-group, .header-right {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    height: 24px !important;
    gap: 3.5px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}

.icon-btn, #theme-toggle {
    width: 24px !important;
    height: 24px !important;
    font-size: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    color: inherit !important;
    line-height: 1 !important;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

body:not(.dark-mode) .icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* 4. 3개 캡슐 버튼 (OST, MBTI, TOP 10, HOME) 크기 및 형태 완전 일치 */
.nav-btn, .header-btn,
.top10-header-btn, .mbti-header-btn, .ost-header-btn, .home-header-btn,
.controls a {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: -0.4px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 9999px !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
    border: 1.2px solid var(--neon);
    text-decoration: none !important;
    white-space: nowrap;
    transition: all 0.2s;
    color: var(--neon);
}

body:not(.dark-mode) .top10-header-btn,
body.light-mode .top10-header-btn,
body.light-theme .top10-header-btn,
body:not(.dark-mode) .mbti-header-btn,
body.light-mode .mbti-header-btn,
body.light-theme .mbti-header-btn,
body:not(.dark-mode) .ost-header-btn,
body.light-mode .ost-header-btn,
body.light-theme .ost-header-btn,
body:not(.dark-mode) .home-header-btn,
body.light-mode .home-header-btn,
body.light-theme .home-header-btn {
    color: #1a1a1a;
    background-color: #39FF14;
    border-color: #2eb800;
}

.top10-header-btn:hover,
.mbti-header-btn:hover,
.ost-header-btn:hover,
.home-header-btn:hover {
    background-color: var(--neon);
    color: #000;
}

.top10-header-btn:active,
.mbti-header-btn:active,
.ost-header-btn:active,
.home-header-btn:active {
    transform: scale(0.95);
}

/* ==========================================================================
   Language Dropdown (Unified Standard: 11 Languages)
   ========================================================================== */
.lang-dropdown {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
}

.lang-btn, .lang-toggle {
    height: 24px !important;
    padding: 0 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 6px !important;
    color: #fff !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

body:not(.dark-mode) .lang-btn,
body:not(.dark-mode) .lang-toggle,
body.light-mode .lang-btn,
body.light-mode .lang-toggle,
body.light-theme .lang-btn,
body.light-theme .lang-toggle {
    color: #1a1a1a !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
}

.lang-btn:hover, .lang-toggle:hover {
    border-color: #39FF14 !important;
    color: #39FF14 !important;
}

.lang-menu {
    position: absolute !important;
    top: calc(100% + 6px) !important;
    right: 0 !important;
    width: 140px !important;
    background: #11141a !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    padding: 6px !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7) !important;
    z-index: 10000 !important;
    display: none !important;
    flex-direction: column !important; /* 세로 나열 강제 박제 */
    max-height: min(420px, calc(100dvh - 70px)) !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.lang-menu::-webkit-scrollbar {
    display: none !important;
}

body:not(.dark-mode) .lang-menu,
body.light-mode .lang-menu,
body.light-theme .lang-menu {
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15) !important;
}

.lang-menu.show {
    display: flex !important;
    animation: dropdownSlideFade 0.25s cubic-bezier(0.23, 1, 0.32, 1) !important;
}

@keyframes dropdownSlideFade {
    from { 
        opacity: 0; 
        transform: translateY(-8px) scale(0.96); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.lang-item {
    width: 100% !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 8px !important;
    gap: 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #fff !important;
    background: transparent !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    text-align: left !important;
    white-space: nowrap !important;
    transition: all 0.2s ease !important;
}

body:not(.dark-mode) .lang-item,
body.light-mode .lang-item,
body.light-theme .lang-item {
    color: #1a1a1a !important;
}

.lang-item:hover, .lang-item.active {
    background: rgba(57, 255, 20, 0.15) !important;
    color: #39FF14 !important;
}

body:not(.dark-mode) .lang-item:hover,
body:not(.dark-mode) .lang-item.active,
body.light-mode .lang-item:hover,
body.light-mode .lang-item.active,
body.light-theme .lang-item:hover,
body.light-theme .lang-item.active {
    background: rgba(57, 255, 20, 0.18) !important;
    color: #1a7a00 !important;
}

.lang-code {
    font-size: 10px !important;
    font-weight: 900 !important;
    opacity: 0.6 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    padding: 1px 4px !important;
    border-radius: 4px !important;
    min-width: 22px !important;
    text-align: center !important;
}

body:not(.dark-mode) .lang-code,
body.light-mode .lang-code,
body.light-theme .lang-code {
    background: rgba(0, 0, 0, 0.08) !important;
}

.lang-item.active .lang-code {
    background: #39FF14 !important;
    color: #000000 !important;
    opacity: 1 !important;
}

/* RTL Support */
[dir="rtl"] .lang-menu {
    right: auto !important;
    left: 0 !important;
}

[dir="rtl"] .lang-item {
    text-align: right !important;
    justify-content: flex-end !important;
}


/* MAIN CONTENT */
.main {
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    padding: 6px 0 16px;
}

.main::-webkit-scrollbar {
    display: none;
}

/* MBTI CARD - 24px 모서리 곡률 규격 통일 */
.mbti-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .mbti-card {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(57, 255, 20, 0.2);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

body:not(.dark-mode) .mbti-card,
body.light-mode .mbti-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

/* BADGE */
.mbti-badge-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.mbti-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.5px;
    background: rgba(57, 255, 20, 0.12);
    color: var(--neon);
    border: 1px solid rgba(57, 255, 20, 0.35);
}

body:not(.dark-mode) .mbti-badge {
    color: #1a5e00;
    background: rgba(57, 255, 20, 0.18);
    border-color: #2eb800;
}

/* TITLE & SUBTITLE */
.mbti-title {
    font-size: 20px;
    font-weight: 850;
    text-align: center;
    line-height: 1.35;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.mbti-subtitle {
    font-size: 13px;
    color: var(--sub-text);
    text-align: center;
    line-height: 1.45;
    margin-bottom: 16px;
    word-break: keep-all;
}

/* VISUAL INTRO GRAPHIC (WELCOME) */
.mbti-intro-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px 16px;
    margin-bottom: 16px;
    border-radius: 18px;
    background: var(--feature-bg);
    border: 1px solid rgba(57, 255, 20, 0.15);
    overflow: hidden;
}

.visual-glow {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(57, 255, 20, 0.25) 0%, rgba(157, 0, 255, 0.12) 60%, transparent 80%);
    filter: blur(20px);
    pointer-events: none;
    animation: pulseGlow 3s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    from { transform: scale(0.9); opacity: 0.6; }
    to { transform: scale(1.15); opacity: 1; }
}

.visual-avatar {
    font-size: 48px;
    z-index: 2;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 12px rgba(57, 255, 20, 0.4));
    animation: gentleFloat 3s ease-in-out infinite;
}

@keyframes gentleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.visual-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 2;
}

.v-tag {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--sub-text);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 7px;
    border-radius: 5px;
}

body:not(.dark-mode) .v-tag {
    background: rgba(0, 0, 0, 0.05);
}

/* FEATURES LIST */
.mbti-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    background: var(--feature-bg);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

body:not(.dark-mode) .feature-item {
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.f-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.f-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.f-text strong {
    font-size: 13px;
    font-weight: 750;
    color: var(--text);
}

.f-text span {
    font-size: 11px;
    color: var(--sub-text);
}

/* START BUTTON */
.mbti-start-btn {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 100px;
    background: var(--neon);
    color: #000000;
    font-size: 15px;
    font-weight: 850;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 6px 18px var(--btn-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

.mbti-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(57, 255, 20, 0.45);
}

/* QUIZ VIEW */
.quiz-card {
    min-height: 430px;
    display: flex;
    flex-direction: column;
}

.quiz-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 12px;
}

body:not(.dark-mode) .quiz-progress-bar {
    background: rgba(0, 0, 0, 0.08);
}

.quiz-progress-fill {
    height: 100%;
    background: var(--neon);
    border-radius: 100px;
    transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

.quiz-step-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.quiz-dimension-badge {
    font-size: 10.5px;
    font-weight: 800;
    padding: 2.5px 8px;
    border-radius: 100px;
    background: rgba(57, 255, 20, 0.12);
    color: var(--neon);
    border: 1px solid rgba(57, 255, 20, 0.3);
}

body:not(.dark-mode) .quiz-dimension-badge {
    color: #1a5e00;
    background: rgba(57, 255, 20, 0.18);
    border-color: #2eb800;
}

.quiz-step-text {
    font-size: 12.5px;
    font-weight: 850;
    color: var(--neon);
}

body:not(.dark-mode) .quiz-step-text {
    color: #1a5e00;
}

.quiz-content-area {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.quiz-content-area.animate-fade {
    animation: questionSlideFade 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes questionSlideFade {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* QUESTION MINI VISUAL BOX (3D MOOD BADGE) */
.question-visual-box {
    width: 64px;
    height: 64px;
    margin: 0 auto 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--scene-accent, rgba(255, 255, 255, 0.12));
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 14px var(--scene-glow, transparent);
    font-size: 30px; /* 아이콘/3D 그래픽 중앙 안착 */
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

body:not(.dark-mode) .question-visual-box {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--scene-accent, rgba(0, 0, 0, 0.1));
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), 0 0 10px var(--scene-glow, transparent);
}

.question-visual-box .visual-glow {
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: radial-gradient(circle at center, var(--scene-glow, rgba(57, 255, 20, 0.28)) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0.85;
    animation: visualGlowPulse 2.8s ease-in-out infinite alternate;
}

@keyframes visualGlowPulse {
    from { opacity: 0.55; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1.1); }
}

.question-visual-box .visual-icon {
    position: relative;
    z-index: 2;
    line-height: 1;
    filter: drop-shadow(0 2px 6px var(--scene-glow, rgba(0, 0, 0, 0.4)));
    animation: visualIconFloat 2.6s ease-in-out infinite;
    user-select: none;
}

@keyframes visualIconFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-2px) scale(1.06); }
}

/* 12 SCENE THEME PALETTES */
.theme-portal { --scene-accent: #00FFD1; --scene-glow: rgba(0, 255, 209, 0.35); }
.theme-guild { --scene-accent: #39FF14; --scene-glow: rgba(57, 255, 20, 0.35); }
.theme-festival { --scene-accent: #FFD700; --scene-glow: rgba(255, 215, 0, 0.35); }
.theme-ruins { --scene-accent: #00E5FF; --scene-glow: rgba(0, 229, 255, 0.35); }
.theme-awakening { --scene-accent: #B388FF; --scene-glow: rgba(179, 136, 255, 0.4); }
.theme-mystery { --scene-accent: #E040FB; --scene-glow: rgba(224, 64, 251, 0.35); }
.theme-battle { --scene-accent: #FF5252; --scene-glow: rgba(255, 82, 82, 0.35); }
.theme-rival { --scene-accent: #FF9100; --scene-glow: rgba(255, 145, 0, 0.35); }
.theme-reward { --scene-accent: #FFEA00; --scene-glow: rgba(255, 234, 0, 0.35); }
.theme-expedition { --scene-accent: #69F0AE; --scene-glow: rgba(105, 240, 174, 0.35); }
.theme-vortex { --scene-accent: #7C4DFF; --scene-glow: rgba(124, 77, 255, 0.4); }
.theme-haven { --scene-accent: #40C4FF; --scene-glow: rgba(64, 196, 255, 0.35); }

body:not(.dark-mode) .theme-portal { --scene-accent: #0b7285; --scene-glow: rgba(11, 114, 133, 0.2); }
body:not(.dark-mode) .theme-guild { --scene-accent: #1a5e00; --scene-glow: rgba(26, 94, 0, 0.2); }
body:not(.dark-mode) .theme-festival { --scene-accent: #d97706; --scene-glow: rgba(217, 119, 6, 0.2); }
body:not(.dark-mode) .theme-ruins { --scene-accent: #0284c7; --scene-glow: rgba(2, 132, 199, 0.2); }
body:not(.dark-mode) .theme-awakening { --scene-accent: #7c3aed; --scene-glow: rgba(124, 58, 237, 0.2); }
body:not(.dark-mode) .theme-mystery { --scene-accent: #c026d3; --scene-glow: rgba(192, 38, 211, 0.2); }
body:not(.dark-mode) .theme-battle { --scene-accent: #dc2626; --scene-glow: rgba(220, 38, 38, 0.2); }
body:not(.dark-mode) .theme-rival { --scene-accent: #ea580c; --scene-glow: rgba(234, 88, 12, 0.2); }
body:not(.dark-mode) .theme-reward { --scene-accent: #ca8a04; --scene-glow: rgba(202, 138, 4, 0.2); }
body:not(.dark-mode) .theme-expedition { --scene-accent: #059669; --scene-glow: rgba(5, 150, 105, 0.2); }
body:not(.dark-mode) .theme-vortex { --scene-accent: #6d28d9; --scene-glow: rgba(109, 40, 217, 0.2); }
body:not(.dark-mode) .theme-haven { --scene-accent: #0284c7; --scene-glow: rgba(2, 132, 199, 0.2); }

.quiz-scenario-tag {
    font-size: 12px;
    font-weight: 800;
    color: var(--mint);
    margin-bottom: 5px;
    letter-spacing: -0.2px;
}

body:not(.dark-mode) .quiz-scenario-tag {
    color: #0b7285;
}

.quiz-question {
    font-size: 16.5px;
    font-weight: 800;
    line-height: 1.45;
    margin-bottom: 16px;
    word-break: keep-all;
    color: var(--text);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.quiz-option-btn {
    background: var(--option-bg);
    border: 1.5px solid var(--option-border);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    color: var(--text);
    outline: none;
    user-select: none;
}

.quiz-option-btn:hover {
    border-color: var(--neon);
    background: rgba(57, 255, 20, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(57, 255, 20, 0.2);
}

.quiz-option-btn:active,
.quiz-option-btn.selected {
    border-color: var(--neon);
    background: rgba(57, 255, 20, 0.18);
    transform: scale(0.98);
}

.option-badge {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: rgba(57, 255, 20, 0.15);
    color: var(--neon);
    font-size: 11.5px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

body:not(.dark-mode) .option-badge {
    color: #1a5e00;
    background: rgba(57, 255, 20, 0.25);
}

.quiz-option-btn:hover .option-badge,
.quiz-option-btn.selected .option-badge {
    background: var(--neon);
    color: #000000;
}

.option-text {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.48;
    word-break: keep-all;
    color: var(--text);
}

/* =========================================================
   RESULT VIEW (SINGLE-SCREEN VIEWPORT COMPACT SPECIFICATION)
   ========================================================= */
.result-card {
    min-height: 460px;
    display: flex;
    flex-direction: column;
    padding: 18px 16px 16px;
}

.result-loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 16px;
    gap: 16px;
}

.result-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3.5px solid rgba(57, 255, 20, 0.15);
    border-top-color: var(--neon);
    animation: spinnerRotate 0.85s linear infinite;
    box-shadow: 0 0 16px rgba(57, 255, 20, 0.3);
}

@keyframes spinnerRotate { to { transform: rotate(360deg); } }

.result-loading-title {
    font-size: 18px;
    font-weight: 850;
    color: var(--text);
}

.result-loading-desc {
    font-size: 13px;
    color: var(--sub-text);
    line-height: 1.45;
    max-width: 280px;
    word-break: keep-all;
}

.result-content-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    animation: resultFadeUp 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes resultFadeUp {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 1. COMPACT ORIGINAL ANIME POSTER FRAME (200px~220px) */
.result-poster-wrap {
    position: relative;
    width: auto;
    max-width: 165px;
    height: 210px;
    max-height: 220px;
    margin: 0 auto 8px auto;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(57, 255, 20, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 16px rgba(57, 255, 20, 0.14);
    background: #000000;
    display: flex;
    justify-content: center;
}

body:not(.dark-mode) .result-poster-wrap {
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.result-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.3s ease;
}

.result-poster-wrap:hover .result-poster-img {
    transform: scale(1.04);
}

.poster-overlay-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, transparent 50%, rgba(0, 0, 0, 0.6) 100%);
    pointer-events: none;
}

.poster-badge-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(57, 255, 20, 0.4);
    padding: 2.5px 8px;
    border-radius: 100px;
    z-index: 2;
}

.p-badge-icon {
    font-size: 10px;
}

.p-badge-text {
    font-size: 9.5px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: var(--neon);
}

body:not(.dark-mode) .poster-badge-tag {
    background: rgba(255, 255, 255, 0.92);
    border-color: #2eb800;
}

body:not(.dark-mode) .p-badge-text {
    color: #1a5e00;
}

/* 2. COMPACT RESULT META HEADER */
.result-meta-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 6px;
}

.mbti-capsule-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 100px;
    background: rgba(57, 255, 20, 0.12);
    border: 1.2px solid var(--neon);
    margin-bottom: 4px;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.2);
}

body:not(.dark-mode) .mbti-capsule-badge {
    background: rgba(57, 255, 20, 0.15);
    border-color: #2eb800;
    box-shadow: none;
}

.mbti-capsule-code {
    font-size: 13.5px;
    font-weight: 950;
    letter-spacing: 0.8px;
    color: var(--neon);
}

body:not(.dark-mode) .mbti-capsule-code {
    color: #1a5e00;
}

.mbti-capsule-divider {
    width: 1px;
    height: 10px;
    background: rgba(57, 255, 20, 0.4);
}

body:not(.dark-mode) .mbti-capsule-divider {
    background: rgba(26, 94, 0, 0.3);
}

.mbti-capsule-archetype {
    font-size: 11.5px;
    font-weight: 850;
    color: var(--text);
}

.result-char-title {
    font-size: 17px;
    font-weight: 900;
    line-height: 1.32;
    letter-spacing: -0.4px;
    color: var(--text);
    margin-bottom: 4px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.char-name {
    font-size: 17.5px;
    font-weight: 900;
    color: var(--text);
}

.anime-title-tag {
    font-size: 12px;
    font-weight: 750;
    color: var(--mint);
    letter-spacing: -0.2px;
}

body:not(.dark-mode) .anime-title-tag {
    color: #0b7285;
}

.result-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

/* 3. COMPACT QUOTE BOX (NEON LEFT BORDER) */
.result-quote-box {
    position: relative;
    background: rgba(57, 255, 20, 0.04);
    border-left: 3px solid var(--neon);
    border-radius: 0 12px 12px 0;
    padding: 8px 12px 7px 12px;
    margin-bottom: 6px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

body:not(.dark-mode) .result-quote-box {
    background: #f1f3f5;
    border-left: 3px solid #2eb800;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.quote-icon {
    position: absolute;
    top: 2px;
    left: 6px;
    font-size: 24px;
    font-family: Georgia, serif;
    line-height: 1;
    color: var(--neon);
    opacity: 0.22;
    pointer-events: none;
}

body:not(.dark-mode) .quote-icon {
    color: #1a5e00;
}

.quote-text {
    font-size: 12.5px;
    font-weight: 750;
    font-style: italic;
    line-height: 1.42;
    color: var(--text);
    margin-bottom: 2px;
    word-break: keep-all;
    position: relative;
    z-index: 1;
}

.quote-author {
    font-size: 10.5px;
    font-weight: 800;
    color: var(--sub-text);
    text-align: right;
}

/* 4. COMPACT DESC & ANIME MATCH CARD (2~3 LINES) */
.result-desc-card {
    background: var(--feature-bg);
    border-radius: 14px;
    padding: 8px 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body:not(.dark-mode) .result-desc-card {
    background: #f1f3f5;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.desc-text {
    font-size: 12px;
    line-height: 1.4;
    word-break: keep-all;
    color: var(--text);
    margin-bottom: 6px;
}

.desc-anime-match {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 11.5px;
    line-height: 1.35;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 5px;
}

body:not(.dark-mode) .desc-anime-match {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.match-badge {
    font-weight: 900;
    color: var(--neon);
    white-space: nowrap;
    flex-shrink: 0;
}

body:not(.dark-mode) .match-badge {
    color: #1a5e00;
}

.match-text {
    color: var(--sub-text);
    word-break: keep-all;
}

.match-text strong {
    color: var(--text);
}

/* 5. COMPACT ACTION BUTTONS (NO VERTICAL OVERFLOW) */
.result-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.mbti-action-btn {
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-weight: 850;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
    outline: none;
}

.cta-btn {
    width: 100%;
    height: 42px;
    border-radius: 100px;
    background: var(--neon);
    color: #000000;
    font-size: 13.5px;
    box-shadow: 0 4px 14px var(--btn-shadow);
}

.cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(57, 255, 20, 0.4);
}

.cta-btn:active {
    transform: scale(0.98);
}

.secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.share-btn,
.retry-btn {
    height: 36px;
    border-radius: 100px;
    font-size: 11.5px;
    background: var(--option-bg);
    color: var(--text);
    border: 1.2px solid var(--option-border);
}

.share-btn:hover,
.retry-btn:hover {
    border-color: var(--neon);
    background: rgba(57, 255, 20, 0.08);
}

.share-btn:active,
.retry-btn:active {
    transform: scale(0.98);
}

/* TOAST NOTIFICATION */
.mbti-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--toast-bg);
    color: var(--toast-text);
    border: 1px solid var(--neon);
    padding: 9px 18px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 850;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 9999;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    white-space: nowrap;
}

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

/* MOBILE ADAPTATION (Viewport max-width 420px) */
@media (max-width: 768px) {
    .app-container {
        width: 100% !important;
        max-width: 420px !important;
        height: 100svh !important;
        margin: 0 auto !important;
        padding: 0 16px !important;
        box-sizing: border-box !important;
    }
    .mbti-card {
        padding: 14px 14px 12px;
    }
    .mbti-title {
        font-size: 18px;
    }
    .mbti-subtitle {
        font-size: 12px;
        margin-bottom: 12px;
    }
    .question-visual-box {
        width: 54px;
        height: 54px;
        font-size: 26px;
        border-radius: 16px;
        margin: 0 auto 8px auto;
    }
    .quiz-question {
        font-size: 15px;
        margin-bottom: 12px;
    }
    .quiz-option-btn {
        padding: 12px 14px;
        border-radius: 14px;
    }
    .option-text {
        font-size: 13px;
    }
    .mbti-start-btn {
        height: 44px;
        font-size: 14px;
    }
    
    /* Result Single-Screen Mobile Tuning */
    .result-poster-wrap {
        height: 190px;
        max-height: 200px;
        max-width: 145px;
        border-radius: 16px;
        margin-bottom: 6px;
    }
    .char-name {
        font-size: 16px;
    }
    .anime-title-tag {
        font-size: 11px;
    }
    .quote-text {
        font-size: 11.5px;
    }
    .desc-text {
        font-size: 11px;
    }
    .desc-anime-match {
        font-size: 10.5px;
    }
    .cta-btn {
        height: 40px;
        font-size: 13px;
    }
    .share-btn,
    .retry-btn {
        height: 34px;
        font-size: 11px;
    }
}

/* PWA Standalone Mode */
@media all and (display-mode: standalone) {
    .app-container {
        width: 100% !important;
        max-width: 420px !important;
        height: 100svh !important;
        margin: 0 auto !important;
        padding: 0 16px !important;
        box-sizing: border-box !important;
    }
    body.ost-page .app-container {
        padding-top: 0 !important;
    }
}


