@font-face {
    font-family: 'Luciole';
    src: url('polices/Luciole-Regular.woff') format('woff');
}

* {
    box-sizing: border-box;
}

.wait * {
    cursor: wait !important;
}

:root {
    --fond-appli: #040556;
    --format-print: portrait;
    --display-maj: block;
    --display-min: block;
    --display-cursive: block;
    --couleur-bordures: #31b4ff;
    --largeur-carte: 33%;
    --hauteur-carte: 33%;
    --taille-police-carte: calc(((100vw - 245px - 40px) * 93 / 100) / 30 );
    --taille-police-initiale: calc(((100vw - 245px - 40px) * 93 / 100) / 9 );
    --taille-police-tag: calc(((100vw - 245px - 40px) * 93 / 100) / 45 );    
    --taille-police-carte-impression: 0.6cm;
    --taille-police-tag-impression: 0.45cm;
    --coins-cartes: 5% / 3.53%;
    --taille-police-texte: calc(((100vw - 245px - 40px) * 93 / 100) / 30 );
    --taille-police-texte-impression: 0.6cm;
    --display-images: block;
    --display-expressions: flex;

}
  
html {
    height: 100%;
    display: flex;
    flex-direction: column;
}

body {
    height: 100%;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--fond-appli);
    color: #ffffff;
}

header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    color: white;
    padding: 5px;
    text-align: center;
    height: 50px;
    flex-shrink: 0;
}

.primtux header {
    height: 80px;
}

#educajou {
    float: left;
    height: 100%;
}

#educajou>img {
  height: 100%;  
}

.primtux #educajou {opacity: 0;}

#logo {
    height: 100%;
    margin-right: 10px;
}

#titre {
    font-size: 36px;
    height: 100%;
    display: flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 60px;
}

#spanBoutons {
    height: 90%;
    flex-direction: row;
    gap: 5px;
    justify-content: space-between;
    align-items: center;
    float: right;
    margin-right: 10px;
    margin-top: 2.5px;
    position: relative;  
}

button {
    box-sizing: border-box !important;
    background-color: #ffffff;
    color: #315570;
    font-weight: bold;
    border-radius: 5px;
    border: none;
    vertical-align: middle;
}

#spanBoutons>button>img {
    height: 75%;
    vertical-align: middle;
}

button:hover {
    background-color: #a0dcfd;
    cursor: pointer;
}

#spanBoutons button {    
    height: 100%;
}

main {
    flex: 1;
    display: flex !important;
    flex-direction: row;
    overflow: hidden;
}

#gauche {
    height: 100%;
    width: 245px;
    overflow-y: auto;
}

.zoneOption {
    padding: 25px 10px 20px 10px;
    margin: 20px 10px;
    border: 1px #ffffff solid;
    border-radius: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.boutonReplier {
    position: absolute;
    top: -10px;
    right: 5px;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background-image: url(images/fleche.svg);
    background-size: 80%;
    background-repeat: no-repeat;
    background-position: center;
}

.zoneOption.repliee>.boutonReplier {
    transform: rotate(180deg);
}

.zoneOption.repliee {
    padding: 0 0 0 10px !important;
    margin: 20px 10px 35px 10px !important;
}

.zoneOption.repliee>.sous-zone {
    display: none !important;
}

.titreZoneOption {
    position: absolute;
    bottom: 100%;
    transform: translateY(50%);
    background-color: var(--fond-appli);
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ffffff;
}

.sous-zone {
    display: flex;
    font-size: 1.2em;
}

.horizontale {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 1em;
}

.verticale {
    flex-direction: column;
}

.sous-zone button {
    font-size: inherit;
    line-height: 1em; /* même hauteur que l’image */
    padding: 0.2em 0.5em; /* ajuste pour un peu d’espace */
    display: inline-flex;
    align-items: center;
    gap: 0.4em; /* espace entre image et texte */
}

.sous-zone button img {
    height: 1em;
    vertical-align: middle;
    display: inline-block;
}

.sous-zone input[type=number] {
    width: 3em;
    font-size: inherit;
    text-align: center;    
}

.sous-zone select {
    font-size: inherit;
    text-align: left; 
}



#paysage::first-letter {
    transform: rotate(90deg);
}

