:root {
    --bg1: #0f172a;
    --bg2: #0b5d52;
    --card: rgba(255, 255, 255, .10);
    --card2: rgba(255, 255, 255, .14);
    --border: rgba(255, 255, 255, .18);
    --text: #f8fafc;
    --muted: #cbd5e1;
    --primary: #22c55e;
    --secondary: #60a5fa;
    --accent: #f97316;
    --danger: #ef4444;
    --shadow: 0 24px 70px rgba(0, 0, 0, .35);
    --radius: 24px;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, .26), transparent 30%),
        radial-gradient(circle at top right, rgba(96, 165, 250, .25), transparent 28%),
        linear-gradient(135deg, var(--bg1), var(--bg2));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

.card {
    width: min(100%, 780px);
    background: linear-gradient(180deg, var(--card2), var(--card));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
    position: relative;
}

.topbar {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, .04);
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand h1 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: .2px;
}

.brand small {
    color: var(--muted);
}

.pill {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: .9rem;
}

.content {
    padding: 24px;
}

.hidden {
    display: none !important
}

.fade-in {
    animation: fadeIn .35s ease
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

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

h2 {
    margin: 0 0 10px;
    font-size: clamp(1.4rem, 3vw, 2rem);
    line-height: 1.2;
}

p {
    color: var(--muted);
    line-height: 1.65
}

.grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 720px) {
    .grid {
        grid-template-columns: 1fr
    }

    .content {
        padding: 18px
    }
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.field label {
    font-size: .92rem;
    font-weight: 600;
    color: #e2e8f0;
}

.field input {
    width: 100%;
    border: none;
    outline: none;
    padding: 14px 15px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .92);
    color: #0f172a;
    font-size: 1rem;
    font-family: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.field input[readonly] {
    background: #edf2f7;
    color: #475569;
}

.section-box {
    background: rgba(255, 255, 255, .08);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px;
    margin-top: 18px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.stat {
    background: rgba(255, 255, 255, .08);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    text-align: center;
}

.stat strong {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 4px;
    color: #fff;
}

.stat span {
    color: var(--muted);
    font-size: .9rem;
}



.btn {
    appearance: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    padding: 14px 18px;
    border-radius: 999px;
    transition: .2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 10px 25px rgba(34, 197, 94, .25);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    box-shadow: 0 10px 25px rgba(249, 115, 22, .20);
}

.btn-danger {
    background: linear-gradient(135deg, #f43f5e, #ef4444);
    color: white;
    box-shadow: 0 10px 25px rgba(239, 68, 68, .2);
}

.btn-ghost {
    background: rgba(255, 255, 255, .08);
    color: white;
    border: 1px solid var(--border);
}

.btn:hover {
    transform: translateY(-2px)
}

.btn:active {
    transform: translateY(0) scale(.98)
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.quiz-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.progress {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, .12);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 18px;
}

.progress>div {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: inherit;
    transition: width .25s ease;
}



.timer.critical {
    border-color: var(--danger);
    color: #fff;
    animation: pulse .9s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.06)
    }

    100% {
        transform: scale(1)
    }
}

.question {
    font-size: clamp(1.15rem, 2.4vw, 1.6rem);
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 16px;
    color: #fff;
}

.options {
    display: grid;
    gap: 12px;
}

/* ==========================================================================
   🎯 UPDATED QUIZ OPTIONS UTILITIES (W3Schools Style Integration)
   ========================================================================== */

.options {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

/* Base style for single quiz option button */
.quiz-option-btn {
    width: 100%;
    text-align: left;
    border-radius: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: .2s ease;
}

/* Hover dynamic micro-interaction */
.quiz-option-btn:hover:not(:disabled) {
    transform: translateX(4px);
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .35);
}

/* Click states triggered dynamically by JavaScript */
.quiz-option-btn.correct-choice {
    background: rgba(34, 197, 94, .25) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.2);
    color: #fff;
    font-weight: 600;
}

.quiz-option-btn.wrong-choice {
    background: rgba(239, 68, 68, .25) !important;
    border-color: var(--danger) !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
    color: #fff;
}

/* Disable pointer events once clicked to lock choice */
.quiz-option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

/* ==========================================================================
   📊 END RESULT CARD MATRIX STRUCTURE 
   ========================================================================== */

.quiz-result-card {
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Global status text updates */
.pass {
    color: #4ade80;
    font-weight: 700;
}

.fail {
    color: #fb7185;
    font-weight: 700;
}