/* ================= BASE THEME ================= */ :root { /* Primary colors */ --primary-color: #5e4b8b; --primary-light: #8a77b5; --primary-dark: #3b2e63; /* Secondary colors */ --secondary-color: #444444; --secondary-dark: #222222; /* Text colors */ --text-color: #333333; --dark-text: #111111; --light-text: #666666; --editor-text: #d4d4d4; --white-text: #ffffff; /* Background colors */ --bg-color: #f8f7fc; --panel-bg: #ffffff; --code-bg: #f7f5fa; --editor-bg: #1e1e1e; --editor-highlight: #303030; /* Border colors */ --border-color: #e0e0e0; /* Status colors */ --info-color: #7a93fe; --success-color: #58b890; --success-color-dark: #3d8d6a; --success-color-light: #a3e6c8; --error-color: #cb6e75; --danger-color: #dc3545; /* Special colors */ --primary-bg-light: rgba(94, 75, 139, 0.05); --primary-bg-medium: rgba(94, 75, 139, 0.1); --primary-bg-instruction: rgba(125, 92, 203, 0.9); --success-bg-light: rgba(88, 184, 144, 0.15); --modal-bg: rgba(0, 0, 0, 0.5); /* Typography */ --font-main: "Inter", "Segoe UI", Roboto, sans-serif; --font-code: "JetBrains Mono", "Fira Code", monospace; /* Effects */ --shadow: 0 2px 8px rgba(0, 0, 0, 0.06); --shadow-modal: 0 4px 20px rgba(0, 0, 0, 0.15); /* Sizes */ --header-height: 50px; --sidebar-width: 280px; --border-radius-sm: 4px; --border-radius-md: 6px; --border-radius-lg: 8px; --spacing-xs: 0.5rem; --spacing-sm: 0.75rem; --spacing-md: 1rem; --spacing-lg: 1.5rem; } /* ================= RESET ================= */ * { margin: 0; padding: 0; box-sizing: border-box; } /* ================= ACCESSIBILITY ================= */ .skip-link { position: absolute; top: -100%; left: 16px; padding: 8px 16px; background: var(--primary-dark); color: var(--white-text); text-decoration: none; border-radius: var(--border-radius-sm); z-index: 10000; transition: top 0.2s ease; } .skip-link:focus { top: 8px; } /* Focus styles - let browser defaults handle most cases */ /* Only enhance for our interactive elements */ /* ================= BASE STYLES ================= */ body { font-family: var(--font-main); background-color: var(--bg-color); color: var(--text-color); line-height: 1.5; overflow: hidden; } code, kbd { font-family: var(--font-code); } /* ================= APP CONTAINER ================= */ .app-container { display: flex; flex-direction: column; height: 100vh; overflow: hidden; } /* ================= HEADER ================= */ .header { display: flex; align-items: center; justify-content: space-between; height: var(--header-height); padding: 0 var(--spacing-md); background: var(--panel-bg); border-bottom: 1px solid var(--border-color); flex-shrink: 0; } .menu-toggle { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: none; border: none; cursor: pointer; padding: 4px; border-radius: var(--border-radius-sm); } .menu-toggle:hover { background: var(--primary-bg-light); } .hamburger-icon { position: relative; width: 18px; height: 2px; background-color: var(--text-color); border-radius: 1px; } .hamburger-icon::before, .hamburger-icon::after { content: ""; position: absolute; left: 0; width: 100%; height: 2px; background-color: var(--text-color); border-radius: 1px; } .hamburger-icon::before { top: -6px; } .hamburger-icon::after { top: 6px; } .logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; cursor: pointer; } .logo h1 { font-size: 1rem; font-weight: 800; color: var(--text-color); line-height: 1; display: flex; align-items: center; gap: 0.15rem; } .logo h1 .code-text { background: var(--primary-color); color: white; padding: 0.15rem 0.35rem; border-radius: 4px; letter-spacing: 0.05em; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); } .logo h1 span:last-child { color: var(--primary-color); } .help-toggle { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-color); background: none; font-weight: bold; cursor: pointer; color: var(--light-text); transition: all 0.2s; } .help-toggle:hover { border-color: var(--primary-color); color: var(--primary-color); } .header-actions { display: flex; align-items: center; gap: var(--spacing-sm); } /* ================= GAME LAYOUT ================= */ .game-layout { display: flex; flex: 1; min-height: 0; overflow: hidden; transition: transform 0.3s ease; } /* ================= LEFT PANEL ================= */ .left-panel { width: 50%; display: flex; flex-direction: column; border-right: 1px solid var(--border-color); background: var(--panel-bg); min-height: 0; } .instructions { padding: var(--spacing-md); border-bottom: 1px solid var(--border-color); max-height: calc(50vh - 60px); overflow-y: auto; } /* Smooth lesson transition */ #lesson-title, .lesson-description, .task-instruction { transition: opacity 0.1s ease; } .editor-section.transitioning #lesson-title, .editor-section.transitioning .lesson-description, .editor-section.transitioning .task-instruction { opacity: 0.3; } /* Loading fallback notice */ .loading-fallback { text-align: center; padding: 3rem 1rem; color: var(--light-text); animation: fadeIn 0.5s ease; } .loading-fallback p { margin-bottom: 1rem; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } .module-pill { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--primary-bg-medium); color: var(--primary-color); padding: 4px 12px; border-radius: 16px; font-size: 0.8rem; font-weight: 600; min-width: 0; flex-shrink: 1; } .module-name { text-transform: uppercase; letter-spacing: 0.5px; } .module-pill .level-indicator { color: var(--primary-dark); font-weight: 500; opacity: 0.8; } #lesson-title { font-size: 1.25rem; color: var(--primary-dark); margin-bottom: var(--spacing-sm); } .completion-badge { display: inline-block; margin-left: 0.5rem; padding: 0.15rem 0.5rem; background: var(--success-color); color: white; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; border-radius: var(--border-radius-sm); vertical-align: middle; } .lesson-description { font-size: 0.95rem; line-height: 1.6; color: var(--text-color); margin-top: var(--spacing-lg); margin-bottom: var(--spacing-md); } .lesson-description kbd, .lesson-description code { background: var(--primary-bg-medium); padding: 2px 6px; border-radius: 3px; font-size: 0.85rem; } .lesson-description pre { background: var(--code-bg); padding: var(--spacing-md); border-radius: var(--border-radius-sm); overflow-x: auto; font-size: 0.85rem; margin: var(--spacing-sm) 0; } .task-instruction { background: var(--primary-bg-instruction); color: var(--white-text); padding: var(--spacing-sm) var(--spacing-md); border-radius: var(--border-radius-sm); font-size: 0.9rem; line-height: 1.6; } .task-instruction kbd, .task-instruction code { background: rgba(255, 255, 255, 0.25); padding: 2px 8px; border-radius: 4px; font-size: 0.9em; font-weight: 500; } /* ================= EDITOR SECTION ================= */ .editor-section { flex: 1; display: flex; flex-direction: column; min-height: 50vh; position: relative; } /* Playground mode - full height editor */ .editor-section.playground-mode { flex: 1; min-height: 0; } .code-editor { flex: 1; display: flex; flex-direction: column; min-height: 0; } .editor-header { display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-xs) var(--spacing-md); background: var(--code-bg); border-bottom: 1px solid var(--border-color); } .editor-label { font-size: 0.85rem; font-weight: 600; color: var(--light-text); } .editor-actions { display: flex; align-items: center; gap: var(--spacing-sm); } .editor-content { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--editor-bg); overflow: hidden; } /* CodeMirror container styles */ .editor-content .cm-editor { flex: 1; height: 100%; } .editor-content .cm-scroller { overflow: auto; } /* Legacy textarea (fallback) */ .code-input { flex: 1; width: 100%; padding: var(--spacing-md); background: var(--editor-bg); color: var(--editor-text); border: none; font-family: var(--font-code); font-size: 14px; line-height: 1.5; resize: none; outline: none; } .code-input::placeholder { color: #666; } /* ================= HINT AREA ================= */ .hint-area { position: absolute; bottom: 0; left: 0; right: 0; padding: var(--spacing-sm) var(--spacing-md); background: rgba(30, 30, 30, 0.9); backdrop-filter: blur(4px); z-index: 5; } .hint-area:empty { display: none; } .hint { display: flex; align-items: center; gap: var(--spacing-sm); padding: var(--spacing-xs) var(--spacing-sm); background: rgba(94, 75, 139, 0.3); border-left: 3px solid var(--primary-light); border-radius: var(--border-radius-sm); color: var(--editor-text); } .hint-progress { background: var(--primary-color); color: white; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: bold; flex-shrink: 0; } .hint-message { font-size: 0.9rem; color: var(--editor-text); } .hint-message kbd, .hint-message code { background: rgba(255, 255, 255, 0.15); color: #fff; padding: 2px 6px; border-radius: 3px; font-size: 0.85rem; font-family: var(--font-code); } .hint-success { background: var(--success-bg-light); border-left-color: var(--success-color); } .hint-success .hint-progress { background: var(--success-color); } /* ================= RIGHT PANEL ================= */ .right-panel { width: 50%; display: flex; flex-direction: column; background: var(--bg-color); min-height: 0; } .preview-section { flex: 1; display: flex; flex-direction: column; min-height: 0; } .preview-header { display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-xs) var(--spacing-md) var(--spacing-md); background: transparent; } .preview-label { font-size: 0.85rem; font-weight: 600; color: var(--light-text); } .preview-wrapper { flex: 1; position: relative; background: var(--panel-bg); margin: var(--spacing-md); border-radius: var(--border-radius-md); box-shadow: var(--shadow); overflow: hidden; min-height: 0; } .preview-frame { width: 100%; height: 100%; padding: var(--spacing-sm); } .preview-frame iframe { width: 100%; height: 100%; border: none; border-radius: var(--border-radius-sm); } /* Expected Overlay (toggleable) */ .expected-overlay { position: absolute; inset: 0; background: var(--panel-bg); opacity: 0; pointer-events: none; transition: opacity 0.3s ease; display: flex; align-items: center; justify-content: center; } .expected-overlay.visible { opacity: 1; pointer-events: auto; } .expected-frame { width: 100%; height: 100%; padding: var(--spacing-sm); } .expected-frame iframe { width: 100%; height: 100%; border: none; border-radius: var(--border-radius-sm); } /* Success Match Animation */ .preview-wrapper.matched { box-shadow: 0 0 0 3px var(--success-color); } .preview-wrapper.matched::after { content: "CRISPY ٩( ◕‿◕ )۶"; position: absolute; background: var(--success-color-dark); color: white; padding: var(--spacing-sm) var(--spacing-lg); border-radius: var(--border-radius-lg); font-weight: bold; font-size: 1.3rem; animation: dvd-bounce 8s ease-in-out infinite; z-index: 10; white-space: nowrap; } @keyframes dvd-bounce { 0% { top: 15%; left: 15%; transform: translate(-50%, -50%) scale(1); } 25% { top: 75%; left: 85%; transform: translate(-50%, -50%) scale(1.1); } 50% { top: 25%; left: 75%; transform: translate(-50%, -50%) scale(0.95); } 75% { top: 70%; left: 20%; transform: translate(-50%, -50%) scale(1.05); } 100% { top: 15%; left: 15%; transform: translate(-50%, -50%) scale(1); } } /* ================= GAME CONTROLS ================= */ .game-controls { display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-md); background: var(--panel-bg); border-bottom: 1px solid var(--border-color); box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.08); } /* ================= SIDEBAR ================= */ .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; z-index: 199; } .sidebar-backdrop.visible { opacity: 1; visibility: visible; } .sidebar-drawer { position: fixed; left: calc(-1 * var(--sidebar-width)); top: 0; width: var(--sidebar-width); height: 100vh; background: var(--panel-bg); box-shadow: var(--shadow-modal); transition: left 0.3s ease; z-index: 200; display: flex; flex-direction: column; overflow: hidden; } .sidebar-drawer.open { left: 0; } /* Shift main content when sidebar is open */ .app-container:has(.sidebar-drawer.open) .game-layout { transform: translateX(calc(var(--sidebar-width) * 0.8)); } .sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-md); border-bottom: 1px solid var(--border-color); flex-shrink: 0; } .sidebar-header h3 { font-size: 1.1rem; color: var(--primary-dark); } .close-btn { width: 32px; height: 32px; border: none; background: none; font-size: 1.5rem; cursor: pointer; color: var(--light-text); border-radius: var(--border-radius-sm); } .close-btn:hover { background: var(--primary-bg-light); color: var(--primary-color); } .sidebar-section { padding: var(--spacing-md); border-bottom: 1px solid var(--border-color); } .sidebar-section:last-child { border-bottom: none; } /* Make the lessons nav section fill available space */ nav.sidebar-section { flex: 1; overflow-y: auto; min-height: 0; } .sidebar-section h4 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--light-text); margin-bottom: var(--spacing-sm); } /* Progress Display */ .progress-display { display: flex; flex-direction: column; gap: var(--spacing-xs); } .progress-bar { height: 8px; background: var(--border-color); border-radius: 4px; overflow: hidden; } .progress-fill { height: 100%; background: var(--success-color); border-radius: 4px; transition: width 0.3s ease; width: 0%; } .progress-text { font-size: 0.85rem; color: var(--light-text); } /* Module List in Sidebar */ .module-list { /* No max-height - parent nav.sidebar-section handles overflow */ } .module-container { margin-bottom: 4px; } .module-header { display: flex; align-items: center; padding: var(--spacing-xs) var(--spacing-sm); cursor: pointer; border-radius: var(--border-radius-sm); font-weight: 600; font-size: 0.9rem; transition: background 0.2s; } .module-header:hover { background: var(--primary-bg-light); } .module-header.completed::before { content: "✓"; margin-right: 6px; color: var(--success-color); } .expand-icon { margin-right: 8px; font-size: 10px; transition: transform 0.2s; } .lessons-container { margin-left: 16px; border-left: 2px solid var(--border-color); padding-left: 8px; } .lesson-list-item { padding: 6px 10px; border-radius: var(--border-radius-sm); cursor: pointer; font-size: 0.85rem; margin: 2px 0; transition: background 0.2s; } .lesson-list-item:hover { background: var(--primary-bg-light); } .lesson-list-item.active { background: var(--primary-bg-medium); font-weight: 600; } .lesson-list-item.completed::before { content: "✓"; margin-right: 6px; color: var(--success-color); } /* Sidebar focus styles - enhance visibility without overriding defaults */ .module-header:focus, .lesson-list-item:focus { background: var(--primary-bg-light); } /* Button reset for sidebar items (when converted to buttons) */ button.module-header, button.lesson-list-item { border: none; background: none; text-align: left; width: 100%; font-family: inherit; color: inherit; } /* ================= BUTTONS ================= */ .btn { padding: var(--spacing-xs) var(--spacing-md); border-radius: var(--border-radius-sm); border: 1px solid var(--border-color); background: var(--panel-bg); color: var(--text-color); cursor: pointer; font-family: var(--font-main); font-size: 0.9rem; transition: all 0.2s; } .btn:hover { background: var(--code-bg); } .btn img { width: 0.8rem; height: 0.8rem; margin-right: 0.3rem; } .btn-primary { background: var(--primary-color); color: var(--white-text); border-color: var(--primary-dark); } .btn-primary:hover { background: var(--primary-dark); } .btn-run { background: var(--secondary-color); color: var(--white-text); border-color: var(--secondary-dark); } .btn-run:hover { background: var(--secondary-dark); } .btn-run.success { background: var(--success-color); border-color: var(--success-color-dark); } .btn-small { padding: 4px 10px; font-size: 0.8rem; } .btn-icon { padding: 4px 8px; font-size: 1rem; min-width: 32px; background: transparent; color: var(--light-text); border: 1px solid var(--border-color); } .btn-icon:hover { background: var(--bg-color); color: var(--text-color); border-color: var(--primary-color); } .editor-tools { display: flex; gap: 4px; } .btn-ghost { background: transparent; color: var(--light-text); border: 1px solid var(--border-color); } .btn-ghost:hover { background: var(--bg-color); color: var(--danger-color); border-color: var(--danger-color); } .btn-text { background: transparent; color: var(--light-text); border: none; font-size: 0.85rem; text-decoration: underline; padding: var(--spacing-xs) 0; } .btn-text:hover { background: transparent; color: var(--danger-color); } #reset-code-btn { background: var(--primary-color); color: white; border-color: var(--primary-color); } #reset-code-btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); } /* Hide Run button - live preview is stable */ #run-btn { display: none; } /* ================= TOGGLE SWITCH ================= */ /* Setting row (for label + control) */ .setting-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--spacing-sm); } .setting-label { font-size: 0.9rem; color: var(--text-color); } /* Language select */ .lang-select { padding: 6px 10px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--panel-bg); color: var(--text-color); font-size: 0.85rem; cursor: pointer; min-width: 120px; } .lang-select:hover { border-color: var(--primary-color); } .lang-select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2); } .toggle-switch { display: flex; align-items: center; cursor: pointer; margin-bottom: var(--spacing-sm); } .toggle-switch input { opacity: 0; width: 0; height: 0; } .toggle-slider { position: relative; display: inline-block; width: 36px; height: 20px; background: #ccc; border-radius: 20px; transition: 0.3s; margin-right: 8px; flex-shrink: 0; } .toggle-slider::before { content: ""; position: absolute; height: 16px; width: 16px; left: 2px; bottom: 2px; background: white; border-radius: 50%; transition: 0.3s; } input:checked + .toggle-slider { background: var(--primary-color); } input:checked + .toggle-slider::before { transform: translateX(16px); } .toggle-label { font-size: 0.9rem; color: var(--text-color); } /* ================= DIALOG (Native HTML) ================= */ .dialog { border: none; border-radius: var(--border-radius-lg); box-shadow: var(--shadow-modal); padding: 0; width: 90%; max-width: 600px; max-height: 80vh; overflow-y: auto; background: var(--panel-bg); /* Ensure centering - native dialog should center, but explicit for safety */ margin: auto; position: fixed; inset: 0; height: fit-content; } .dialog::backdrop { background: var(--modal-bg); } .dialog-header { display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-md); border-bottom: 1px solid var(--border-color); } .dialog-header h3 { margin: 0; } .dialog-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--light-text); line-height: 1; padding: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all 0.2s; } .dialog-close:hover { background: var(--primary-bg-light); color: var(--primary-color); } .dialog-content { padding: var(--spacing-lg); } .dialog-content h4 { margin-top: var(--spacing-md); margin-bottom: var(--spacing-xs); color: var(--dark-text); } .dialog-content h4:first-child { margin-top: 0; } .dialog-content p { margin-bottom: var(--spacing-md); } .dialog-content ul, .dialog-content ol { margin: 0 0 var(--spacing-md) 0; padding-left: var(--spacing-lg); } .dialog-content li { margin-bottom: var(--spacing-xs); } .dialog-content kbd { background: var(--code-bg); padding: 2px 6px; border-radius: var(--border-radius-sm); font-size: 0.85em; border: 1px solid var(--border-color); } .dialog-actions { display: flex; justify-content: flex-end; gap: var(--spacing-sm); margin-top: var(--spacing-lg); } /* Project Cards in Help Dialog */ .project-cards { display: flex; flex-direction: column; gap: var(--spacing-sm); margin-bottom: var(--spacing-md); } .project-card { display: block; padding: var(--spacing-md); background: var(--primary-bg-light); border-radius: var(--border-radius-md); border: 1px solid var(--primary-bg-medium); text-decoration: none; color: var(--text-color); transition: all 0.2s ease; } .project-card:hover { background: var(--primary-bg-medium); border-color: var(--primary-color); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(94, 75, 139, 0.15); } .project-card strong { display: block; color: var(--primary-color); font-size: 1rem; margin-bottom: 4px; } .project-card span { font-size: 0.9rem; color: var(--light-text); line-height: 1.4; } /* ================= FOOTER ================= */ .app-footer { padding: var(--spacing-md); font-size: 0.7rem; color: var(--light-text); text-align: center; border-top: 1px solid var(--border-color); margin-top: auto; } .app-footer a { color: var(--primary-color); text-decoration: none; } /* ================= UTILITY ================= */ .hidden { display: none !important; } /* ================= RESPONSIVE ================= */ @media (max-width: 768px) { .game-layout { flex-direction: column; overflow-y: auto; } .left-panel, .right-panel { width: 100%; flex-shrink: 0; border-right: none; display: contents; } /* Mobile order: nav -> instructions -> preview -> editor */ .game-controls { order: 1; padding: var(--spacing-sm); } .instructions { order: 2; max-height: none; overflow-y: visible; } .preview-section { order: 3; display: flex; flex-direction: column; min-height: 50vh; } .preview-section .preview-header { order: 1; } .preview-section .preview-wrapper { order: 2; } .editor-section { order: 4; display: flex; flex-direction: column; min-height: 50vh; } .preview-wrapper { flex: 1; margin: var(--spacing-sm); min-height: 40vh; } .editor-content { flex: 1; min-height: 45vh; } .module-pill { flex: 1; margin: 0 var(--spacing-sm); justify-content: center; } .module-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .level-label { display: none; } .btn { padding: var(--spacing-xs) var(--spacing-sm); font-size: 0.85rem; } } @media (max-width: 480px) { .logo h1 { font-size: 0.9rem; } .logo img { width: 32px; } #lesson-title { font-size: 1.1rem; } .lesson-description { font-size: 0.9rem; } .task-instruction { font-size: 0.85rem; } .code-input { font-size: 13px; } } /* ================== RTL SUPPORT ================== */ /* RTL: Sidebar slides from right */ [dir="rtl"] .sidebar-drawer { left: auto; right: calc(-1 * var(--sidebar-width)); transition: right 0.3s ease; } [dir="rtl"] .sidebar-drawer.open { right: 0; } /* RTL: Content shifts to left when sidebar opens */ [dir="rtl"] .app-container:has(.sidebar-drawer.open) .game-layout { transform: translateX(calc(-1 * var(--sidebar-width) * 0.8)); } /* RTL: Flip horizontal layouts */ [dir="rtl"] .header-left, [dir="rtl"] .header-right { flex-direction: row-reverse; } /* RTL: Editor tools */ [dir="rtl"] .editor-tools { flex-direction: row-reverse; } /* RTL: Navigation buttons */ [dir="rtl"] .nav-controls { flex-direction: row-reverse; } /* RTL: Hint layout */ [dir="rtl"] .hint { flex-direction: row-reverse; text-align: right; border-left: none; border-right: 3px solid var(--primary-light); } [dir="rtl"] .hint-success { border-right-color: var(--success-color); } /* RTL: Module list items */ [dir="rtl"] .module-header { flex-direction: row-reverse; } [dir="rtl"] .lesson-list button { text-align: right; } /* RTL: Lesson progress indicator */ [dir="rtl"] .lesson-list button::before { margin-left: var(--spacing-sm); margin-right: 0; } /* RTL: Content areas - use auto direction for mixed content */ [dir="rtl"] .lesson-description, [dir="rtl"] .task-instruction { direction: auto; unicode-bidi: plaintext; } /* RTL: Code editor always LTR */ [dir="rtl"] .editor-content, [dir="rtl"] .CodeMirror { direction: ltr; text-align: left; } /* RTL: Preview always LTR (code output) */ [dir="rtl"] .preview-wrapper, [dir="rtl"] #preview-area { direction: ltr; } /* RTL: Dialog close button */ [dir="rtl"] .dialog-close { left: var(--spacing-sm); right: auto; } /* RTL: Keep logo in LTR order */ [dir="rtl"] .logo { direction: ltr; } /* RTL: Swap left/right panels */ [dir="rtl"] .game-layout { flex-direction: row-reverse; } /* RTL: Left panel border flips to left side */ [dir="rtl"] .left-panel { border-right: none; border-left: 1px solid var(--border-color); } /* RTL: Lessons container indentation flips */ [dir="rtl"] .lessons-container { margin-left: 0; margin-right: 16px; border-left: none; border-right: 2px solid var(--border-color); padding-left: 0; padding-right: 8px; } /* RTL: Module expand icon */ [dir="rtl"] .module-header .expand-icon { margin-left: 6px; margin-right: 0; } /* RTL: Lesson checkmark position */ [dir="rtl"] .lesson-list-item::before { margin-left: 6px; margin-right: 0; } /* RTL: Toggle switch slider */ [dir="rtl"] .toggle-slider { margin-right: 0; margin-left: 8px; } /* RTL: Setting row */ [dir="rtl"] .setting-row { flex-direction: row-reverse; } /* RTL: Preview controls */ [dir="rtl"] .preview-controls { flex-direction: row-reverse; }