:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-sans: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

#app {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* Background Animated Blobs */
#background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(80px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    animation: move 20s infinite alternate linear;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #7c3aed;
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #06b6d4;
    top: 40%;
    left: 60%;
    animation-delay: -10s;
}

@keyframes move {
    from {
        transform: translate(0, 0) rotate(0deg);
    }

    to {
        transform: translate(100px, 100px) rotate(360deg);
    }
}

/* Container & Layout */
#main-container {
    width: 100%;
    max-width: 800px;
    z-index: 10;
}

.view {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition-smooth);
}

.view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 1rem;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 2rem;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* Buttons */
.btn-primary {
    padding: 1rem 2.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.4);
}

/* Quiz Styles */
.progress-wrapper {
    margin-bottom: 3rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.progress-bar {
    height: 8px;
    background: var(--surface);
    border-radius: 4px;
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #818cf8);
    width: 0%;
    transition: width 0.6s ease;
}

.question-card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    padding: 3rem;
    border-radius: 2rem;
}

.question-card h2 {
    font-size: 1.75rem;
    margin-bottom: 2.5rem;
    text-align: center;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-btn {
    padding: 1.25rem 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    border-radius: 1rem;
    color: var(--text-main);
    text-align: left;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    transform: translateX(10px);
}

/* Loading Spinner */
.loader-content {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--surface);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    margin: 0 auto 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Result Styles */
.result-card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    padding: 4rem;
    border-radius: 2.5rem;
    text-align: center;
}

.type-code {
    font-size: 5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
    letter-spacing: 5px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.traits-container {
    margin-bottom: 3rem;
    text-align: left;
}

.type-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.type-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    text-align: left;
}

.traits-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
    text-align: left;
}

.trait-bar-container {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.25rem 1.5rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.trait-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
}

.bar-outer {
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-percentage-label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    pointer-events: none;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.bar-percentage-label.p1 {
    left: 8px;
}

.bar-percentage-label.p2 {
    right: 8px;
}

/* Dimension Colors */
.ei .bar-fill {
    background: linear-gradient(90deg, #6366f1, #818cf8);
}

.sn .bar-fill {
    background: linear-gradient(90deg, #ec4899, #f472b6);
}

.tf .bar-fill {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.jp .bar-fill {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.ei .trait-labels span:first-child {
    color: #818cf8;
}

.sn .trait-labels span:first-child {
    color: #f472b6;
}

.tf .trait-labels span:first-child {
    color: #34d399;
}

.jp .trait-labels span:first-child {
    color: #fbbf24;
}

.trait-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.analysis-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.analysis-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-smooth);
}

.analysis-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(99, 102, 241, 0.2);
}

.analysis-item h4 {
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.analysis-item p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.soulmate-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 2rem;
    border-radius: 1.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

.soulmate-banner h4 {
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.match-text {
    font-weight: 800;
    font-size: 2rem !important;
    background: linear-gradient(90deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 4px;
}

/* Responsive & Mobile Optimizations */
@media (max-width: 768px) {
    #app {
        padding: 1.5rem 1rem;
    }

    .hero {
        padding: 2rem 0.5rem;
    }

    h1 {
        font-size: 2.75rem;
        margin-bottom: 1rem;
    }

    .hero p {
        font-size: 1.1rem;
        margin-bottom: 2.5rem;
    }

    .question-card,
    .result-card {
        padding: 2rem 1.25rem;
        border-radius: 1.5rem;
    }

    .question-card h2 {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .option-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        border-radius: 0.875rem;
    }

    .option-btn:hover {
        transform: none;
        /* Disable hover movement on touch */
        background: rgba(255, 255, 255, 0.08);
    }

    .type-code {
        font-size: 3.5rem;
        letter-spacing: 3px;
    }

    .type-title {
        font-size: 1.75rem;
    }

    .analysis-sections {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .soulmate-banner {
        padding: 1.5rem;
    }

    .match-text {
        font-size: 1.5rem !important;
        letter-spacing: 2px;
    }

    .traits-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Extra small devices */
@media (max-width: 380px) {
    h1 {
        font-size: 2.25rem;
    }

    .type-code {
        font-size: 3rem;
    }

    .btn-primary {
        width: 100%;
        padding: 1rem;
    }
}

/* Footer */
footer {
    margin-top: auto;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}

/* Invitation Code Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #1e293b;
    padding: 2.5rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.modal-overlay.hidden .modal-content {
    transform: translateY(20px);
}

.modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: white;
    font-size: 1rem;
    text-align: center;
    outline: none;
    font-family: monospace;
    letter-spacing: 2px;
}

.input-group input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.3);
}

.error-msg {
    color: #ef4444 !important;
    font-size: 0.875rem !important;
    min-height: 1.25rem;
    margin-bottom: 0 !important;
}

.activation-help {
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

.activation-help a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.activation-help a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

```