/* =========================================================================
   Auto-École 3D — Simulateur de Conduite
   CSS complet
   ========================================================================= */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #fff;
    -webkit-font-smoothing: antialiased;
}

/* --- Canvas 3D (injecté par Three.js) --- */
canvas {
    position: fixed !important;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    cursor: grab;
}
canvas.head-look-active { cursor: grabbing; }

/* --- HUD Overlay --- */
#hud {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#hud-top-actions {
    position: fixed;
    top: 23px;
    right: 88px;
    z-index: 1005;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    pointer-events: auto;
}

.hud-top-btn,
#btn-mute {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border-radius: 19px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(16, 20, 26, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #e8f5e9;
    font: 700 0.74rem/1 inherit;
    letter-spacing: 0.05em;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.hud-top-btn[hidden] {
    display: none !important;
}
.hud-top-btn:hover,
#btn-mute:hover {
    background: rgba(34, 44, 56, 0.92);
    border-color: rgba(105, 240, 174, 0.65);
}
#btn-guides.active {
    background: rgba(14, 116, 144, 0.72);
    border-color: rgba(56, 189, 248, 0.85);
    color: #e0f2fe;
}
#btn-drone.active {
    background: rgba(217, 119, 6, 0.78);
    border-color: rgba(251, 191, 36, 0.9);
    color: #fef3c7;
}
#btn-mute.muted {
    background: rgba(180, 35, 35, 0.72);
    border-color: rgba(255, 107, 107, 0.85);
    color: #fff;
}
#btn-mute .mute-icon {
    font-size: 0.96rem;
    line-height: 1;
}

#maneuver-telemetry {
    position: fixed;
    top: 88px;
    left: 16px;
    z-index: 15;
    display: flex;
    gap: 10px;
    padding: 7px 12px;
    border-radius: 11px;
    background: rgba(12, 18, 28, 0.76);
    border: 1px solid rgba(56, 189, 248, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
}
#maneuver-telemetry[hidden] {
    display: none !important;
}
.telemetry-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.telemetry-label {
    font-size: 0.54rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(148, 163, 184, 0.9);
}
.telemetry-val {
    font-size: 0.76rem;
    font-weight: 700;
    color: #e2e8f0;
}
.telemetry-val.ok { color: #4ade80; }
.telemetry-val.warn { color: #fbbf24; }

#speed-limit-indicator {
    position: fixed;
    top: 14px;
    right: 18px;
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 6px solid #d51f2a;
    border-radius: 50%;
    background: #fff;
    color: #111;
    font: 800 1.35rem/1 Arial, sans-serif;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}
#speed-limit-indicator.overspeed {
    transform: scale(1.08);
    box-shadow: 0 0 0 5px rgba(255, 40, 40, 0.3), 0 2px 10px rgba(0,0,0,0.45);
}

/* --- Moniteur (instructions du moniteur) --- */
#monitor-panel {
    align-self: flex-start;
    margin-top: 12px;
    margin-left: 16px;
    margin-right: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(76,175,80,0.5);
    border-radius: 12px;
    padding: 8px 18px;
    max-width: min(640px, calc(100vw - 540px));
    pointer-events: auto;
    animation: fadeInDown 0.5s ease;
}
#monitor-icon { font-size: 1.4rem; }
#monitor-message {
    font-size: 0.95rem;
    line-height: 1.35;
    color: rgba(255,255,255,0.9);
}

/* --- Dashboard (bas de l'écran) --- */
#dashboard {
    display: flex;
    justify-content: center;
    gap: 2px;
    pointer-events: none;
}
.dash-cell {
    background: rgba(0,0,0,0.82);
    padding: 6px 20px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 94px;
}
.dash-cell:first-child { border-radius: 8px 0 0 0; }
.dash-cell:last-child  { border-radius: 0 8px 0 0; }
.dash-label {
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
}
.dash-value {
    font-family: 'Courier New', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    color: #00ff88;
    line-height: 1.2;
}
.dash-unit {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.05em;
}
.dash-gear {
    color: #ffcc00;
    font-size: 1.8rem;
}
.dash-wheel {
    color: #90caf9;
    font-size: 1.3rem;
}
.dash-target {
    color: #64b5f6;
}
.dash-seatbelt {
    color: #ff6b6b;
}
.dash-seatbelt.fastened {
    color: #69f0ae;
}

