/* Formulaire de règles (Soutien) */
.rule-content {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 1rem;
}

.rule-content h3 {
    color: #1e293b;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

.rule-content .explication {
    color: #475569;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* Styles pour les balises <b> dans les règles - Couleurs significatives */
.rule-content .explication b,
.rule-content .remarques b {
    color: #4f46e5;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(79, 70, 229, 0.15) 100%);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    display: inline-block;
    margin: 0 0.1rem;
}

.rule-content .exemple-correct b {
    color: #059669;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.15) 0%, rgba(5, 150, 105, 0.2) 100%);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    display: inline-block;
    margin: 0 0.1rem;
}

.rule-content .exemple-incorrect b {
    color: #dc2626;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15) 0%, rgba(220, 38, 38, 0.2) 100%);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    display: inline-block;
    margin: 0 0.1rem;
}

.rule-content .remarques b {
    color: #d97706;
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.15) 0%, rgba(217, 119, 6, 0.2) 100%);
}

.rule-content .exemples-section {
    margin-top: 2rem;
}

.rule-content .exemples-section h4 {
    color: #334155;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rule-content .exemples-corrects {
    margin-bottom: 1.5rem;
}

.rule-content .exemple-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    border-left: 4px solid;
    background: #f8fafc;
}

.rule-content .exemple-correct {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.rule-content .exemple-incorrect {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.rule-content .exemple-item i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.rule-content .exemple-correct i {
    color: #10b981;
}

.rule-content .exemple-incorrect i {
    color: #ef4444;
}

.rule-content .remarques {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
}

.rule-content .remarques h4 {
    color: #78350f;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rule-content .remarques ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rule-content .remarques li {
    color: #92400e;
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.rule-content .remarques li:before {
    content: "💡";
    position: absolute;
    left: 0;
}

/* Dark mode pour le formulaire de règles */
body.dark-mode .rule-content {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .rule-content h3 {
    color: #f1f5f9;
    border-bottom-color: #334155;
}

body.dark-mode .rule-content .explication {
    color: #cbd5e1;
}

body.dark-mode .rule-content .exemple-item {
    background: #0f172a;
}

body.dark-mode .rule-content .exemple-correct {
    background: #064e3b;
}

body.dark-mode .rule-content .exemple-incorrect {
    background: #7f1d1d;
}

body.dark-mode .rule-content .remarques {
    background: #78350f;
    border-left-color: #f59e0b;
}

body.dark-mode .rule-content .remarques h4 {
    color: #fef3c7;
}

body.dark-mode .rule-content .remarques li {
    color: #fde68a;
}

/* Dark mode pour les balises <b> */
body.dark-mode .rule-content .explication b,
body.dark-mode .rule-content .remarques b {
    color: #818cf8;
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.2) 0%, rgba(129, 140, 248, 0.25) 100%);
}

body.dark-mode .rule-content .exemple-correct b {
    color: #34d399;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.2) 0%, rgba(52, 211, 153, 0.25) 100%);
}

body.dark-mode .rule-content .exemple-incorrect b {
    color: #f87171;
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.2) 0%, rgba(248, 113, 113, 0.25) 100%);
}

body.dark-mode .rule-content .remarques b {
    color: #fbbf24;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(251, 191, 36, 0.25) 100%);
}

@media (max-width: 768px) {
    .activity-type-buttons {
        flex-direction: column;
    }
    
    .btn-activity-type {
        min-width: 100%;
    }
    
    .rule-content {
        padding: 1.5rem;
    }
}

/* ============================================
   MODE PROJECTION - BOUTON AVEC EFFET VIBRANT
   ============================================ */
.btn-projection {
    position: relative;
    overflow: hidden;
    animation: projectionPulse 2s ease-in-out infinite;
}

.btn-projection::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-projection:hover::before {
    width: 300px;
    height: 300px;
}

@keyframes projectionPulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2), 0 0 0 0 rgba(79, 70, 229, 0.4);
    }
    50% {
        box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2), 0 0 0 8px rgba(79, 70, 229, 0);
    }
}

/* ============================================
   POPUP PROJECTION (Mode clair uniquement)
   ============================================ */
.projection-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

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

.projection-popup-container {
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: none;
}

/* Support plein écran réel (Fullscreen API) */
:fullscreen .projection-popup-container,
:-webkit-full-screen .projection-popup-container,
:-moz-full-screen .projection-popup-container,
:-ms-fullscreen .projection-popup-container {
    width: 100vw;
    height: 100vh;
}

:fullscreen .projection-popup-overlay,
:-webkit-full-screen .projection-popup-overlay,
:-moz-full-screen .projection-popup-overlay,
:-ms-fullscreen .projection-popup-overlay {
    width: 100vw;
    height: 100vh;
}

/* HEADER COMPACT (< 5%) */
.projection-header-compact {
    height: 4vh;
    min-height: 40px;
    max-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.projection-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.projection-title img {
    height: 24px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.projection-close-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #dc2626;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.projection-close-btn:hover {
    background: #fee2e2;
    color: #991b1b;
    transform: rotate(90deg);
}

/* STEPPER ET NAVIGATION WRAPPER (< 5%) */
.projection-stepper-nav-wrapper {
    height: 5vh;
    min-height: 50px;
    max-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    gap: 1rem;
}

/* STEPPER COMPACT (au centre) avec navigation intégrée */
.projection-stepper-compact {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    gap: 1rem;
}

.stepper-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.stepper-step:hover {
    background: #f1f5f9;
}

.stepper-step.active .stepper-number {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.stepper-step.active .stepper-label {
    color: #4f46e5;
    font-weight: 600;
}

.stepper-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s;
}

.stepper-label {
    font-size: 0.875rem;
    color: #64748b;
    transition: all 0.3s;
}

.stepper-line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin: 0 1rem;
    max-width: 100px;
}

/* NAVIGATION COMPACT (sur les côtés) */
.projection-nav-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-shrink: 0;
}

.projection-nav-left {
    justify-content: flex-start;
}

.projection-nav-right {
    justify-content: flex-end;
}

.projection-nav-btn {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    color: #4f46e5;
    font-size: 0.85rem;
}

.projection-nav-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
    border-color: #4f46e5;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.projection-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Boutons de navigation avec couleurs différentes (couleurs atténuées) */
.projection-nav-btn-prev {
    background: linear-gradient(135deg, #fca5a5 0%, #f87171 100%);
    border-color: #fca5a5;
    color: white;
}

.projection-nav-btn-prev:hover:not(:disabled) {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    border-color: #f87171;
    color: white;
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.3);
    transform: scale(1.05);
}

