/* Base styles and variables */
:root {
    --primary-color: #0ea5e9;      /* ShortNotesLK Blue */
    --primary-hover: #0284c7;
    --bg-color: #f3f4f6;           /* Light gray background */
    --card-bg: #ffffff;
    --text-main: #111827;          /* Dark gray for main text */
    --text-muted: #6b7280;         /* Lighter gray for secondary text */
    --success-color: #10b981;      /* Emerald green for correct answers */
    --error-color: #ef4444;        /* Red for wrong answers/errors */
    --border-color: #e5e7eb;
    --radius: 12px;
}

/* Global Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding: 20px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* Main Container */
.app-container {
    width: 100%;
    max-width: 600px; /* Mobile responsive, but looks good on desktop */
    margin: 0 auto;
    padding-top: 40px;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 30px;
}

.brand-logo {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.brand-dot {
    color: var(--primary-color);
}

.brand-sub {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-muted);
}

.app-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* Card Component (used for input and questions) */
.card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Mascot Component */
.mascot-wrapper {
    position: fixed;
    top: 30px;
    right: 30px;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 16px;
    z-index: 50;
    max-width: 340px;
}

/* ---- SVG Mascot Wrapper ---- */
.mascot-svg-wrapper {
    position: relative;
    flex-shrink: 0;
    width: 110px;
    height: 146px;
    filter: drop-shadow(0 6px 14px rgba(108, 99, 255, 0.35));
}

#mascot-svg {
    animation: mascot-float 3s ease-in-out infinite;
    transform-origin: bottom center;
    overflow: visible;
}

/* ---- Base float ---- */
@keyframes mascot-float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    30%       { transform: translateY(-7px) rotate(1.5deg); }
    70%       { transform: translateY(-4px) rotate(-1deg); }
}

/* ---- Idle blink: scale eyes vertically to zero briefly ---- */
.emotion-default .mascot-pupil-l,
.emotion-default .mascot-pupil-r {
    animation: mascot-blink 4s ease-in-out infinite;
    transform-origin: center;
}
.emotion-default .mascot-pupil-r { animation-delay: 0.06s; }

@keyframes mascot-blink {
    0%, 92%, 100% { transform: scaleY(1); }
    94%, 96%      { transform: scaleY(0.05); }
}

/* ---- HAPPY: bouncy jump ---- */
#mascot-svg.emotion-happy {
    animation: mascot-bounce 0.7s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite alternate;
}
@keyframes mascot-bounce {
    0%   { transform: translateY(0px) scale(1, 1); }
    60%  { transform: translateY(-14px) scale(1.04, 0.97); }
    100% { transform: translateY(-18px) scale(1.06, 0.95); }
}

/* ---- THINKING: slow sway ---- */
#mascot-svg.emotion-thinking {
    animation: mascot-sway 2.2s ease-in-out infinite;
}
@keyframes mascot-sway {
    0%, 100% { transform: rotate(-4deg) translateY(0); }
    50%       { transform: rotate(4deg) translateY(-3px); }
}

/* ---- EXCITED: fast wiggle ---- */
#mascot-svg.emotion-excited {
    animation: mascot-wiggle 0.3s ease-in-out infinite alternate;
}
@keyframes mascot-wiggle {
    0%   { transform: rotate(-6deg) scale(1.05); }
    100% { transform: rotate(6deg) scale(1.08); }
}

/* ---- SAD: droop & slow bob ---- */
#mascot-svg.emotion-sad {
    animation: mascot-sad 2.8s ease-in-out infinite;
}
@keyframes mascot-sad {
    0%, 100% { transform: translateY(0px) rotate(-2deg); }
    50%       { transform: translateY(4px) rotate(1deg); }
}

/* ---- PERFECT: spin-jump celebration ---- */
#mascot-svg.emotion-perfect {
    animation: mascot-celebrate 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite alternate;
}
@keyframes mascot-celebrate {
    0%   { transform: translateY(0) rotate(0deg) scale(1); }
    50%  { transform: translateY(-22px) rotate(8deg) scale(1.1); }
    100% { transform: translateY(-10px) rotate(-5deg) scale(1.05); }
}