/* --- Keyboard Help --- */
#controls-help {
    position: fixed;
    bottom: 64px;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 24px);
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(0,0,0,0.46);
    text-align: center;
    font-size: 0.76rem;
    color: rgba(255,255,255,0.72);
    pointer-events: none;
}
kbd {
    display: inline-block;
    padding: 1px 5px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.75rem;
    background: rgba(255,255,255,0.08);
    margin: 0 1px;
}

/* --- Start Overlay (mobile) --- */
#start-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 18% 12%, rgba(14, 165, 233, 0.22), transparent 32%),
        radial-gradient(circle at 86% 88%, rgba(245, 158, 11, 0.14), transparent 34%),
        linear-gradient(120deg, rgba(2, 8, 18, 0.76), rgba(7, 17, 31, 0.64));
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
#start-overlay::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.72), transparent 78%);
}
.start-content {
    text-align: center;
}
.start-content h1 {
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.02;
    letter-spacing: -0.045em;
    margin: 8px 0 10px;
    color: #f8fafc;
    text-shadow: 0 10px 38px rgba(0, 0, 0, 0.52);
}
.start-content p {
    color: #aebdce;
    margin-bottom: 24px;
}
#start-btn {
    padding: 14px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
#start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(76,175,80,0.5);
}

/* --- Menu Auto-École --- */
.menu-container {
    position: relative;
    max-width: 1120px;
    width: min(94%, 1120px);
    margin: 28px auto;
    padding: 28px 32px 24px;
    background: linear-gradient(145deg, rgba(12, 23, 38, 0.94), rgba(6, 13, 24, 0.9));
    backdrop-filter: blur(22px) saturate(125%);
    -webkit-backdrop-filter: blur(22px) saturate(125%);
    border: 1px solid rgba(125, 211, 252, 0.2);
    border-radius: 28px;
    box-shadow: 0 30px 90px rgba(0,0,0,0.64), inset 0 1px 0 rgba(255,255,255,0.08);
}
.menu-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 7%;
    right: 7%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #38bdf8 34%, #fbbf24 66%, transparent);
    box-shadow: 0 0 26px rgba(56, 189, 248, 0.5);
}
.menu-container > .subtitle {
    max-width: 720px;
    margin: 0 auto 24px;
    font-size: 0.98rem;
    line-height: 1.55;
    color: #b8c7d8;
}
.menu-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.menu-official-tag {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #bae6fd;
    background: rgba(14, 116, 144, 0.22);
    border: 1px solid rgba(56, 189, 248, 0.36);
    padding: 6px 11px;
    border-radius: 99px;
}
.menu-progress-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.menu-progress-pill {
    font-size: 0.75rem;
    font-weight: 700;
    color: #d9f99d;
    background: rgba(77, 124, 15, 0.2);
    border: 1px solid rgba(163, 230, 53, 0.32);
    padding: 6px 12px;
    border-radius: 99px;
}
.menu-recommended-pill {
    font-size: 0.72rem;
    font-weight: 700;
    color: #fef08a;
    background: rgba(234, 179, 8, 0.18);
    border: 1px solid rgba(250, 204, 21, 0.45);
    padding: 6px 11px;
    border-radius: 99px;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.12s ease;
}
.menu-recommended-pill:hover {
    background: rgba(234, 179, 8, 0.3);
    transform: translateY(-1px);
}
.menu-share-pill {
    font-size: 0.72rem;
    font-weight: 700;
    color: #bae6fd;
    background: rgba(56, 189, 248, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.42);
    padding: 6px 11px;
    border-radius: 99px;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.12s ease;
}
.menu-share-pill:hover {
    background: rgba(56, 189, 248, 0.28);
    transform: translateY(-1px);
}
.menu-reset-pill {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 3px 8px;
    border-radius: 99px;
    cursor: pointer;
}
.menu-reset-pill:hover {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.5);
}
.legal-disclaimer-note {
    font-size: 0.72rem;
    line-height: 1.35;
    color: #9baabd !important;
    background: rgba(2, 8, 23, 0.38);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    padding: 8px 14px;
    margin: -10px auto 14px !important;
    max-width: 780px;
}
.menu-modes {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 16px;
    margin-top: 18px;
    text-align: left;
}
@media (max-width: 960px), (max-height: 540px) {
    #start-overlay {
        align-items: flex-start;
        padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    }
    .menu-container {
        width: 100%;
        padding: 16px 14px;
        margin: 0 auto;
        border-radius: 20px;
    }
    .menu-modes {
        flex-direction: column;
        margin-top: 12px;
        gap: 12px;
    }
    .mode-card { padding: 14px; }
    .start-content h1 { font-size: 1.55rem; }
    .start-content p { margin-bottom: 8px; }
}
.mode-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(155deg, rgba(30, 48, 68, 0.72), rgba(8, 17, 29, 0.82));
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
    padding: 22px 20px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.055), 0 16px 35px rgba(0,0,0,0.18);
}
.mode-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(#38bdf8, rgba(56, 189, 248, 0.08));
}
#mode-freeroam::before {
    background: linear-gradient(#fbbf24, rgba(251, 191, 36, 0.08));
}

