:root {
    /* Dreamy twilight palette */
    --deep-1: #1a1033;
    --deep-2: #2d1b4e;
    --plum: #3d2466;
    --lavender: #c9b6ff;
    --rose: #ffb8d9;
    --peach: #ffd6a5;
    --ring-gold: #ffe29a;
    --planet-1: #ffb3c6;
    --planet-2: #d49bff;
    --mint: #a8f0e8;
    --text: #f4ecff;
    --text-soft: #c8b8e8;
    --card-bg: rgba(45, 27, 78, 0.55);
    --card-border: rgba(201, 182, 255, 0.25);
    --correct: #7ee8b0;
    --correct-bg: rgba(126, 232, 176, 0.16);
    --wrong: #ff9ab0;
    --wrong-bg: rgba(255, 154, 176, 0.16);
}

* { box-sizing: border-box; }

body {
    background: radial-gradient(ellipse at 50% -10%, var(--plum) 0%, var(--deep-2) 40%, var(--deep-1) 100%);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Quicksand', sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* ---------- Cosmos background ---------- */
.cosmos {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle var(--dur, 3s) ease-in-out infinite;
    opacity: 0.8;
}
@keyframes twinkle {
    0%, 100% { opacity: 0.15; transform: scale(0.7); }
    50% { opacity: 1; transform: scale(1.2); }
}
.nebula {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    z-index: 0;
    pointer-events: none;
}
.nebula-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, var(--rose), transparent 70%);
    top: -150px; left: -120px;
    animation: drift 22s ease-in-out infinite;
}
.nebula-2 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--planet-2), transparent 70%);
    bottom: -200px; right: -150px;
    animation: drift 28s ease-in-out infinite reverse;
}
@keyframes drift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, 30px); }
}

/* ---------- Hero ---------- */
.hero {
    text-align: center;
    padding: 50px 20px 20px;
    z-index: 2;
    position: relative;
}

.saturn-stage {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 10px;
}