button.actif {
    background-color: rgb(246, 252, 211);
    color: #000000;
}

.inputCouleur {
    width: 2em;
    height: 2em;
    border-width: 1px;
}

.caseCouleur {
    display: inline-block;
    height: 20px;
    width: 20px;
    border: 1px #000000 solid;
    border-radius: 3px;

}

#main {
    background-color: rgb(43, 100, 131);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    padding: 10px;
    overflow: auto;
    border-left: 4px gray solid;
    border-top: 4px gray solid;
    border-radius: 10px 0px 0px 0px;
}

#indicateurs {
}

#apercu {
    flex: 1;
}


#feuille {
    background-color: #ffffff;
    color: #000000;
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.2);
    padding: 7%;
    width: 100%;
    margin: auto;
    border: 1px #296be4 solid;    
    position: relative;
    flex: 1;
    font-size: 1em;
}

body:not(.cartons) #feuille {
    display: none;
}
body.cartons #feuille {
    display: block;
}

body:not(.preparation) #apercu {
    display: none;
}
body.preparation #apercu {
    display: block;
}

body.preparation .cartons{
    display: none;
}

body.cartons .editer {
    display: none;
}

#boutonEditer {
    margin-top: 2em;
    margin-left: 2em;    
}

#feuille p {
    margin-top: 0;
}

#cartonRef {
    margin-bottom: 0.5cm;
}

#contenuCartonRef {
    font-size: 0em;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
}

.carton {
    border: 2px #000 solid;
    margin-bottom: 0.5cm;
    font-size: 0em;
    background-color: #d1e0dc;
    padding: 5px;
    gap: 5px;
    display: flex;
    flex-direction: column;
}

.enteteCarton {
    font-size: 18px;
    font-weight: bold;
    color: #000000;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.cartoucheCarton {
    vertical-align: middle;
    padding: 0.2em 0.4em;
    border: 1px solid #000000;
    border-radius: 1em;
    background-color: #ffffff;
    display: inline-block;
}

.contenuCarton {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
}

.caseCarton {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    flex-direction: column;
    aspect-ratio: 1 / 1; 
    background-color: #ffffff;
    font-size: 1rem;
    overflow: hidden;
    padding: 2.5%;
    gap: 2.5%;
}

.contenuCarton .caseCarton {
    border-top: 2px solid #000;
    border-left: 2px solid #000;
}

.contenuCarton .caseCarton:nth-child(5n) { /* dernière colonne */
    border-right: 2px solid #000;
}

.contenuCarton .caseCarton:nth-last-child(-n+5) { /* dernière ligne */
    border-bottom: 2px solid #000;
}


#contenuCartonRef .caseCarton {
    border-top: 2px dotted #7c7c7c;
    border-left: 2px dotted #7c7c7c;
}

#contenuCartonRef .caseCarton:nth-child(5n) { /* dernière colonne */
    border-right: 2px dotted #7c7c7c;
}

#contenuCartonRef .caseCarton:nth-last-child(-n+5) { /* dernière ligne */
    border-bottom: 2px dotted #7c7c7c;
}

#contenuCartonRef .caseCarton:last-child {
    border-right: 2px dotted #7c7c7c;
}

.caseCarton.vide {
    background-color: #82a2bb;
}

.caseCarton img {
    flex: 1 1 auto;
    height: 100%;
    width: 100%;
    object-fit: contain;
    display: var(--display-images);
}

.caseCarton .expression {
    flex: 0 0 auto;
    color: #000000;
    align-items: center;
    justify-content: center;
    display: var(--display-expressions);

}


.credits {
    position: absolute;
    top: 2%;
    left: 2%;
    width: 98%;
    font-size: calc(((100vw - 245px - 40px) * 93 / 100) / 60 );
    color: gray;
    text-align: center;
}

.credits img {
    height: 1.2em;
    vertical-align: middle;
}

.credits.bas {
    top: auto;
    bottom: 2%;
}

