/* ============================================================
   SCIENCE QUIZ — PREMIUM EMBOSSED STYLES
   With Result Score Card + Answer Key Table + Clean Print
   ============================================================ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #dde3ea;
    --surface: #eef2f7;
    --surface-raised: #f8fbfe;
    --text: #1f2a36;
    --text-heading: #2b3a4a;
    --text-muted: #5f6c7c;
    --highlight: #ffffff;
    --shadow: rgba(70, 85, 110, 0.3);
    --shadow-light: rgba(163, 177, 198, 0.5);
    --accent: #2b5f9e;
    --accent-hover: #1e4a7a;
    --accent-green: #34a060;
    --accent-red: #c94a4a;
    --accent-amber: #d97706;
    --accent-purple: #6d4a9e;
    --radius-sm: 0.5rem;
    --radius-md: 0.65rem;
    --radius-lg: 0.85rem;
    --radius-pill: 1.5rem;
    --transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: "Noto Sans Devanagari", 'Poppins', system-ui, sans-serif;
    background:
        radial-gradient(circle at 15% 20%, rgba(43, 95, 158, 0.05), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(42, 122, 75, 0.05), transparent 40%),
        linear-gradient(145deg, #d4dbe4, #e6ecf3);
    background-attachment: fixed;
    color: var(--text);
    margin: 0;
    padding: 4px;
    text-align: center;
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ============ CONTAINER ============ */
.quiz-container {
    max-width: 1000px;
    margin: 0.5rem auto;
    background: linear-gradient(145deg, #f8fbfe, #e3e9f0);
    padding: 1.25rem 1.15rem 1.35rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.95);
    position: relative;
    box-shadow:
        -8px -8px 20px var(--highlight),
        8px 8px 20px var(--shadow-light),
        10px 10px 26px var(--shadow),
        inset 2px 2px 0 var(--highlight),
        inset -2px -2px 0 rgba(0, 0, 0, 0.04);
}

.quiz-container h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-heading);
    margin: 0 auto 0.85rem;
    padding: 0 0.75rem 0.55rem;
    position: relative;
    display: inline-block;
    text-shadow: -1px -1px 2px #fff, 1px 1px 2px rgba(70, 85, 110, 0.12);
}

.quiz-container h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-green));
    border-radius: 2px;
}

/* ============ STATUS ROW ============ */
.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(145deg, #e3e9f0, #f1f5f9);
    box-shadow:
        inset -3px -3px 8px var(--highlight),
        inset 3px 3px 8px rgba(70, 85, 110, 0.15);
}

.progress-bar {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    background: linear-gradient(145deg, #f8fbfe, #eef2f7);
    box-shadow: -2px -2px 6px var(--highlight), 2px 2px 6px var(--shadow-light);
    white-space: nowrap;
}

.progress-bar span {
    font-weight: 800;
    color: var(--text-heading);
}

.timer-wrapper {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1;
    max-width: 320px;
    margin-left: auto;
}

.timer-text {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent-green);
    min-width: 32px;
    text-align: right;
    font-family: 'Poppins', sans-serif;
    transition: color 0.4s ease;
}

.timer-text.warning {
    color: var(--accent-amber);
}

.timer-text.danger {
    color: var(--accent-red);
}

.timer-bar-track {
    flex: 1;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(145deg, #d8e0ea, #eef2f7);
    overflow: hidden;
    box-shadow: inset -2px -2px 4px var(--highlight), inset 2px 2px 4px rgba(70, 85, 110, 0.2);
}

.timer-bar-fill {
    height: 100%;
    width: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #2a7a4b, #34a060);
    transition: width 0.95s linear, background 0.4s ease;
    position: relative;
}

.timer-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent);
    border-radius: 6px 6px 0 0;
}