.projection-nav-btn-next {
    background: linear-gradient(135deg, #86efac 0%, #4ade80 100%);
    border-color: #86efac;
    color: white;
}

.projection-nav-btn-next:hover:not(:disabled) {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border-color: #4ade80;
    color: white;
    box-shadow: 0 2px 8px rgba(74, 222, 128, 0.3);
    transform: scale(1.05);
}

.projection-step-indicator {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    min-width: 50px;
    text-align: center;
}

.projection-step-indicator-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* CONTENU CARROUSEL (85%+ hauteur) */
.projection-carousel-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #ffffff;
    /* Calculer la hauteur disponible: 100vh - header (4vh) - stepper (5vh si visible) */
    height: calc(100vh - 4vh - 5vh);
    height: calc(100dvh - 4vh - 5vh); /* Dynamic viewport pour partage d'écran */
}

/* Sur mobile, le stepper est masqué, donc on utilise toute la hauteur moins le header */
@media (max-width: 768px) {
    .projection-carousel-wrapper {
        height: calc(100vh - 40px);
        height: calc(100dvh - 40px); /* Dynamic viewport pour partage d'écran */
    }
}

.projection-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    color: #4f46e5;
    font-size: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.projection-carousel-nav:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
    border-color: #4f46e5;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.projection-carousel-nav-left {
    left: 1rem;
}

.projection-carousel-nav-right {
    right: 1rem;
}

.projection-carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Styles RTL pour le track du carrousel */
.projection-popup-overlay[dir="rtl"] .projection-carousel-track {
    direction: rtl;
}

.projection-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.projection-slide.active {
    opacity: 1;
}

.projection-slide-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 0;
}

/* ÉTAPE 1: Règles - Prend toute la hauteur disponible - COMPACT */
.projection-slide[data-step="1"] .projection-slide-content {
    padding: 1.5rem 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    height: 100%;
}

.projection-rule-display {
    background: #ffffff;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    max-width: 1400px;
    width: 100%;
    height: fit-content;
    min-height: calc(100vh - 20vh);
}

/* Wrapper pour le contenu RTL */
.projection-rule-display-wrapper {
    width: 100%;
}

.projection-rule-display h3 {
    color: #1e293b;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #4f46e5;
}

.projection-rule-display .explication {
    color: #475569;
    font-size: 2rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 4px solid #4f46e5;
    border-radius: 8px;
}

/* Styles pour les balises <b> dans le mode projection - Couleurs significatives */
.projection-rule-display .explication b,
.projection-rule-display .remarques b {
    color: #4f46e5;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(79, 70, 229, 0.18) 100%);
    padding: 0.3rem 0.75rem;
    border-radius: 5px;
    font-weight: 700;
    display: inline-block;
    margin: 0 0.2rem;
    font-size: 1.1em;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.15);
}

.projection-rule-display .exemples-corrects-block b {
    color: #059669;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.18) 0%, rgba(5, 150, 105, 0.25) 100%);
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    font-weight: 700;
    display: inline-block;
    margin: 0 0.15rem;
    font-size: 1.05em;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.15);
}

.projection-rule-display .exemples-incorrects-block b {
    color: #dc2626;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.18) 0%, rgba(220, 38, 38, 0.25) 100%);
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    font-weight: 700;
    display: inline-block;
    margin: 0 0.15rem;
    font-size: 1.05em;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.15);
}

.projection-rule-display .remarques b {
    color: #d97706;
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.18) 0%, rgba(217, 119, 6, 0.25) 100%);
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.15);
}

.projection-rule-display .exemples-section {
    margin-top: 1.5rem;
}

/* Carte contenant les deux blocs d'exemples - COMPACT */
.projection-rule-display .exemples-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* Bloc horizontal pour chaque type d'exemples */
.projection-rule-display .exemples-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.projection-rule-display .exemples-block h4 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.projection-rule-display .exemples-corrects-block h4 {
    color: #10b981;
}

.projection-rule-display .exemples-incorrects-block h4 {
    color: #ef4444;
}

/* Conteneur exemple-item avec liste à l'intérieur - COMPACT */
.projection-rule-display .exemple-item {
    padding: 1.5rem;
    border-radius: 8px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.75rem;
}

.projection-rule-display .exemple-item.exemple-correct {
    border-left: 4px solid #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
}

.projection-rule-display .exemple-item.exemple-incorrect {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12);
}

/* Liste des exemples à l'intérieur du conteneur */
.projection-rule-display .exemples-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.projection-rule-display .exemples-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    transition: all 0.2s;
}

.projection-rule-display .exemples-list li:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(3px);
}

.projection-rule-display .exemples-list li i {
    flex-shrink: 0;
    margin-top: 0.3rem;
    font-size: 1.5rem;
}

.projection-rule-display .exemples-corrects-block .exemples-list li i {
    color: #10b981;
}

.projection-rule-display .exemples-incorrects-block .exemples-list li i {
    color: #ef4444;
}

.projection-rule-display .exemples-list li span {
    flex: 1;
    font-size: 1.75rem;
    font-weight: 500;
    line-height: 1.6;
}

.projection-rule-display .exemples-corrects-block .exemples-list li span {
    color: #065f46;
}

.projection-rule-display .exemples-incorrects-block .exemples-list li span {
    color: #991b1b;
}

.projection-rule-display .exemples-list li.exemple-empty {
    background: transparent;
    color: #94a3b8;
    font-style: italic;
    text-align: center;
    padding: 1rem;
    border: 2px dashed rgba(255, 255, 255, 0.5);
}

/* Scrollbar personnalisée pour les conteneurs d'exemples */
.projection-rule-display .exemple-item::-webkit-scrollbar {
    width: 6px;
}

.projection-rule-display .exemple-item::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.projection-rule-display .exemple-item.exemple-correct::-webkit-scrollbar-thumb {
    background: #10b981;
    border-radius: 3px;
}

.projection-rule-display .exemple-item.exemple-correct::-webkit-scrollbar-thumb:hover {
    background: #059669;
}

.projection-rule-display .exemple-item.exemple-incorrect::-webkit-scrollbar-thumb {
    background: #ef4444;
    border-radius: 3px;
}

.projection-rule-display .exemple-item.exemple-incorrect::-webkit-scrollbar-thumb:hover {
    background: #dc2626;
}

/* Le style .exemple-empty est maintenant dans .exemples-list li.exemple-empty ci-dessus */

/* Les styles des exemples individuels sont maintenant dans .exemples-list li ci-dessus */

