:root {
    --bg-dark: #121212;
    /* Material Dark */
    --bg-color: #0d0d10;
    /* Almost Black with slight blue tint */

    /* Text Colors */
    --text-color: #f5f5f7;
    /* Global Text Color (Fixed) */
    --text-light: #f5f5f7;
    /* Apple-style off-white */
    --text-dim: #9e9e9e;
    /* Readable grey */

    /* Accents (Neon Cyberpunk) */
    --accent-primary: #ff2d55;
    /* Radical Red */
    --accent-secondary: #00e5ff;
    /* Cyan */

    /* Glass Panel */
    --glass-bg: rgba(30, 30, 40, 0.7);
    /* Darker, more opaque glass */
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Fonts */
    --font-main: 'Pretendard', sans-serif;
    --font-display: 'Outfit', sans-serif;
}

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

body {
    font-family: 'Pretendard', 'Outfit', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    word-break: keep-all;
    /* Korean Typography Rule */
    overflow-wrap: break-word;
    /* Prevent overflow */
    align-items: flex-start;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 10s infinite ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #1a237e, transparent);
    /* Deep Indigo */
    top: -100px;
    left: -100px;
    opacity: 0.4;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #004d40, transparent);
    /* Dark Teal */
    bottom: -50px;
    right: -50px;
    animation-delay: 2s;
    opacity: 0.4;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #311b92, transparent);
    /* Deep Purple */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 5s;
    opacity: 0.3;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-20px) scale(1.1);
    }
}

/* Main Container */
.container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    text-align: center;
}

/* Screens */
.screen {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.screen.active {
    display: block;
    opacity: 1;
}

.hidden {
    display: none !important;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Intro Screen */
.logo-area {
    margin-bottom: 25px;
}

.brand-tag {
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--accent-secondary);
    text-transform: uppercase;
}

h1 {
    font-family: var(--font-display);
    font-size: 2.8rem;
    background: linear-gradient(to right, #ff5f6d, #ffc371);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 5px 0;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.intro-desc {
    margin-bottom: 40px;
    line-height: 1.8;
}

.intro-desc .small-text {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 20px;
    opacity: 0.7;
}

/* Buttons */
.cta-btn {
    position: relative;
    padding: 15px 40px;
    background: linear-gradient(45deg, #ff5f6d, #ffc371);
    border: none;
    border-radius: 30px;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 95, 109, 0.4);
}

.cta-btn .btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }

    20% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

/* Test Screen */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-bottom: 30px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, #ff5f6d, #ffc371);
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.question-header {
    margin-bottom: 30px;
}

.q-number {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--glass-border);
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

#question-text {
    font-size: 1.5rem;
    line-height: 1.4;
    word-break: keep-all;
    min-height: 4.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.options-grid {
    display: grid;
    gap: 15px;
}

.option-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    border-radius: 12px;
    color: var(--text-light);
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    font-size: 1rem;
    line-height: 1.5;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
    /* Ensure full width in grid */
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-secondary);
    transform: translateY(-2px);
    /* Slight lift */
}

/* Likert Scale Specifics */
.likert-scale {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 20px;
}

.likert-btn {
    flex: 1;
    /* Distribute space evenly */
    text-align: center;
    padding: 15px 5px;
    /* Reduce side padding */
    font-size: 0.9rem;
    /* Slightly smaller font */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 80px;
    /* Fixed height for consistency */
    white-space: nowrap;
    /* Prevent wrapping if possible, or handle gracefully */
}

/* Handle "Very..." text breaking */
.likert-btn span {
    display: block;
}

@media (max-width: 600px) {
    .likert-scale {
        gap: 5px;
    }

    .likert-btn {
        font-size: 0.8rem;
        padding: 10px 2px;
    }
}

