:root {
    --bg-dark: #0b1120;
    --panel-dark: #121b2d;
    --panel-hover: #1a2740;
    --accent: #38bdf8;
    --accent-hover: #7dd3fc;
    --accent-dim: rgba(56, 189, 248, 0.1);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #1e293b;
    --success: #22c55e;
    --danger: #ef4444;
    --sidebar-width: 320px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #2d3a52;
    border-radius: 3px;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a5a78;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #2d3a52 transparent;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--panel-dark);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.03) 0%, transparent 100%);
}

.sidebar-header h2 {
    font-size: 1.15rem;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
}

.sidebar-header h2 i {
    font-size: 1.1rem;
}

.progress-container {
    height: 5px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #4ade80);
    transition: width 0.4s ease;
    border-radius: 4px;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: 6px;
    font-weight: 500;
}

.modules-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px 16px;
}

.modules-list::-webkit-scrollbar {
    width: 4px;
}

.modules-list::-webkit-scrollbar-thumb {
    background: #1e2a3d;
    border-radius: 2px;
}

.module-title {
    font-weight: 700;
    padding: 14px 10px 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.7;
}

.lessons-list {
    list-style: none;
}

.lessons-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    line-height: 1.3;
}

.lessons-list li a i {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.lessons-list li a:hover {
    background-color: rgba(56, 189, 248, 0.06);
    color: var(--accent);
}

.lessons-list li a:hover i {
    color: var(--accent);
}

.lessons-list li.active a {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(56, 189, 248, 0.05));
    border: 1px solid rgba(56, 189, 248, 0.2);
    font-weight: 600;
    color: var(--accent);
    border-left: 3px solid var(--accent);
    border-radius: 6px 4px 4px 6px;
}

.lessons-list li.active a i {
    color: var(--accent);
}

.lessons-list li.completed a i {
    color: var(--success);
}