/* Remarques - Style amélioré - COMPACT */
.projection-rule-display .remarques {
    margin-top: 2rem;
    padding: 2rem 2.5rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.projection-rule-display .remarques h4 {
    color: #78350f;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.projection-rule-display .remarques ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.projection-rule-display .remarques li {
    color: #92400e;
    padding: 0.75rem 0;
    padding-left: 2.5rem;
    position: relative;
    font-size: 1.75rem;
    line-height: 1.6;
    font-weight: 500;
}

.projection-rule-display .remarques li:before {
    content: "💡";
    position: absolute;
    left: 0;
    font-size: 1.8rem;
}

/* Styles RTL pour le contenu arabe dans le projecteur */
.projection-rule-display-wrapper.rtl-content {
    direction: rtl;
    text-align: right;
}

.projection-rule-display-wrapper.rtl-content h3 {
    text-align: right;
    border-bottom: 3px solid #4f46e5;
    border-left: none;
    border-right: none;
}

.projection-rule-display-wrapper.rtl-content .explication {
    text-align: right;
    border-left: none;
    border-right: 4px solid #4f46e5;
}

.projection-rule-display-wrapper.rtl-content .exemples-card {
    flex-direction: row-reverse;
}

.projection-rule-display-wrapper.rtl-content .exemples-list {
    direction: rtl;
}

.projection-rule-display-wrapper.rtl-content .exemples-list li {
    flex-direction: row-reverse;
    text-align: right;
}

.projection-rule-display-wrapper.rtl-content .exemples-list li:hover {
    transform: translateX(-3px);
}

.projection-rule-display-wrapper.rtl-content .exemple-item.exemple-correct {
    border-left: none;
    border-right: 4px solid #10b981;
}

.projection-rule-display-wrapper.rtl-content .exemple-item.exemple-incorrect {
    border-left: none;
    border-right: 4px solid #ef4444;
}

.projection-rule-display-wrapper.rtl-content .remarques {
    text-align: right;
    border-left: none;
    border-right: 4px solid #f59e0b;
}

.projection-rule-display-wrapper.rtl-content .remarques li {
    padding-left: 0;
    padding-right: 1.75rem;
}

.projection-rule-display-wrapper.rtl-content .remarques li:before {
    left: auto;
    right: 0;
}

.projection-rule-display-wrapper.rtl-content .exemples-block h4 {
    flex-direction: row-reverse;
    text-align: right;
    justify-content: flex-end;
}

/* Styles RTL pour le stepper et le header du projecteur */
.projection-popup-overlay[dir="rtl"] .projection-stepper-compact {
    direction: rtl;
}

.projection-popup-overlay[dir="rtl"] .projection-header-compact {
    direction: rtl;
}

.projection-popup-overlay[dir="rtl"] .projection-title {
    text-align: right;
}

.projection-popup-overlay[dir="rtl"] .stepper-step {
    flex-direction: row-reverse;
}

.projection-popup-overlay[dir="rtl"] .projection-close-btn {
    left: 1rem;
    right: auto;
}

/* ÉTAPE 2: Application */
.projection-application-view {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Timer section - COMPACT avec navigation intégrée */
.projection-timer-section {
    height: 5vh;
    min-height: 50px;
    max-height: 60px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-bottom: 3px solid #4f46e5;
    border-radius: 0;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 1rem;
}

.projection-timer-display-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    justify-content: center;
}

.projection-timer-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4f46e5;
    font-family: 'Courier New', monospace;
    background: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    display: inline-block;
    min-width: 80px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.projection-timer-display.warning {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.projection-timer-display.danger {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.projection-timer-label {
    color: #64748b;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.5rem;
}

.projection-timer-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.projection-timer-input-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: #ffffff;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
}

.projection-timer-input-group label {
    color: #64748b;
    font-size: 0.8rem;
}

.projection-timer-input {
    width: 50px;
    padding: 0.35rem;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    text-align: center;
    font-size: 0.85rem;
    color: #1e293b;
}

.projection-timer-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.projection-timer-input-group span {
    color: #64748b;
    font-size: 0.8rem;
}

.projection-timer-buttons {
    display: flex;
    gap: 0.4rem;
}

.projection-timer-buttons .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    min-width: auto;
}

/* Navigation intégrée dans timer section */
.projection-timer-section .projection-nav-compact {
    flex-shrink: 0;
}

.projection-timer-section .projection-nav-btn {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
}

/* Question section - 95% de l'espace (timer compact) */
.projection-question-section {
    flex: 1;
    height: 95%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
    overflow-y: auto;
}

.projection-question-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.projection-question-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 6px;
    flex-shrink: 0;
    min-width: 120px;
}

.projection-question-controls-left {
    justify-content: flex-start;
    min-width: auto;
    width: auto;
    padding: 0.25rem;
}

.projection-question-controls-right {
    justify-content: center;
    min-width: auto;
    width: auto;
    padding: 0.25rem;
}

.projection-q-nav-btn {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    padding: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    color: #4f46e5;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
}

.projection-q-nav-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.projection-q-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.projection-q-counter {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    background: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 2px solid #4f46e5;
    z-index: 10;
}

.projection-question-display {
    flex: 1;
    background: #ffffff;
    border: 2px solid #4f46e5;
    border-radius: 12px;
    padding: 3.5rem 2.5rem 2.5rem 2.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-size: 2rem;
    line-height: 1.6;
    color: #1e293b;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.projection-question-display .question-text-content {
    font-size: 2rem;
    line-height: 1.6;
    font-weight: 500;
    color: #1e293b;
}

.projection-question-display .question-text-content span {
    font-size: 2rem;
    font-weight: 700;
    color: #4f46e5;
}

.projection-question-display.has-choices {
    flex-direction: column;
    align-items: flex-start;
    align-content: flex-start;
    min-height: auto;
    height: auto;
    justify-content: flex-start;
    align-self: flex-start;
}

.projection-choices-list {
    width: 100%;
    margin-top: 1.5rem;
}

.projection-choice-item {
    padding: 1.5rem;
    margin: 0.75rem 0;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.75rem;
    line-height: 1.5;
    font-weight: 500;
    color: #1e293b;
}

.projection-choice-item span {
    font-size: 1.75rem;
    line-height: 1.5;
}

.projection-choice-item span:first-child {
    font-size: 2rem;
    font-weight: 700;
    color: #4f46e5;
    min-width: 2.5rem;
}

.projection-choice-item.correct {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.projection-show-answer-btn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
}

.projection-show-answer-btn:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.projection-answer-display {
    background: #f0fdf4;
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 1rem;
    display: none;
    animation: slideDown 0.3s ease-out;
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    color: #15803d;
    line-height: 1.5;
}

.projection-answer-display.show {
    display: block;
}

.projection-answer-display strong {
    font-size: 1.5rem;
    color: #065f46;
    display: block;
    margin-bottom: 1rem;
}

.projection-answer-display .answer-text {
    font-size: 3.5rem;
    font-weight: 700;
    color: #15803d;
    margin-top: 0.5rem;
}

.projection-hide-answer-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 2px solid #ef4444;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.projection-hide-answer-btn:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.projection-answer-display {
    position: relative;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ÉTAPE 2: Application - Utilisation complète de la hauteur */
