/**
 * Le Dojo - Styles page élèves
 * 
 * Interface publique pour les élèves
 */

/* ========================================
   CONTAINER PRINCIPAL
   ======================================== */
.dojo-public-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: var(--font-main);
    background-color: var(--dojo-blanc);
    min-height: 100vh;
}

.dojo-public-container::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    z-index: -1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='%23000' stroke-width='1'/%3E%3Ccircle cx='50' cy='50' r='30' fill='none' stroke='%23000' stroke-width='1'/%3E%3Ccircle cx='50' cy='50' r='20' fill='none' stroke='%23000' stroke-width='1'/%3E%3Ccircle cx='50' cy='50' r='10' fill='none' stroke='%23000' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 50px 50px;
}

/* ========================================
   EN-TÊTE
   ======================================== */
.dojo-public-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 60px 20px;
    background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    border-radius: 0;
    color: #fff;
    position: relative;
    overflow: hidden;
    border-top: 4px solid var(--dojo-rouge);
    border-bottom: 4px solid var(--dojo-rouge);
}

.dojo-public-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30 Z' fill='none' stroke='%23c41e3a' stroke-width='0.5' opacity='0.1'/%3E%3C/svg%3E");
    background-size: 30px 30px;
    opacity: 0.3;
}

.dojo-public-title {
    font-family: var(--font-jp);
    font-size: 3.5em;
    margin: 0 0 15px 0;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    position: relative;
    letter-spacing: 0.1em;
}

.dojo-public-title::before {
    content: "道場";
    display: block;
    font-size: 0.4em;
    color: var(--dojo-rouge);
    margin-bottom: 10px;
    letter-spacing: 0.3em;
}

.dojo-public-subtitle {
    font-size: 1.1em;
    margin: 0;
    color: var(--dojo-or);
    font-style: italic;
    position: relative;
}

.dojo-public-header::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--dojo-rouge);
}

/* ========================================
   FILTRES
   ======================================== */
.dojo-filtres {
    display: flex;
    gap: 25px;
    margin-bottom: 40px;
    padding: 25px 30px;
    background: linear-gradient(135deg, var(--dojo-gris-clair) 0%, #ebe4d6 100%);
    border-radius: var(--border-radius);
    flex-wrap: wrap;
    border: 1px solid var(--dojo-gris);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: relative;
}

.dojo-filtres::before {
    content: "選択";
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--dojo-gris-clair);
    padding: 0 10px;
    font-size: 0.8em;
    color: #8b7355;
    font-family: var(--font-jp);
}

.dojo-filtre-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.dojo-filtre-group label {
    font-weight: 700;
    color: #4a4a4a;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dojo-filtre-group select {
    padding: 12px 15px;
    border: 2px solid #c9b896;
    border-radius: 3px;
    font-size: 1em;
    cursor: pointer;
    background: #fff;
    font-family: inherit;
    transition: all 0.3s;
    height: auto;
    line-height: 1.4;
    min-height: 48px;
}

.dojo-filtre-group select:focus {
    outline: none;
    border-color: var(--dojo-rouge);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

/* ========================================
   GRILLE DES CAHIERS
   ======================================== */
.dojo-cahiers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.dojo-cahier-public {
    background: #fff;
    border-radius: 3px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid #e0d8c8;
    position: relative;
    border-top: 5px solid var(--dojo-rouge);
}

.dojo-cahier-public:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.dojo-cahier-public-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 25px 25px 15px 25px;
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
}

.dojo-cahier-public-header h3 {
    margin: 0;
    color: #1a1a1a;
    font-size: 1.25em;
    flex: 1;
    padding-right: 15px;
    font-family: var(--font-jp);
    line-height: 1.4;
}

.dojo-cahier-public-desc {
    color: #666;
    margin: 0;
    padding: 0 25px 15px 25px;
    font-size: 0.95em;
    line-height: 1.6;
}

.dojo-cahier-public-meta {
    display: flex;
    gap: 10px;
    padding: 0 25px 20px 25px;
    flex-wrap: wrap;
}

.dojo-tag-public {
    padding: 6px 14px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dojo-cahier-public-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: #f8f6f2;
    border-top: 1px solid #ebe4d6;
}

.dojo-nb-exercices {
    color: #8b7355;
    font-size: 0.9em;
    font-weight: 500;
}