.zoneCentrale {
    width: 100%;
    height: 100%;
}

.portrait>.zoneCentrale {
    gap: 10%
}

.paysage>.zoneCentrale {
    gap: 16%;
}

.indicateur {
    border: 1px #ffffff solid;
    padding: 5px;
    border-radius: 8px;
    display: inline-block;
    background-color: var(--fond-appli);
    color: #ffffff;
    font-size: 1em;
    height: 2em;
    vertical-align: middle;

}



.indicateur input {
    width: 3.5em;
    text-align: center;
}

#boutonGenerer {
    background-color: #812104;
}

button:disabled {
    opacity: 0.25;
}

#boutonGenerer:not(:disabled):hover {
    filter: brightness(1.5)
}


.carteRef {

    width: 250px;
    display: inline-flex;
    vertical-align: top;
    flex-direction: column;
    align-items: center;
    background-color: #ffffff;
    position: relative;
    transition: width 0.3s linear,margin-right 0.3s linear,margin-bottom 0.3s linear;
    margin-right: 5px;
    margin-bottom: 5px;
    box-shadow: 5px 5px 5px #0000008a;

}

.zoneImage {

    display: flex;
    flex-direction: column;
    max-height: 150px;
    align-items: center;
    justify-content: center;
    padding: 5px;
    position: relative;
    
}

.zoneTexte {
    text-align: center;
    border: 0;
    margin-top: 5px;
    width: calc(100% - 5px);
}



.zoneInputImage {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 1em;
    padding: 5px;
}

.zoneInputImage button {
    background-color: #a0dcfd;
}


.conteneurImage {
    height: 100px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.conteneurImage img {
    max-width: 100%;
    max-height: 100%;
}



.boutonnav {
    position: absolute;
    top: 50%;
    height: 20px;
    width: 20px;
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #000000;
    border-radius: 50%;
    transform: translateY(-50%);
    display: none;
}

.contientImageDistante:hover>.boutonnav {
    display: block;
}

.precedent {
    right: calc(100% - 20px);
}

.suivant {
    left: calc(100% - 20px);
}

.labelInputImage {

    background-image: url(images/ouvrir.svg);

}

.boutonRecherche {
    background-image: url(images/internet.svg);
}

#boutonsBasLightbox{
    text-align: center;
}


.boutonSupprimerCarte {
    position: absolute;
    height: 20px;
    width: 20px;
    right: 2px;
    bottom: 2px;
    background-image: url(images/supprimer.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    visibility: hidden;
    background-color: transparent;
    border: none;
    outline: none;
}

.carteRef:hover>.boutonSupprimerCarte {
    visibility: visible;
}

.cadreIllustration:hover>.boutonSupprimer {
    visibility: visible;
}


.maj {
    text-transform: uppercase !important;
    font-family: Luciole;
    display: var(--display-maj);
}

.min {
    text-transform: none;
    font-family: Luciole;
    display: var(--display-min);
}

.cursive {
    text-transform: none;
    font-family: Belle Allure CE !important;
    display: var(--display-cursive);
}

.inputExpression.cursive {
    height: 2.25em;
}

.initiale.cursive {
    height: 1.2em;
}

.majLongue .initiale.cursive {
    height: 2.25em;
}

.minLongue .initiale.cursive {
    line-height: 1.2em;
}

.texte {
    border-radius: 5px;
    border: none;
    font-size: var(--taille-police-texte);
    text-align: center;
    resize: none;
    overflow: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 0;
    min-height: 1.2em;
    transition: height 0.2s ease;
    height: auto !important;
    margin: 0;
}

.initialeRouge .texte::first-letter {
    color: red;;
}

#conteneurFeuilles:not(.initialeRouge) .initiale, .pdf:not(.initialeRouge) .initiale {
    display: none;
}


.initialeRouge .initiale {
    color: red;
    background-color: white;
    font-size: var(--taille-police-initiale);
    font-family: Luciole;
    margin: 0;
    text-align: center;
}


.multiTexteVide .texte {
    background-color: #c9e9fa;
}

#mention {
    display: none;
}

#titreJeu {
    font-size: 24px;
    color: #000000;
    font-weight: bold;
}