.projection-slide[data-step="2"] .projection-slide-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ÉTAPE 3: Évaluation */
.projection-slide[data-step="3"] .projection-slide-content {
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.projection-evaluation-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.projection-eval-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.projection-eval-card .btn {
    margin: 0 auto;
    display: block;
}

.projection-eval-icon {
    font-size: 4rem;
    color: #4f46e5;
    margin-bottom: 1.5rem;
}

.projection-eval-card h3 {
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 1rem;
}

.projection-eval-name {
    color: #64748b;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* RESPONSIVE */
/* Optimisations pour mobile/tablette en mode projection (partage d'écran vers projecteur/TV) */
@media (max-width: 768px) {
    /* Utiliser dvh/dvw pour meilleure compatibilité avec partage d'écran */
    .projection-popup-container {
        width: 100vw;
        width: 100dvw; /* Dynamic viewport width - meilleur pour partage d'écran */
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height - meilleur pour partage d'écran */
        border-radius: 0;
    }
    
    .projection-popup-overlay {
        width: 100vw;
        width: 100dvw;
        height: 100vh;
        height: 100dvh;
    }
    
    /* Support plein écran avec dvh/dvw */
    :fullscreen .projection-popup-container,
    :-webkit-full-screen .projection-popup-container,
    :-moz-full-screen .projection-popup-container,
    :-ms-fullscreen .projection-popup-container {
        width: 100vw;
        width: 100dvw;
        height: 100vh;
        height: 100dvh;
    }
    
    :fullscreen .projection-popup-overlay,
    :-webkit-full-screen .projection-popup-overlay,
    :-moz-full-screen .projection-popup-overlay,
    :-ms-fullscreen .projection-popup-overlay {
        width: 100vw;
        width: 100dvw;
        height: 100vh;
        height: 100dvh;
    }
    
    /* Header optimisé pour projection - plus compact */
    .projection-header-compact {
        height: auto;
        min-height: 35px;
        max-height: 40px;
        padding: 0.4rem 1rem;
    }
    
    .projection-title {
        font-size: 0.95rem;
    }
    
    .projection-title img {
        height: 20px;
    }
    
    .projection-close-btn {
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
        padding: 0.3rem;
    }
    
    .projection-stepper-compact {
        display: none; /* Masqué en mobile */
    }
    
    .projection-slide-content {
        width: 100%;
        padding: 0;
    }
    
    .projection-carousel-nav {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
        background: rgba(255, 255, 255, 0.95);
        border: 2px solid #4f46e5;
        box-shadow: 0 3px 10px rgba(79, 70, 229, 0.3);
    }
    
    .projection-carousel-nav:hover {
        background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
        transform: translateY(-50%) scale(1.15);
        box-shadow: 0 5px 15px rgba(79, 70, 229, 0.5);
    }
    
    .projection-carousel-nav-left {
        left: 0.75rem;
    }
    
    .projection-carousel-nav-right {
        right: 0.75rem;
    }
    
    /* ÉTAPE 2: Application - Optimisation mobile pour espace maximal */
    .projection-slide[data-step="2"] .projection-application-view {
        height: 100%;
        height: 100dvh; /* Meilleur pour partage d'écran */
        display: flex;
        flex-direction: column;
    }
    
    .projection-timer-section {
        height: auto;
        min-height: 45px;
        max-height: 55px;
        padding: 0.5rem 0.75rem;
        flex-direction: row;
        gap: 0.5rem;
        flex-shrink: 0;
    }
    
    .projection-timer-display-wrapper {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
    
    .projection-timer-display {
        font-size: 1.5rem; /* Augmenté pour meilleure visibilité sur projecteur */
        padding: 0.5rem 1rem;
        min-width: 90px;
        font-weight: 700;
    }
    
    .projection-timer-label {
        display: none; /* Masqué sur mobile pour économiser l'espace */
    }
    
    .projection-timer-controls {
        flex-shrink: 0;
        justify-content: flex-end;
        gap: 0.4rem;
    }
    
    .projection-timer-input-group {
        display: none; /* Masqué sur mobile pour économiser l'espace */
    }
    
    .projection-timer-buttons .btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-width: 36px;
        height: 36px;
    }
    
    .projection-question-section {
        flex: 1;
        padding: 0.75rem;
        gap: 0.75rem;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        /* Calculer la hauteur disponible: 100dvh - header (40px) - timer (55px) */
        height: calc(100dvh - 40px - 55px);
        height: calc(100vh - 40px - 55px); /* Fallback */
    }
    
    .projection-question-wrapper {
        flex-direction: row;
        gap: 0.75rem;
        flex: 1;
        min-height: 0;
    }
    
    .projection-question-controls {
        min-width: auto;
        width: auto;
        padding: 0.3rem;
        background: transparent;
    }
    
    .projection-question-controls-left,
    .projection-question-controls-right {
        justify-content: center;
        padding: 0;
    }
    
    .projection-q-nav-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        padding: 0;
        font-size: 0.9rem;
    }
    
    .projection-question-display {
        font-size: 1.6rem; /* Augmenté pour meilleure visibilité sur projecteur */
        padding: 2.5rem 1.25rem 1.25rem 1.25rem;
        flex: 1;
        min-height: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .projection-question-display .question-text-content {
        font-size: 1.6rem; /* Augmenté pour meilleure visibilité sur projecteur */
        line-height: 1.6;
    }
    
    .projection-question-display .question-text-content span {
        font-size: 1.6rem; /* Augmenté pour meilleure visibilité sur projecteur */
    }
    
    .projection-q-counter {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
        top: 0.75rem;
        font-weight: 700;
    }
    
    .projection-choice-item {
        font-size: 1.3rem; /* Augmenté pour meilleure visibilité sur projecteur */
        padding: 1rem;
        margin: 0.75rem 0;
    }
    
    .projection-choice-item span {
        font-size: 1.3rem; /* Augmenté pour meilleure visibilité sur projecteur */
    }
    
    .projection-choice-item span:first-child {
        font-size: 1.5rem; /* Augmenté pour meilleure visibilité sur projecteur */
        min-width: 2.25rem;
    }
    
    .projection-show-answer-btn {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
        margin-top: 0.75rem;
        flex-shrink: 0;
        font-weight: 600;
    }
    
    .projection-answer-display {
        padding: 1.25rem;
        margin-top: 0.75rem;
        font-size: 1.5rem; /* Augmenté pour meilleure visibilité sur projecteur */
        flex-shrink: 0;
    }
    
    .projection-hide-answer-btn {
        top: 0.75rem;
        right: 0.75rem;
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }
    
    .projection-answer-display strong {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .projection-answer-display .answer-text {
        font-size: 2.5rem; /* Augmenté pour meilleure visibilité sur projecteur */
        margin-top: 0.5rem;
    }
    
    /* ÉTAPE 1: Règles - Responsive - COMPACT - Optimisé pour projection */
    .projection-slide[data-step="1"] .projection-slide-content {
        padding: 1rem;
        height: calc(100dvh - 40px); /* Hauteur disponible moins header */
        height: calc(100vh - 40px); /* Fallback */
        overflow-y: auto;
    }
    
    .projection-rule-display {
        padding: 1.5rem;
        min-height: auto;
        max-width: 100%;
    }
    
    .projection-rule-display h3 {
        font-size: 2.5rem; /* Augmenté pour meilleure visibilité sur projecteur */
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .projection-rule-display .explication {
        font-size: 1.75rem; /* Augmenté pour meilleure visibilité sur projecteur */
        padding: 1.5rem 1.75rem;
        margin-bottom: 1.75rem;
        line-height: 1.7;
    }
    
    .projection-rule-display .exemples-section {
        margin-top: 1.5rem;
    }
    
    /* Carte d'exemples - Responsive */
    .projection-rule-display .exemples-card {
        flex-direction: column;
        padding: 1.25rem;
        gap: 1.25rem;
    }
    
    .projection-rule-display .exemples-block h4 {
        font-size: 1.75rem; /* Augmenté pour meilleure visibilité sur projecteur */
        margin-bottom: 1rem;
        padding: 0.75rem;
    }
    
    .projection-rule-display .exemple-item {
        max-height: 450px;
        padding: 1.25rem;
    }
    
    .projection-rule-display .exemples-list {
        gap: 0.75rem;
    }
    
    .projection-rule-display .exemples-list li {
        padding: 1rem 1.125rem;
    }
    
    .projection-rule-display .exemples-list li span {
        font-size: 1.6rem; /* Augmenté pour meilleure visibilité sur projecteur */
    }
    
    .projection-rule-display .remarques {
        margin-top: 1.75rem;
        padding: 1.5rem 1.75rem;
    }
    
    .projection-rule-display .remarques h4 {
        font-size: 1.75rem; /* Augmenté pour meilleure visibilité sur projecteur */
        margin-bottom: 1.25rem;
    }
    
    .projection-rule-display .remarques li {
        font-size: 1.6rem; /* Augmenté pour meilleure visibilité sur projecteur */
        padding: 0.75rem 0;
        padding-left: 2.25rem;
        line-height: 1.6;
    }
}

/* Très petits écrans - Optimisation maximale pour slide 2 - Optimisé pour projection */
@media (max-width: 480px) {
    /* ÉTAPE 2: Application - Optimisation maximale pour très petits écrans */
    .projection-timer-section {
        min-height: 40px;
        max-height: 48px;
        padding: 0.4rem 0.5rem;
    }
    
    .projection-timer-display {
        font-size: 1.3rem; /* Augmenté pour meilleure visibilité sur projecteur */
        padding: 0.4rem 0.8rem;
        min-width: 80px;
        font-weight: 700;
    }
    
    .projection-timer-buttons .btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
        min-width: 32px;
        height: 32px;
    }
    
    .projection-question-section {
        padding: 0.5rem;
        gap: 0.5rem;
        height: calc(100dvh - 40px - 48px); /* Hauteur disponible moins header et timer */
        height: calc(100vh - 40px - 48px); /* Fallback */
    }
    
    .projection-question-wrapper {
        gap: 0.5rem;
    }
    
    .projection-q-nav-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        font-size: 0.85rem;
    }
    
    .projection-question-display {
        font-size: 1.4rem; /* Augmenté pour meilleure visibilité sur projecteur */
        padding: 2rem 1rem 1rem 1rem;
    }
    
    .projection-question-display .question-text-content {
        font-size: 1.4rem; /* Augmenté pour meilleure visibilité sur projecteur */
        line-height: 1.5;
    }
    
    .projection-question-display .question-text-content span {
        font-size: 1.4rem; /* Augmenté pour meilleure visibilité sur projecteur */
    }
    
    .projection-q-counter {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        top: 0.5rem;
        font-weight: 700;
    }
    
    .projection-choice-item {
        font-size: 1.2rem; /* Augmenté pour meilleure visibilité sur projecteur */
        padding: 0.875rem;
        margin: 0.5rem 0;
    }
    
    .projection-choice-item span {
        font-size: 1.2rem; /* Augmenté pour meilleure visibilité sur projecteur */
    }
    
    .projection-choice-item span:first-child {
        font-size: 1.35rem; /* Augmenté pour meilleure visibilité sur projecteur */
        min-width: 2rem;
    }
    
    .projection-show-answer-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        margin-top: 0.5rem;
        font-weight: 600;
    }
    
    .projection-answer-display {
        padding: 1rem;
        margin-top: 0.5rem;
        font-size: 1.3rem; /* Augmenté pour meilleure visibilité sur projecteur */
    }
    
    .projection-hide-answer-btn {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .projection-answer-display strong {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .projection-answer-display .answer-text {
        font-size: 2rem; /* Augmenté pour meilleure visibilité sur projecteur */
        margin-top: 0.3rem;
    }
}

/* Optimisations spécifiques pour tablettes (768px - 1024px) en mode projection */
@media (min-width: 481px) and (max-width: 1024px) {
    /* Utiliser dvh/dvw pour meilleure compatibilité avec partage d'écran */
    .projection-popup-container {
        width: 100vw;
        width: 100dvw;
        height: 100vh;
        height: 100dvh;
    }
    
    .projection-popup-overlay {
        width: 100vw;
        width: 100dvw;
        height: 100vh;
        height: 100dvh;
    }
    
    /* Header optimisé pour tablette */
    .projection-header-compact {
        height: auto;
        min-height: 38px;
        max-height: 45px;
        padding: 0.5rem 1.25rem;
    }
    
    .projection-title {
        font-size: 1rem;
    }
    
    /* Timer section optimisé */
    .projection-timer-section {
        min-height: 48px;
        max-height: 58px;
        padding: 0.6rem 1rem;
    }
    
    .projection-timer-display {
        font-size: 1.6rem;
        padding: 0.6rem 1.2rem;
        min-width: 100px;
    }
    
    /* Question section optimisé */
    .projection-question-section {
        padding: 1rem;
        gap: 1rem;
        height: calc(100dvh - 45px - 58px);
        height: calc(100vh - 45px - 58px);
    }
    
    .projection-question-display {
        font-size: 1.8rem;
        padding: 3rem 2rem 2rem 2rem;
    }
    
    .projection-question-display .question-text-content {
        font-size: 1.8rem;
    }
    
    .projection-question-display .question-text-content span {
        font-size: 1.8rem;
    }
    
    .projection-choice-item {
        font-size: 1.5rem;
        padding: 1.25rem;
    }
    
    .projection-choice-item span {
        font-size: 1.5rem;
    }
    
    .projection-choice-item span:first-child {
        font-size: 1.75rem;
    }
    
    /* Règles optimisées pour tablette */
    .projection-slide[data-step="1"] .projection-slide-content {
        height: calc(100dvh - 45px);
        height: calc(100vh - 45px);
    }
    
    .projection-rule-display h3 {
        font-size: 2.75rem;
    }
    
    .projection-rule-display .explication {
        font-size: 2rem;
    }
}

/* Optimisations pour mode paysage sur mobile/tablette */
@media (max-width: 1024px) and (orientation: landscape) {
    /* Réduire encore plus le header en paysage */
    .projection-header-compact {
        min-height: 32px;
        max-height: 38px;
        padding: 0.3rem 1rem;
    }
    
    .projection-title {
        font-size: 0.9rem;
    }
    
    .projection-title img {
        height: 18px;
    }
    
    .projection-close-btn {
        width: 32px;
        height: 32px;
        font-size: 1.3rem;
    }
    
    /* Timer plus compact en paysage */
    .projection-timer-section {
        min-height: 40px;
        max-height: 48px;
        padding: 0.4rem 0.75rem;
    }
    
    .projection-timer-display {
        font-size: 1.4rem;
        padding: 0.4rem 0.9rem;
    }
    
    /* Question section optimisé pour paysage */
    .projection-question-section {
        padding: 0.75rem;
        gap: 0.75rem;
        height: calc(100dvh - 38px - 48px);
        height: calc(100vh - 38px - 48px);
    }
    
    .projection-question-display {
        font-size: 1.5rem;
        padding: 2rem 1.5rem 1.5rem 1.5rem;
    }
    
    .projection-question-display .question-text-content {
        font-size: 1.5rem;
    }
    
    .projection-question-display .question-text-content span {
        font-size: 1.5rem;
    }
    
    /* Règles optimisées pour paysage */
    .projection-slide[data-step="1"] .projection-slide-content {
        height: calc(100dvh - 38px);
        height: calc(100vh - 38px);
        padding: 0.75rem;
    }
    
    .projection-rule-display {
        padding: 1.25rem;
    }
    
    .projection-rule-display h3 {
        font-size: 2.25rem;
        margin-bottom: 1rem;
    }
    
    .projection-rule-display .explication {
        font-size: 1.6rem;
        padding: 1.25rem 1.5rem;
    }
}

/* ============================================
   POPUP ACTIVITY RUN (2 slides: Application + Résultats)
   ============================================ */
.activity-run-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.activity-run-popup-container {
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: none;
}

/* Support plein écran réel (Fullscreen API) */
:fullscreen .activity-run-popup-container,
:-webkit-full-screen .activity-run-popup-container,
:-moz-full-screen .activity-run-popup-container,
:-ms-fullscreen .activity-run-popup-container {
    width: 100vw;
    height: 100vh;
}

:fullscreen .activity-run-popup-overlay,
:-webkit-full-screen .activity-run-popup-overlay,
:-moz-full-screen .activity-run-popup-overlay,
:-ms-fullscreen .activity-run-popup-overlay {
    width: 100vw;
    height: 100vh;
}

/* HEADER COMPACT (< 5%) */
.activity-run-header-compact {
    height: 4vh;
    min-height: 40px;
    max-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.activity-run-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.activity-run-close-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #dc2626;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-run-close-btn:hover {
    background: #fee2e2;
    color: #991b1b;
    transform: rotate(90deg);
}

/* STEPPER ET NAVIGATION */
.activity-run-stepper-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
    margin: 0 2rem;
}

.activity-run-nav-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.3s;
}

.activity-run-nav-btn:hover:not(:disabled) {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.activity-run-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* CARROUSEL */
.activity-run-carousel-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #ffffff;
}

.activity-run-carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.activity-run-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.activity-run-slide.active {
    opacity: 1;
}

.activity-run-slide-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 0;
}