.mode-card h2 {
    font-size: 1.28rem;
    margin-bottom: 5px;
    color: #e0f2fe;
    letter-spacing: -0.018em;
}
#mode-freeroam > h2:first-child {
    color: #fef3c7;
}
.mode-card h2.menu-subrubric-title {
    font-size: 1.12rem;
    margin-top: 4px;
    margin-bottom: 8px;
    color: #fbbf24;
}
.mode-card p {
    font-size: 0.85rem;
    color: #91a3b7;
    margin-bottom: 14px;
}
.lesson-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lesson-btn {
    width: 100%;
    min-height: 42px;
    padding: 9px 13px;
    background: linear-gradient(135deg, rgba(30, 49, 68, 0.82), rgba(18, 31, 47, 0.78));
    border: 1px solid rgba(125, 211, 252, 0.16);
    border-radius: 12px;
    color: #edf6ff;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.lesson-btn-title {
    font-weight: 600;
}
.lesson-btn.highway-btn {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(14, 116, 144, 0.18));
    border-color: rgba(59, 130, 246, 0.52);
}
#mode-lessons .lesson-list li:first-child .lesson-btn {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.28), rgba(37, 99, 235, 0.22));
    border-color: rgba(125, 211, 252, 0.52);
    box-shadow: inset 3px 0 0 #38bdf8, 0 8px 20px rgba(2, 132, 199, 0.1);
}
#mode-lessons .lesson-list li:first-child .lesson-btn::after {
    content: "CONSEILLÉ";
    flex: 0 0 auto;
    margin-left: auto;
    color: #bae6fd;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}
#mode-lessons .lesson-list li:first-child .lesson-badge {
    display: none;
}
.lesson-btn.highway-btn:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.34), rgba(14, 116, 144, 0.28));
    border-color: rgba(96, 165, 250, 0.88);
}
.lesson-btn.exam-btn {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(16, 185, 129, 0.16));
    border-color: rgba(251, 191, 36, 0.55);
}
.lesson-btn.exam-btn:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(16, 185, 129, 0.26));
    border-color: rgba(251, 191, 36, 0.85);
}
.lesson-btn.verif-entry-btn {
    margin-bottom: 10px;
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.45);
}
.lesson-btn.verif-entry-btn:hover {
    background: rgba(56, 189, 248, 0.24);
    border-color: rgba(56, 189, 248, 0.85);
}
.lesson-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 99px;
    background: rgba(2, 8, 23, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: #9fb0c4;
    white-space: nowrap;
}
.lesson-badge.passed {
    background: rgba(76, 175, 80, 0.24);
    border: 1px solid rgba(105, 240, 174, 0.5);
    color: #69f0ae;
}
.lesson-badge.attempted {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 213, 79, 0.45);
    color: #ffd54f;
}
.lesson-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(14, 116, 144, 0.44), rgba(30, 58, 138, 0.38));
    border-color: rgba(125, 211, 252, 0.7);
    transform: translateX(3px);
    box-shadow: 0 8px 22px rgba(2, 132, 199, 0.14);
}
.lesson-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(0,0,0,0.3);
}
.lesson-btn.primary-btn {
    min-height: 48px;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    border: 1px solid rgba(186, 230, 253, 0.34);
    justify-content: center;
    text-align: center;
    font-weight: 800;
    letter-spacing: 0.01em;
    margin-top: auto;
}
.lesson-btn.primary-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
}
.help-entry-button {
    width: auto;
    margin: 16px auto 0;
    padding: 10px 16px;
    justify-content: center;
    text-align: center;
    color: #bae6fd;
    background: rgba(2, 8, 23, 0.38);
    border-color: rgba(125, 211, 252, 0.22);
}