/* ---- Particle container ---- */
.mascot-particles {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.mascot-particle {
    position: absolute;
    border-radius: 50%;
    animation: particle-burst 0.9s ease-out forwards;
    width: 8px;
    height: 8px;
}

@keyframes particle-burst {
    0%   { transform: translate(0,0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

.speech-bubble {
    position: relative;
    background: white;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    flex: 1;
    transition: background 0.4s ease, border-color 0.4s ease;
}

.speech-bubble p {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    margin: 0;
    transition: color 0.3s ease;
}

/* Speech Bubble Arrow - Pointing RIGHT towards the mascot */
.speech-bubble::before {
    content: '';
    position: absolute;
    top: 50%;
    right: -8px; 
    left: auto;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid var(--border-color);
    border-right: none;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6.5px;
    left: auto;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 7px solid white;
    border-right: none;
}



/* Premium Settings Container */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    background: #f8fafc;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

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

.setting-group > label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Segmented Control Styling */
.segmented-control {
    display: flex;
    background-color: #e2e8f0;
    padding: 4px;
    border-radius: 8px;
    position: relative;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segment-label {
    flex: 1;
    text-align: center;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    user-select: none;
}

.segmented-control input[type="radio"]:checked + .segment-label {
    background-color: white;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    font-weight: 600;
}

.segment-label:hover {
    color: var(--text-main);
}

/* Textarea styling */
textarea {
    width: 100%;
    padding: 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

textarea::placeholder {
    color: #9ca3af;
}

/* Buttons */
.primary-btn, .secondary-btn {
    width: 100%;
    padding: 16px; /* Larger click target for mobile */
    border: none;
    border-radius: 12px; /* Rounder corners */
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); /* Smoother interaction */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.primary-btn:hover:not(:disabled) {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
    transform: translateY(-2px);
}

.primary-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.primary-btn:disabled {
    background-color: #9ca3af;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    background-color: white;
    color: var(--text-main);
    border: 1.5px solid var(--border-color);
    margin-top: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.secondary-btn:hover {
    background-color: var(--bg-color);
    border-color: #d1d5db;
    transform: translateY(-2px);
}

/* Small inline loader for button */
.loader {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Main Spinner for loading section */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(79, 70, 229, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loading Section */
#loading-section {
    text-align: center;
    padding: 40px 0;
}

#loading-section p {
    color: var(--text-muted);
    font-weight: 500;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.error {
    color: var(--error-color);
    margin-top: 12px;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

/* --- Quiz Styles --- */

.progress-header {
    background: var(--card-bg);
    padding: 20px 24px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
}

#score-count {
    color: var(--primary-color);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: var(--bg-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.question-block {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.question-text {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-main);
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Updated Option Button for MCQ feel */
.option-btn {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-main);
    position: relative;
}

.option-label {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--bg-color);
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.option-btn:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #d1d5db;
}

.option-btn:hover:not(:disabled) .option-label {
    background-color: var(--primary-color);
    color: white;
}

.option-text {
    flex-grow: 1;
}

/* Correct/Incorrect Answer Highlights with Icons */
.option-btn .result-icon {
    display: none;
    font-size: 1.2rem;
    font-weight: bold;
    margin-left: 12px;
}

.option-btn.correct {
    background-color: #d1fae5;
    border-color: var(--success-color);
    color: #065f46;
}

.option-btn.correct .option-label {
    background-color: var(--success-color);
    color: white;
}

.option-btn.correct .result-icon.check {
    display: block;
    color: var(--success-color);
}

.option-btn.incorrect {
    background-color: #fee2e2;
    border-color: var(--error-color);
    color: #991b1b;
}

.option-btn.incorrect .option-label {
    background-color: var(--error-color);
    color: white;
}

.option-btn.incorrect .result-icon.cross {
    display: block;
    color: var(--error-color);
}

.option-btn:disabled {
    cursor: default;
}

/* Rewards Animations */
@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#results-container {
    text-align: center;
    background: var(--card-bg);
    padding: 40px 32px;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-top: 24px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reward-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    60% { transform: translateY(-7px); }
}

#final-score {
    font-size: 1.75rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 10px;
}

/* ---- Shake animation for wrong-answer speech bubble ---- */
@keyframes bubble-shake {
    0%, 100% { transform: translateX(0); }
    15%       { transform: translateX(-6px) rotate(-1deg); }
    30%       { transform: translateX(6px) rotate(1deg); }
    45%       { transform: translateX(-5px); }
    60%       { transform: translateX(5px); }
    75%       { transform: translateX(-3px); }
    90%       { transform: translateX(3px); }
}

.speech-bubble.roasting {
    animation: bubble-shake 0.5s ease-in-out;
    border-color: var(--error-color);
    background: #fff1f2;
}

/* === TABLET (≤ 1024px): mascot goes inline === */
@media (max-width: 1024px) {
    .mascot-wrapper {
        position: static;
        flex-direction: row;
        margin: 0 auto 24px;
        max-width: 100%;
        padding: 0 10px;
        justify-content: flex-start;
    }

    .mascot-svg-wrapper {
        width: 80px;
        height: 106px;
    }

    #mascot-svg {
        width: 80px;
        height: 106px;
    }

    /* Arrow points LEFT toward mascot */
    .speech-bubble::before {
        left: -8px;
        right: auto;
        border-right: 8px solid var(--border-color);
        border-left: none;
    }
    .speech-bubble::after {
        left: -6.5px;
        right: auto;
        border-right: 7px solid white;
        border-left: none;
    }
}

/* === MOBILE (≤ 600px): full overhaul === */
@media (max-width: 600px) {
    /* --- Layout --- */
    body {
        padding: 0;
        background-color: #eef0f8;
    }

    .app-container {
        padding: 12px;
        padding-top: 16px;
        max-width: 100%;
    }

    /* --- Header --- */
    .app-header {
        margin-bottom: 16px;
    }

    .app-header h1 {
        font-size: 1.4rem;
        letter-spacing: -0.3px;
    }

    .app-header p {
        font-size: 0.82rem;
    }

    /* --- Mascot: compact pill at top --- */
    .mascot-wrapper {
        position: static;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        margin: 0 0 14px;
        padding: 0;
        max-width: 100%;
        background: white;
        border-radius: 16px;
        padding: 10px 14px;
        box-shadow: 0 2px 10px rgba(108,99,255,0.12);
        border: 1px solid #e0deff;
    }

    .mascot-svg-wrapper {
        width: 58px;
        height: 77px;
        flex-shrink: 0;
    }

    #mascot-svg {
        width: 58px;
        height: 77px;
    }

    .speech-bubble {
        flex: 1;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    /* Hide the arrow on mobile since bubble is inline */
    .speech-bubble::before,
    .speech-bubble::after {
        display: none;
    }

    .speech-bubble p {
        font-size: 0.85rem;
    }
}

/* ── Credit Badge ──────────────────────────────────────────────────────────── */
.credit-badge-wrapper {
    margin-top: 10px;
}

.credit-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
    white-space: nowrap;
    transition: box-shadow 0.2s;
}

.credit-badge--low {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
    animation: pulse-low 1.5s ease-in-out infinite;
}

.credit-badge--guest {
    background: #6b7280;
    box-shadow: none;
}

.credit-badge--error {
    background: #9ca3af;
    box-shadow: none;
}

.credit-pending {
    font-size: 0.75rem;
    opacity: 0.85;
    margin-left: 4px;
}

@keyframes pulse-low {
    0%, 100% { box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35); }
    50%       { box-shadow: 0 4px 16px rgba(239, 68, 68, 0.6); }
}

/* ── Modal Overlay ─────────────────────────────────────────────────────────── */
body.modal-open { overflow: hidden; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-card {
    background: white;
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.modal-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.modal-close {
    background: var(--bg-color);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
    background: #e5e7eb;
    color: var(--text-main);
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 20px;
}

/* ── Credit Steps ──────────────────────────────────────────────────────────── */
.credit-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.credit-step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-main);
}

.step-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

/* ── Upload Dropzone ───────────────────────────────────────────────────────── */
.upload-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 28px 16px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
}

.upload-dropzone:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.04);
}

.dropzone-icon {
    font-size: 2rem;
}

.dropzone-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.dropzone-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-chosen-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    min-height: 1.2em;
}