/* ÉTAPE 1: Application */
.activity-run-slide[data-step="1"] .activity-run-slide-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
    height: 100%;
}

/* Timer fixe en haut */
.activity-run-timer-section-fixed {
    height: 5vh;
    min-height: 50px;
    max-height: 60px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-bottom: 3px solid #4f46e5;
    border-radius: 0;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 1rem;
    position: relative;
    z-index: 10;
}

/* Container pour les deux viewports */
.activity-run-viewports-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    height: calc(100vh - 4vh - 5vh); /* 100vh - header compact (4vh) - timer (5vh) */
    min-height: 0;
}

/* Viewport individuel */
.activity-run-viewport {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    background: #ffffff;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Quand la réponse est affichée, réduire le padding du viewport pour éliminer l'espace */
.activity-run-viewport:has(.answer-display.visible) {
    padding-bottom: 0.25rem;
}

.activity-run-viewport:not(.active) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.activity-run-viewport.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Viewport 1: Questions */
.activity-run-viewport-questions {
    z-index: 1;
}

/* Viewport 2: Grille des Élèves */
.activity-run-viewport-students {
    z-index: 2;
}

/* Timer section - COMPACT avec navigation intégrée (ancien style pour compatibilité) */
.activity-run-timer-section {
    height: 5vh;
    min-height: 50px;
    max-height: 60px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-bottom: 3px solid #4f46e5;
    border-radius: 0;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 1rem;
}

.activity-run-timer-display-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    justify-content: center;
}