.timer-bar-fill.warning {
    background: linear-gradient(90deg, #b45309, #d97706);
}

.timer-bar-fill.danger {
    background: linear-gradient(90deg, #a32e2e, #c94a4a);
}

/* ============ QUESTION ============ */
.question {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0.85rem auto;
    padding: 0.85rem 1rem;
    background: linear-gradient(145deg, #ffffff, #eef2f7);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 1);
    line-height: 1.55;
    box-shadow: -5px -5px 14px var(--highlight), 5px 5px 14px var(--shadow-light);
    text-align: justify;
}

/* ============ OPTIONS ============ */
.options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}

.options button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: var(--radius-sm);
    background: linear-gradient(145deg, #ffffff, #eef2f7);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    box-shadow: -4px -4px 10px var(--highlight), 4px 4px 10px var(--shadow-light);
}

.options button:hover:not(:disabled) {
    transform: translateY(-2px);
    color: var(--accent);
    box-shadow: -6px -6px 14px var(--highlight), 6px 6px 14px var(--shadow-light), 0 6px 16px rgba(43, 95, 158, 0.18);
}

.options button:active:not(:disabled) {
    transform: translateY(1px) scale(0.99);
    box-shadow: inset -4px -4px 10px var(--highlight), inset 4px 4px 10px var(--shadow-light);
}

.options button:disabled {
    cursor: default;
    opacity: 0.9;
}

.options button.correct {
    background: linear-gradient(145deg, #34a060, #226b3f) !important;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    box-shadow: -4px -4px 10px var(--highlight), 4px 4px 10px var(--shadow-light), 0 6px 16px rgba(42, 122, 75, 0.4) !important;
    opacity: 1 !important;
}

.options button.wrong {
    background: linear-gradient(145deg, #c94a4a, #a32e2e) !important;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    box-shadow: -4px -4px 10px var(--highlight), 4px 4px 10px var(--shadow-light), 0 6px 16px rgba(179, 58, 58, 0.4) !important;
    opacity: 1 !important;
}

/* ============ ANSWER + EXPLANATION ============ */
.answer-text {
    margin-top: 0.85rem;
    font-size: 0.92rem;
    text-align: left;
    display: none;
}

.current-answer {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--accent-green);
    padding: 0.65rem 0.9rem;
    margin-bottom: 0.55rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(145deg, #e6f4eb, #d4ecdc);
    border-left: 4px solid var(--accent-green);
    box-shadow: inset -2px -2px 6px var(--highlight), inset 2px 2px 6px rgba(42, 122, 75, 0.12);
}

.explanation {
    color: var(--text);
    text-align: justify;
    background: linear-gradient(145deg, #eef4fa, #e3e9f0);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    line-height: 1.65;
    font-size: 0.88rem;
    border-left: 4px solid var(--accent);
    box-shadow: inset -3px -3px 8px var(--highlight), inset 3px 3px 8px rgba(70, 85, 110, 0.1);
}

.explanation strong {
    color: var(--accent);
    font-weight: 700;
    margin-right: 0.3rem;
}

/* ============ NAVIGATION ============ */
.navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-top: 0.95rem;
}

.navigation button {
    padding: 0.7rem 1rem;
    font-size: 0.92rem;
    font-family: inherit;
    font-weight: 700;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    background: linear-gradient(145deg, #2b5f9e, #1e4a7a);
    cursor: pointer;
    transition: all var(--transition);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    box-shadow: -4px -4px 10px var(--highlight), 4px 4px 10px var(--shadow-light), 0 4px 12px rgba(43, 95, 158, 0.28);
}

.navigation button:hover {
    transform: translateY(-2px);
}

.navigation button:active {
    transform: translateY(1px) scale(0.98);
}

.navigation button.end-btn {
    background: linear-gradient(145deg, #c94a4a, #a32e2e);
    grid-column: 1 / -1;
    box-shadow: -4px -4px 10px var(--highlight), 4px 4px 10px var(--shadow-light), 0 4px 12px rgba(179, 58, 58, 0.28);
}

.navigation button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============ SCORE ============ */
.score {
    display: inline-block;
    font-size: 0.92rem;
    margin-top: 0.95rem;
    font-weight: 700;
    color: var(--accent);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-pill);
    background: linear-gradient(145deg, #ffffff, #eef2f7);
    box-shadow: -4px -4px 10px var(--highlight), 4px 4px 10px var(--shadow-light);
}

.score span {
    color: var(--accent-green);
    font-weight: 800;
    font-size: 1.05rem;
}

/* ============ RESULT ============ */
.result-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.result-header {
    padding: 1.5rem 1.25rem 1.35rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, #f8fbfe, #e3e9f0);
    border: 1px solid rgba(255, 255, 255, 1);
    position: relative;
    overflow: hidden;
    box-shadow: -8px -8px 20px var(--highlight), 8px 8px 20px var(--shadow-light), 10px 10px 26px var(--shadow);
}

.result-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--accent), var(--accent-green), var(--accent-purple));
}

.result-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 0.35rem;
    text-shadow: -1px -1px 2px #fff, 1px 1px 2px rgba(70, 85, 110, 0.15);
}

.result-header .result-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.score-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.25rem auto 0.5rem;
    flex-wrap: wrap;
}

.score-circle,
.score-percent {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f8fbfe, #e3e9f0);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    box-shadow: -8px -8px 20px var(--highlight), 8px 8px 20px var(--shadow-light), inset 2px 2px 0 rgba(255, 255, 255, 1);
}

.score-circle .big-num {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    color: var(--accent);
    line-height: 1;
    text-shadow: -2px -2px 3px #fff, 2px 2px 3px rgba(70, 85, 110, 0.15);
}

.score-percent .big-num {
    font-size: 1.85rem;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    color: var(--accent-green);
    line-height: 1;
    text-shadow: -2px -2px 3px #fff, 0 0 14px rgba(42, 122, 75, 0.25);
}

.score-circle .big-label,
.score-percent .big-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 4px;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
    margin-top: 1.25rem;
}

