/* IQ Test - Styling & Design System */
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    --bg-gradient: radial-gradient(circle at 10% 20%, #0f172a 0%, #1e1b4b 50%, #020617 100%);
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-hover: rgba(255, 255, 255, 0.08);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    background-attachment: fixed;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #a855f7, #06b6d4);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography */
h1 {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #ffffff 30%, #c7d2fe 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}

h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 12px;
}

p {
    color: #cbd5e1;
    margin-bottom: 16px;
    font-size: 1.05rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 28px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    border: none;
    gap: 10px;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.55);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.55);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    color: #e2e8f0;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: #fff;
    background: var(--primary-light);
}

/* Badges & Tags */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-info {
    background: rgba(6, 182, 212, 0.2);
    color: #67e8f9;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Note box / Instruction box */
.note-box {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 24px 0;
}

.note-box p {
    margin-bottom: 8px;
}

.note-box p:last-child {
    margin-bottom: 0;
}

.instruction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.instruction-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.instruction-item .icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    line-height: 1;
}

.instruction-item h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.instruction-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

/* Forms (Register page) */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 24px 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #cbd5e1;
}

.form-input {
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    background: rgba(15, 23, 42, 0.85);
}

.form-input::placeholder {
    color: var(--text-dim);
}

/* Test Page Layout */
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 24px;
}

.participant-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.participant-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1rem;
}

.timer-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.8);
    border: 1.5px solid rgba(99, 102, 241, 0.4);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: #a5b4fc;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.timer-box.warning {
    border-color: var(--warning);
    color: var(--warning);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
    animation: pulse 1s infinite;
}

.timer-box.danger {
    border-color: var(--danger);
    color: var(--danger);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.35);
    animation: pulse 0.6s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Progress bar */
.progress-container {
    margin-bottom: 24px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.progress-track {
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a855f7, #06b6d4);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Question Navigator Grid */
.question-nav-grid {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 6px;
    margin-bottom: 28px;
    background: rgba(15, 23, 42, 0.4);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.q-nav-btn {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.q-nav-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.q-nav-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    font-weight: 700;
}

.q-nav-btn.answered {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
}

.q-nav-btn.answered.active {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

/* Question Card */
.question-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 28px;
}

.question-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.question-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.6;
    margin-bottom: 20px;
}

.question-image-container {
    display: none;
    text-align: center;
    margin: 16px auto 20px auto;
    padding: 12px;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.question-image-container.has-image {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.question-image-container img {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Options Grid */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    gap: 16px;
}

.option-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateX(4px);
}

.option-item.selected {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

.option-radio {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.option-item.selected .option-radio {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.option-text {
    font-size: 1.05rem;
    color: #e2e8f0;
    flex-grow: 1;
}

.option-item.selected .option-text {
    color: #ffffff;
    font-weight: 600;
}

/* Navigation buttons below question */
.test-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
    width: 100%;
}

.test-nav-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.test-nav-row .btn {
    flex: 1;
    justify-content: center;
}

#finishBtn {
    width: 100%;
    justify-content: center;
}

/* Results Screen */
.results-header {
    text-align: center;
    margin-bottom: 32px;
}

.iq-score-display {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: var(--radius-xl);
    padding: 36px 24px;
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
}

.score-numbers {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
}

.score-main {
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.score-total {
    font-size: 1.8rem;
    color: var(--text-dim);
    font-weight: 600;
}

.iq-range-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 8px 24px;
    border-radius: 9999px;
    font-size: 1.25rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    margin-bottom: 14px;
}

.iq-level-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

/* Subscales Cards */
.subscales-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.subscale-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.subscale-icon {
    font-size: 2rem;
    line-height: 1;
}

.subscale-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #cbd5e1;
}

.subscale-score {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
}

.subscale-score span {
    font-size: 1rem;
    color: var(--text-dim);
    font-weight: 500;
}

.subscale-bar-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    overflow: hidden;
}

.subscale-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.subscale-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 4px;
}

/* Interpretation Sections */
.interpretation-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.interpretation-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.famous-matches {
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--primary);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-top: 14px;
    font-size: 0.95rem;
    color: #c7d2fe;
}

/* Question Breakdown Accordion/List */
.breakdown-section {
    margin-top: 32px;
}

.breakdown-toggle-btn {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
    transition: all 0.2s;
}

.breakdown-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.09);
}

.breakdown-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.breakdown-item {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 16px 20px;
}

.breakdown-item.correct {
    border-left: 4px solid var(--success);
}

.breakdown-item.incorrect {
    border-left: 4px solid var(--danger);
}

.breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
}

.breakdown-answer-row {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    margin-top: 6px;
}