.activity-run-timer-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4f46e5;
    font-family: 'Courier New', monospace;
    background: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    display: inline-block;
    min-width: 80px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.activity-run-timer-display.warning {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.activity-run-timer-display.finished {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.activity-run-timer-display.time-expired {
    color: #ffffff;
    background: #ef4444;
    animation: timerExpiredPulse 1s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}

@keyframes timerExpiredPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.9);
    }
}

.activity-run-timer-label {
    color: #64748b;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.5rem;
}

.activity-run-timer-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.activity-run-timer-input-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: #ffffff;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
}

.activity-run-timer-input-group label {
    color: #64748b;
    font-size: 0.8rem;
}

.activity-run-timer-input {
    width: 50px;
    padding: 0.35rem;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    text-align: center;
    font-size: 0.85rem;
    color: #1e293b;
}

.activity-run-timer-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.activity-run-timer-input-group span {
    color: #64748b;
    font-size: 0.8rem;
}

.activity-run-timer-buttons {
    display: flex;
    gap: 0.4rem;
}

.activity-run-timer-buttons .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    min-width: auto;
}

/* Question section dans le viewport - Optimisation de l'espace comme projection-question-section */
.activity-run-viewport .activity-run-question-section {
    flex: 0 1 auto;
    min-height: 0;
    height: auto;
    max-height: 95%;
    background: #ffffff;
    border-radius: 0;
    padding: 1rem;
    box-shadow: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Styles de base pour currentQuestionDisplay dans la popup - Optimisé comme projection */
#currentQuestionDisplay {
    flex: 0 1 auto;
    background: #ffffff;
    border: 2px solid #4f46e5;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-size: 2rem;
    line-height: 1.6;
    color: #1e293b;
    min-height: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

#currentQuestionDisplay.visible {
    font-size: 2rem;
    padding: 2rem 1.5rem;
}

/* Styles pour les éléments de question dans la popup - Comme projection */
#currentQuestionDisplay .question-text-content {
    font-size: 2rem;
    line-height: 1.6;
    font-weight: 500;
    color: #1e293b;
    word-wrap: break-word;
}

#currentQuestionDisplay .question-text-content span {
    font-size: 2rem;
    font-weight: 700;
    color: #4f46e5;
}

#currentQuestionDisplay.has-choices {
    flex-direction: column;
    align-items: flex-start;
}

/* Rendre question-display compact pour les questions à choix multiple quand la réponse est affichée */
.activity-run-viewport:has(.answer-display.visible) #currentQuestionDisplay.has-choices {
    padding: 1rem 1rem;
    font-size: 1.5rem;
    max-height: 40vh;
    overflow-y: auto;
}

.activity-run-viewport:has(.answer-display.visible) #currentQuestionDisplay.has-choices .question-text-content {
    font-size: 1.5rem;
    line-height: 1.4;
}

