/* =============================================
   DIGITAL ASSESSMENT CENTER - STUDENT PORTAL
   Space-Themed, FERPA-Compliant, Accessible
   ============================================= */

:root {
    /* Space Theme Palette */
    --bg-deep-space: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

    /* Accents */
    --cyan-glow: #06b6d4;
    --purple-glow: #8b5cf6;
    --accent-gradient: linear-gradient(90deg, #06b6d4, #8b5cf6);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* Spacing & Layout */
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Typography */
    --font-heading: 'Orbitron', sans-serif;
    /* Assumes Orbitron imported or fallback */
    --font-body: 'Outfit', sans-serif;

    /* Radius */
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
}

/* =============================================
   BASE STYLES
   ============================================= */

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-deep-space);
    min-height: 100vh;
    overflow-x: hidden;
}

/* =============================================
   ACCESSIBILITY FAB + SLIDE-UP PANEL
   ============================================= */

/* Container: fixed bottom-right */
.a11y-fab-container {
    position: fixed;
    bottom: 2.75rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* FAB button */
.a11y-fab {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.a11y-fab:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: var(--cyan-glow);
    box-shadow: 0 4px 25px rgba(6, 182, 212, 0.3);
    transform: scale(1.08);
}

.a11y-fab:active {
    transform: scale(0.95);
}

.a11y-fab svg {
    width: 24px;
    height: 24px;
}

/* Active indicator dot on FAB */
.a11y-fab-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--cyan-glow);
    border: 2px solid rgba(0, 0, 0, 0.6);
    animation: fabDotPulse 2s ease-in-out infinite;
}

@keyframes fabDotPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(6, 182, 212, 0.4); }
    50% { box-shadow: 0 0 10px rgba(6, 182, 212, 0.8); }
}

/* Slide-up panel */
.a11y-panel {
    position: absolute;
    bottom: 64px;
    right: 0;
    width: 280px;
    background: rgba(10, 15, 30, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: a11ySlideUp 0.25s ease-out;
}

.a11y-panel.hidden {
    display: none;
}

@keyframes a11ySlideUp {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Panel header */
.a11y-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.a11y-panel-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.a11y-panel-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.a11y-panel-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

/* Read Aloud action button (prominent) */
.a11y-action-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: calc(100% - 1.5rem);
    margin: 0.75rem auto 0;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 10px;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.a11y-action-btn:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(139, 92, 246, 0.25));
    border-color: var(--cyan-glow);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.a11y-action-btn.reading {
    border-color: var(--cyan-glow);
    animation: readingPulse 1.5s ease-in-out infinite;
}

@keyframes readingPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(6, 182, 212, 0.2); }
    50% { box-shadow: 0 0 18px rgba(6, 182, 212, 0.4); }
}

.a11y-action-icon {
    font-size: 1.2rem;
}

.a11y-action-btn.hidden {
    display: none;
}

/* Toggle rows */
.a11y-toggles {
    padding: 0.375rem 0;
}

.a11y-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.a11y-toggle-row:last-child {
    border-bottom: none;
}

.a11y-toggle-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.a11y-toggle-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.a11y-toggle-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.a11y-toggle-info span:last-child {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* iOS-style toggle switch */
.a11y-switch-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.a11y-switch {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    transition: background 0.3s ease;
    cursor: pointer;
}

.a11y-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.a11y-switch-input:checked + .a11y-switch {
    background: var(--cyan-glow);
}

.a11y-switch-input:checked + .a11y-switch::after {
    transform: translateX(20px);
    box-shadow: 0 1px 6px rgba(6, 182, 212, 0.5);
}

.a11y-switch-input:focus-visible + .a11y-switch {
    outline: 2px solid var(--cyan-glow);
    outline-offset: 2px;
}


/* =============================================
   LARGE FONT MODE
   Increases all text sizes for low-vision students
   ============================================= */

body.large-font {
    font-size: 1.25rem;
}

body.large-font .question-text {
    font-size: 2rem;
    line-height: 1.7;
}

body.large-font .answer-option {
    padding: 1.5rem;
    font-size: 1.3rem;
}

body.large-font .answer-text {
    font-size: 1.3rem;
}

body.large-font .btn-primary,
body.large-font .btn-nav {
    font-size: 1.15rem;
    padding: 0.85rem 1.75rem;
}

body.large-font .login-card h2,
body.large-font .hero-header h1 {
    font-size: 2.2rem;
}

body.large-font .login-card label,
body.large-font .login-card input,
body.large-font .login-card select {
    font-size: 1.2rem;
}

body.large-font #question-counter {
    font-size: 1.15rem;
}

body.large-font #quiz-title {
    font-size: 1.6rem;
}

body.large-font .written-answer-input {
    font-size: 1.2rem;
}

