/* === Quiz Layout === */
.quiz-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    min-height: 100vh;
}

.quiz-screen,
.result-screen {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.hidden {
    display: none !important;
}

/* === Transitions === */
@keyframes quizFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: quizFadeIn 0.28s ease forwards;
}

/* === Header / Progress === */
.quiz-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 0 40px;
}

.quiz-back {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--text-dim);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.2s;
}

.quiz-back:hover {
    color: var(--text-muted);
}

.progress-container {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--fire);
    border-radius: 2px;
    transition: width 0.45s ease;
    width: 0%;
}

.progress-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    white-space: nowrap;
    flex-shrink: 0;
}

/* === Question === */
.question-container {
    /* fade-in class applied by JS */
}

.question-text {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.05rem, 2.8vw, 1.4rem);
    font-weight: 400;
    color: var(--text);
    line-height: 1.55;
    text-align: center;
    margin-bottom: 36px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* === Options Grid === */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.option-card {
    background: var(--bg-subtle);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 16px 18px;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    line-height: 1.55;
    text-align: left;
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        color 0.18s ease,
        background 0.18s ease,
        transform 0.12s ease;
}

.option-card:hover {
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-1px);
}

.option-card:active {
    transform: translateY(0);
}

.option-card.selected {
    border-color: var(--fire);
    color: var(--text);
    background: rgba(232, 100, 26, 0.07);
}

/* === Result Screen === */
.result-content {
    padding-top: 48px;
    text-align: center;
}

/* === Result Card === */
.result-card {
    border: 1px solid rgba(var(--element-color-rgb), 0.28);
    border-radius: 16px;
    padding: 44px 32px 36px;
    margin-bottom: 36px;
    background: rgba(var(--element-color-rgb), 0.05);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 340px;
    height: 340px;
    background: radial-gradient(
        ellipse at center,
        rgba(var(--element-color-rgb), 0.10) 0%,
        transparent 68%
    );
    pointer-events: none;
}

.result-avatar-img {
    width: 100%;
    max-width: 320px;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    margin: 0 auto 24px;
    display: block;
}

.result-element-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 10px;
    position: relative;
}

.result-element-name {
    font-family: 'Cinzel', serif;
    font-size: clamp(2.8rem, 9vw, 5rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 18px;
    position: relative;
}

.result-avatar-label {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    position: relative;
}

.result-secondary {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-top: 14px;
    letter-spacing: 0.02em;
    position: relative;
}

/* === Declaration === */
.result-declaration {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.92rem, 1.9vw, 1.02rem);
    line-height: 1.8;
    color: var(--text-muted);
    max-width: 540px;
    margin: 0 auto 32px;
    text-align: left;
}

/* === Combo Description === */
.result-combo-desc {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.88rem, 1.8vw, 0.96rem);
    line-height: 1.75;
    max-width: 540px;
    margin: 0 auto 36px;
    text-align: left;
    font-style: italic;
}

/* === Spark === */
.result-spark {
    background: var(--bg-subtle);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 20px 22px;
    margin-bottom: 36px;
    text-align: left;
}

.result-spark-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 9px;
}

.result-spark-blurb {
    font-family: 'Inter', sans-serif;
    font-size: 0.93rem;
    color: var(--text-muted);
    line-height: 1.65;
}

/* === Actions === */
.result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto 20px;
}

.result-cta {
    display: block;
    padding: 13px 22px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.18s ease, transform 0.12s ease;
    border: none;
    width: 100%;
    letter-spacing: 0.01em;
}

.result-cta:hover {
    opacity: 0.82;
    transform: translateY(-1px);
}

.result-cta:active {
    transform: translateY(0);
}

/* result-cta-primary gets bg/color set inline by JS (per-element) */

.result-cta-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.13);
    color: var(--text-muted);
}

.result-cta-ghost {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 0.82rem;
    padding: 6px;
}

/* === Footer links === */
.result-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.result-footer button,
.result-footer a {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    color: var(--text-dim);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.18s;
}

.result-footer button:hover,
.result-footer a:hover {
    color: var(--text-muted);
}

.result-footer-sep {
    color: var(--text-dim);
    font-size: 0.78rem;
}

.copy-feedback {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 10px;
    min-height: 1.2em;
    transition: opacity 0.2s;
}

/* === Responsive === */
@media (max-width: 600px) {
    .quiz-screen,
    .result-screen {
        padding: 0 16px 60px;
    }

    .quiz-header {
        padding: 18px 0 32px;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .result-card {
        padding: 32px 20px 28px;
    }

    .result-actions {
        max-width: 100%;
    }

    .result-declaration {
        text-align: center;
    }

    .result-spark {
        text-align: center;
    }
}