.stat-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    background: linear-gradient(145deg, #ffffff, #eef2f7);
    box-shadow: -4px -4px 10px var(--highlight), 4px 4px 10px var(--shadow-light);
}

.stat-pill.correct-pill {
    color: var(--accent-green);
    border-left: 5px solid var(--accent-green);
}

.stat-pill.wrong-pill {
    color: var(--accent-red);
    border-left: 5px solid var(--accent-red);
}

.stat-pill .stat-num {
    font-size: 1.15rem;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
}

.perf-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: inset -3px -3px 8px var(--highlight), inset 3px 3px 8px rgba(70, 85, 110, 0.12);
}

.perf-message.excellent {
    background: linear-gradient(145deg, #d4f0dd, #b8e6c8);
    color: #1a5c34;
    border-left: 5px solid var(--accent-green);
}

.perf-message.good {
    background: linear-gradient(145deg, #d6e8f8, #bdd7f0);
    color: #1a4a7a;
    border-left: 5px solid var(--accent);
}

.perf-message.average {
    background: linear-gradient(145deg, #fbe8c8, #f5d9a6);
    color: #7a4e0d;
    border-left: 5px solid var(--accent-amber);
}

.perf-message.poor {
    background: linear-gradient(145deg, #f8d6d6, #f0bdbd);
    color: #7a1e1e;
    border-left: 5px solid var(--accent-red);
}

.result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
    font-family: inherit;
    font-weight: 700;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    box-shadow: -4px -4px 10px var(--highlight), 4px 4px 10px var(--shadow-light);
}

.action-btn.print-btn {
    background: linear-gradient(145deg, #34a060, #226b3f);
}

.action-btn.print-btn:hover {
    transform: translateY(-2px);
}

.action-btn.retry-btn {
    background: linear-gradient(145deg, #2b5f9e, #1e4a7a);
}

.action-btn.retry-btn:hover {
    transform: translateY(-2px);
}

/* ============ ANSWER KEY TABLE ============ */
.answer-key-wrapper {
    padding: 1.25rem 1rem 1.15rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, #f8fbfe, #e3e9f0);
    border: 1px solid rgba(255, 255, 255, 1);
    box-shadow: -8px -8px 20px var(--highlight), 8px 8px 20px var(--shadow-light);
    text-align: left;
}

.answer-key-wrapper h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 0.9rem;
    padding-bottom: 0.55rem;
    text-align: center;
    position: relative;
}

.answer-key-wrapper h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-green));
    border-radius: 2px;
}

.answer-key-wrapper h3 i {
    color: var(--accent);
    margin-right: 0.4rem;
}

.answer-key-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    font-family: 'Poppins', 'Noto Sans Devanagari', sans-serif;
}