@media print {

  body {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    height: fit-content !important;
    background-color: #ffffff;
    margin: 0;
    padding: 0;
  }

  @page {
    size: var(--format-print);
  }

  .hidePrint {
    display: none !important;
  }

  #main {
    margin: 0;
    padding: 0cm;
    background-color: #ffffff;
    border: 0;
  }

  p {
    font-size: 5mm;
    color: #000;
  }

  #mention {
    display: block;
  }

  #titreJeu {
    font-size: 8mm;
  }

  .credits {
    font-size: 0.4cm;
    top: 8mm;
  }

  .credits.bas {
    top: auto;
    bottom: 8mm;
  }

  /* Conteneur principal : pas de grid/flex */
  #cartons {
    display: block !important;
  }

  .carton {
    border: 1.5mm #000 solid;
    padding: 1mm;
    gap: 0mm;
    margin-bottom: 2mm;

   }

  .enteteCarton {
    font-size: 6mm;

  }

  .cartoucheCarton {
        padding: 1mm 2mm;
        border: 0.5mm solid #000000;
    }

  .contenuCarton {
    vertical-align: top;
    page-break-inside: avoid;
    break-inside: avoid;
    -moz-column-break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin: 0.2cm;
    border-width: 1mm;
    padding: 0;
  }

  /* Les sous-cases et références doivent aussi rester entiers */
  .caseCarton,
  #cartonRef {
    page-break-inside: avoid;
    break-inside: avoid;
    -moz-column-break-inside: avoid;
    -webkit-column-break-inside: avoid;
  }

    .contenuCarton .caseCarton {
        border-top: 0.5mm solid #000;
        border-left: 0.5mm solid #000;
    }

    .contenuCarton .caseCarton:nth-child(5n) { /* dernière colonne */
        border-right: 0.5mm  solid #000;
    }

    .contenuCarton .caseCarton:nth-last-child(-n+5) { /* dernière ligne */
        border-bottom: 0.5mm solid #000;
    }


    #contenuCartonRef .caseCarton {
        border-top: 0.5mm dotted #7c7c7c;
        border-left: 0.5mm dotted #7c7c7c;
    }

    #contenuCartonRef .caseCarton:nth-child(5n) { /* dernière colonne */
        border-right: 0.5mm dotted #7c7c7c;
    }

    #contenuCartonRef .caseCarton:nth-last-child(-n+5) { /* dernière ligne */
        border-bottom: 0.5mm dotted #7c7c7c;
    }

    #contenuCartonRef .caseCarton:last-child {
        border-right: 0.5mm dotted #7c7c7c;
    }

  #cartonRef {
    page-break-after: always;
  }



}




#darkbox {
/* Elle doit prendre toute la largeur et toute la hauteyr  */
    position: absolute;
    z-index: 999; /* O la place sous la lightbox */
    width: 100%;
    height: 100%;
    top: 0px;
    left: 0px;
    background-color: rgba(0,0,0,0.5);
}
        
.lightbox {
    position: absolute;
    z-index: 1000; /* O la place sur la lightbox */
    display: flex;
    flex-direction: column;
    max-width: calc(100% - 20px);
    max-height: calc(100% - 40px);
    top: 50%;
    left: 50%;
    padding: 10px; /* Marge intérieure */
    border-radius: 20px; /* Coins arrondis */
    box-shadow: 0px 0px 15px #ffffff; /* Ombre transparente blanche */
    border: 2px solid #000000; /* Bordure de 2px noire */
    transform: translateX(-50%) translateY(-50%); /* Pour centrer dans la page */
    background-color: #ffffff; /* Couleur de fond */
    color: #000000;

}

#waitPdf {
    position: absolute;
    top: 50px;
    right: 20px;
    color: #ffffff;
    background-color: #812104;
    padding: 1em;
    border: 2px #ffffff solid;
    border-radius: 2em;
}

#divTuto {
    width: 80vw;
    height: 45vw; /* Pour respecter un ratio 16:9 */
    max-width: 100vw;
    max-height: 100vh;
    padding-top: 45px;
    overflow: hidden;
}