/* --- Mobile Controls --- */
#mobile-controls {
    pointer-events: auto;
    padding: 10px 16px 16px;
}
.mobile-top-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.btn-mobile {
    padding: 9px 14px;
    font-size: 0.92rem;
    font-weight: 600;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.btn-mobile.active {
    background: rgba(76,175,80,0.35);
    border-color: #69f0ae;
}
.btn-mobile.unavailable {
    opacity: 0.58;
    border-style: dashed;
}
.mobile-compact-label { display: none; }
.gear-selector {
    display: flex;
    gap: 4px;
}
.btn-gear {
    width: 40px; height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: #fff;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.15s, border-color 0.15s;
}
.btn-gear.active {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
}
.pedals-container {
    display: flex;
    justify-content: space-between;
}
.mobile-action-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}
.btn-driving {
    width: 54px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.32);
    background: rgba(10,10,10,0.72);
    color: #fff;
    font: 800 1.3rem/1 inherit;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
}
.btn-driving small {
    display: block;
    font-size: 0.43rem;
    line-height: 1;
    letter-spacing: 0.04em;
}
.btn-steer {
    border-color: rgba(100,181,246,0.72);
    color: #90caf9;
}
.btn-indicator {
    border-color: rgba(255,193,7,0.68);
    color: #ffd54f;
}
.btn-driving.active,
.btn-driving:active {
    background: rgba(255,193,7,0.4);
    border-color: #ffd54f;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(255,193,7,0.2);
}

/* --- Mini-Volant Tactile Rotatif --- */
#touch-wheel-dial {
    position: relative;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 45%, rgba(28, 38, 52, 0.92), rgba(10, 14, 22, 0.95));
    border: 2px solid rgba(144, 202, 249, 0.72);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), inset 0 0 8px rgba(56, 189, 248, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
    flex-shrink: 0;
}
#touch-wheel-dial.active {
    cursor: grabbing;
    border-color: #ffd54f;
    box-shadow: 0 0 0 3px rgba(255, 202, 40, 0.28), 0 4px 14px rgba(0, 0, 0, 0.5);
}
#touch-wheel-svg {
    width: 54px;
    height: 54px;
    transition: transform 0.04s linear;
    pointer-events: none;
}
#touch-wheel-angle {
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1px 5px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.4);
    font: 700 0.52rem/1.1 monospace;
    color: #90caf9;
    pointer-events: none;
    white-space: nowrap;
}

.pedal {
    width: 31%;
    height: 86px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 14px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    transition: background 0.1s;
    font-family: inherit;
    cursor: pointer;
}
.pedal-speed {
    background: rgba(33,150,243,0.18);
    border: 2px solid rgba(33,150,243,0.5);
    color: #64b5f6;
}
.pedal-brake {
    background: rgba(255,60,60,0.18);
    border: 2px solid rgba(255,60,60,0.5);
    color: #ff6b6b;
}
.pedal-up {
    background: rgba(76,175,80,0.18);
    border: 2px solid rgba(76,175,80,0.5);
    color: #69f0ae;
}
.pedal:active, .pedal.active {
    background: rgba(255,255,255,0.25);
}

/* --- Modal Bilan CEPC Permis B (fin de leçon) --- */
#lesson-report-modal {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(6, 10, 18, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: auto;
}
#lesson-report-modal[hidden] { display: none !important; }
.report-card {
    width: min(94vw, 560px);
    max-height: min(90vh, 620px);
    overflow-y: auto;
    padding: 22px 24px;
    border-radius: 18px;
    background: rgba(18, 24, 34, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}
.report-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}
.report-ministry-tag {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    color: #94a3b8;
}
.report-header h2 {
    font-size: 1.35rem;
    color: #f8fafc;
}
.report-verdict {
    align-self: flex-start;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}