.dojo-btn-commencer {
    background: linear-gradient(180deg, var(--dojo-rouge) 0%, #a01830 100%);
    color: #fff;
    box-shadow: 0 3px 10px rgba(196, 30, 58, 0.3);
    position: relative;
    overflow: hidden;
}

.dojo-btn-commencer::before {
    content: "始";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    opacity: 0.3;
    font-family: var(--font-jp);
}

.dojo-btn-commencer:hover {
    background: linear-gradient(180deg, #d42a46 0%, #b01e38 100%);
    box-shadow: 0 5px 15px rgba(196, 30, 58, 0.4);
}

/* ========================================
   ZONE EXERCICES
   ======================================== */
.dojo-exercices-zone {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0d8c8;
}

.dojo-btn-retour {
    background: #4a4a4a;
    color: #fff;
    margin-bottom: 25px;
}

.dojo-btn-retour:hover {
    background: #333;
}

.dojo-exercices-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.dojo-exercices-titre {
    text-align: center;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-family: var(--font-jp);
    font-size: 2em;
}

.dojo-exercices-titre::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: var(--dojo-rouge);
    margin: 15px auto 0;
}

/* ========================================
   BARRE DE PROGRESSION
   ======================================== */
.dojo-progression {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--dojo-or);
}

.dojo-progression-bar {
    flex: 1;
    height: 12px;
    background: #444;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dojo-progression-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--dojo-or) 0%, #f4d03f 50%, var(--dojo-or) 100%);
    border-radius: 6px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.dojo-progression-text {
    font-weight: 700;
    color: var(--dojo-or);
    white-space: nowrap;
    font-size: 1.1em;
    min-width: 60px;
    text-align: right;
}

/* ========================================
   CARTE EXERCICE
   ======================================== */
.dojo-exercice-public {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e0d0;
    border-left: 5px solid var(--dojo-rouge);
    position: relative;
}

.dojo-exercice-public::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, transparent 50%, #f8f6f2 50%);
}

.dojo-exercice-public.correct {
    border-left-color: var(--dojo-vert);
    background: linear-gradient(135deg, #f8fff8 0%, #fff 100%);
}

.dojo-exercice-public.incorrect {
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, #fff8f8 0%, #fff 100%);
}

.dojo-exercice-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.dojo-exercice-numero {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--dojo-rouge) 0%, var(--dojo-rouge-fonce) 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1em;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(196, 30, 58, 0.3);
}

.dojo-exercice-header h3 {
    margin: 0;
    flex: 1;
    color: #1a1a1a;
    font-family: var(--font-jp);
}

.dojo-exercice-ceinture {
    flex-shrink: 0;
}

.dojo-exercice-consigne {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 25px;
    line-height: 1.7;
    padding: 15px 20px;
    background: #f8f6f2;
    border-radius: 3px;
    border-left: 3px solid var(--dojo-gris);
}

/* Cacher la consigne vide pour les rappels de cours */
.dojo-exercice-public[data-type="rappel_cours"] .dojo-exercice-consigne {
    display: none;
}

/* ========================================
   FEEDBACK
   ======================================== */
.dojo-exercice-feedback {
    margin-top: 20px;
    padding: 20px 25px;
    border-radius: var(--border-radius);
    font-weight: 500;
    line-height: 1.6;
}