/* ── Upload Status Message ─────────────────────────────────────────────────── */
.upload-status {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    min-height: 1.3em;
    border-radius: 8px;
    padding: 0;
    transition: all 0.2s;
}

.upload-status--success {
    background: #d1fae5;
    color: #065f46;
    padding: 10px 14px;
}

.upload-status--error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 14px;
}

/* ── Modal Mobile Fixes ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .modal-card {
        padding: 24px 20px;
        border-radius: 16px;
    }
    .modal-title { font-size: 1.2rem; }
}

    .speech-bubble p {
        font-size: 0.82rem;
        line-height: 1.4;
        color: var(--text-main);
    }

    /* --- Card / Input section --- */
    .card {
        padding: 14px;
        border-radius: 14px;
    }

    /* --- Settings --- */
    .settings-container {
        padding: 12px;
        gap: 14px;
        margin-bottom: 16px;
    }

    .setting-group > label {
        font-size: 0.75rem;
    }

    .segmented-control {
        flex-direction: column;
        gap: 4px;
    }

    .segment-label {
        font-size: 0.9rem;
        padding: 11px 12px;
        border-radius: 6px;
        text-align: center;
    }

    /* --- Textarea --- */
    textarea {
        font-size: 0.92rem;
        padding: 12px;
        rows: 6;
    }

    /* --- Buttons --- */
    .primary-btn,
    .secondary-btn {
        padding: 15px;
        font-size: 1rem;
        border-radius: 14px;
    }

    /* --- Progress header --- */
    .progress-header {
        padding: 14px 16px;
        margin-bottom: 14px;
    }

    .progress-text {
        font-size: 0.82rem;
        margin-bottom: 8px;
    }

    .progress-bar-container {
        height: 7px;
    }

    /* --- Quiz questions --- */
    .question-block {
        padding: 16px 14px;
        margin-bottom: 14px;
        border-radius: 14px;
    }

    .question-text {
        font-size: 1rem;
        margin-bottom: 14px;
        line-height: 1.5;
    }

    .options-list {
        gap: 10px;
    }

    /* Big tap targets for mobile fingers */
    .option-btn {
        padding: 14px 12px;
        font-size: 0.9rem;
        border-radius: 10px;
        min-height: 52px;
        /* prevent text overflow on narrow screens */
        word-break: break-word;
    }

    .option-label {
        width: 26px;
        height: 26px;
        font-size: 0.85rem;
        margin-right: 10px;
        flex-shrink: 0;
    }

    .result-icon {
        font-size: 1rem;
        margin-left: 8px;
    }

    /* --- Results --- */
    #results-container {
        padding: 28px 20px;
    }

    #final-score {
        font-size: 1.4rem;
    }

    .reward-icon {
        font-size: 3.2rem;
    }

    /* --- Loading section --- */
    #loading-section {
        padding: 30px 0;
    }

/* --- ACCESSIBLE TOGGLE SWITCH --- */
.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
    padding: 12px 0; /* large tap target for mobile */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
    z-index: 20;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: relative;
    width: 46px;
    height: 26px;
    background-color: #cbd5e1;
    border-radius: 26px;
    transition: 0.3s;
    flex-shrink: 0;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color, #0f766e);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-label-text {
    font-size: 0.9rem;
    color: var(--text-muted, #64748b);
    line-height: 1.4;
    user-select: none;
    text-align: left;
}

.toggle-switch:hover .toggle-slider {
    background-color: #94a3b8;
}

.toggle-switch input:checked:hover + .toggle-slider {
    background-color: #0d6059;
}