/* Loading Screen */
.brain-loader {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.neuron {
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: pulse 1.5s infinite ease-in-out;
}

.neuron:nth-child(2) {
    animation-delay: 0.3s;
    background: var(--accent-secondary);
}

.neuron:nth-child(3) {
    animation-delay: 0.6s;
    background: #6a11cb;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Result Screen */
.result-header .type-tag {
    display: block;
    font-size: 0.9rem;
    color: var(--accent-primary);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

#result-title {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.highlight-text {
    color: var(--accent-secondary);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.result-visual {
    margin: 20px 0;
}

/* Character Display & Gender Toggle (Mobile Optimized) */
.character-display-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

.character-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 350px;
    /* Optimized for mobile/desktop balance */
    margin-bottom: 15px;
}

.character-image {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gender-toggle-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gender-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: var(--font-display);
    transition: all 0.2s ease;
}

.gender-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.gender-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #1a1a2e;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(255, 95, 109, 0.4);
}


.result-desc {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    line-height: 1.6;
    text-align: left;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.primary-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
}

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

.legal-footer {
    margin-top: 30px;
    font-size: 0.7rem;
    color: var(--text-dim);
    opacity: 0.6;
}

/* =========================================
   Unified Result Page Enhancements
   ========================================= */

/* Survival Kit Cards */
.survival-kit-section {
    margin-top: 50px;
    text-align: left;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
}

.kit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.kit-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s, background 0.2s;
}

.kit-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-secondary);
}

.kit-icon {
    font-size: 1.5rem;
    margin-bottom: 10px;
    display: block;
}

.kit-title {
    font-weight: bold;
    color: var(--accent-secondary);
    margin-bottom: 5px;
    display: block;
    word-break: keep-all;
}

.kit-desc {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.5;
    word-break: keep-all;
}

/* Expert Overlay (Hidden by Default) */
#expert-overlay {
    display: none;
    /* Logic toggles this */
    margin-top: 40px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 1px solid var(--accent-primary);
    animation: fadeIn 0.5s ease;
}

#expert-overlay.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
    margin: 20px 0;
}

/* Tier Card */
.tier-card {
    text-align: center;
    padding: 20px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #fff;
    margin-bottom: 20px;
}

.tier-label {
    font-size: 0.8rem;
    color: #a0a0b0;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.tier-score {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 5px 0;
}

.tier-score .max-score {
    font-size: 1rem;
    color: #666;
    font-weight: normal;
}

.tier-rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.tier-desc {
    font-style: italic;
    color: #d0d0d0;
    font-size: 0.9rem;
}

/* Locked Teaser Mode */
.locked-mode {
    display: block !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px dashed rgba(255, 255, 255, 0.2) !important;
}

.locked-blur-area {
    position: relative;
    height: 250px;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fake Chart BG */
.fake-chart-placeholder {
    position: absolute;
    width: 60%;
    height: 60%;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTAwLDIwIEwxODAsOTAgTTE2MCwxODAgTDQwLDE4MCBMMjAsOTAgWiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJyZ2JhKDI1NSwyNTUsMjU1LDAuMSkiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPg==') no-repeat center center;
    background-size: contain;
    filter: blur(5px);
    opacity: 0.5;
}

.lock-overlay {
    position: relative;
    z-index: 10;
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 20px 40px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lock-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.unlock-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: var(--accent-secondary);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(106, 17, 203, 0.4);
}

.unlock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(106, 17, 203, 0.6);
}

/* =========================================
   Innovation UI Styles
   ========================================= */

.btn-pipe-code {
    width: 100%;
    padding: 10px;
    background: #0f172a;
    border: 1px solid #10b981;
    color: #10b981;
    font-family: 'Consolas', monospace;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 5px;
}

.btn-pipe-code:hover {
    background: #10b981;
    color: #0f172a;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

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

#btn-study-ai:hover {
    background: #00ffcc !important;
    color: #064e3b !important;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.4);
}

.toast-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 8px;
}

.toast-btn:hover {
    background: #fff;
    color: #000;
}

#ai-study-prompt {
    font-family: 'Consolas', monospace;
    letter-spacing: 2px;
}

.pipe-fill {
    transition: width 0.3s ease-out;
}