.report-verdict.favorable {
    background: rgba(34, 197, 94, 0.22);
    border: 1px solid #4ade80;
    color: #4ade80;
}
.report-verdict.insuffisant {
    background: rgba(245, 158, 11, 0.22);
    border: 1px solid #fbbf24;
    color: #fbbf24;
}
.report-verdict.elimine {
    background: rgba(239, 68, 68, 0.26);
    border: 1px solid #f87171;
    color: #fca5a5;
}
.report-score-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 14px 0;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}
.report-main-score {
    font-size: 2rem;
    font-weight: 800;
    color: #38bdf8;
    line-height: 1;
}
.report-main-score small {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-left: 4px;
}
.report-stars {
    font-size: 1.55rem;
    color: #fbbf24;
    letter-spacing: 0.08em;
}
.report-subscore {
    font-size: 0.82rem;
    color: #cbd5e1;
}
.report-competencies {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}
.comp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
}
.comp-score {
    font-weight: 800;
    color: #69f0ae;
}
.comp-score.elimine {
    color: #f87171;
}
.report-feedback-list {
    margin-bottom: 16px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.7);
    font-size: 0.78rem;
    line-height: 1.4;
    color: #cbd5e1;
}
.report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.report-btn {
    flex: 1 1 auto;
    padding: 11px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
}
.report-btn.primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: none;
}
.report-btn.secondary {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.55);
    color: #e0f2fe;
}
.report-btn.ghost {
    background: rgba(255, 255, 255, 0.08);
}

/* --- Modal Quiz Vérifications Officielles & Premiers Secours --- */
#verif-quiz-modal {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(6, 10, 18, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: auto;
}
#verif-quiz-modal[hidden] { display: none !important; }
.verif-question-text {
    margin: 14px 0 12px;
    font-size: 0.96rem;
    font-weight: 600;
    line-height: 1.4;
    color: #f1f5f9;
}
.verif-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.verif-opt-btn {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(30, 41, 59, 0.78);
    color: #f8fafc;
    font-size: 0.86rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.verif-opt-btn:hover:not(:disabled) {
    background: rgba(51, 65, 85, 0.92);
    border-color: #38bdf8;
}
.verif-opt-btn.correct {
    background: rgba(22, 163, 74, 0.32);
    border-color: #4ade80;
    color: #dcfce7;
}
.verif-opt-btn.wrong {
    background: rgba(220, 38, 38, 0.28);
    border-color: #f87171;
    color: #fee2e2;
}
.verif-explanation {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.85);
    border-left: 3px solid #38bdf8;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #cbd5e1;
}

/* Guide mobile à la demande : les explications et le gyroscope ne prennent
   aucune place dans la vue de conduite tant que l'élève ne les demande pas. */
#mobile-guide {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    background: rgba(0,0,0,0.72);
    pointer-events: auto;
}
#mobile-guide[hidden] { display: none !important; }
.mobile-guide-card {
    position: relative;
    width: min(92vw, 570px);
    max-height: min(88vh, 560px);
    overflow-y: auto;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    background: rgba(18,18,18,0.97);
    box-shadow: 0 16px 50px rgba(0,0,0,0.55);
}
.mobile-guide-card h2 {
    margin: 0 38px 12px 0;
    color: #69f0ae;
    font-size: 1.2rem;
}
#mobile-guide-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 1.6rem;
}
.startup-guide {
    padding-left: 20px;
    color: rgba(255,255,255,0.88);
    font-size: 0.82rem;
    line-height: 1.35;
}
.startup-guide li + li { margin-top: 6px; }
.guide-control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}
.guide-control-grid p,
.gyro-guide {
    padding: 9px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
}
.guide-control-grid strong,
.guide-control-grid span { display: block; }
.guide-control-grid strong { color: #ffd54f; font-size: 0.78rem; }
.guide-control-grid span,
.gyro-guide p {
    margin-top: 3px;
    color: rgba(255,255,255,0.7);
    font-size: 0.72rem;
    line-height: 1.3;
}
.gyro-guide { margin-top: 8px; }
.guide-section-title {
    margin-top: 12px;
    font-size: 0.84rem;
    color: #fff;
}
.keyboard-guide {
    margin-top: 9px;
    padding: 9px;
    border-radius: 10px;
    background: rgba(100,181,246,0.08);
    font-size: 0.72rem;
    line-height: 1.35;
}
.keyboard-guide summary {
    color: #90caf9;
    cursor: pointer;
    font-weight: 700;
}
.keyboard-guide p { margin-top: 7px; color: rgba(255,255,255,0.72); }
.gyro-guide h3 { font-size: 0.84rem; color: #90caf9; }
.gyro-state-line { margin-top: 7px !important; }
#gyro-status { color: #69f0ae; }

/* Hide mobile controls on desktop */
@media (min-width: 1024px) {
    #mobile-controls { display: none; }
}
@media (max-width: 1023px) {
    .desktop-only { display: none; }
    #dashboard { margin-top: auto; }
}
@media (max-width: 600px) {
    #hud-top-actions {
        top: 10px;
        right: 58px;
        gap: 3px;
    }
    #hud-top-actions #btn-mute {
        display: none;
    }
    .hud-top-btn {
        height: 30px;
        padding: 0 8px;
        font-size: 0.62rem;
    }
    #speed-limit-indicator {
        top: 8px;
        right: 8px;
        width: 46px;
        height: 46px;
        border-width: 5px;
        font-size: 1.05rem;
    }
    #gps-minimap-widget {
        top: 108px;
        right: 8px;
        width: 138px;
        padding: 4px 5px;
    }
    #gps-radar-canvas {
        height: 84px;
    }
    .gps-step-caption {
        display: none;
    }
    #monitor-panel {
        align-self: center;
        margin-left: 0;
        margin-right: 0;
        margin-top: 50px;
        max-width: calc(100vw - 24px);
    }
    #maneuver-telemetry {
        position: static;
        align-self: center;
        margin-top: 6px;
        max-width: calc(100vw - 24px);
    }
    #dashboard {
        width: 100%;
        gap: 1px;
        margin-top: auto;
    }
    .dash-cell {
        flex: 1 1 0;
        min-width: 0;
        padding: 5px 3px 7px;
    }
    .dash-label {
        font-size: 0.48rem;
        letter-spacing: 0.06em;
    }
    .dash-value {
        font-size: 1.25rem;
    }
    .mobile-top-row {
        gap: 6px;
        margin-bottom: 8px;
    }
    .mobile-top-row .btn-mobile {
        padding: 7px 10px;
        font-size: 0.78rem;
    }
    .pedal {
        font-size: 0.82rem;
    }
}