body.large-font .question-map-dot {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

body.large-font .user-info-bar,
body.large-font .user-greeting {
    font-size: 1.1rem;
}

body.large-font .quiz-student-badge {
    font-size: 1rem;
}

body.large-font .a11y-panel {
    width: 310px;
}

body.large-font .a11y-toggle-info span:last-child {
    font-size: 1.05rem;
}

body.large-font .a11y-action-btn {
    font-size: 1.1rem;
    padding: 0.875rem 1rem;
}

body.large-font .a11y-panel-title {
    font-size: 1rem;
}

/* =============================================
   DYSLEXIA-FRIENDLY FONT MODE
   OpenDyslexic font for students with dyslexia
   ============================================= */

@import url('https://fonts.cdnfonts.com/css/open-dyslexic');

body.dyslexia-font,
body.dyslexia-font * {
    font-family: 'Open-Dyslexic', 'OpenDyslexic', sans-serif !important;
}

body.dyslexia-font .hero-title {
    font-family: 'Open-Dyslexic', 'OpenDyslexic', sans-serif !important;
    letter-spacing: 0;
}

body.dyslexia-font .question-text {
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    word-spacing: 0.1em;
}

body.dyslexia-font .answer-text {
    letter-spacing: 0.02em;
    word-spacing: 0.1em;
}

/* =============================================
   LINE SPACING / READING MODE
   Increased spacing for easier reading
   ============================================= */

body.line-spacing {
    line-height: 2;
    letter-spacing: 0.03em;
    word-spacing: 0.12em;
}

body.line-spacing .question-text {
    line-height: 2.2;
    margin-bottom: 1.5rem;
}

body.line-spacing .answer-option {
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.9;
}

body.line-spacing .answer-text {
    line-height: 2;
}

body.line-spacing .login-card label {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

body.line-spacing .login-card input,
body.line-spacing .login-card select {
    padding: 1rem;
    margin-bottom: 1rem;
}

body.line-spacing .rte-editor.written-answer {
    line-height: 2.2;
    padding: 1.5rem;
}

body.line-spacing .a11y-toggle-row {
    padding: 0.85rem 1rem;
}

/* =============================================
   FOCUS GUIDE / READING GUIDE
   Translucent highlight bar that follows mouse
   ============================================= */

.focus-guide {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 900;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.focus-guide.hidden {
    display: none;
}

/* Dim overlay above and below the focus bar */
.focus-guide::before,
.focus-guide::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.45);
    transition: none;
}

.focus-guide::before {
    top: 0;
    height: var(--guide-top, 0px);
}

.focus-guide::after {
    bottom: 0;
    height: var(--guide-bottom, 0px);
}

/* The illuminated reading bar */
.focus-guide-bar {
    position: absolute;
    left: 0;
    width: 100%;
    height: var(--guide-height, 120px);
    top: var(--guide-top, 40%);
    border-top: 2px solid rgba(6, 182, 212, 0.5);
    border-bottom: 2px solid rgba(6, 182, 212, 0.5);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.1);
    transition: none;
}

/* Divider between toggle groups */
.a11y-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.25rem 1rem;
}

/* =============================================
   HIGH CONTRAST MODE
   Maximum contrast for visually impaired students
   ============================================= */

body.high-contrast {
    background: #000000 !important;
    color: #ffffff;
}

body.high-contrast .hero-header,
body.high-contrast .login-card,
body.high-contrast .question-container,
body.high-contrast .quiz-interface {
    background: #000000;
}

body.high-contrast .login-card {
    border: 2px solid #ffffff;
    box-shadow: none;
    background: #111111;
}

body.high-contrast .login-card h2 {
    color: #ffffff;
}

body.high-contrast .login-card label {
    color: #ffffff;
    font-weight: 700;
}

body.high-contrast .login-card input,
body.high-contrast .login-card select {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
}

body.high-contrast .login-card input:focus,
body.high-contrast .login-card select:focus {
    border-color: #ffff00;
    outline: 2px solid #ffff00;
}

body.high-contrast .question-text {
    color: #ffffff;
    font-weight: 700;
}

body.high-contrast .answer-option {
    background: #111111;
    border: 2px solid #ffffff;
    color: #ffffff;
}

body.high-contrast .answer-option:hover {
    background: #333333;
    border-color: #ffff00;
    color: #ffff00;
}

body.high-contrast .answer-option.selected {
    background: #003300;
    border-color: #00ff00;
    color: #00ff00;
    box-shadow: none;
}

body.high-contrast .answer-text {
    color: inherit;
}

body.high-contrast .btn-primary {
    background: #ffffff;
    color: #000000;
    font-weight: 800;
    border: 2px solid #ffffff;
}

body.high-contrast .btn-primary:hover {
    background: #ffff00;
    color: #000000;
    border-color: #ffff00;
}

