:root {
    --quiz-bg-start: #141e30;
    --quiz-bg-end:   #243b55;
    --quiz-accent:   #ffbc42;
    --quiz-primary:  #4c6fff;
    --quiz-option-bg: rgba(255, 255, 255, 0.03);
    --quiz-option-border: rgba(255, 255, 255, 0.12);
    --quiz-text-main: #f9fbff;
    --quiz-text-muted: #a8b2cc;
    --quiz-card-bg: rgba(10, 17, 32, 0.9);
    --quiz-radius: 1.75rem;
    --quiz-text-soft-muted: rgba(255, 255, 255, 0.3);
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--quiz-text-main);
    margin: 0;
}

/* Background wrapper */
.quiz-bg {
    background: radial-gradient(circle at top left, #31456a 0, transparent 50%),
                radial-gradient(circle at bottom right, #141e30 0, #050814 60%);
    padding: 1.5rem;
}

/* Main card */
.quiz-card {
    max-width: 720px;
    width: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border-radius: var(--quiz-radius);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(18px);
}

/* Inner padding */
.quiz-card-inner {
    padding: 1.8rem 2rem 1.5rem;
}

/* Header */
.logo-wrap {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    padding: 3px;
    background: conic-gradient(from 160deg, #ffbc42, #ff6b6b, #4c6fff, #ffbc42);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    border: 2px solid rgba(10, 15, 30, 0.8);
}

.quiz-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

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

/* Footer */
.quiz-footer {
    border-top: 1px solid rgba(138, 137, 137, 0.461);
    padding-top: 0.75rem;
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--quiz-text-soft-muted);
}

/* Landing highlight box */
.landing-highlight {
    border-radius: 1.1rem;
    padding: 1rem 1.25rem;
    background: radial-gradient(circle at top left, rgba(255,255,255,0.12), transparent 60%),
                rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.18);
    display: inline-block;
    color: var(--quiz-text-main);
    text-align: left;
}

/* Buttons */
.quiz-btn-main {
    padding-inline: 2.5rem;
    padding-block: 0.9rem;
    font-weight: 600;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--quiz-primary), #8f6fff);
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
    color: #ffffff;
}

.quiz-btn-next {
    padding-inline: 1.7rem;
    padding-block: 0.6rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--quiz-primary), #4cffdf);
    border: none;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.quiz-btn-main:hover,
.quiz-btn-next:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
}

/* Progress bar */
.quiz-progress span {
    font-size: 0.85rem;
    color: var(--quiz-text-muted);
}

.progress {
    background-color: rgba(255,255,255,0.08);
    height: 0.55rem;
}

.progress-bar {
    background: linear-gradient(90deg, #4cffdf, #4c6fff);
    border-radius: 999px;
}

/* Question block */
.question-block {
    margin-top: 1.3rem;
}

.question-text {
    font-size: 1.2rem;
    line-height: 1.4;
}

/* Options */
.quiz-option {
    background: var(--quiz-option-bg);
    border: 1px solid var(--quiz-option-border);
    color: var(--quiz-text-main);
    border-radius: 0.9rem !important;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease, transform 0.05s ease;
}

.quiz-option input[type="radio"] {
    accent-color: var(--quiz-primary);
}

.quiz-option:hover {
    border-color: var(--quiz-primary);
    background: rgba(76, 111, 255, 0.1);
    transform: translateY(-1px);
}

/* Result */
.result-message {
    font-size: 1rem;
    color: var(--quiz-text-main);
}

/* Fireworks canvas (overlay) */
#fireworks-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 20;
}

/* ===========================
   RESPONSIVE TWEAKS
   =========================== */

/* Tablets and below */
@media (max-width: 992px) {
    .quiz-bg {
        padding: 1rem;
    }

    .quiz-card {
        max-width: 95vw;
    }

    .quiz-card-inner {
        padding: 1.4rem 1.4rem 1.1rem;
    }

    .quiz-title {
        font-size: 1.2rem;
    }

    .quiz-subtitle {
        font-size: 0.85rem;
    }

    .question-text {
        font-size: 1.1rem;
    }
}