.answer-key-table thead th {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-heading);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 0.65rem 0.55rem;
    text-align: center;
    background: linear-gradient(145deg, #e3e9f0, #f1f5f9);
    border: 1px solid #c4d0de;
    border-bottom: 2px solid rgba(43, 95, 158, 0.3);
}

.answer-key-table tbody td {
    padding: 0.65rem 0.55rem;
    background: #ffffff;
    font-weight: 500;
    color: var(--text);
    text-align: center;
    border: 1px solid #dde4ec;
    vertical-align: middle;
}

.answer-key-table tbody tr:nth-child(even) td {
    background: #f7f9fc;
}

.answer-key-table tbody td:first-child {
    font-weight: 700;
    color: var(--accent);
}

.status-cell {
    font-size: 1.15rem;
    font-weight: 800;
}

.status-cell.correct {
    color: var(--accent-green);
}

.status-cell.wrong {
    color: var(--accent-red);
}

.status-cell.unanswered {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.q-cell {
    font-weight: 600;
    color: var(--text-heading);
    text-align: left !important;
    font-size: 0.78rem;
    line-height: 1.45;
    max-width: 260px;
}

.ans-cell {
    font-weight: 700;
    color: var(--accent-green);
}

.user-ans-cell {
    font-weight: 700;
}

.user-ans-cell.correct {
    color: var(--accent-green);
}

.user-ans-cell.wrong {
    color: var(--accent-red);
}

.user-ans-cell.unanswered {
    color: var(--text-muted);
}

/* ============================================================
   PREMIUM MODAL
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(31, 42, 54, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-box {
    background: linear-gradient(145deg, #f8fbfe, #e3e9f0);
    border-radius: 1.1rem;
    padding: 1.75rem 1.5rem 1.5rem;
    max-width: 440px;
    width: 100%;
    position: relative;
    box-shadow:
        -10px -10px 26px var(--highlight),
        10px 10px 26px var(--shadow-light),
        14px 14px 34px var(--shadow),
        inset 2px 2px 0 var(--highlight);
    border: 1px solid rgba(255, 255, 255, 0.95);
    animation: modalPopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}

@keyframes modalPopIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem;
    background: linear-gradient(145deg, #ffffff, #e3e9f0);
    box-shadow:
        -6px -6px 14px var(--highlight),
        6px 6px 14px var(--shadow-light),
        inset 2px 2px 0 rgba(255, 255, 255, 1);
}

.modal-icon.info {
    color: var(--accent);
}

.modal-icon.warning {
    color: var(--accent-amber);
}

.modal-icon.danger {
    color: var(--accent-red);
}

.modal-icon.success {
    color: var(--accent-green);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
    letter-spacing: -0.3px;
    text-shadow: -1px -1px 2px #fff, 1px 1px 2px rgba(70, 85, 110, 0.12);
}

.modal-message {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 1.35rem;
    padding: 0 0.25rem;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.modal-actions.single {
    grid-template-columns: 1fr;
}

.modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    box-shadow: -4px -4px 10px var(--highlight), 4px 4px 10px var(--shadow-light);
}

.modal-btn.primary {
    color: #ffffff;
    background: linear-gradient(145deg, #2b5f9e, #1e4a7a);
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
}

.modal-btn.success {
    color: #ffffff;
    background: linear-gradient(145deg, #34a060, #226b3f);
}

.modal-btn.success:hover {
    transform: translateY(-2px);
}

.modal-btn.danger {
    color: #ffffff;
    background: linear-gradient(145deg, #c94a4a, #a32e2e);
}

.modal-btn.danger:hover {
    transform: translateY(-2px);
}

.modal-btn.ghost {
    color: var(--text);
    background: linear-gradient(145deg, #ffffff, #eef2f7);
    border: 1px solid rgba(255, 255, 255, 1);
}

.modal-btn.ghost:hover {
    transform: translateY(-2px);
    color: var(--accent);
}

.modal-btn:active {
    transform: translateY(1px) scale(0.98);
}

/* ============ AUDIO UNLOCK BUTTON ============ */
#audioUnlockBtn {
    position: fixed;
    bottom: 12px;
    right: 12px;
    padding: 10px 16px;
    background: linear-gradient(145deg, #2b5f9e, #1e4a7a);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-family: 'Noto Sans Devanagari', 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow:
        -4px -4px 10px rgba(255, 255, 255, 0.95),
        4px 4px 10px rgba(70, 85, 110, 0.3),
        0 4px 12px rgba(43, 95, 158, 0.3);
    z-index: 9999;
    display: none;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s ease;
}

#audioUnlockBtn:hover {
    transform: translateY(-2px);
}