/* The cute-but-realistic Saturn (pure CSS) */
.saturn {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 10px auto 0;
    animation: float 6s ease-in-out infinite;
    transform: rotate(-12deg);
}
.saturn-planet {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 118px;
    height: 118px;
    border-radius: 50%;
    overflow: hidden;
    background:
        radial-gradient(circle at 32% 26%, #fff3d6 0%, #ffe1a8 18%, #f6c47a 46%, #e0a256 72%, #b97c3e 100%);
    box-shadow:
        inset -16px -18px 34px rgba(120, 66, 28, 0.55),
        inset 10px 10px 22px rgba(255, 244, 214, 0.35),
        0 0 38px rgba(255, 210, 140, 0.45),
        0 0 80px rgba(244, 196, 122, 0.30);
    z-index: 3;
}
/* atmospheric bands */
.band {
    position: absolute;
    left: -10%;
    width: 120%;
    border-radius: 50%;
    opacity: 0.5;
    filter: blur(1px);
}
.band-1 { top: 30%; height: 9px;  background: rgba(180, 110, 50, 0.55); }
.band-2 { top: 48%; height: 13px; background: rgba(255, 235, 190, 0.45); }
.band-3 { top: 66%; height: 8px;  background: rgba(150, 90, 40, 0.5); }
/* shadow the rings cast across the planet */
.ring-shadow {
    position: absolute;
    top: 42%; left: -10%;
    width: 120%; height: 16px;
    background: rgba(80, 45, 20, 0.45);
    filter: blur(4px);
    transform: rotate(0deg);
    z-index: 4;
}
.shine {
    position: absolute;
    top: 14%; left: 20%;
    width: 34px; height: 22px;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    filter: blur(6px);
    z-index: 5;
}

/* Rings — split into back (behind planet) and front (over planet) halves */
.ring {
    position: absolute;
    top: 50%; left: 50%;
    width: 210px;
    height: 210px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background:
        repeating-radial-gradient(circle,
            transparent 0 38px,
            rgba(255, 236, 196, 0.0) 38px 50px,
            rgba(214, 168, 110, 0.85) 50px 54px,
            rgba(255, 240, 205, 0.9) 54px 60px,
            rgba(190, 140, 88, 0.55) 60px 66px,
            rgba(255, 232, 188, 0.85) 66px 74px,
            rgba(160, 112, 66, 0.4) 74px 80px,
            rgba(255, 240, 210, 0.75) 80px 88px,
            transparent 88px 200px);
    /* tilt the ring plane */
    transform: translate(-50%, -50%) rotateX(74deg);
    transform-origin: center;
    pointer-events: none;
}
/* show only the rear half of the ring behind the planet */
.ring-back  { z-index: 1; clip-path: inset(0 0 50% 0); }
/* show only the front half of the ring over the planet's lower body */
.ring-front { z-index: 4; clip-path: inset(50% 0 0 0); }

/* face */
.eye {
    position: absolute;
    width: 12px; height: 15px;
    background: #5a341a;
    border-radius: 50%;
    top: 46px;
    z-index: 6;
    animation: blink 5s infinite;
}
.eye-l { left: 40px; }
.eye-r { right: 40px; }
.eye::after {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 4px; height: 4px;
    background: #fff;
    border-radius: 50%;
}
@keyframes blink {
    0%, 92%, 100% { transform: scaleY(1); }
    96% { transform: scaleY(0.1); }
}
.cheek {
    position: absolute;
    width: 17px; height: 11px;
    background: rgba(255, 130, 120, 0.5);
    border-radius: 50%;
    top: 62px;
    z-index: 6;
    filter: blur(1.5px);
}
.cheek-l { left: 28px; }
.cheek-r { right: 28px; }
.mouth {
    position: absolute;
    top: 64px; left: 50%;
    transform: translateX(-50%);
    width: 18px; height: 9px;
    border-bottom: 3px solid #5a341a;
    border-radius: 0 0 12px 12px;
    z-index: 6;
}

@keyframes float {
    0%, 100% { transform: rotate(-12deg) translateY(0); }
    50% { transform: rotate(-12deg) translateY(-16px); }
}

/* ---------- Couple scene: Mercury (you) + Saturn (her) ---------- */
.saturn-stage.couple {
    width: 360px;
    height: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    position: relative;
}
.saturn-stage.couple .saturn {
    width: 200px;
    height: 200px;
    margin: 0;
    margin-left: -18px;
}

/* Mercury = you */
.mercury {
    position: relative;
    width: 130px;
    height: 130px;
    flex-shrink: 0;
    animation: floatMercury 6s ease-in-out infinite;
    z-index: 4;
    margin-right: -6px;
}
@keyframes floatMercury {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}
.mercury-planet {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
    background:
        radial-gradient(circle at 34% 28%, #e9e4dc 0%, #c9c2b8 30%, #9a948b 62%, #6f6a63 100%);
    box-shadow:
        inset -10px -12px 22px rgba(40, 38, 34, 0.6),
        inset 8px 8px 16px rgba(255, 255, 255, 0.25),
        0 0 26px rgba(190, 184, 175, 0.35);
}
.crater {
    position: absolute;
    border-radius: 50%;
    background: rgba(80, 76, 70, 0.45);
    box-shadow: inset 1px 1px 3px rgba(30,28,25,0.6), inset -1px -1px 2px rgba(255,255,255,0.15);
}
.crater-1 { width: 16px; height: 16px; top: 22px; left: 18px; }
.crater-2 { width: 10px; height: 10px; top: 52px; left: 44px; }
.crater-3 { width: 7px;  height: 7px;  top: 30px; left: 62px; }
.m-eye {
    position: absolute;
    width: 9px; height: 12px;
    background: #3a3631;
    border-radius: 50%;
    top: 59px;
    z-index: 3;
    animation: blink 5s infinite 0.4s;
}
.m-eye-l { left: 42px; }
.m-eye-r { right: 42px; }
.m-eye::after {
    content: "";
    position: absolute; top: 2px; left: 2px;
    width: 3px; height: 3px; background: #fff; border-radius: 50%;
}
.m-mouth {
    position: absolute;
    top: 76px; left: 50%;
    transform: translateX(-50%);
    width: 30px; height: 15px;
    border-bottom: 3px solid #3a3631;
    border-radius: 0 0 10px 10px;
    z-index: 3;
}
.m-shine {
    position: absolute;
    top: 12%; left: 22%;
    width: 22px; height: 14px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    filter: blur(5px);
    z-index: 2;
}

/* the heart pulsing between the two planets */
.love-heart {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.4rem;
    z-index: 6;
    filter: drop-shadow(0 0 8px rgba(255, 150, 190, 0.8));
    animation: heartbeat 1.8s ease-in-out infinite;
}
@keyframes heartbeat {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
    25% { transform: translate(-50%, -50%) scale(1.25); opacity: 1; }
    40% { transform: translate(-50%, -50%) scale(1.05); }
}

.couple-label {
    font-family: 'Fredoka', sans-serif;
    font-size: 0.9rem;
    margin: 4px 0 0;
    letter-spacing: 0.5px;
}
.couple-label .me  { color: #d8d2c8; }
.couple-label .her { color: var(--ring-gold); }

/* little orbiting hearts/dots */
.orbit-dot {
    position: absolute;
    top: 50%; left: 50%;
    width: 8px; height: 8px;
    margin: -4px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 10px var(--mint);
}
.orbit-dot-1 { animation: orbit 7s linear infinite; }
.orbit-dot-2 { animation: orbit 11s linear infinite reverse; background: var(--peach); box-shadow: 0 0 10px var(--peach); }
@keyframes orbit {
    from { transform: rotate(0deg) translateX(105px); }
    to   { transform: rotate(360deg) translateX(105px); }
}

.eyebrow {
    font-family: 'Fredoka', sans-serif;
    color: var(--rose);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.85rem;
    margin: 8px 0 0;
}
.quote {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    color: var(--text);
    font-size: 2rem;
    line-height: 1.3;
    max-width: 620px;
    margin: 14px auto 6px;
    text-shadow: 0 0 24px rgba(201, 182, 255, 0.5);
}
.subtitle {
    color: var(--text-soft);
    font-size: 0.95rem;
    margin: 6px auto 0;
    font-weight: 500;
}

/* ---------- Card ---------- */
#quiz-container { z-index: 2; position: relative; width: 100%; display: flex; justify-content: center; }
.card {
    background: var(--card-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--card-border);
    border-radius: 26px;
    padding: 30px 28px 32px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(15, 8, 35, 0.6), inset 0 1px 0 rgba(255,255,255,0.08);
    margin: 20px 0 50px;
    animation: cardIn 0.5s ease both;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.hidden { display: none; }

/* progress */
.progress-wrap { margin-bottom: 22px; }
.progress-meta {
    display: flex;
    justify-content: space-between;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.9rem;
    color: var(--text-soft);
    margin-bottom: 8px;
}
#live-score { color: var(--ring-gold); }
.progress-track {
    height: 8px;
    background: rgba(201, 182, 255, 0.15);
    border-radius: 99px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 5%;
    background: linear-gradient(90deg, var(--rose), var(--planet-2), var(--mint));
    border-radius: 99px;
    transition: width 0.5s cubic-bezier(.4,0,.2,1);
}

#question-text {
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
    font-size: 1.3rem;
    line-height: 1.45;
    margin: 0 0 6px;
    color: var(--text);
}
.hint {
    color: var(--mint);
    font-size: 0.85rem;
    margin: 0 0 18px;
    font-weight: 600;
    min-height: 1em;
}

/* options */
.option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: rgba(201, 182, 255, 0.06);
    border: 1.5px solid rgba(201, 182, 255, 0.22);
    color: var(--text);
    padding: 15px 16px;
    margin: 11px 0;
    border-radius: 16px;
    cursor: pointer;
    text-align: left;
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    transition: transform 0.18s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.option-btn .marker {
    flex-shrink: 0;
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 2px solid var(--lavender);
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    transition: all 0.25s ease;
}
.option-btn:hover:not(.locked) {
    transform: translateX(4px);
    border-color: var(--rose);
    box-shadow: 0 0 18px rgba(255, 184, 217, 0.25);
}
.option-btn.selected {
    background: rgba(255, 184, 217, 0.14);
    border-color: var(--rose);
}
.option-btn.selected .marker {
    background: var(--rose);
    border-color: var(--rose);
    color: var(--deep-1);
}
.option-btn.selected .marker::after { content: "★"; }
.option-btn.correct {
    background: var(--correct-bg);
    border-color: var(--correct);
}
.option-btn.correct .marker { background: var(--correct); border-color: var(--correct); color: var(--deep-1); }
.option-btn.correct .marker::after { content: "✓"; }
.option-btn.wrong {
    background: var(--wrong-bg);
    border-color: var(--wrong);
}
.option-btn.wrong .marker { background: var(--wrong); border-color: var(--wrong); color: var(--deep-1); }
.option-btn.wrong .marker::after { content: "✕"; }
.option-btn.locked { cursor: default; }

/* buttons */
#submit-btn, #restart-btn {
    background: linear-gradient(135deg, var(--rose), var(--planet-2));
    color: var(--deep-1);
    border: none;
    padding: 16px 30px;
    font-size: 1.05rem;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    border-radius: 16px;
    cursor: pointer;
    margin-top: 22px;
    width: 100%;
    box-shadow: 0 8px 24px rgba(212, 155, 255, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
#submit-btn:hover, #restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(212, 155, 255, 0.55);
    filter: brightness(1.05);
}
#submit-btn:active, #restart-btn:active { transform: translateY(0); }

/* ---------- Result ---------- */
#score-card { text-align: center; }
.result-saturn { margin-bottom: 6px; }
.saturn.small { width: 150px; height: 150px; margin: 0 auto; }
.saturn.small .saturn-planet { width: 88px; height: 88px; }
.saturn.small .ring { width: 158px; height: 158px; }
.saturn.small .eye { top: 34px; width: 10px; height: 12px; }
.saturn.small .eye-l { left: 30px; }
.saturn.small .eye-r { right: 30px; }
.saturn.small .mouth { top: 48px; width: 14px; }
.saturn.small .shine { top: 12%; left: 20%; width: 24px; height: 16px; }

#result-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.7rem;
    color: var(--ring-gold);
    margin: 14px 0 4px;
}
.score-line { color: var(--text-soft); margin: 0; font-weight: 600; }
.score-big {
    font-family: 'Fredoka', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    color: var(--text);
    margin: 4px 0;
    line-height: 1;
    text-shadow: 0 0 30px rgba(255, 184, 217, 0.5);
}
.score-total { font-size: 1.5rem; color: var(--text-soft); margin-left: 8px; }
.result-message {
    color: var(--lavender);
    font-size: 1.05rem;
    font-weight: 500;
    max-width: 420px;
    margin: 8px auto 0;
    line-height: 1.5;
}

.footer {
    z-index: 2;
    color: var(--text-soft);
    font-size: 0.85rem;
    padding: 0 0 30px;
    opacity: 0.7;
}

/* shooting star on correct */
.spark {
    position: fixed;
    font-size: 1.4rem;
    pointer-events: none;
    z-index: 99;
    animation: sparkUp 0.9s ease-out forwards;
}
@keyframes sparkUp {
    0% { opacity: 1; transform: translateY(0) scale(0.6) rotate(0deg); }
    100% { opacity: 0; transform: translateY(-90px) scale(1.3) rotate(40deg); }
}

@media (max-width: 600px) {
    .quote { font-size: 1.5rem; }
    .card { padding: 24px 20px 26px; }
    #question-text { font-size: 1.15rem; }
    .score-big { font-size: 3.2rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}