/* Phones */
@media (max-width: 576px) {
    .quiz-bg {
        padding: 0.75rem;
    }

    .quiz-card {
        border-radius: 1.2rem;
        box-shadow: 0 10px 24px rgba(0,0,0,0.6);
    }

    .quiz-card-inner {
        padding: 1.2rem 1.1rem 1rem;
    }

    header {
        text-align: left;
    }

    .logo-wrap {
        width: 44px;
        height: 44px;
    }

    .quiz-title {
        font-size: 1.05rem;
    }

    .quiz-subtitle {
        font-size: 0.78rem;
    }

    .landing-highlight {
        width: 100%;
        font-size: 0.9rem;
        padding: 0.9rem 0.9rem;
    }

    .quiz-btn-main,
    .quiz-btn-next {
        width: 100%;
        justify-content: center;
        display: inline-flex;
    }

    .question-text {
        font-size: 1rem;
    }

    .quiz-option {
        padding: 0.6rem 0.7rem;
        font-size: 0.95rem;
    }

    .quiz-footer {
        margin-top: 1.4rem;
        font-size: 0.75rem;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    .quiz-card-inner {
        padding: 1rem 0.9rem 0.9rem;
    }

    .quiz-title {
        font-size: 1rem;
    }

    .quiz-subtitle {
        font-size: 0.75rem;
    }

    .question-text {
        font-size: 0.95rem;
    }

    .landing-highlight {
        font-size: 0.85rem;
    }
}

.quiz-btn-secondary {
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    border: 2px solid #ffffff;
    color: #ffffff;
    font-weight: 600;
    transition: 0.15s ease;
}

.quiz-btn-secondary:hover {
    background: rgba(255,255,255,0.15);
    color: #ffffff;
}

.msg-success {
    color: #c9c9c9;
}

.msg-fail {
    color: #c9c9c9;
}

/* Full-screen Nazgûl attack overlay */
.nazgul-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    opacity: 0;
    pointer-events: none;
    z-index: 99999;
    transition: opacity 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f8f9fa;
    text-align: center;
    padding: 1.5rem;
    box-sizing: border-box;
    font-family: inherit;
}

.nazgul-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.nazgul-overlay-message {
    max-width: 600px;
    font-size: 1.05rem;
}

/* Nazgûl flying across the screen */
.nazgul-fly {
    position: absolute;
    top: 20vh;          /* vertical position of the flight path */
    left: -40vw;        /* start off-screen to the left */
    width: 35vw;
    max-width: 500px;
    pointer-events: none;
    opacity: 0;
    animation: nazgulFly 3.5s linear forwards;
    animation-play-state: paused;   /* start paused, resume when overlay shows */
}

/* When overlay becomes visible, start the flight */
.nazgul-overlay.show .nazgul-fly {
    animation-play-state: running;
}

/* Keyframes for flight from left to right */
@keyframes nazgulFly {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(160vw);  /* fly far to the right */
        opacity: 0;
    }
}

/* Flying One Ring (base) */
.one-ring-fly {
    position: fixed;
    top: 20vh;              /* overridden by JS */
    width: 80px;
    max-width: 100px;
    pointer-events: auto;
    z-index: 100000;
    opacity: 1;
}

/* Left → Right */
.one-ring-left-to-right {
    left: -15vw;            /* start off-screen on the left */
    animation: oneRingFlyLR 5s linear forwards;
}

/* Right → Left */
.one-ring-right-to-left {
    right: -15vw;           /* start off-screen on the right */
    animation: oneRingFlyRL 5s linear forwards;
}

/* Flight animation: left -> right */
@keyframes oneRingFlyLR {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(140vw);
        opacity: 0;
    }
}

/* Flight animation: right -> left */
@keyframes oneRingFlyRL {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-140vw);
        opacity: 0;
    }
}

/* Big cursed announcement overlay */
.ring-curse-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 100002;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.ring-curse-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.ring-curse-content {
    max-width: 480px;
    padding: 2rem 2.5rem;
    background: radial-gradient(circle at top, #2b1b08 0, #000 70%);
    border-radius: 24px;
    border: 1px solid #f1c40f;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    text-align: center;
    color: #f8f9fa;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.ring-curse-overlay.show .ring-curse-content {
    transform: scale(1);
}

.ring-curse-title {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    color: #f1c40f;
}

.ring-curse-text {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.ring-curse-btn {
    padding: 0.55rem 1.4rem;
    border-radius: 999px;
    border: none;
    background: #f1c40f;
    color: #000;
    font-weight: 600;
    cursor: pointer;
}