.dojo-exercice-feedback.correct {
    background: linear-gradient(135deg, #e8f8e8 0%, #d4edda 100%);
    color: #155724;
    border-left: 5px solid var(--dojo-vert);
}

.dojo-exercice-feedback.incorrect {
    background: linear-gradient(135deg, #fde8e8 0%, #f8d7da 100%);
    color: #721c24;
    border-left: 5px solid #e74c3c;
}

/* ========================================
   BOUTONS VALIDER / RÉESSAYER
   ======================================== */
.dojo-btn-valider {
    background: linear-gradient(180deg, var(--dojo-rouge) 0%, var(--dojo-rouge-fonce) 100%);
    color: #fff;
    margin-top: 25px;
    padding: 15px 35px;
    font-size: 1em;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
    position: relative;
}

.dojo-btn-valider::after {
    content: "確認";
    position: absolute;
    right: 12px;
    font-size: 0.8em;
    opacity: 0.5;
    font-family: var(--font-jp);
}

.dojo-btn-valider:hover {
    background: linear-gradient(180deg, #d42a46 0%, #a01830 100%);
    box-shadow: 0 6px 18px rgba(196, 30, 58, 0.4);
}

.dojo-btn-valider:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.dojo-btn-valider:disabled::after {
    content: "✓";
}

.dojo-btn-reessayer {
    background: linear-gradient(180deg, var(--dojo-orange) 0%, #d68910 100%);
    color: #fff;
    margin-top: 25px;
    margin-left: 15px;
    padding: 15px 35px;
    font-size: 1em;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.dojo-btn-reessayer:hover {
    background: linear-gradient(180deg, #f5b041 0%, var(--dojo-orange) 100%);
    box-shadow: 0 6px 18px rgba(243, 156, 18, 0.4);
}

/* ========================================
   QCM
   ======================================== */
.dojo-qcm-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dojo-qcm-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    background: #fafafa;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid #e8e0d0;
}

.dojo-qcm-option:hover {
    background: var(--dojo-gris-clair);
    border-color: var(--dojo-gris);
}

.dojo-qcm-option.selected {
    background: #fff5f5;
    border-color: var(--dojo-rouge);
}

.dojo-qcm-option.correct {
    background: #e8f8e8;
    border-color: var(--dojo-vert);
}

.dojo-qcm-option.incorrect {
    background: #fde8e8;
    border-color: #e74c3c;
}

.dojo-qcm-option input {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--dojo-rouge);
}

.dojo-qcm-label {
    flex: 1;
    font-size: 1em;
    color: #333;
}

/* ========================================
   VRAI / FAUX
   ======================================== */
.dojo-vrai-faux-options {
    display: flex;
    gap: 25px;
    justify-content: center;
}

.dojo-vrai-faux-option {
    cursor: pointer;
}

.dojo-vrai-faux-option input {
    display: none;
}

.dojo-vf-label {
    display: block;
    padding: 25px 50px;
    border-radius: var(--border-radius);
    font-weight: 700;
    font-size: 1.3em;
    transition: all 0.2s;
    border: 3px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.dojo-vf-vrai {
    background: linear-gradient(135deg, #e8f8e8 0%, #d4edda 100%);
    color: #1e7e34;
}

.dojo-vf-faux {
    background: linear-gradient(135deg, #fde8e8 0%, #f8d7da 100%);
    color: #a71d2a;
}

.dojo-vrai-faux-option input:checked + .dojo-vf-label {
    border-color: #1a1a1a;
    transform: scale(1.08);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ========================================
   TEXTE À TROUS
   ======================================== */
.dojo-texte-trous {
    font-size: 1.15em;
    line-height: 2.2;
    color: #333;
}

.dojo-trou-input {
    width: auto;
    min-width: 80px;
    max-width: 150px;
    padding: 4px 10px;
    border: 2px dashed var(--dojo-rouge);
    border-radius: 3px;
    font-size: 0.95em;
    text-align: center;
    margin: 0 3px;
    font-family: inherit;
    background: #fff5f5;
    display: inline-block;
    vertical-align: middle;
}

.dojo-trou-input:focus {
    outline: none;
    border-style: solid;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.dojo-trou-input.correct {
    background: #e8f8e8;
    border-color: var(--dojo-vert);
    border-style: solid;
}

.dojo-trou-input.incorrect {
    background: #fde8e8;
    border-color: #e74c3c;
    border-style: solid;
}

.dojo-trou-correction {
    display: inline-block;
    background: #d4edda;
    color: #155724;
    padding: 4px 10px;
    border-radius: 3px;
    font-weight: 600;
    margin-left: 5px;
    font-size: 0.9em;
    vertical-align: middle;
}

/* ========================================
   RÉPONSE COURTE
   ======================================== */
.dojo-reponse-courte {
    max-width: 450px;
}

.dojo-reponse-input {
    width: 100%;
    padding: 18px 20px;
    border: 2px solid var(--dojo-gris);
    border-radius: var(--border-radius);
    font-size: 1.1em;
    font-family: inherit;
    background: #fafafa;
}

.dojo-reponse-input:focus {
    outline: none;
    border-color: var(--dojo-rouge);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

/* ========================================
   ASSOCIATION
   ======================================== */
.dojo-association-container {
    display: flex;
    justify-content: space-between;
    gap: 60px;
    padding: 20px 0;
    position: relative;
}

.dojo-association-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.dojo-association-ligne {
    stroke: var(--dojo-rouge);
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
}

.dojo-association-ligne.correct {
    stroke: var(--dojo-vert);
}

.dojo-association-ligne.incorrect {
    stroke: #e74c3c;
}

.dojo-association-gauche,
.dojo-association-droite {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    max-width: 45%;
    position: relative;
    z-index: 2;
}

.dojo-association-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    background: #fff;
    border: 2px solid #e8e0d0;
    border-radius: 8px;
    transition: all 0.3s;
    cursor: pointer;
}

.dojo-association-item-gauche {
    flex-direction: row;
    border-left: 4px solid var(--dojo-rouge);
}

.dojo-association-item-droite {
    flex-direction: row;
    border-right: 4px solid #2980b9;
    border-left: none;
}

.dojo-association-item.selected {
    border-color: var(--dojo-rouge);
    background: #fff5f5;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.2);
}

.dojo-association-item.matched {
    opacity: 0.6;
    pointer-events: none;
}

.dojo-association-item.correct {
    border-color: var(--dojo-vert);
    background: #e8f8e8;
}

.dojo-association-item.incorrect {
    border-color: #e74c3c;
    background: #fde8e8;
}

.dojo-association-texte {
    flex: 1;
    font-size: 1em;
    color: #333;
}

.dojo-association-point {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e8e0d0;
    border: 3px solid #d4c5a9;
    flex-shrink: 0;
    transition: all 0.3s;
}

.dojo-association-item.selected .dojo-association-point {
    background: var(--dojo-rouge);
    border-color: var(--dojo-rouge);
}

.dojo-association-item.matched .dojo-association-point {
    background: var(--dojo-vert);
    border-color: var(--dojo-vert);
}

.dojo-association-badge {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--dojo-rouge) 0%, var(--dojo-rouge-fonce) 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    font-weight: 700;
    flex-shrink: 0;
}

/* ========================================
   ORDONNANCEMENT
   ======================================== */
.dojo-ordonnancement-container {
    padding: 10px 0;
}

.dojo-ordonnancement-liste {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dojo-ordonnancement-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #fff;
    border: 2px solid #e8e0d0;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.2s;
    border-left: 4px solid var(--dojo-rouge);
}

.dojo-ordonnancement-item:hover {
    border-color: var(--dojo-rouge);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.15);
}

.dojo-ordonnancement-item:active {
    cursor: grabbing;
}

.dojo-ordonnancement-item.dragging {
    opacity: 0.5;
    transform: scale(1.02);
}

.dojo-ordonnancement-item.drag-over {
    border-top: 3px solid var(--dojo-rouge);
}

.dojo-ordonnancement-item.correct {
    border-color: var(--dojo-vert);
    border-left-color: var(--dojo-vert);
    background: #e8f8e8;
}

.dojo-ordonnancement-item.incorrect {
    border-color: #e74c3c;
    border-left-color: #e74c3c;
    background: #fde8e8;
}

.dojo-ordonnancement-handle {
    color: #999;
    font-size: 1.3em;
    flex-shrink: 0;
}

.dojo-ordonnancement-texte {
    flex: 1;
    font-size: 1em;
    color: #333;
}

.dojo-ordonnancement-numero {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--dojo-rouge) 0%, var(--dojo-rouge-fonce) 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85em;
    flex-shrink: 0;
}

.dojo-ordonnancement-numero.correct {
    background: linear-gradient(135deg, var(--dojo-vert) 0%, var(--dojo-vert-fonce) 100%);
}

.dojo-ordonnancement-numero.incorrect {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

/* ========================================
   FLASHCARDS
   ======================================== */
.dojo-flashcard-container {
    padding: 20px 0;
}

.dojo-flashcard-progression {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 8px;
    color: #fff;
}

.dojo-flashcard-compteur {
    font-weight: 600;
}

.dojo-flashcard-score {
    color: var(--dojo-or);
    font-weight: 700;
}

.dojo-flashcard-deck {
    perspective: 1000px;
    margin-bottom: 25px;
}

.dojo-flashcard {
    width: 100%;
    height: 250px;
    cursor: pointer;
}

.dojo-flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.dojo-flashcard.flipped .dojo-flashcard-inner {
    transform: rotateY(180deg);
}

.dojo-flashcard-front,
.dojo-flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    box-sizing: border-box;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.dojo-flashcard-front {
    background: linear-gradient(135deg, #fff 0%, #f8f6f2 100%);
    border: 3px solid var(--dojo-rouge);
}

.dojo-flashcard-back {
    background: linear-gradient(135deg, var(--dojo-rouge) 0%, var(--dojo-rouge-fonce) 100%);
    color: #fff;
    transform: rotateY(180deg);
}

.dojo-flashcard-texte {
    font-size: 1.5em;
    font-weight: 600;
    text-align: center;
    font-family: var(--font-jp);
}

.dojo-flashcard-image {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 8px;
}

.dojo-flashcard-hint {
    position: absolute;
    bottom: 15px;
    font-size: 0.85em;
    color: #999;
    font-style: italic;
}

.dojo-flashcard-back .dojo-flashcard-hint {
    color: rgba(255, 255, 255, 0.7);
}

.dojo-flashcard-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.dojo-flashcard-btn-non {
    background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    padding: 15px 30px;
}

.dojo-flashcard-btn-oui {
    background: linear-gradient(180deg, var(--dojo-vert) 0%, var(--dojo-vert-fonce) 100%);
    color: #fff;
    padding: 15px 30px;
}

.dojo-flashcard-btn-rejouer {
    background: linear-gradient(180deg, var(--dojo-bleu) 0%, #2980b9 100%);
    color: #fff;
    margin-top: 20px;
    padding: 15px 35px;
}

.dojo-flashcard-resultat {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #f8f6f2 0%, #ebe4d6 100%);
    border-radius: 15px;
    border: 2px solid var(--dojo-gris);
}

.dojo-flashcard-resultat h3 {
    font-family: var(--font-jp);
    color: #1a1a1a;
    margin-bottom: 15px;
}

.dojo-flashcard-resultat .score-final {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--dojo-rouge);
}

.dojo-exercice-public[data-type="flashcard"] .dojo-btn-valider {
    display: none;
}

/* ========================================
   DICTÉE AUDIO
   ======================================== */
.dojo-dictee-container {
    padding: 20px 0;
}

.dojo-dictee-audio {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 10px;
}

.dojo-btn-play {
    background: linear-gradient(180deg, var(--dojo-rouge) 0%, var(--dojo-rouge-fonce) 100%);
    color: #fff;
    padding: 15px 30px;
    border-radius: 50px;
}

.dojo-btn-play.playing {
    background: linear-gradient(180deg, var(--dojo-orange) 0%, #d68910 100%);
}

.dojo-dictee-status {
    color: var(--dojo-or);
    font-style: italic;
}

.dojo-dictee-input {
    width: 100%;
    padding: 20px;
    border: 2px solid var(--dojo-gris);
    border-radius: 8px;
    font-size: 1.1em;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    box-sizing: border-box;
}

.dojo-dictee-input:focus {
    outline: none;
    border-color: var(--dojo-rouge);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.dojo-dictee-input.correct {
    border-color: var(--dojo-vert);
    background: #e8f8e8;
}

.dojo-dictee-input.incorrect {
    border-color: #e74c3c;
    background: #fde8e8;
}

.dojo-dictee-correction {
    margin-top: 15px;
    padding: 15px 20px;
    background: #f8f6f2;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--dojo-rouge);
}

/* ========================================
   OÙ EST CHARLIE
   ======================================== */
.dojo-charlie-container {
    padding: 20px 0;
}

.dojo-charlie-instruction {
    text-align: center;
    font-size: 1.1em;
    color: #666;
    margin-bottom: 15px;
}

.dojo-charlie-zone {
    position: relative;
    display: inline-block;
    cursor: crosshair;
    max-width: 100%;
}

.dojo-charlie-img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 10px;
    border: 3px solid #e8e0d0;
    transition: border-color 0.3s;
}

.dojo-charlie-zone:hover .dojo-charlie-img {
    border-color: var(--dojo-rouge);
}

.dojo-charlie-click {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid var(--dojo-rouge);
    border-radius: 50%;
    background: rgba(196, 30, 58, 0.3);
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: charlieClick 0.3s ease-out;
}

.dojo-charlie-click.correct {
    border-color: var(--dojo-vert);
    background: rgba(39, 174, 96, 0.3);
}

.dojo-charlie-click.incorrect {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.3);
}

.dojo-charlie-target {
    position: absolute;
    border: 4px dashed var(--dojo-vert);
    border-radius: 50%;
    background: rgba(39, 174, 96, 0.2);
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: charlieReveal 0.5s ease-out;
}

@keyframes charlieClick {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes charlieReveal {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ========================================
   CALCUL MENTAL
   ======================================== */
.dojo-calcul-mental-container {
    text-align: center;
    padding: 20px;
}

.dojo-calcul-progress {
    margin-bottom: 30px;
    font-size: 1.1em;
    color: #666;
}

.dojo-calcul-progress-bar {
    width: 100%;
    height: 8px;
    background: #e8e0d0;
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.dojo-calcul-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--dojo-rouge), #e74c3c);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.dojo-calcul-question {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 2.5em;
    font-weight: 700;
    margin: 30px 0;
    font-family: var(--font-jp);
}

.dojo-calcul-operateur {
    color: var(--dojo-rouge);
}

.dojo-calcul-egal {
    color: #666;
}

.dojo-calcul-reponse {
    width: 100px;
    padding: 10px;
    font-size: 1em;
    text-align: center;
    border: 3px solid var(--dojo-gris);
    border-radius: 8px;
    font-weight: 700;
}

.dojo-calcul-reponse:focus {
    outline: none;
    border-color: var(--dojo-rouge);
}

.dojo-calcul-feedback {
    min-height: 40px;
    margin: 20px 0;
    font-size: 1.2em;
    font-weight: 600;
}

.dojo-calcul-feedback.correct { color: var(--dojo-vert); }
.dojo-calcul-feedback.incorrect { color: #e74c3c; }

.dojo-calcul-resultat {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f6f2, #fff);
    border-radius: 10px;
    border: 2px solid var(--dojo-gris);
}

.dojo-calcul-score {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 20px;
    font-family: var(--font-jp);
}

.dojo-calcul-score.excellent { color: var(--dojo-vert); }
.dojo-calcul-score.bon { color: var(--dojo-orange); }
.dojo-calcul-score.moyen { color: #e67e22; }
.dojo-calcul-score.faible { color: #e74c3c; }

.dojo-exercice-public[data-type="calcul_mental"] .dojo-btn-valider {
    display: none;
}

/* ========================================
   TIMELINE
   ======================================== */
.dojo-timeline-container {
    padding: 20px 0;
}

.dojo-timeline-frise {
    position: relative;
    padding: 60px 20px 40px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #f8f6f2 0%, #ebe4d6 100%);
    border-radius: 10px;
    min-height: 120px;
}

.dojo-timeline-ligne {
    position: absolute;
    top: 50%;
    left: 40px;
    right: 40px;
    height: 6px;
    background: linear-gradient(90deg, var(--dojo-rouge), var(--dojo-rouge-fonce));
    border-radius: 3px;
    transform: translateY(-50%);
}

.dojo-timeline-ligne::before,
.dojo-timeline-ligne::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    background: var(--dojo-rouge);
    border-radius: 50%;
    transform: translateY(-50%);
}

.dojo-timeline-ligne::before { left: -8px; }
.dojo-timeline-ligne::after { right: -8px; }

.dojo-timeline-bornes {
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    transform: translateY(25px);
}

.dojo-timeline-borne-debut,
.dojo-timeline-borne-fin {
    font-weight: 700;
    font-size: 1.1em;
    color: #1a1a1a;
    background: #fff;
    padding: 5px 12px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.dojo-timeline-zones {
    position: absolute;
    top: 0;
    left: 40px;
    right: 40px;
    bottom: 30px;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 10px;
}

.dojo-timeline-zone {
    width: 120px;
    min-height: 80px;
    border: 2px dashed var(--dojo-rouge);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    padding: 10px;
}

.dojo-timeline-zone.drag-over {
    background: #fff5f5;
    border-style: solid;
    transform: scale(1.05);
}

.dojo-timeline-zone.has-event {
    border-style: solid;
    border-color: var(--dojo-vert);
    background: #e8f8e8;
}

.dojo-timeline-zone.correct { border-color: var(--dojo-vert); background: #e8f8e8; }
.dojo-timeline-zone.incorrect { border-color: #e74c3c; background: #fde8e8; }

.dojo-timeline-instruction {
    text-align: center;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

.dojo-timeline-evenements {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.dojo-timeline-event {
    background: linear-gradient(135deg, #fff 0%, #f8f6f2 100%);
    border: 2px solid var(--dojo-gris);
    border-left: 4px solid var(--dojo-rouge);
    padding: 12px 18px;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.2s;
    max-width: 200px;
}

.dojo-timeline-event:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.dojo-timeline-event.dragging { opacity: 0.5; cursor: grabbing; }
.dojo-timeline-event.placed { display: none; }
.dojo-timeline-event.in-zone { max-width: 100px; padding: 8px 10px; font-size: 0.85em; position: relative; }
.dojo-timeline-event.correct { border-color: var(--dojo-vert); border-left-color: var(--dojo-vert); background: #e8f8e8; }
.dojo-timeline-event.incorrect { border-color: #e74c3c; border-left-color: #e74c3c; background: #fde8e8; }

.dojo-timeline-retirer {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 0.7em;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.dojo-timeline-event.in-zone:hover .dojo-timeline-retirer { opacity: 1; }

/* ========================================
   CODE HTML/CSS/JS
   ======================================== */
.dojo-code-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dojo-code-editeurs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.dojo-code-editeur {
    display: flex;
    flex-direction: column;
}

.dojo-code-header {
    background: #1a1a1a;
    padding: 8px 15px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dojo-code-lang {
    color: var(--dojo-or);
    font-weight: 700;
    font-size: 0.85em;
    text-transform: uppercase;
}

.dojo-code-textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #1a1a1a;
    border-top: none;
    border-radius: 0 0 8px 8px;
    font-family: "Courier New", Consolas, monospace;
    font-size: 0.9em;
    line-height: 1.5;
    resize: vertical;
    background: #2d2d2d;
    color: #f8f8f2;
    box-sizing: border-box;
}

.dojo-code-textarea:focus {
    outline: none;
    border-color: var(--dojo-rouge);
}

.dojo-code-preview-wrapper {
    border: 2px solid var(--dojo-gris);
    border-radius: 8px;
    overflow: hidden;
}

.dojo-code-preview-header {
    background: linear-gradient(135deg, #f8f6f2 0%, #ebe4d6 100%);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--dojo-gris);
}

.dojo-code-preview {
    width: 100%;
    min-height: 200px;
    border: none;
    background: #fff;
}

.dojo-code-run {
    background: linear-gradient(180deg, var(--dojo-vert) 0%, var(--dojo-vert-fonce) 100%);
    color: #fff;
}

.dojo-exercice-public[data-type="code_html"] .dojo-btn-valider { display: none; }

/* ========================================
   PYTHON
   ======================================== */
.dojo-python-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dojo-python-editeur {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dojo-python-code {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: none;
    font-family: "Courier New", Consolas, monospace;
    font-size: 0.95em;
    line-height: 1.5;
    resize: vertical;
    background: #1a1a2e;
    color: #a6e22e;
    box-sizing: border-box;
}

.dojo-python-output-wrapper {
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #333;
}

.dojo-python-output-header {
    background: #333;
    color: #fff;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}

.dojo-python-output {
    background: #1a1a1a;
    color: #0f0;
    padding: 15px;
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    font-family: "Courier New", Consolas, monospace;
    font-size: 0.9em;
    margin: 0;
    white-space: pre-wrap;
}

.dojo-python-output .error { color: #ff6b6b; }
.dojo-python-run { background: linear-gradient(180deg, #306998 0%, #1a4a6e 100%) !important; }
.dojo-exercice-public[data-type="python"] .dojo-btn-valider { display: none; }

/* ========================================
   PUZZLE
   ======================================== */
.dojo-puzzle-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
}

.dojo-puzzle-game {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.dojo-puzzle-grid {
    display: grid;
    gap: 3px;
    background: #1a1a1a;
    padding: 3px;
    border-radius: 10px;
    aspect-ratio: 1;
}

.dojo-puzzle-cell {
    background: var(--dojo-gris-clair);
    border: 2px dashed var(--dojo-gris);
    border-radius: var(--border-radius);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.dojo-puzzle-cell.drag-over {
    background: #fff5f5;
    border-color: var(--dojo-rouge);
    border-style: solid;
    transform: scale(1.02);
}

.dojo-puzzle-cell.has-piece { border: none; padding: 0; }
.dojo-puzzle-cell.correct { border: 2px solid var(--dojo-vert) !important; }
.dojo-puzzle-cell.incorrect { border: 2px solid #e74c3c !important; }

.dojo-puzzle-pieces {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.dojo-puzzle-instruction {
    text-align: center;
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
}

.dojo-puzzle-pieces-grid {
    display: grid;
    gap: 8px;
}

.dojo-puzzle-piece {
    aspect-ratio: 1;
    border-radius: var(--border-radius);
    cursor: grab;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    border: 2px solid #fff;
}

.dojo-puzzle-piece:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.dojo-puzzle-piece.dragging { opacity: 0.5; cursor: grabbing; }
.dojo-puzzle-piece.placed { display: none; }

.dojo-puzzle-reference { text-align: center; }
.dojo-puzzle-reference p { color: #666; font-size: 0.9em; margin-bottom: 10px; }
.dojo-puzzle-reference img {
    max-width: 150px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    border: 3px solid #e8e0d0;
}

/* ========================================
   RAPPEL DE COURS
   ======================================== */
.dojo-rappel-container {
    padding: 10px 0;
}

.dojo-rappel-texte {
    font-size: 1.05em;
    line-height: 1.8;
    color: #333;
}

.dojo-rappel-texte h2 {
    font-size: 1.4em;
    color: var(--dojo-rouge);
    margin: 20px 0 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #e8e0d0;
}

.dojo-rappel-texte h3 { font-size: 1.2em; color: #1a1a1a; margin: 15px 0 8px; }
.dojo-rappel-texte h4 { font-size: 1.1em; color: #555; margin: 12px 0 6px; }
.dojo-rappel-texte ul, .dojo-rappel-texte ol { margin: 15px 0; padding-left: 30px; }
.dojo-rappel-texte li { margin-bottom: 8px; }
.dojo-rappel-texte a { color: var(--dojo-rouge); text-decoration: underline; }
.dojo-rappel-texte strong { color: #1a1a1a; }

.dojo-rappel-image { margin: 20px 0; text-align: center; }
.dojo-rappel-image img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 3px solid #e8e0d0;
}

.dojo-rappel-pdf { margin: 20px 0; }
.dojo-pdf-viewer {
    width: 100%;
    height: 500px;
    border: 3px solid #e8e0d0;
    border-radius: 10px;
}

.dojo-pdf-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--dojo-rouge);
    font-weight: 600;
    text-decoration: none;
}

.dojo-exercice-public[data-type="rappel_cours"] .dojo-btn-valider { display: none; }
.dojo-exercice-public[data-type="rappel_cours"] {
    border-left-color: var(--dojo-bleu);
    background: linear-gradient(135deg, #f8fbff 0%, #fff 100%);
}
.dojo-exercice-public[data-type="rappel_cours"] .dojo-exercice-numero {
    background: linear-gradient(135deg, var(--dojo-bleu) 0%, #2980b9 100%);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 900px) {
    .dojo-code-editeurs { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .dojo-public-title { font-size: 2.5em; }
    .dojo-public-title::before { font-size: 0.35em; }
    .dojo-filtres { flex-direction: column; }
    .dojo-filtre-group { width: 100%; }
    .dojo-cahiers-grid { grid-template-columns: 1fr; }
    .dojo-exercices-zone { padding: 25px 20px; }
    .dojo-exercice-public { padding: 20px; }
    .dojo-vrai-faux-options { flex-direction: column; gap: 15px; }
    .dojo-vf-label { padding: 20px 30px; }
    .dojo-association-container { flex-direction: column; gap: 30px; }
    .dojo-association-gauche, .dojo-association-droite { max-width: 100%; }
    .dojo-puzzle-container { flex-direction: column; }
    .dojo-puzzle-game, .dojo-puzzle-pieces { max-width: 100%; }
    .dojo-puzzle-reference img { max-width: 100px; }
}