#audioUnlockBtn:active {
    transform: translateY(1px) scale(0.98);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 480px) {
    body {
        padding: 0.75rem 0.6rem;
    }

    .quiz-container {
        padding: 1.1rem 0.9rem 1.2rem;
        border-radius: 0.75rem;
    }

    .quiz-container h1 {
        font-size: 1.15rem;
    }

    .question {
        font-size: 0.98rem;
        padding: 0.75rem 0.85rem;
    }

    .options {
        grid-template-columns: 1fr;


    }

    .options button {
        font-size: 0.85rem;
        min-height: 52px;
        padding: 0.55rem;
    }

    .result-header {
        padding: 1.15rem 1rem 1.1rem;
    }

    .result-header h2 {
        font-size: 1.25rem;
    }

    .score-circle,
    .score-percent {
        width: 100px;
        height: 100px;
    }

    .score-circle .big-num {
        font-size: 1.65rem;
    }

    .score-percent .big-num {
        font-size: 1.45rem;
    }

    .stat-pill {
        padding: 0.65rem 0.55rem;
        font-size: 0.82rem;
    }

    .action-btn {
        padding: 0.7rem 0.75rem;
        font-size: 0.82rem;
    }

    .answer-key-wrapper {
        padding: 1rem 0.75rem 0.9rem;
    }

    .answer-key-table {
        font-size: 0.68rem;
    }

    .answer-key-table thead th {
        font-size: 0.6rem;
        padding: 0.45rem 0.3rem;
    }

    .answer-key-table tbody td {
        padding: 0.45rem 0.3rem;
    }

    .q-cell {
        max-width: 110px;
        font-size: 0.64rem;
    }

    .modal-box {
        padding: 1.4rem 1.15rem 1.25rem;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .modal-message {
        font-size: 0.85rem;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    body {
        padding: 1rem 0.8rem;
    }

    .options button {
        font-size: 0.92rem;
        min-height: 54px;
    }

    .answer-key-table {
        font-size: 0.74rem;
    }

    .q-cell {
        max-width: 180px;
    }
}

/* ============================================================
   PRINT STYLES — CLEAN ANSWER KEY ONLY
   ============================================================ */
#print-area {
    display: none;
}

@media print {
    @page {
        margin: 1.2cm;
        size: A4 portrait;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html,
    body {
        background: #fff !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 10pt !important;
    }

    body * {
        visibility: hidden !important;
    }

    #print-area,
    #print-area * {
        visibility: visible !important;
    }

    #print-area {
        display: block !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
    }

    .print-header {
        text-align: center;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 2.5px solid #2b5f9e;
    }

    .print-header h1 {
        font-size: 15pt !important;
        color: #1f2a36 !important;
        margin: 0 0 3px !important;
    }

    .print-header p {
        font-size: 9.5pt !important;
        color: #5f6c7c !important;
        margin: 2px 0 0 !important;
    }

    .print-header .print-stats {
        margin-top: 8px !important;
        font-size: 10pt !important;
        font-weight: 700 !important;
    }

    .print-header .print-stats .stat {
        display: inline-block;
        margin: 0 12px;
    }

    .print-header .print-stats .stat.correct {
        color: #226b3f !important;
    }

    .print-header .print-stats .stat.wrong {
        color: #a32e2e !important;
    }

    .print-header .print-stats .stat.percent {
        color: #2b5f9e !important;
    }

    .answer-key-wrapper {
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
    }

    .answer-key-wrapper h3 {
        display: none !important;
    }

    .answer-key-table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 9pt !important;
    }

    .answer-key-table thead {
        display: table-header-group !important;
    }

    .answer-key-table thead th {
        background: #e3e9f0 !important;
        color: #1f2a36 !important;
        font-size: 9pt !important;
        font-weight: 800 !important;
        padding: 7px 6px !important;
        border: 1px solid #8fa3ba !important;
        text-align: center !important;
        text-transform: uppercase !important;
    }

    .answer-key-table tbody tr {
        page-break-inside: avoid !important;
    }

    .answer-key-table tbody td {
        background: #fff !important;
        padding: 6px 5px !important;
        font-size: 9pt !important;
        border: 1px solid #c4d0de !important;
    }

    .answer-key-table tbody tr:nth-child(even) td {
        background: #f7f9fc !important;
    }

    .q-cell {
        font-size: 8.5pt !important;
        text-align: left !important;
    }

    .ans-cell {
        color: #226b3f !important;
    }

    .user-ans-cell.correct {
        color: #226b3f !important;
    }

    .user-ans-cell.wrong {
        color: #a32e2e !important;
    }

    .status-cell {
        font-size: 12pt !important;
    }

    .status-cell.correct {
        color: #226b3f !important;
    }

    .status-cell.wrong {
        color: #a32e2e !important;
    }
}


