body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #1f1c2c, #928dab);
    color: #fff;
    text-align: center;
    margin: 0;
    padding: 0;
}

/* Quiz Container */
.quiz-container {
    max-width: 600px;
    width: 90%;
    margin: 60px auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 30px 25px;
    border-radius: 16px;
    box-shadow: 0px 8px 25px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

h2 {
    margin-bottom: 25px;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}

/* Animations */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeSlideIn 0.5s ease;
}

/* Logo + Title */
.logo-container {
    text-align: center;
    margin-bottom: 25px;
}

.logo {
    max-width: 90px;
    height: auto;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.7);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    animation: floatLogo 3s ease-in-out infinite;
}

.logo:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 0 25px rgba(0, 255, 255, 1);
}

@keyframes floatLogo {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.quiz-title {
    margin-top: 12px;
    font-size: 28px;
    font-weight: 700;
    color: #00f7ff;
    text-shadow: 0 0 5px #00f7ff, 0 0 20px #00e1ff, 0 0 30px #00cfff;
    letter-spacing: 1px;
    animation: glowText 2s ease-in-out infinite alternate;
}

@keyframes glowText {
    from {
        text-shadow: 0 0 10px #00f7ff, 0 0 20px #00e1ff, 0 0 30px #00cfff;
    }

    to {
        text-shadow: 0 0 20px #00f7ff, 0 0 40px #00e1ff, 0 0 60px #00cfff;
    }
}

/* Answers */
ul,
ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quiz-container ul li {
    margin: 0;
}

.answer-btn {
    display: block;
    width: 100%;
    max-width: 500px;
    margin: 12px auto;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.answer-btn:nth-child(1) {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.answer-btn:nth-child(2) {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.answer-btn:nth-child(3) {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

.answer-btn:nth-child(4) {
    background: linear-gradient(135deg, #1abc9c, #16a085);
}

.answer-btn:hover,
.answer-btn.selected {
    transform: scale(1.03);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.answer-btn:active {
    transform: scale(0.96);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-6px);
    }

    75% {
        transform: translateX(6px);
    }
}

.answer-btn.correct {
    background: #27ae60 !important;
}

.answer-btn.wrong {
    background: #e74c3c !important;
    animation: shake 0.3s;
}

/* Submit + Skip Buttons */
.btn-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

#submit,
#skip {
    padding: 12px 25px;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#submit {
    background: #28a745;
}

#submit:hover {
    background: #218838;
}

#submit:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
}

#skip {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

#skip:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

#skip:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

@media (max-width: 480px) {
    .btn-row {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    #submit,
    #skip {
        width: 80%;
        text-align: center;
    }
}

/* Restart Button */
.restart-btn {
    margin-top: 25px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #00f7ff, #007bff);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(0, 247, 255, 0.7), 0 0 25px rgba(0, 123, 255, 0.6);
    transition: all 0.3s ease;
    animation: pulseBtn 1.8s infinite alternate;
}

.restart-btn:hover {
    background: linear-gradient(135deg, #007bff, #0056b3);
    box-shadow: 0 0 20px rgba(0, 247, 255, 1), 0 0 35px rgba(0, 123, 255, 1);
    transform: scale(1.05);
}

@keyframes pulseBtn {
    from {
        transform: scale(1);
        box-shadow: 0 0 12px rgba(0, 247, 255, 0.5), 0 0 18px rgba(0, 123, 255, 0.4);
    }

    to {
        transform: scale(1.07);
        box-shadow: 0 0 22px rgba(0, 247, 255, 1), 0 0 40px rgba(0, 123, 255, 0.8);
    }
}

.restart-btn.success {
    background: linear-gradient(135deg, #28a745, #218838);
}

.restart-btn.fail {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* Timer */
#timer {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #f1c40f;
}

.time-warning {
    color: #ff4d4d;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
    animation: flash 0.8s infinite;
}

@keyframes flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Progress Bar */
.progress-container {
    display: flex;
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
    height: 14px;
}

.progress-segment {
    flex: 1;
    background: rgba(255, 255, 255, 0.3);
    transition: background 0.3s ease;
}

.progress-segment.correct {
    background: #27ae60;
    animation: flashGreen 0.6s ease;
}

@keyframes flashGreen {
    from {
        background: #2ecc71;
        opacity: 0.7;
    }

    to {
        background: #27ae60;
        opacity: 1;
    }
}

.progress-segment.wrong {
    background: #e74c3c;
}

.progress-segment.skipped {
    background: #f39c12;
}

.progress-container.recap {
    margin: 20px auto;
    height: 16px;
    max-width: 500px;
}

/* Summary */
.summary-list {
    list-style: none;
    padding: 0;
    margin: 20px auto;
    max-width: 500px;
    text-align: left;
}

.summary-item {
    background: rgba(255, 255, 255, 0.08);
    padding: 12px 14px;
    margin: 6px 0;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.summary-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.summary-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-detail {
    max-height: 0;
    overflow: hidden;
    font-size: 14px;
    color: #ddd;
    margin-top: 6px;
    line-height: 1.4;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

.summary-item.active .summary-detail {
    max-height: 300px;
    opacity: 1;
}

.summary-item.correct {
    border-left: 5px solid #27ae60;
    color: #27ae60;
}

.summary-item.wrong {
    border-left: 5px solid #e74c3c;
    color: #e74c3c;
}

.summary-item.skipped {
    border-left: 5px solid #f39c12;
    color: #f39c12;
}

.status {
    font-size: 18px;
}

#toggleAllBtn .arrow {
    display: inline-block;
    margin-left: 5px;
    transition: transform 0.4s ease;
}

/* Time Overlay */
.time-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    animation: fadeInOverlay 0.6s ease-out, screen-shake 0.6s;
}

.time-overlay .time-warning {
    color: #ff4d4d;
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    animation: flash 0.8s infinite, glow-explode 1s infinite, heartbeat 1.2s infinite;
}

@keyframes glow-explode {
    0% {
        text-shadow: 0 0 5px #ff0000;
        transform: scale(1);
    }

    50% {
        text-shadow: 0 0 30px #ff0000, 0 0 60px #ff4444;
        transform: scale(1.25);
    }

    100% {
        text-shadow: 0 0 5px #ff0000;
        transform: scale(1);
    }
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    20%,
    60% {
        transform: scale(1.3);
    }

    40%,
    80% {
        transform: scale(1.1);
    }
}

@keyframes screen-shake {

    0%,
    100% {
        transform: translate(0, 0);
    }

    20% {
        transform: translate(-12px, 0);
    }

    40% {
        transform: translate(12px, 0);
    }

    60% {
        transform: translate(-8px, 0);
    }

    80% {
        transform: translate(8px, 0);
    }
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}