body.high-contrast .btn-nav {
    border: 2px solid #ffffff;
    color: #ffffff;
    background: #222222;
}

body.high-contrast .btn-nav:hover {
    background: #444444;
    border-color: #ffff00;
}

body.high-contrast .btn-back {
    border: 2px solid #ffffff;
    color: #ffffff;
}

body.high-contrast .btn-back:hover {
    background: #333333;
}

body.high-contrast .progress-bar {
    background: #333333;
    border: 1px solid #ffffff;
}

body.high-contrast .progress-fill {
    background: #00ff00;
}

body.high-contrast #question-counter {
    color: #ffffff;
}

body.high-contrast #quiz-title {
    color: #ffffff;
}

body.high-contrast .user-info-bar {
    background: #111111;
    border-color: #ffffff;
}

body.high-contrast .user-greeting {
    color: #ffffff;
}

body.high-contrast .written-answer-input {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
}

body.high-contrast .written-answer-input:focus {
    border-color: #ffff00;
    outline: 2px solid #ffff00;
}

body.high-contrast .quiz-student-badge {
    background: #222222;
    border-color: #ffffff;
    color: #ffffff;
}

body.high-contrast .quiz-period-tag {
    background: #444444;
    color: #ffffff;
}

body.high-contrast .question-map-dot {
    border-color: #ffffff;
    color: #ffffff;
}

body.high-contrast .question-map-dot.answered {
    background: #006600;
    border-color: #00ff00;
}

body.high-contrast .question-map-dot.current {
    border-color: #ffff00;
    box-shadow: 0 0 0 2px #ffff00;
}

body.high-contrast .btn-emergency {
    background: #990000;
    color: #ffffff;
    border: 2px solid #ff0000;
}

body.high-contrast .assessment-card {
    background: #111111;
    border: 2px solid #ffffff;
    color: #ffffff;
}

body.high-contrast .assessment-card:hover {
    border-color: #ffff00;
}

body.high-contrast .a11y-fab {
    background: #111111;
    border: 2px solid #ffffff;
}

body.high-contrast .a11y-fab:hover {
    background: #333333;
    border-color: #ffff00;
}

body.high-contrast .a11y-fab-dot {
    background: #ffff00;
    border-color: #000000;
}

body.high-contrast .a11y-panel {
    background: #111111;
    border: 2px solid #ffffff;
}

body.high-contrast .a11y-panel-header {
    border-bottom-color: #ffffff;
}

body.high-contrast .a11y-panel-title {
    color: #ffffff;
}

body.high-contrast .a11y-panel-close {
    background: #333333;
    color: #ffffff;
    border: 1px solid #ffffff;
}

body.high-contrast .a11y-action-btn {
    background: #222222;
    border: 2px solid #ffffff;
    color: #ffffff;
}

body.high-contrast .a11y-action-btn:hover {
    background: #333333;
    border-color: #ffff00;
}

body.high-contrast .a11y-toggle-row {
    border-bottom-color: #444444;
}

body.high-contrast .a11y-toggle-row:hover {
    background: #222222;
}

body.high-contrast .a11y-toggle-info span:last-child {
    color: #ffffff;
}

body.high-contrast .a11y-switch {
    background: #444444;
    border: 1px solid #ffffff;
}

body.high-contrast .a11y-switch-input:checked + .a11y-switch {
    background: #ffff00;
}

body.high-contrast .a11y-switch::after {
    background: #ffffff;
}

body.high-contrast .a11y-switch-input:checked + .a11y-switch::after {
    background: #000000;
}

body.high-contrast .a11y-divider {
    background: #666666;
}

body.high-contrast .focus-guide::before,
body.high-contrast .focus-guide::after {
    background: rgba(0, 0, 0, 0.7);
}

body.high-contrast .focus-guide-bar {
    border-top-color: #ffff00;
    border-bottom-color: #ffff00;
}

/* =============================================
   HERO HEADER (Clean & Integrated)
   ============================================= */

.hero-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 2rem;
}

/* Removed the big white .hero-card background */
.hero-card {
    background: transparent;
    box-shadow: none;
    padding: 0;
    max-width: 800px;
    margin: 0 auto;
}

.hero-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--cyan-glow);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.2);
}

.hero-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
}

.hero-divider {
    display: none;
    /* Removed simpler look */
}


.divider-line {
    width: 40px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
}

.divider-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-pink);
    border-radius: 50%;
}

/* =============================================
   USER INFO BAR (Shown after login)
   ============================================= */

.user-info-bar {
    max-width: 600px;
    margin: -1rem auto 2rem;
    padding: 0.75rem 1.5rem;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 50px;
    backdrop-filter: blur(8px);
}

.user-info-bar.hidden {
    display: none;
}

.user-info-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.user-greeting {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.user-greeting svg {
    color: var(--cyan-glow);
}

#user-display-name {
    font-weight: 600;
    color: var(--cyan-glow);
}