#audioUnlockBtn {
    position: fixed;
    bottom: 12px;
    right: 12px;
    padding: 10px 16px;
    background: linear-gradient(145deg, #2b5f9e, #1e4a7a);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-family: 'Noto Sans Devanagari', 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow:
        -4px -4px 10px rgba(255, 255, 255, 0.95),
        4px 4px 10px rgba(70, 85, 110, 0.3),
        0 4px 12px rgba(43, 95, 158, 0.3);
    z-index: 99999;
    display: none;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s ease;
}

#audioUnlockBtn:hover {
    transform: translateY(-2px);
}

#audioUnlockBtn:active {
    transform: translateY(1px) scale(0.98);
}




/* ============================================================
   MATHJAX — Math rendering styles
   ============================================================ */

/* MathJax containers — prevent overflow on small screens */
mjx-container {
    display: inline-block !important;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    vertical-align: middle;
    line-height: 1;
    padding: 0 2px;
    /* Prevent horizontal scrollbar flicker */
    scrollbar-width: thin;
}

mjx-container::-webkit-scrollbar {
    height: 4px;
}

mjx-container::-webkit-scrollbar-thumb {
    background: rgba(43, 95, 158, 0.3);
    border-radius: 4px;
}

/* Display math (block-level) — center it */
mjx-container[display="true"] {
    display: block !important;
    margin: 0.6rem auto !important;
    text-align: center;
}

/* Question text with math — make sure it wraps properly */
.question mjx-container {
    color: var(--text-heading);
}

/* Options with math — center the math inside buttons */
.options button mjx-container {
    color: inherit;
    font-size: 1.05em;
}