.breakdown-explanation {
    margin-top: 8px;
    font-size: 0.88rem;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

/* Modal Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Print Styles (Strictly for Reports & PDF generation) */
@media print {
    body {
        background: #ffffff !important;
        color: #0f172a !important;
        padding: 0 !important;
    }

    .container {
        max-width: 100% !important;
        width: 100% !important;
    }

    .glass-card {
        background: #ffffff !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        backdrop-filter: none !important;
    }

    .glass-card::before {
        display: none !important;
    }

    h1, h2, h3, h4, p, span, div {
        color: #0f172a !important;
        -webkit-text-fill-color: initial !important;
    }

    .no-print,
    .btn,
    .test-actions,
    .q-nav-btn,
    .question-nav-grid,
    .breakdown-toggle-btn {
        display: none !important;
    }

    .iq-score-display {
        background: #f8fafc !important;
        border: 2px solid #cbd5e1 !important;
        color: #0f172a !important;
        page-break-inside: avoid;
    }

    .score-main {
        color: #4f46e5 !important;
        -webkit-text-fill-color: #4f46e5 !important;
    }

    .iq-range-badge {
        background: #4f46e5 !important;
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    .subscales-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        page-break-inside: avoid;
    }

    .subscale-card {
        background: #f8fafc !important;
        border: 1px solid #cbd5e1 !important;
        page-break-inside: avoid;
    }

    .subscale-bar-track {
        background: #e2e8f0 !important;
    }

    .interpretation-card {
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        page-break-inside: avoid;
        margin-bottom: 16px !important;
    }

    .famous-matches {
        background: #f1f5f9 !important;
        border-left: 3px solid #4f46e5 !important;
        color: #334155 !important;
    }

    .breakdown-list {
        display: flex !important;
    }

    .breakdown-item {
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        page-break-inside: avoid;
    }
}

/* Mobile Responsiveness - Optimized for 1-Screen View Without Scrolling */
@media (max-width: 768px) {
    body {
        padding: 8px 6px 20px 6px !important;
        align-items: flex-start !important;
        background-attachment: scroll !important;
    }

    .container {
        width: 100% !important;
        max-width: 100% !important;
    }

    .glass-card {
        padding: 14px 10px !important;
        border-radius: var(--radius-md) !important;
    }

    /* Test View specifically on Mobile */
    #testView.glass-card {
        padding: 10px 10px !important;
        margin: 0 auto !important;
    }

    /* Compact 1-row Header */
    .test-header {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding-bottom: 6px !important;
        margin-bottom: 6px !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .participant-badge {
        display: flex !important;
        align-items: center !important;
        padding: 4px 8px !important;
        gap: 6px !important;
        background: rgba(255, 255, 255, 0.04) !important;
        border-radius: 8px !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .participant-avatar {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        font-size: 0.75rem !important;
        flex-shrink: 0 !important;
    }

    #participantName {
        font-size: 0.82rem !important;
        max-width: 120px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #participantMeta {
        display: none !important;
    }

    .timer-box {
        display: flex !important;
        align-items: center !important;
        padding: 3px 10px !important;
        font-size: 0.95rem !important;
        border-radius: 8px !important;
        gap: 6px !important;
        height: 30px !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        margin-left: auto !important;
        white-space: nowrap !important;
    }

    .timer-box svg,
    .timer-box i {
        width: 14px !important;
        height: 14px !important;
    }

    /* Compact Progress */
    .progress-container {
        margin-bottom: 6px !important;
    }

    .progress-info {
        font-size: 0.72rem !important;
        margin-bottom: 3px !important;
    }

    .progress-track {
        height: 4px !important;
    }

    /* Horizontal single-row scrollable question strip */
    .question-nav-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        gap: 4px !important;
        padding: 4px 2px !important;
        margin-bottom: 6px !important;
        scrollbar-width: none !important;
        background: rgba(15, 23, 42, 0.4) !important;
        border-radius: 8px !important;
    }

    .question-nav-grid::-webkit-scrollbar {
        display: none !important;
    }

    .q-nav-btn {
        width: 28px !important;
        min-width: 28px !important;
        height: 26px !important;
        aspect-ratio: auto !important;
        font-size: 0.72rem !important;
        border-radius: 6px !important;
        flex-shrink: 0 !important;
        padding: 0 !important;
    }

    /* Question Card Compact */
    .question-card {
        padding: 10px 10px !important;
        margin-bottom: 6px !important;
        border-radius: 12px !important;
    }

    .question-meta {
        margin-bottom: 4px !important;
        gap: 4px !important;
    }

    .question-meta .badge {
        font-size: 0.68rem !important;
        padding: 2px 6px !important;
    }

    #questionBadge {
        font-size: 0.7rem !important;
    }

    .question-title {
        font-size: 0.92rem !important;
        line-height: 1.35 !important;
        margin-bottom: 8px !important;
    }

    .question-image-container {
        display: none !important;
        margin: 4px auto 8px auto !important;
        padding: 4px 8px !important;
        max-width: 100% !important;
        max-height: 100px !important;
        border-radius: 8px !important;
    }

    .question-image-container.has-image {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .question-image-container img {
        max-height: 95px !important;
        width: auto !important;
        max-width: 100% !important;
        object-fit: contain !important;
    }

    /* Options Grid Compact */
    .options-grid {
        gap: 5px !important;
    }

    .option-item {
        padding: 7px 10px !important;
        gap: 8px !important;
        border-radius: 8px !important;
        min-height: 38px !important;
    }

    .option-radio {
        width: 20px !important;
        height: 20px !important;
        font-size: 0.72rem !important;
        min-width: 20px !important;
        border-width: 1.5px !important;
    }

    .option-text {
        font-size: 0.85rem !important;
        line-height: 1.25 !important;
    }

    /* Mobile Buttons Layout - Placed right after 5th option */
    .test-actions {
        position: static !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        margin-top: 14px !important;
        margin-bottom: 2px !important;
        width: 100% !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        z-index: auto !important;
    }

    .test-nav-row {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 480px !important;
        margin: 0 auto !important;
    }

    .test-nav-row .btn,
    .test-nav-row #prevBtn,
    .test-nav-row #nextBtn {
        flex: 1 1 50% !important;
        width: 50% !important;
        max-width: 50% !important;
        padding: 10px 8px !important;
        font-size: 0.9rem !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
        gap: 6px !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
        min-height: 44px !important;
        height: 44px !important;
    }

    #finishBtn {
        display: none !important;
    }

    /* Headings and subscales on Mobile */
    h1 {
        font-size: 1.5rem !important;
    }

    .form-grid {
        grid-template-columns: 1fr !important;
    }

    .subscales-grid {
        grid-template-columns: 1fr !important;
    }

    .score-main {
        font-size: 3rem !important;
    }
}