.btn-sign-out {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 25px;
    color: #f87171;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sign-out:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
    color: #fca5a5;
    transform: translateX(2px);
}

.btn-sign-out svg {
    transition: transform 0.2s ease;
}

.btn-sign-out:hover svg {
    transform: translateX(3px);
}

/* =============================================
   LOGIN SECTION
   ============================================= */

.login-section {
    max-width: 600px;
    margin: 0 auto 3rem;
}

.login-card {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.login-card h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
    letter-spacing: 1px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--cyan-glow);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.4);
    color: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--cyan-glow);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
    background: rgba(0, 0, 0, 0.6);
}

.btn-primary {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--cyan-glow), var(--purple-glow));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
    filter: brightness(1.1);
}

/* =============================================
   v6.1 MULTI-STEP LOGIN
   ============================================= */
.login-step {
    animation: loginFadeIn 0.3s ease;
}
.login-step.hidden {
    display: none;
}
.login-step h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}
.login-step-subtitle {
    text-align: center;
    color: var(--cyan-glow);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}
.btn-back-login {
    background: none;
    border: none;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 0;
    margin-bottom: 1rem;
    display: inline-block;
    transition: color 0.2s;
}
.btn-back-login:hover {
    color: var(--cyan-glow);
}

/* Period Buttons Grid */
.period-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}
.period-btn {
    padding: 1.5rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.period-btn:hover {
    border-color: var(--cyan-glow);
    background: rgba(6, 182, 212, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}

/* Alias Grid */
.alias-search-box {
    margin-bottom: 1rem;
}
.alias-search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    color: white;
    font-size: 1rem;
    box-sizing: border-box;
}
.alias-search-box input:focus {
    outline: none;
    border-color: var(--cyan-glow);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}
.alias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
    max-height: 320px;
    overflow-y: auto;
    padding: 0.5rem 0;
}
.alias-btn {
    padding: 0.75rem 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: var(--text-secondary, #d1d5db);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.alias-btn:hover {
    border-color: var(--purple-glow);
    background: rgba(139, 92, 246, 0.15);
    color: white;
    transform: translateY(-1px);
}

/* PIN Entry */
.pin-dots {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}
.pin-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    transition: all 0.2s;
}
.pin-dot.filled {
    background: var(--cyan-glow);
    border-color: var(--cyan-glow);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}
.pin-dot.error {
    border-color: #ef4444;
    background: #ef4444;
}
.pin-confirm-label {
    text-align: center;
    color: var(--text-muted, #9ca3af);
    font-size: 0.9rem;
    margin-top: 1rem;
}
.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    max-width: 280px;
    margin: 1.5rem auto 0;
}
.pin-key {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-body);
}
.pin-key:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}
.pin-key:active {
    transform: scale(0.95);
}
.pin-key-action {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
}
.login-error-msg {
    text-align: center;
    color: #f87171;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}
.login-error-msg.hidden {
    display: none;
}

@keyframes loginFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pinShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}
.pin-error-shake {
    animation: pinShake 0.4s ease;
}

/* High contrast overrides for v6.1 login */
body.high-contrast .period-btn {
    background: #000;
    border-color: #fff;
    color: #fff;
}
body.high-contrast .period-btn:hover {
    border-color: #ffd700;
    background: #333;
}
body.high-contrast .alias-btn {
    background: #000;
    border-color: #fff;
    color: #fff;
}
body.high-contrast .alias-btn:hover {
    border-color: #ffd700;
    background: #333;
}
body.high-contrast .pin-key {
    background: #000;
    border-color: #fff;
    color: #fff;
}
body.high-contrast .pin-dot.filled {
    background: #ffd700;
    border-color: #ffd700;
}

/* Large font overrides for v6.1 login */
body.large-font .period-btn {
    font-size: 1.6rem;
    padding: 2rem;
}
body.large-font .alias-btn {
    font-size: 1.1rem;
    padding: 1rem;
}
body.large-font .pin-key {
    font-size: 1.8rem;
    padding: 1.3rem;
}

.btn-primary:active {
    transform: translateY(0);
}

/* =============================================
   ASSESSMENT SELECTION
   ============================================= */

.assessment-selection {
    margin-bottom: 3rem;
}

.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

/* Base style for quiz cards - ENHANCED */
.quiz-card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 27, 75, 0.8) 100%);
    border: 2px solid rgba(6, 182, 212, 0.3);
    border-radius: 1.5rem;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Animated gradient border effect */
.quiz-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
            transparent 0%,
            rgba(6, 182, 212, 0.1) 25%,
            rgba(139, 92, 246, 0.1) 50%,
            rgba(6, 182, 212, 0.1) 75%,
            transparent 100%);
    background-size: 400% 400%;
    animation: shimmer 8s ease infinite;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}