.activity-run-viewport:has(.answer-display.visible) #currentQuestionDisplay.has-choices .question-text-content span {
    font-size: 1.5rem;
}

/* Masquer les choix quand la réponse est affichée */
.activity-run-viewport:has(.answer-display.visible) #currentQuestionDisplay.has-choices .question-choices-list {
    display: none;
}

.activity-run-viewport:has(.answer-display.visible) #currentQuestionDisplay.has-choices .question-choice-item {
    padding: 0.75rem;
    margin: 0.25rem 0;
    font-size: 1.4rem;
}

.activity-run-viewport:has(.answer-display.visible) #currentQuestionDisplay.has-choices .question-choice-item span:first-child {
    font-size: 1.5rem;
    min-width: 2rem;
}

#currentQuestionDisplay .question-choices-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1rem;
}

#currentQuestionDisplay .question-choice-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin: 0.5rem 0;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #e2e8f0;
    font-size: 1.75rem;
    line-height: 1.5;
    font-weight: 500;
    color: #1e293b;
    transition: all 0.3s ease;
    word-wrap: break-word;
}

#currentQuestionDisplay .question-choice-item span:first-child {
    font-size: 2rem;
    font-weight: 700;
    color: #4f46e5;
    min-width: 2.5rem;
}

/* Quand la réponse est affichée, éliminer l'espace et rendre la section non-scrollable */
.activity-run-viewport .activity-run-question-section:has(.answer-display.visible) {
    flex: 0 1 auto;
    overflow-y: visible;
    height: auto;
    max-height: none;
    margin-bottom: 0;
    padding-bottom: 0.5rem;
}

/* Titre de l'activité au-dessus des contrôles de question */
.activity-title-section {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 4px solid #4f46e5;
    border-radius: 8px;
    text-align: center;
    flex-shrink: 0;
}

/* Optimisation des contrôles de question - Style compact comme projection */
.activity-run-viewport .question-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.3rem 0.5rem;
    background: #f8fafc;
    border-radius: 6px;
    flex-shrink: 0;
    margin-top: 0;
}

.activity-run-viewport .question-controls .btn-small {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    min-width: auto;
    white-space: nowrap;
}

/* Compteur de question optimisé - Style compact dans les contrôles */
.activity-run-viewport #currentQuestionDisplay {
    position: relative;
}

.activity-run-viewport .question-controls-center {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.activity-run-viewport #questionCounter {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    background: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid #4f46e5;
    white-space: nowrap;
}

/* Optimisation des actions de question - Style compact */
.activity-run-viewport .question-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-top: 0;
}

.activity-run-viewport .question-actions .btn {
    flex: 1;
    min-width: auto;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
}

/* Assurer la visibilité du bouton "Afficher la réponse" quand il est affiché */
.activity-run-viewport .question-actions #showAnswerBtn:not([style*="display: none"]) {
    display: flex;
    visibility: visible;
    opacity: 1;
    margin-top: 0.75rem;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Optimisation de l'affichage de réponse */
.activity-run-viewport .answer-display {
    flex-shrink: 0;
    margin-top: 0;
    display: none;
}

/* Affichage de la réponse en vert avec bouton hideAnswer en haut à droite */
.activity-run-viewport .answer-display.visible {
    display: block;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 0.75rem;
    position: relative;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.activity-run-viewport .answer-display.visible .answer-content {
    position: relative;
    padding-right: 0;
}

/* Bouton hideAnswer en haut à droite */
.activity-run-viewport .answer-display.visible .projection-hide-answer-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #10b981;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #10b981;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 10;
    padding: 0;
    margin: 0;
}

.activity-run-viewport .answer-display.visible .projection-hide-answer-btn:hover {
    background: #10b981;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.activity-run-viewport .answer-display.visible .projection-hide-answer-btn i {
    font-size: 0.9rem;
}

/* Styles pour le contenu de la réponse */
.activity-run-viewport .answer-display.visible .answer-label {
    font-weight: 700;
    color: #065f46;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    padding-right: 2.75rem; /* Espace pour le bouton */
    margin-top: 0;
}

.activity-run-viewport .answer-display.visible .answers-display-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.activity-run-viewport .answer-display.visible .answer-display-item {
    background: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 3px solid #10b981;
}

.activity-run-viewport .answer-display.visible .answer-text {
    color: #065f46;
    font-weight: 500;
    font-size: 2.5rem;
    line-height: 1.6;
}

.activity-run-viewport .answer-display.visible .answer-correct-badge {
    background: #10b981;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
    display: inline-block;
}

/* Question section - 95% de l'espace (timer compact) - ancien style pour compatibilité */
.activity-run-question-section {
    flex: 0 0 auto;
    min-height: 300px;
    max-height: 50vh;
    background: #ffffff;
    border-radius: 0;
    padding: 1.5rem;
    box-shadow: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Navigation entre viewports */
.activity-run-viewport-navigation {
    height: 5vh;
    min-height: 40px;
    max-height: 50px;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    margin-top: auto;
}

/* Quand la réponse est affichée, éliminer l'espace avant le bouton */
.activity-run-viewport:has(.answer-display.visible) .activity-run-viewport-navigation {
    margin-top: 0;
}

.activity-run-viewport-navigation .btn {
    min-width: 200px;
}

/* Navigation unifiée pour viewport 2 */
.activity-run-unified-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    flex-shrink: 0;
    margin-top: auto;
}

.activity-run-unified-navigation .btn {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    white-space: nowrap;
}

.activity-run-unified-navigation .btn-nav-prev,
.activity-run-unified-navigation .btn-nav-next {
    max-width: 140px;
}

.activity-run-unified-navigation .btn-warning {
    max-width: 130px;
}

.activity-run-unified-navigation .btn-secondary {
    max-width: 120px;
}

.activity-run-question-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.activity-run-question-controls {
    flex-shrink: 0;
}

.activity-run-q-nav-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.3s;
}

.activity-run-q-nav-btn:hover:not(:disabled) {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.activity-run-q-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.activity-run-question-display {
    flex: 1;
    min-height: 200px;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.activity-run-q-counter {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1rem;
    font-weight: 600;
}

.activity-run-show-answer-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
}

.activity-run-show-answer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.activity-run-answer-display {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 8px;
    border-left: 4px solid #10b981;
    position: relative;
}

.activity-run-hide-answer-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #10b981;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #10b981;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.activity-run-hide-answer-btn:hover {
    background: #10b981;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.activity-run-hide-answer-btn i {
    font-size: 1rem;
}

/* Section Grille des Élèves dans le viewport */
.activity-run-viewport .activity-run-students-section {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8fafc;
    border-top: none;
    margin-top: 0;
}

/* Section Grille des Élèves - ancien style pour compatibilité */
.activity-run-students-section {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8fafc;
    border-top: 3px solid #e2e8f0;
    margin-top: 1rem;
}

.activity-run-students-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.activity-run-students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
}