.lessons-list li.locked a {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.5;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px 36px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.badge {
    background: var(--accent-dim);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    border: 1px solid rgba(56, 189, 248, 0.15);
    display: inline-block;
}

.content-header h1 {
    font-size: 1.65rem;
    margin-top: 8px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* Buttons */
.btn {
    padding: 9px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #0284c7 100%);
    color: white;
    box-shadow: 0 2px 12px rgba(56, 189, 248, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.35);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: rgba(56, 189, 248, 0.06);
    border-color: rgba(56, 189, 248, 0.3);
    color: var(--accent);
}

.video-container {
    width: 100%;
    max-height: 380px; 
    aspect-ratio: 16/9;
    background: radial-gradient(ellipse at center, #0f1a2e, #070d17);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    position: relative;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    gap: 8px;
}

.play-icon {
    font-size: 3.5rem;
    color: var(--accent);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.play-icon:hover {
    transform: scale(1.1);
    opacity: 1;
}

.video-placeholder p {
    font-size: 0.85rem;
    font-weight: 500;
}

.tabs-header {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    padding: 0 4px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px; 
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 6px 6px 0 0;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(56, 189, 248, 0.04);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: var(--accent-dim);
}

.tab-content {
    display: none;
    animation: fadeIn 0.25s ease;
}

.tab-content.active {
    display: block;
}

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.lesson-details {
    animation: slideIn 0.25s ease;
}

.lesson-details h2 {
    margin-bottom: 16px;
    font-size: 1.3rem;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(56, 189, 248, 0.15);
    color: var(--accent);
}

.lesson-details p {
    color: #cbd5e1;
    line-height: 1.7;
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.lesson-details p strong {
    color: #f1f5f9;
}

.code-block {
    background: #0d1117;
    padding: 18px;
    border-radius: 10px;
    border: 1px solid #21262d;
    font-family: 'Consolas', 'Courier New', monospace;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.code-block {
    transition: box-shadow 0.2s ease;
}

.code-block:hover {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.code-block pre {
    font-family: 'Consolas', 'Courier New', monospace;
    color: #e6edf3;
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-block pre code {
    color: inherit;
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

.code-block > code {
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.12);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.85rem;
}

.quiz-card {
    background-color: var(--panel-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.quiz-header h3 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quiz-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.question-box {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 20px;
    min-height: 90px;
    display: flex;
    align-items: center;
}

.question-box p {
    font-size: 1.15rem;
    line-height: 1.5;
}

.quiz-setup-box h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: var(--text-main);
}

.feedback-message {
    margin-top: 15px;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    min-height: 24px;
}

.feedback-correct { 
    color: var(--success); 
}
.feedback-wrong { 
    color: #f87171; 
}

.quiz-results {
    text-align: center;
    padding: 20px 0;
}

.quiz-results h3 { 
    font-size: 1.6rem; 
    margin-bottom: 10px; 
}

.quiz-results p { 
    font-size: 1.25rem; 
    margin-bottom: 20px; 
    color: var(--accent); 
    font-weight: 600;
}

.code-window {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    margin-top: 15px;
}

.window-header {
    background: #161b22;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #21262d;
    position: relative;
}

.window-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.window-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: #8b949e;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-weight: 500;
}

.window-body {
    padding: 24px;
}

/* Terminal & Question Design */
.code-prompt {
    font-family: 'Fira Code', 'Consolas', monospace;
    color: #58a6ff;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.quiz-desc {
    color: #8b949e;
    margin-bottom: 15px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.question-terminal-box {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 18px;
    margin: 16px 0;
    font-family: 'Fira Code', 'Consolas', monospace;
    color: #e6edf3;
    font-size: 1rem;
    line-height: 1.6;
}

.line-number {
    color: #484f58;
    margin-right: 15px;
    user-select: none;
}

.quiz-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.score-badge {
    font-family: 'Fira Code', 'Consolas', monospace;
    background: #0d1117;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid #21262d;
    color: #7ee787;
    font-size: 0.85rem;
}

/* Modern Quiz Buttons */
.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-quiz {
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-true {
    background: #238636;
    color: #ffffff;
}

.btn-true:hover {
    background: #2ea043;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(35, 134, 54, 0.3);
}

.btn-false {
    background: #da3633;
    color: #ffffff;
}

.btn-false:hover {
    background: #f85149;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(218, 54, 51, 0.3);
}

/* ---- Quiz widget (lesson sidebar quizzes) ---- */
.quiz-widget {
    background: linear-gradient(145deg, #121b2d, #0f172a);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    margin-top: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.quiz-widget-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 22px;
    background: linear-gradient(135deg, rgba(56,189,248,0.12), rgba(99,102,241,0.12));
    border-bottom: 1px solid var(--border-color);
}

.quiz-widget-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
}

.quiz-widget-title i {
    color: var(--accent);
}

.quiz-widget-count {
    margin-left: auto;
    color: var(--success);
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.quiz-widget-body {
    padding: 24px;
}

/* Setup state */
.quiz-setup {
    text-align: center;
    padding: 12px 0 6px;
}

.quiz-setup-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 1.4rem;
}

.quiz-setup-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 18px;
}

.quiz-start-btn,
.quiz-retry-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.quiz-start-btn:hover,
.quiz-retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

/* Active state */
.quiz-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.quiz-progress-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.quiz-score-badge {
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.1);
    padding: 4px 12px;
    border-radius: 999px;
}

.quiz-progress-track {
    height: 6px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 22px;
}

.quiz-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #6366f1);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.quiz-question-text {
    color: var(--text-main);
    font-size: 1.05rem;
    line-height: 1.7;
    text-align: center;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 22px;
    margin-bottom: 22px;
    min-height: 32px;
}

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

.quiz-answer-btn {
    padding: 13px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.quiz-answer-true {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.quiz-answer-true:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.35);
}

.quiz-answer-false {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.quiz-answer-false:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

/* Results state */
.quiz-results {
    text-align: center;
    padding: 10px 0 4px;
}

.quiz-result-emoji {
    font-size: 3rem;
    margin-bottom: 10px;
}

.quiz-result-title {
    color: var(--text-main);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.quiz-result-score {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.quiz-result-score span {
    color: var(--accent);
    font-weight: 700;
}

.quiz-result-message {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 18px;
}

.quiz-result-track {
    max-width: 260px;
    margin: 0 auto 22px;
    height: 8px;
}

/* ============================================================
   RESPONSIVE  —  mobile / tablet layer
   ============================================================ */

/* Chrome that only exists on small screens. Rendered in the markup
   at all times, revealed by the media queries below. */
.pa-mobile-bar,
.pa-sidebar-backdrop,
.pa-sidebar-close {
    display: none;
}

.pa-mobile-bar-btn {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--panel-dark);
    color: var(--text-main);
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pa-mobile-bar-btn:active {
    background: var(--panel-hover);
}

.pa-mobile-bar-title {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Tablet & below: sidebar becomes an off-canvas drawer ---- */
@media (max-width: 1024px) {
    .pa-mobile-bar {
        display: flex;
        align-items: center;
        gap: 12px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        padding: 0 14px;
        z-index: 1200;
        background: rgba(11, 17, 32, 0.94);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border-color);
    }

    .pa-mobile-bar .pa-account-widget {
        font-size: 0.72rem;
        gap: 6px;
        min-width: 0;
    }

    /* Truncate the username only — never the "Σύνδεση / Εγγραφή" prompt. */
    .pa-mobile-bar .pa-account-widget > span:not(.pa-logout):not(.pa-back-link) {
        max-width: 88px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .pa-mobile-bar .pa-account-widget .pa-back-link {
        white-space: nowrap;
    }

    /* The desktop copy of the widget lives in .content-header; on mobile the
       drawer bar carries it instead. Inline style needs !important. */
    .content-header .pa-account-widget {
        display: none !important;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(86vw, var(--sidebar-width));
        z-index: 1300;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        border-right: 1px solid var(--border-color);
        will-change: transform;
    }

    .sidebar.pa-open {
        transform: translateX(0);
        box-shadow: 0 0 48px rgba(0, 0, 0, 0.6);
    }

    .pa-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1250;
        background: rgba(2, 6, 16, 0.65);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .pa-sidebar-backdrop.pa-open {
        opacity: 1;
        pointer-events: auto;
    }

    .pa-sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 14px;
        right: 14px;
        width: 34px;
        height: 34px;
        border: none;
        border-radius: 8px;
        background: rgba(148, 163, 184, 0.1);
        color: var(--text-muted);
        font-size: 1.1rem;
        cursor: pointer;
    }

    .sidebar-header {
        position: relative;
        padding-right: 58px;
    }

    /* Drawer is out of flow, so main content spans the viewport. */
    .main-content {
        padding: 76px 20px 40px;
    }

    /* Comfortable touch targets in the lesson list. */
    .lessons-list li a {
        padding: 11px 12px;
        font-size: 0.88rem;
    }

}

/* ---- Phones ---- */
@media (max-width: 700px) {
    .main-content {
        padding: 72px 14px 36px;
    }

    .content-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-bottom: 18px;
        padding-bottom: 14px;
    }

    .content-header h1 {
        font-size: 1.3rem;
        line-height: 1.3;
    }

    #next-lesson-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 18px;
    }

    /* Tabs scroll sideways instead of squeezing. */
    .tabs-header {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-bottom: 18px;
    }

    .tabs-header::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        flex-shrink: 0;
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    /* Lesson bodies are authored with inline multi-column grids.
       Collapse them all to a single column on narrow screens. */
    .lesson-details div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .lesson-details,
    .lesson-details p,
    .lesson-details li {
        overflow-wrap: break-word;
    }

    .lesson-details h2 {
        font-size: 1.15rem;
    }

    .lesson-details table {
        font-size: 0.75rem;
    }

    .lesson-details th,
    .lesson-details td {
        padding: 8px 6px !important;
    }

    .code-block {
        padding: 14px;
        border-radius: 8px;
    }

    .code-block pre {
        font-size: 0.82rem;
    }

    .video-container {
        margin-bottom: 18px;
    }

    .play-icon {
        font-size: 2.5rem;
    }

    /* Quiz widgets */
    .quiz-widget-header {
        padding: 14px 16px;
        align-items: flex-start;
    }

    /* Let the title wrap rather than shoving the count badge onto its own row. */
    .quiz-widget-title {
        flex: 1;
        min-width: 0;
        font-size: 0.9rem;
    }

    .quiz-widget-count {
        font-size: 0.7rem;
        padding: 4px 9px;
    }

    .quiz-widget-body,
    .quiz-card,
    .window-body {
        padding: 16px;
    }

    .quiz-question-text {
        font-size: 0.95rem;
        padding: 16px;
        margin-bottom: 18px;
    }

    .quiz-answer-row,
    .quiz-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .quiz-answer-btn,
    .btn-quiz {
        padding: 14px;
    }

    .quiz-header {
        gap: 10px;
    }

    .question-box {
        padding: 16px;
    }

    .question-box p {
        font-size: 1rem;
    }

    .question-terminal-box {
        padding: 14px;
        font-size: 0.9rem;
        overflow-x: auto;
    }

    /* Absolutely-centred filename overlaps the traffic-light dots. */
    .window-title {
        display: none;
    }

    .quiz-results h3 {
        font-size: 1.3rem;
    }

    .quiz-results p {
        font-size: 1.05rem;
    }
}

@media (max-width: 400px) {
    .main-content {
        padding: 70px 11px 32px;
    }

    .content-header h1 {
        font-size: 1.15rem;
    }

    .quiz-start-btn,
    .quiz-retry-btn {
        width: 100%;
        justify-content: center;
        padding: 13px 20px;
    }
}

/* Hover lift effects misfire on touch (they stick after a tap). */
@media (hover: none) {
    .btn-primary:hover,
    .quiz-start-btn:hover,
    .quiz-retry-btn:hover,
    .quiz-answer-true:hover,
    .quiz-answer-false:hover,
    .btn-true:hover,
    .btn-false:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .pa-sidebar-backdrop {
        transition: none;
    }
}