.btn-mobile.muted {
    background: rgba(180, 35, 35, 0.55);
    border-color: #ff6b6b;
}

/* --- Sélecteur Météo & Luminosité (Menu) + Bannière 3D Sous le Capot --- */
.weather-selector-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 14px;
    padding: 7px 9px;
    border-radius: 999px;
    background: rgba(2, 8, 23, 0.52);
    border: 1px solid rgba(125, 211, 252, 0.16);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.weather-bar-label {
    font-size: 0.74rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-right: 4px;
}
.weather-pill {
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: #e2e8f0;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.weather-pill:hover {
    border-color: #38bdf8;
    background: rgba(51, 65, 85, 0.9);
}
.weather-pill.active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.42), rgba(37, 99, 235, 0.3));
    border-color: #38bdf8;
    color: #f0f9ff;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.2);
}
.weather-lesson-btn {
    border-color: rgba(56, 189, 248, 0.42) !important;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 58, 138, 0.45)) !important;
}

/* Panneau d'inspection 3D « Sous le Capot » */
#organ-inspect-banner {
    align-self: center;
    width: min(92vw, 650px);
    margin-top: 8px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(10, 15, 28, 0.88);
    border: 1px solid rgba(56, 189, 248, 0.48);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
}
#organ-inspect-banner[hidden] { display: none !important; }
.organ-banner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.organ-banner-tag {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #38bdf8;
}
.organ-banner-close {
    padding: 3px 9px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}
.organ-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}
.organ-pill-btn {
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(30, 41, 59, 0.82);
    color: #e2e8f0;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
}
.organ-pill-btn.active {
    background: rgba(250, 204, 21, 0.24);
    border-color: #facc15;
    color: #fef9c3;
}
.organ-detail-box {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.78);
    border-left: 3px solid #facc15;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #e2e8f0;
}
.organ-detail-box strong {
    display: block;
    color: #fef08a;
    margin-bottom: 3px;
}
.organ-detail-risk {
    margin-top: 4px;
    color: #fca5a5;
    font-size: 0.74rem;
}

/* --- Replay Trajectoire 2D sur le Bilan --- */
.report-trajectory-box {
    margin: 10px 0;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(10, 18, 32, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.35);
}
.report-trajectory-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #bae6fd;
}
.report-trajectory-header small {
    font-size: 0.65rem;
    font-weight: 500;
    color: #94a3b8;
}
.report-replay-anim-btn {
    font-size: 0.68rem;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 6px;
    padding: 2px 8px;
    cursor: pointer;
}
.report-replay-anim-btn:hover {
    background: rgba(56, 189, 248, 0.26);
}
#report-trajectory-canvas {
    width: 100%;
    height: 118px;
    border-radius: 8px;
    border: 1px solid rgba(71, 85, 105, 0.5);
    background: #091322;
    display: block;
    cursor: crosshair;
}