#divTuto::before {
    height: 35px;
    width: 100%;
    position: absolute;
    top: 0px;
    left: 0px;
    background: linear-gradient(to bottom, #8a8d8f, #d9e5ec);
}

#titreTuto {
    position: absolute;
    left: 10px;
    top: 5px;
    font-size: 24px;
}

#herve {
    padding-left: 30px;
    background-image: url(images/herve.png);
    background-repeat: no-repeat;
    background-position: left center;
    background-size: auto 100%;
}


#videoTuto {
    aspect-ratio: 16/9;
}



.contenu-lightbox {
    flex: 1;
    font-size: 16px;
    font-family: Arial, Helvetica, sans-serif;
    overflow-y: auto;
    text-align: left;
    width: fit-content;
    width: 100%;


}

.bouton-fermer {
    position : fixed;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-image: url(images/bouton_fermer.svg);
    background-size: contain;
    background-color: transparent;
    border: none;
    outline: none;
}

#divTuto .bouton-fermer {
    top: 3px;
    right: 5px;
}

.cartouche {
    padding-left: 20px;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: left;
}

.code {
    background-color: #000000;
    color: #ffffff;
    padding: 0.5em;
    font-family: 'Courier New', Courier, monospace;
    width: 90%;
    border-radius: 5px;
    border: 1px gray outset;
}

#divCodi, #DivNextcloud {
    background-color: #d1e8f7 !important;
}

#divListe {
    width: 45em;
    max-width: 100%;
    height: 25em;
    max-height: 100%;
}

#inputListe {
    flex: 1;
    resize: none;
    margin-bottom: 1em;
}

#boutonListe {
    margin: 1em auto;
    font-size: 1em;
    border: 1px solid #000000;
}

#inputCodi, #inputNextcloud {
    width: 90%;
    padding: 0.5em;
}

#inputCodi, #inputNextcloud {
    width: calc(100% - 6px);
    box-sizing: border-box;
    border-radius: 5px;
    height: 2em;
    padding: 3px;
    margin-top: 10px;
    margin-bottom: 10px;
    display: inline-block;
}

#resultatCodi, #resultatNextcloud {
    padding: 3px;
    border-radius: 3px;
}

#resultatCodi.correct, #resultatNextcloud.correct {
    background-color: greenyellow;
}

#resultatCodi.incorrect, #resultatNextcloud.incorrect {
    background-color: orange;
}

@keyframes loadingBackground {
    0% { background-color: #f0f0f0; }
    50% { background-color: #d0d0d0; }
    100% { background-color: #f0f0f0; }
}

#resultatCodi.waiting, #resultatNextcloud.waiting {
    display: block;
    border-radius: 0.5em;
    border: 1px solid #000000;
    text-align: center;
    padding: 10px;
    animation: loadingBackground 1.5s infinite ease-in-out;
}

#lienCodi, #lienNextcloud {
    font-family: 'Courier New', Courier, monospace;
    color:rgb(41, 40, 40);
    font-size: 0.8em;
    padding: 1em;
    border: 1px #000000 solid;
    border-radius: 5px;
    margin-top: 1em;
    margin-bottom: 1em;
}

#divMD .contenu-lightbox {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

#conteneurCodeMD {
    flex: 1;
    background-color: #000000;
    color: #ffffff;
    font-family: 'Courier New', Courier, monospace;
    padding: 1em 0.5em;
    border: 2px gray outset;
    border-radius: 0.5em;
    min-height: 3em;
    height: 100%;
    position: relative;
    width: calc(100% - 1em - 4px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#contenuCodeMD {
    width: 100%;
    height: 100%;
    flex: 1;
    max-height: 100%;
    overflow-y: scroll;  /* Change from auto to scroll if you want scrollbars always visible */
    overflow-x: auto;  /* Keep this for horizontal scrolling if content overflows horizontally */
    padding-right: 17px;  /* Optional: to compensate for scrollbar width */
}


.boutonCopier {
    position: absolute;
    top: 0.2em;
    right: 0.2em;
}

.hide {
    display: none !important;
}