/* Hover glow effect */
.quiz-card::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.quiz-card:hover::after {
    opacity: 1;
}

.quiz-card:hover {
    transform: translateY(-10px) scale(1.02);
    background: linear-gradient(145deg, rgba(20, 30, 50, 0.95) 0%, rgba(40, 37, 95, 0.9) 100%);
    border-color: var(--cyan-glow);
    box-shadow:
        0 20px 50px rgba(6, 182, 212, 0.3),
        0 0 30px rgba(6, 182, 212, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.quiz-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(80%);
    border-color: rgba(100, 100, 100, 0.3);
}

.quiz-card.disabled:hover {
    transform: none;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.quiz-card.active {
    border-color: rgba(6, 182, 212, 0.5);
}

/* Mission number badge */
.quiz-number {
    position: relative;
    z-index: 1;
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Quiz name enhanced */
.quiz-name {
    position: relative;
    z-index: 1;
    font-family: var(--font-heading), sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #ffffff, #e0e7ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
}

/* Date badge */
.quiz-date {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.quiz-date .icon {
    font-size: 1rem;
}

.quiz-badge {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    z-index: 2;
}

.quiz-badge.soon {
    background: linear-gradient(135deg, #475569, #334155);
    box-shadow: none;
}

.quiz-badge.new {
    background: linear-gradient(135deg, #10b981, #059669);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    }

    50% {
        box-shadow: 0 4px 25px rgba(16, 185, 129, 0.6);
    }
}

.quiz-status {
    position: relative;
    z-index: 1;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.75rem;
    text-align: center;
    transition: all 0.3s ease;
}

.quiz-status.available {
    color: var(--cyan-glow);
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.05));
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.quiz-card:hover .quiz-status.available {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.25), rgba(6, 182, 212, 0.1));
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

/* Shimmer animation */
@keyframes shimmer {
    0% {
        background-position: 0% 0%;
    }

    50% {
        background-position: 100% 100%;
    }

    100% {
        background-position: 0% 0%;
    }
}

/* Mission Control Header Enhancement */
.mission-control-header {
    position: relative;
    padding: 2rem;
    margin-bottom: 2rem;
}

.mission-control-header h2 {
    font-family: var(--font-heading), sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(90deg, #06b6d4, #8b5cf6, #06b6d4);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientText 4s linear infinite;
    margin-bottom: 0.5rem;
}

@keyframes gradientText {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

.mission-control-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Entrance animation for cards */
@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

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

.quiz-card {
    animation: cardEntrance 0.6s ease-out both;
}

/* =============================================
   QUIZ INTERFACE
   ============================================= */
.quiz-interface {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    margin-bottom: 3rem;
}

.quiz-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
    .quiz-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* =============================================
   QUIZ TIMER
   ============================================= */
.quiz-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid #3b82f6;
    border-radius: 12px;
    padding: 8px 16px;
    color: #93c5fd;
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.quiz-timer svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.quiz-timer.timer-extended {
    border-color: #8b5cf6;
    color: #c4b5fd;
}

.quiz-timer.timer-warning {
    border-color: #f59e0b;
    color: #fbbf24;
    background: rgba(120, 53, 15, 0.4);
    animation: timerPulse 2s ease-in-out infinite;
}

.quiz-timer.timer-critical {
    border-color: #ef4444;
    color: #f87171;
    background: rgba(127, 29, 29, 0.5);
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); box-shadow: none; }
    50% { transform: scale(1.05); box-shadow: 0 0 12px rgba(239, 68, 68, 0.4); }
}

/* Timer warning toasts */
.timer-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 28px;
    border-radius: 14px;
    z-index: 9999;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    animation: timerSlideDown 0.4s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: opacity 0.3s, transform 0.3s;
}

.timer-toast-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.timer-toast-critical {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.timer-toast-expired {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    border: 2px solid #ef4444;
}

.timer-toast-icon {
    font-size: 1.3rem;
}

@keyframes timerSlideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* High contrast overrides for timer */
body.high-contrast .quiz-timer {
    background: #000;
    border-color: #fff;
    color: #fff;
}

body.high-contrast .quiz-timer.timer-warning {
    border-color: #fbbf24;
    color: #fbbf24;
    background: #000;
}

body.high-contrast .quiz-timer.timer-critical {
    border-color: #ef4444;
    color: #ef4444;
    background: #000;
}

/* Large font override */
body.large-font .quiz-timer {
    font-size: 1.5rem;
    padding: 10px 20px;
}

/* Student identity badge shown during quiz */
.quiz-student-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #c7d2fe;
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.quiz-student-badge svg {
    opacity: 0.7;
    flex-shrink: 0;
}

.quiz-period-tag {
    background: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 4px;
}

.btn-back {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 99px;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: white;
}

.progress-bar {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 99px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.question-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.answer-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.answer-option:hover {
    border-color: var(--cyan-glow);
    background: rgba(6, 182, 212, 0.1);
    color: white;
}

.answer-option.selected {
    border-color: var(--purple-glow);
    background: rgba(139, 92, 246, 0.2);
    color: white;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.answer-option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--purple-glow);
}

/* Written Answer Container */
.written-answer-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Rich Text Editor Toolbar */
.rte-toolbar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-wrap: wrap;
}

.rte-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.rte-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.rte-btn.active {
    background: rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.4);
    color: var(--cyan-glow);
}

.rte-btn svg {
    width: 16px;
    height: 16px;
}

.rte-separator {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 0.25rem;
}

/* Rich Text Editor (contenteditable div) */
.rte-editor.written-answer {
    width: 100%;
    min-height: 200px;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    font-family: inherit;
    font-size: 1.1rem;
    color: white;
    line-height: 1.6;
    overflow-y: auto;
    max-height: 500px;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.rte-editor.written-answer:focus {
    border-color: var(--cyan-glow);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

/* Placeholder for empty contenteditable */
.rte-editor.written-answer:empty::before {
    content: attr(data-placeholder);
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
    pointer-events: none;
}

/* Rich text content styling inside editor */
.rte-editor.written-answer b,
.rte-editor.written-answer strong {
    font-weight: 700;
    color: #e0e7ff;
}

.rte-editor.written-answer i,
.rte-editor.written-answer em {
    font-style: italic;
    color: #c4b5fd;
}

.rte-editor.written-answer u {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.rte-editor.written-answer ul,
.rte-editor.written-answer ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.rte-editor.written-answer li {
    margin-bottom: 0.25rem;
}

/* Fallback textarea (legacy, if ever needed) */
textarea.written-answer {
    width: 100%;
    min-height: 200px;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 1.1rem;
    color: white;
    resize: vertical;
    transition: all 0.2s ease;
}

textarea.written-answer:focus {
    outline: none;
    border-color: var(--cyan-glow);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    gap: 1rem;
}

.btn-nav {
    padding: 0.75rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: white;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.btn-nav.btn-primary {
    background: var(--accent-gradient);
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-nav.btn-primary:hover {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

/* Center button group in quiz navigation */
.nav-center-btns {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Emergency Submit Button */
.btn-emergency {
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border: 2px solid #f87171;
    color: white;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: emergency-pulse 2s ease-in-out infinite;
}

.btn-emergency:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    transform: scale(1.05);
}

@keyframes emergency-pulse {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(239, 68, 68, 0.3);
    }

    50% {
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
    }
}

/* =============================================
   RESULTS SECTION
   ============================================= */

.results-section {
    max-width: 600px;
    margin: 0 auto;
}

.results-card {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.results-card h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: white;
    margin-bottom: 2rem;
}

.result-stat {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-label {
    color: var(--text-secondary);
}

.result-value {
    color: white;
}

.result-value.score {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2rem;
}

.quiz-interface h2#quiz-title {
    color: var(--cyan-glow);
    font-family: var(--font-heading);
    margin: 0;
    font-size: 1.5rem;
}


/* =============================================
   FOOTER
   ============================================= */

.footer {
    text-align: center;
    padding: var(--spacing-xl);
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-sm);
}

/* =============================================
   STT INDICATOR
   ============================================= */

.stt-indicator {
    position: fixed;
    bottom: var(--spacing-xl);
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-gradient);
    color: white;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    z-index: 1000;
}

.stt-pulse {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {

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

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
}

/* =============================================
   UTILITY CLASSES
   ============================================= */

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =============================================
   RESPONSIVE ADJUSTMENTS
   ============================================= */

@media (max-width: 640px) {
    .main-container {
        padding: var(--spacing-md);
        padding-top: calc(var(--spacing-lg) + 50px);
    }

    .hero-card {
        padding: var(--spacing-xl);
    }

    .hero-title {
        font-size: var(--font-size-2xl);
    }

    .a11y-fab-container {
        bottom: 1rem;
        right: 1rem;
    }

    .a11y-fab {
        width: 46px;
        height: 46px;
    }

    .a11y-panel {
        width: calc(100vw - 2rem);
        right: -0.5rem;
    }

    .quiz-grid {
        grid-template-columns: 1fr;
    }

    .quiz-navigation {
        flex-wrap: wrap;
    }

    .btn-nav {
        flex: 1;
        min-width: 120px;
    }
}

/* =============================================
   MY SUBMISSIONS SECTION
   ============================================= */

.btn-submissions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #06b6d4, #8b5cf6);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-submissions:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.my-submissions-section {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.submissions-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.submissions-header h2 {
    font-size: 1.5rem;
    color: var(--cyan-glow);
}

.submissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.submission-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submission-card:hover {
    transform: translateY(-3px);
    border-color: var(--cyan-glow);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.15);
}

.submission-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    margin-bottom: 0.5rem;
}

.submission-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.submission-points {
    font-size: 1rem;
    color: var(--cyan-glow);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.status-badge.pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-badge.graded {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.view-details {
    font-size: 0.8rem;
    color: var(--purple-glow);
    font-weight: 500;
    margin-top: 0.5rem;
}

.loading-submissions,
.error-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading-submissions .loader {
    margin: 0 auto 1rem;
}

/* =============================================
   STUDENT PROGRESS VIEW
   ============================================= */

.progress-overview {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.progress-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.progress-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #93c5fd;
    margin-bottom: 1rem;
}

.weak-areas-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.weak-area-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.weak-area-topic {
    flex: 0 0 140px;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weak-area-bar {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    overflow: hidden;
}

.weak-area-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.weak-area-pct {
    flex: 0 0 40px;
    text-align: right;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
}

/* High contrast overrides for progress */
body.high-contrast .progress-card {
    background: #000;
    border-color: #fff;
}

body.high-contrast .progress-card-title {
    color: #fff;
}

/* =============================================
   SURVEY QUESTION STYLES (PHASE 17)
   ============================================= */

/* Transition screen shown between assessment and surveys */
.survey-transition {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.1), rgba(6, 182, 212, 0.05));
    border: 2px dashed rgba(16, 185, 129, 0.4);
    border-radius: 1.5rem;
}

.survey-transition-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {

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

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

.survey-transition-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: #10b981;
    margin-bottom: 0.5rem;
}

.survey-transition-text {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.survey-transition-subtext {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.survey-continue-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Wrapper for survey questions */
.survey-question-wrapper {
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.08), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 1.25rem;
    padding: 1.5rem;
    position: relative;
}

/* Survey header with badge and encouragement */
.survey-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed rgba(139, 92, 246, 0.3);
}

.survey-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: linear-gradient(90deg, #8b5cf6, #a855f7);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 999px;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.survey-encouragement {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-style: italic;
}

/* Survey question text styling */
.survey-question-text {
    font-size: 1.3rem !important;
    color: #e0e7ff;
}

/* Survey options styling */
.survey-option {
    border-color: rgba(139, 92, 246, 0.2) !important;
    background: rgba(139, 92, 246, 0.05) !important;
}

.survey-option:hover {
    border-color: #a855f7 !important;
    background: rgba(139, 92, 246, 0.15) !important;
}

.survey-option.selected {
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.2) !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2) !important;
}

/* Thank you message */
.survey-thanks {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(16, 185, 129, 0.3);
    color: #10b981;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Survey written container */
.survey-written {
    border-color: rgba(139, 92, 246, 0.3) !important;
}

.survey-written textarea {
    background: rgba(139, 92, 246, 0.05) !important;
}

/* Animation for entrance */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.animate-fadeIn {
    animation: fadeIn 0.4s ease-out;
}

/* =============================================
   PRACTICE & STUDY MODE — IXL-STYLE FEEDBACK
   ============================================= */

/* Widen results card for practice mode */
.results-section.practice-mode-results {
    max-width: 900px;
}

.results-section.practice-mode-results .results-card {
    text-align: left;
    padding: 2rem;
}

/* Score ring */
.practice-score-ring {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 1.5rem;
}

.practice-score-ring svg {
    transform: rotate(-90deg);
}

.practice-score-ring .ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 10;
}

.practice-score-ring .ring-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s ease-out;
}

.practice-score-ring .score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.practice-score-ring .score-number {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
}

.practice-score-ring .score-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Practice header stats row */
.practice-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.practice-stat-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 0.75rem;
    text-align: center;
}