/* --- Mini-carte Radar GPS & Guidage vocalisé --- */
#gps-minimap-widget {
    position: fixed;
    top: 82px;
    right: 16px;
    width: 178px;
    padding: 6px;
    border-radius: 12px;
    background: rgba(10, 18, 30, 0.86);
    border: 1px solid rgba(56, 189, 248, 0.42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.42);
    pointer-events: auto;
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
#gps-minimap-widget[hidden] {
    display: none !important;
}
.gps-header-row {
    display: flex;
    align-items: center;
    gap: 4px;
}
.gps-turn-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(14, 165, 233, 0.24);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #e0f2fe;
    font-size: 0.68rem;
    white-space: nowrap;
}
.gps-dest-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.66rem;
    font-weight: 700;
    color: #bae6fd;
}
.gps-mini-btn {
    width: 21px;
    height: 21px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(30, 41, 59, 0.85);
    color: #f8fafc;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.gps-mini-btn:hover {
    border-color: #38bdf8;
    background: rgba(14, 165, 233, 0.32);
}
#gps-radar-canvas {
    width: 100%;
    height: 118px;
    border-radius: 8px;
    border: 1px solid rgba(71, 85, 105, 0.55);
    background: #0c1624;
    display: block;
}
.gps-step-caption {
    font-size: 0.63rem;
    line-height: 1.22;
    color: #cbd5e1;
    padding: 1px 2px;
}
#gps-minimap-widget.collapsed #gps-radar-canvas,
#gps-minimap-widget.collapsed .gps-step-caption {
    display: none;
}

/* Téléphone en paysage : la chaussée reste la surface principale. Les
   commandes essentielles occupent les bords bas, le tableau de bord devient
   une petite capsule à gauche et la consigne une bande peu profonde. */
