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

:root {
    --primary:      #e91e8c;
    --secondary:    #7c3aed;
    --card-bg:      rgba(255, 255, 255, 0.06);
    --card-border:  rgba(255, 255, 255, 0.08);
    --text:         #f2f2f8;
    --muted:        #8888aa;
}

html, body { height: 100%; }

body {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #1a0a2e 50%, #24243e 100%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Background hearts ──────────────────────────────────────────────────── */

#bg-hearts {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-heart {
    position: absolute;
    bottom: -30px;
    color: var(--primary);
    animation: bgFloat linear infinite;
    user-select: none;
}

@keyframes bgFloat {
    0%   { transform: translateY(0);        opacity: 0; }
    5%   { opacity: 1; }
    95%  { opacity: 1; }
    100% { transform: translateY(-108vh);   opacity: 0; }
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

#app {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 24px 16px;
}

footer {
    text-align: center;
    padding: 16px;
    position: relative;
    z-index: 1;
}

footer a {
    color: rgba(255, 255, 255, 0.18);
    text-decoration: none;
    font-size: 0.72em;
    letter-spacing: 0.14em;
    transition: color 150ms;
}

footer a:hover { color: rgba(255, 255, 255, 0.48); }

/* ── Screen ─────────────────────────────────────────────────────────────── */

.screen {
    width: 100%;
    max-width: 520px;
}

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

@keyframes enterFromLeft {
    from { opacity: 0; transform: translateX(-28px); }
    to   { opacity: 1; transform: translateX(0);     }
}

/* ── Card ───────────────────────────────────────────────────────────────── */

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 24px;
    padding: 36px 32px;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ── Progress bar ───────────────────────────────────────────────────────── */

.progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-bottom: 18px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 10px;
    transition: width 400ms ease;
}

/* ── Welcome ────────────────────────────────────────────────────────────── */

.welcome-screen .card {
    text-align: center;
    padding: 48px 36px;
}

.welcome-icon {
    font-size: 3.2em;
    display: block;
    margin-bottom: 20px;
    animation: gentlePulse 3s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1);    }
    50%       { transform: scale(1.1); }
}

.welcome-screen h1 {
    font-size: 1.75em;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 14px;
}

.highlight {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-sub {
    color: var(--muted);
    font-size: 0.9em;
    line-height: 1.65;
    margin-bottom: 32px;
}

/* ── Question ───────────────────────────────────────────────────────────── */

.step-tag {
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 10px;
    min-height: 1.2em;
}

.question-screen h2 {
    font-size: 1.25em;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 22px;
}

/* ── Options ────────────────────────────────────────────────────────────── */

.options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.option-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: var(--text);
    padding: 13px 18px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 180ms, border-color 180ms, transform 150ms, box-shadow 180ms;
}

.option-btn:hover {
    background: rgba(233, 30, 140, 0.1);
    border-color: rgba(233, 30, 140, 0.38);
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(233, 30, 140, 0.18);
}

.option-btn:active {
    transform: translateY(0);
    background: rgba(233, 30, 140, 0.18);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 13px 28px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(233, 30, 140, 0.35);
    transition: transform 180ms, box-shadow 180ms;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(233, 30, 140, 0.48);
}

.btn-primary:active { transform: translateY(0); }

.btn-large {
    padding: 15px 36px;
    font-size: 1em;
}

.btn-secondary {
    display: inline-block;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 13px 28px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background 180ms, transform 150ms;
    text-decoration: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.13);
    transform: translateY(-1px);
}

.btn-back {
    background: none;
    border: none;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.82em;
    cursor: pointer;
    padding: 6px 0;
    display: block;
    transition: color 150ms;
}

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

.btn-link {
    color: var(--muted);
    font-size: 0.82em;
    text-decoration: none;
    padding: 8px;
    display: block;
    transition: color 150ms;
}

.btn-link:hover { color: var(--text); }

/* ── Results ────────────────────────────────────────────────────────────── */

.results-screen .card { text-align: center; }

.results-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin-bottom: 8px;
}

.result-pct {
    font-size: 4.5em;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    min-height: 1.1em;
    font-variant-numeric: tabular-nums;
}

.result-desc {
    color: var(--muted);
    font-size: 0.87em;
    margin-bottom: 24px;
    min-height: 1.4em;
}

/* ── Hearts grid ────────────────────────────────────────────────────────── */

.hearts-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
    width: 200px;
    margin: 0 auto 12px;
}

.heart {
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    transform: rotate(-45deg);
}

.heart::before,
.heart::after {
    content: '';
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    position: absolute;
}

.heart::before { top: -7px; left: 0;   }
.heart::after  { left: 7px; top: 0;    }

.heart.lit {
    background: var(--primary);
    animation: heartPop 350ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.heart.lit::before,
.heart.lit::after {
    background: var(--primary);
}

@keyframes heartPop {
    from { transform: rotate(-45deg) scale(0); }
    to   { transform: rotate(-45deg) scale(1); }
}

.result-count {
    color: var(--muted);
    font-size: 0.85em;
    margin-bottom: 28px;
    min-height: 1.4em;
}

.result-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* ── Sources page ───────────────────────────────────────────────────────── */

.sources-title {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 20px;
}

.sources-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sources-list li {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.88em;
    color: var(--muted);
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .card             { padding: 28px 20px; border-radius: 20px; }
    .welcome-screen .card { padding: 36px 24px; }
    .welcome-screen h1    { font-size: 1.45em; }
    .question-screen h2   { font-size: 1.1em;  }
    .result-pct           { font-size: 3.5em;  }

    .hearts-grid { width: 160px; }
    .heart { width: 11px; height: 11px; }
    .heart::before,
    .heart::after { width: 11px; height: 11px; }
    .heart::before { top: -5.5px; }
    .heart::after  { left: 5.5px; }
}