.practice-stat-card .stat-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.practice-stat-card .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.practice-stat-card .stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Question review list */
.practice-questions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Individual question card */
.practice-q-card {
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s ease;
}

.practice-q-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Card header with status indicator */
.practice-q-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.practice-q-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Status icon circle */
.pq-status-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
}

.pq-status-icon.correct {
    background: rgba(34, 197, 94, 0.15);
    border: 2px solid rgba(34, 197, 94, 0.5);
    color: #22c55e;
}

.pq-status-icon.incorrect {
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

.pq-status-icon.partial {
    background: rgba(251, 191, 36, 0.15);
    border: 2px solid rgba(251, 191, 36, 0.5);
    color: #fbbf24;
}

.pq-status-icon.excellent {
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid rgba(16, 185, 129, 0.5);
    color: #10b981;
}

.pq-status-icon.pending {
    background: rgba(148, 163, 184, 0.15);
    border: 2px solid rgba(148, 163, 184, 0.3);
    color: #94a3b8;
}

/* Header text */
.pq-header-text {
    flex: 1;
    min-width: 0;
}

.pq-question-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.pq-question-preview {
    font-size: 0.95rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Points badge */
.pq-points-badge {
    flex-shrink: 0;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.pq-points-badge.correct {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.pq-points-badge.incorrect {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.pq-points-badge.partial {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.pq-points-badge.excellent {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.pq-points-badge.pending {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Chevron toggle */
.pq-chevron {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.practice-q-card.expanded .pq-chevron {
    transform: rotate(180deg);
}

/* Expandable detail body */
.pq-detail-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.practice-q-card.expanded .pq-detail-body {
    max-height: 2000px;
}

.pq-detail-inner {
    padding: 0 1.25rem 1.25rem;
}

/* Question full text */
.pq-full-question {
    font-size: 1.05rem;
    color: white;
    line-height: 1.6;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
    border-left: 3px solid var(--cyan-glow);
}

/* Answer comparison (MC) */
.pq-answer-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .pq-answer-compare {
        grid-template-columns: 1fr;
    }
}

.pq-answer-box {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
}

.pq-answer-box .pq-answer-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.pq-answer-box.student-answer {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.pq-answer-box.student-answer .pq-answer-label {
    color: #f87171;
}

.pq-answer-box.student-answer .pq-answer-text {
    color: #fca5a5;
}

.pq-answer-box.student-answer.is-correct {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.pq-answer-box.student-answer.is-correct .pq-answer-label {
    color: #22c55e;
}

.pq-answer-box.student-answer.is-correct .pq-answer-text {
    color: #86efac;
}

.pq-answer-box.correct-answer {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.pq-answer-box.correct-answer .pq-answer-label {
    color: #22c55e;
}

.pq-answer-box.correct-answer .pq-answer-text {
    color: #86efac;
}

/* Written answer display */
.pq-written-response {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.pq-written-response .pq-answer-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.pq-written-response .pq-answer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    font-style: italic;
}

/* Explanation card — the IXL-style key learning section */
.pq-explanation-card {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.06), rgba(139, 92, 246, 0.06));
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.pq-explanation-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--cyan-glow);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pq-explanation-header svg {
    width: 18px;
    height: 18px;
}

.pq-explanation-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.pq-explanation-text p {
    margin-bottom: 0.5rem;
}

.pq-explanation-text p:last-child {
    margin-bottom: 0;
}

/* Key concept callout */
.pq-key-concept {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 0.5rem;
    font-size: 0.85rem;
    color: #c4b5fd;
    line-height: 1.5;
}

.pq-key-concept strong {
    color: #a78bfa;
}

/* Classification meter for written answers */
.pq-classification-meter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.pq-meter-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.pq-meter-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-out;
}

.pq-meter-fill.excellent { background: linear-gradient(90deg, #10b981, #34d399); }
.pq-meter-fill.correct { background: linear-gradient(90deg, #22c55e, #4ade80); }
.pq-meter-fill.good { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.pq-meter-fill.partial { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.pq-meter-fill.incorrect { background: linear-gradient(90deg, #ef4444, #f87171); }

.pq-meter-label {
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.pq-meter-label.excellent { color: #10b981; }
.pq-meter-label.correct { color: #22c55e; }
.pq-meter-label.good { color: #22d3ee; }
.pq-meter-label.partial { color: #fbbf24; }
.pq-meter-label.incorrect { color: #f87171; }

/* Staggered entrance animation */
@keyframes practiceCardSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.practice-q-card {
    animation: practiceCardSlideIn 0.4s ease-out both;
}

/* Section divider */
.practice-section-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 1rem;
}

.practice-section-divider .divider-line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.practice-section-divider .divider-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
}

/* AI loading shimmer for pending feedback */
@keyframes feedbackShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.pq-feedback-loading {
    background: linear-gradient(90deg,
        rgba(6, 182, 212, 0.05) 0%,
        rgba(6, 182, 212, 0.15) 50%,
        rgba(6, 182, 212, 0.05) 100%);
    background-size: 200% 100%;
    animation: feedbackShimmer 2s ease-in-out infinite;
    border-radius: 0.5rem;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Practice mode banner in results */
.practice-results-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 9999px;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #34d399;
    letter-spacing: 0.5px;
}

/* Responsive adjustments for practice mode */
@media (max-width: 640px) {
    .results-section.practice-mode-results {
        max-width: 100%;
    }

    .results-section.practice-mode-results .results-card {
        padding: 1.25rem;
    }

    .practice-stats-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .practice-stat-card .stat-value {
        font-size: 1rem;
    }

    .pq-answer-compare {
        grid-template-columns: 1fr;
    }

    .practice-score-ring {
        width: 110px;
        height: 110px;
    }

    .practice-score-ring .score-number {
        font-size: 1.75rem;
    }
}

/* Spinner animation for force-end overlay */
@keyframes spin {
    to { transform: rotate(360deg); }
}