@media (max-width: 1023px) and (orientation: landscape) {
    #hud-top-actions {
        display: flex;
        top: max(5px, env(safe-area-inset-top));
        right: max(50px, calc(env(safe-area-inset-right) + 44px));
        gap: 3px;
    }
    #hud-top-actions #btn-mute {
        display: none;
    }
    #hud-top-actions .hud-btn-label {
        display: none;
    }
    #hud-top-actions .hud-top-btn {
        width: 29px;
        height: 29px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
        font-size: 0.75rem;
    }
    #organ-inspect-banner {
        position: fixed;
        top: max(42px, calc(env(safe-area-inset-top) + 38px));
        left: 50%;
        transform: translateX(-50%);
        width: min(86vw, 560px);
        max-height: calc(100vh - 102px);
        overflow-y: auto;
        margin-top: 0;
        padding: 7px 10px;
    }
    #maneuver-telemetry {
        position: fixed;
        top: max(44px, calc(env(safe-area-inset-top) + 39px));
        left: max(7px, env(safe-area-inset-left));
        margin-top: 0;
        padding: 3px 8px;
        gap: 7px;
    }
    .telemetry-label { font-size: 0.42rem; }
    .telemetry-val { font-size: 0.62rem; }
    #monitor-panel {
        position: fixed;
        top: max(5px, env(safe-area-inset-top));
        left: 43%;
        width: min(42vw, 410px);
        max-width: none;
        max-height: 36px;
        align-items: flex-start;
        margin: 0;
        padding: 4px 8px;
        gap: 6px;
        border-radius: 8px;
        transform: translateX(-50%);
        overflow-y: auto;
        background: rgba(0,0,0,0.62);
    }
    .report-card {
        max-height: calc(100vh - 18px);
        padding: 14px 18px;
    }
    #monitor-icon { font-size: 0.85rem; line-height: 1.1; }
    #monitor-message {
        font-size: clamp(0.58rem, 1.35vw, 0.7rem);
        line-height: 1.14;
    }
    #speed-limit-indicator {
        top: max(5px, env(safe-area-inset-top));
        right: max(7px, env(safe-area-inset-right));
        width: 39px;
        height: 39px;
        border-width: 4px;
        font-size: 0.92rem;
    }
    #gps-minimap-widget {
        top: max(48px, calc(env(safe-area-inset-top) + 42px));
        right: max(7px, env(safe-area-inset-right));
        width: 134px;
        padding: 3px 5px;
        gap: 3px;
    }
    #gps-radar-canvas {
        height: 62px;
    }
    .gps-step-caption {
        display: none;
    }
    #dashboard {
        position: fixed;
        top: max(5px, env(safe-area-inset-top));
        left: max(7px, env(safe-area-inset-left));
        width: auto;
        gap: 1px;
        border-radius: 8px;
        overflow: hidden;
    }
    #dashboard .dash-cell {
        min-width: 45px;
        padding: 3px 5px 4px;
    }
    #dashboard .dash-cell:nth-child(2),
    #dashboard .dash-cell:nth-child(n+4) {
        display: none;
    }
    #dashboard .dash-label { font-size: 0.42rem; letter-spacing: 0.03em; }
    #dashboard .dash-value { font-size: 1rem; }
    #dashboard .dash-unit { display: none; }

    #mobile-controls {
        position: fixed;
        inset: 0;
        padding: 0;
        pointer-events: none;
    }
    .mobile-top-row {
        position: absolute;
        left: 50%;
        bottom: max(5px, env(safe-area-inset-bottom));
        transform: translateX(-50%);
        margin: 0;
        padding: 3px;
        flex-wrap: nowrap;
        gap: 3px;
        border-radius: 10px;
        background: rgba(0,0,0,0.45);
        pointer-events: auto;
    }
    .mobile-top-row .btn-mobile {
        width: 33px;
        height: 39px;
        padding: 0;
        font-size: 0.88rem;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        line-height: 0.9;
    }
    .mobile-compact-label {
        display: block;
        margin-top: 2px;
        font-size: 0.34rem;
        line-height: 1;
        color: rgba(255,255,255,0.72);
    }
    .mobile-button-label { display: none; }
    #mobile-guide .mobile-button-label { display: inline; }
    .gear-selector { gap: 2px; }
    .btn-gear {
        width: 30px;
        height: 39px;
        border-radius: 7px;
        font-size: 0.82rem;
    }
    .mobile-action-row {
        position: absolute;
        left: max(6px, env(safe-area-inset-left));
        bottom: max(5px, env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: 42px 54px 42px;
        grid-template-rows: 38px 38px;
        gap: 3px;
        margin: 0;
        pointer-events: auto;
        align-items: center;
        justify-items: center;
    }
    #btn-indicator-left  { grid-column: 1; grid-row: 1; }
    #btn-indicator-right { grid-column: 3; grid-row: 1; }
    #steer-left          { grid-column: 1; grid-row: 2; }
    #touch-wheel-dial    { grid-column: 2; grid-row: 1 / span 2; width: 52px; height: 52px; }
    #touch-wheel-svg     { width: 44px; height: 44px; }
    #steer-right         { grid-column: 3; grid-row: 2; }
    .btn-driving {
        width: 42px;
        height: 38px;
        border-radius: 8px;
        font-size: 1rem;
    }
    .pedals-container {
        position: absolute;
        right: max(6px, env(safe-area-inset-right));
        bottom: max(5px, env(safe-area-inset-bottom));
        gap: 4px;
        pointer-events: auto;
    }
    .pedal {
        width: 54px;
        height: 54px;
        padding: 2px;
        border-radius: 10px;
        font-size: 0.6rem;
        line-height: 1.05;
    }
    .mobile-guide-card {
        width: min(80vw, 570px);
        max-height: calc(100vh - 18px);
        padding: 12px 14px;
    }
    .mobile-guide-card h2 { margin-bottom: 8px; font-size: 1rem; }
    .startup-guide { font-size: 0.7rem; line-height: 1.22; }
    .startup-guide li + li { margin-top: 3px; }
    .guide-control-grid { margin-top: 7px; }
    .guide-control-grid p { padding: 6px; }
    .guide-control-grid span { font-size: 0.64rem; }
    .gyro-guide { margin-top: 6px; }
}

@media (max-width: 700px) and (orientation: landscape) {
    #monitor-panel { left: 41%; width: 38vw; }
    .mobile-top-row { gap: 2px; padding: 2px; }
    .mobile-top-row .btn-mobile { width: 28px; }
    .btn-gear { width: 25px; }
    .mobile-action-row {
        grid-template-columns: 38px 48px 38px;
        grid-template-rows: 36px 36px;
    }
    .btn-driving { width: 38px; height: 36px; }
    #touch-wheel-dial { width: 46px; height: 46px; }
    #touch-wheel-svg { width: 38px; height: 38px; }
    .pedal { width: 46px; }
}

/* --- Animations --- */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}