/* Answer key table — math cells */
.ans-cell mjx-container,
.user-ans-cell mjx-container {
    font-size: 0.95em;
    color: inherit;
}

/* Explanation — math spacing */
.explanation mjx-container {
    color: var(--text);
}

.explanation mjx-container[display="true"] {
    margin: 0.5rem auto !important;
    padding: 0.35rem 0;
}

/* Print — compact math */
@media print {
    mjx-container {
        font-size: 0.95em !important;
    }

    mjx-container[display="true"] {
        margin: 0.3rem auto !important;
    }
}

/* On very small screens, allow math to shrink */
@media (max-width: 480px) {
    mjx-container {
        font-size: 0.92em;
    }

    .options button mjx-container {
        font-size: 0.98em;
    }
}

/* ============ (keep all your existing quiz.css rules below) ============ */



/* ============================================================
   AUDIO CONTROLS — Volume Panel
   ============================================================ */
/* ============================================================
   INLINE VOLUME CONTROL (in header status row)
   ============================================================ */
.inline-volume-control {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 !important;
    max-width: 260px !important;
    padding: 4px 10px !important;
    border-radius: 2rem !important;
    background: linear-gradient(145deg, #f8fbfe, #eef2f7) !important;
    box-shadow:
        -2px -2px 6px rgba(255, 255, 255, 0.95),
         2px  2px 6px rgba(163, 177, 198, 0.5) !important;
    margin-left: auto !important;
}

.inline-volume-icon-btn {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    border: none !important;
    background: linear-gradient(145deg, #ffffff, #eef2f7) !important;
    color: #2b5f9e !important;
    font-size: 0.8rem !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    transition: all 0.2s ease !important;
    box-shadow:
        -2px -2px 5px rgba(255, 255, 255, 0.95),
         2px  2px 5px rgba(163, 177, 198, 0.5) !important;
}

.inline-volume-icon-btn:hover {
    color: #2b5f9e !important;
    transform: scale(1.05) !important;
}

/* Volume slider */
.volume-slider,
.inline-volume-slider {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    height: 6px !important;
    border-radius: 3px !important;
    outline: none !important;
    cursor: pointer !important;
    background: linear-gradient(
        to right,
        #2b5f9e 0%,
        #2b5f9e var(--volume-pct, 70%),
        #d8e0ea var(--volume-pct, 70%),
        #d8e0ea 100%
    ) !important;
    box-shadow:
        inset -1px -1px 3px rgba(255, 255, 255, 0.9),
        inset  1px  1px 3px rgba(70, 85, 110, 0.15) !important;
}

.inline-volume-slider {
    flex: 1 !important;
    min-width: 60px !important;
}

.volume-slider::-webkit-slider-thumb,
.inline-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    background: linear-gradient(145deg, #ffffff, #eef2f7) !important;
    border: 2px solid #2b5f9e !important;
    cursor: pointer !important;
    box-shadow:
        -2px -2px 5px rgba(255, 255, 255, 0.95),
         2px  2px 5px rgba(163, 177, 198, 0.6) !important;
}

.volume-slider::-moz-range-thumb,
.inline-volume-slider::-moz-range-thumb {
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    background: linear-gradient(145deg, #ffffff, #eef2f7) !important;
    border: 2px solid #2b5f9e !important;
    cursor: pointer !important;
}

.inline-volume-percent {
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    color: #2b5f9e !important;
    font-variant-numeric: tabular-nums !important;
    min-width: 32px !important;
    text-align: right !important;
    flex-shrink: 0 !important;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .inline-volume-control {
        max-width: 100% !important;
        width: 50% !important;
        margin-left: 0 !important;
        margin-top: 6px !important;
        order: 3 !important;
    }
    .inline-volume-slider {
        max-width: 20px !important;
    }
    .inline-volume-percent {
        font-size: 0.68rem !important;
        max-width: 15px !important;
    }
   
}