.activity-run-students-grid .student-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
    transition: all 0.3s;
}

.activity-run-students-grid .student-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #4f46e5;
}

.activity-run-students-grid .student-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.activity-run-students-grid .student-photo-container {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.activity-run-students-grid .student-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.activity-run-students-grid .student-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    font-size: 1.5rem;
}

.activity-run-students-grid .student-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-run-students-grid .student-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4f46e5;
    text-align: center;
    margin: 0.75rem 0;
    padding: 0.5rem;
    background: #eef2ff;
    border-radius: 6px;
}

.activity-run-students-grid .student-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.activity-run-students-grid .btn-score {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.activity-run-students-grid .btn-score.btn-true {
    background: #10b981;
    color: white;
}

.activity-run-students-grid .btn-score.btn-true:hover {
    background: #059669;
}

.activity-run-students-grid .btn-score.btn-half {
    background: #f59e0b;
    color: white;
}

.activity-run-students-grid .btn-score.btn-half:hover {
    background: #d97706;
}

.activity-run-students-grid .btn-score.btn-false {
    background: #ef4444;
    color: white;
}

.activity-run-students-grid .btn-score.btn-false:hover {
    background: #dc2626;
}

.activity-run-students-grid .group-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
    transition: all 0.3s;
}

.activity-run-students-grid .group-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.activity-run-students-grid .group-header {
    margin-bottom: 0.75rem;
}

.activity-run-students-grid .group-name {
    font-size: 1rem;
    font-weight: 700;
}

.activity-run-students-grid .group-members {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #64748b;
}

.activity-run-students-grid .group-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4f46e5;
    text-align: center;
    margin: 0.75rem 0;
    padding: 0.5rem;
    background: #eef2ff;
    border-radius: 6px;
}

.activity-run-students-grid .group-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.activity-run-students-grid .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

/* ÉTAPE 2: Résultats */
.activity-run-slide[data-step="2"] .activity-run-slide-content {
    padding: 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    height: 100%;
}

.activity-run-results-view {
    width: 100%;
    max-width: 1400px;
    position: relative;
}

/* Modal dans la popup activity-run - doit être au-dessus de la popup */
#activity-run-popup .modal-overlay {
    z-index: 12000 !important;
    position: fixed;
}

.activity-run-results-display {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Responsive */
/* Grands écrans (≥1920px) */
@media (min-width: 1920px) {
    #currentQuestionDisplay {
        font-size: 4rem;
        padding: 4rem;
        min-height: auto;
        height: auto;
    }
    
    #currentQuestionDisplay.visible {
        font-size: 5rem;
        padding: 5rem;
        min-height: auto;
        height: auto;
    }
    
    .question-text-content {
        font-size: 3rem;
    }
}

/* Tablettes et écrans moyens (≤768px) */
@media (max-width: 768px) {
    .activity-run-timer-section-fixed {
        height: 6vh;
        min-height: 45px;
        padding: 0.4rem 0.75rem;
    }

    .activity-run-viewports-wrapper {
        height: calc(100vh - 4vh - 6vh);
    }

    .activity-run-viewport {
        padding: 1rem;
    }

    .activity-run-timer-display {
        font-size: 2rem;
    }
    
    .activity-run-timer-controls {
        flex-direction: column;
    }
    
    .activity-run-question-wrapper {
        flex-direction: column;
    }
    
    /* Optimisation de l'espace comme projection-question-section */
    .activity-run-viewport .activity-run-question-section {
        padding: 0.5rem;
        gap: 0.5rem;
        min-height: 0;
    }
    
    .activity-run-viewport .question-controls {
        padding: 0.25rem;
        background: transparent;
        flex-wrap: wrap;
    }
    
    .activity-run-viewport .question-controls .btn-small {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
        flex: 1;
        min-width: 100px;
    }
    
    .activity-run-viewport #questionCounter {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    /* Ajustement pour currentQuestionDisplay */
    #currentQuestionDisplay {
        font-size: 1.4rem;
        padding: 2rem 1rem 1rem 1rem;
        flex: 0 1 auto;
        min-height: auto;
        height: auto;
    }
    
    #currentQuestionDisplay.visible {
        font-size: 1.4rem;
        padding: 2rem 1rem 1rem 1rem;
    }
    
    #currentQuestionDisplay .question-text-content {
        font-size: 1.4rem;
        line-height: 1.5;
    }
    
    #currentQuestionDisplay .question-text-content span {
        font-size: 1.4rem;
    }
    
    #currentQuestionDisplay .question-choice-item {
        font-size: 1.15rem;
        padding: 0.75rem;
        margin: 0.5rem 0;
    }
    
    #currentQuestionDisplay .question-choice-item span {
        font-size: 1.15rem;
    }
    
    #currentQuestionDisplay .question-choice-item span:first-child {
        font-size: 1.3rem;
        min-width: 2rem;
    }
    
    .activity-run-viewport .question-actions .btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* Petits écrans (≤480px) */
@media (max-width: 480px) {
    /* Optimisation maximale comme projection-question-section */
    .activity-run-viewport .activity-run-question-section {
        padding: 0.3rem;
        gap: 0.3rem;
    }
    
    .activity-run-viewport .question-controls {
        gap: 0.3rem;
    }
    
    .activity-run-viewport .question-controls .btn-small {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .activity-run-viewport #questionCounter {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    #currentQuestionDisplay {
        font-size: 1.2rem;
        padding: 1.5rem 0.8rem 0.8rem 0.8rem;
        min-height: auto;
        height: auto;
    }
    
    #currentQuestionDisplay.visible {
        font-size: 1.2rem;
        padding: 1.5rem 0.8rem 0.8rem 0.8rem;
    }
    
    #currentQuestionDisplay .question-text-content {
        font-size: 1.2rem;
        line-height: 1.4;
    }
    
    #currentQuestionDisplay .question-text-content span {
        font-size: 1.2rem;
    }
    
    #currentQuestionDisplay .question-choice-item {
        font-size: 1rem;
        padding: 0.6rem;
        margin: 0.4rem 0;
    }
    
    #currentQuestionDisplay .question-choice-item span {
        font-size: 1rem;
    }
    
    #currentQuestionDisplay .question-choice-item span:first-child {
        font-size: 1.15rem;
        min-width: 1.8rem;
    }
    
    .activity-run-viewport .question-actions .btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
    }
}

/* Très petits écrans (≤375px) */
@media (max-width: 375px) {
    #currentQuestionDisplay {
        font-size: 1.25rem;
        padding: 1rem;
        min-height: auto;
        height: auto;
        margin: 0.5rem 0;
        border-radius: 12px;
    }
    
    #currentQuestionDisplay.visible {
        font-size: 1.5rem;
        padding: 1.25rem;
        min-height: auto;
        height: auto;
        margin: 0.5rem 0 1rem 0;
    }
    
    .question-text-content {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }
    
    .question-choices-list {
        gap: 0.4rem;
    }
    
    .question-choice-item {
        padding: 0.6rem;
        font-size: 1rem;
    }
}