/* =========================================================
   AREPO MOTS CROISÉS
   Constructeur
   ========================================================= */

.arepo-mc {
    --arepo: #0bb4aa;
    max-width: 1100px;
    margin: 0 auto;
}

.arepo-mc-entete {
    margin-bottom: 25px;
}

.arepo-mc-entete h2 {
    margin-bottom: 8px;
}

.arepo-mc-config {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 14px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #f8f8f8;
}

.arepo-mc-config label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 14px;
    font-weight: 600;
}

.arepo-mc-config select {
    min-width: 85px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: white;
    font-size: 16px;
}

.arepo-mc-fois {
    padding-bottom: 9px;
    font-size: 22px;
}
.arepo-mc .arepo-mc-bouton {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    width: auto !important;
    min-width: 145px;
    min-height: 44px;

    padding: 8px 18px !important;

    border: 0 !important;
    border-radius: 8px;

    background: #0bb4aa !important;
    color: #062b29 !important;

    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-indent: 0 !important;

    cursor: pointer;
}

.arepo-mc .arepo-mc-bouton:hover {
    background: #0aa59c !important;
    color: #062b29 !important;
}
    filter: brightness(0.92);
}


/* GRILLE */

#arepo-mc-zone-grille {
    width: 100%;
}

.arepo-mc-grille {
    display: grid;
    width: min(100%, 620px);
    border: 2px solid #222;
    background: #222;
    gap: 1px;
}

.arepo-mc-case {
    aspect-ratio: 1 / 1;
    border: 0;
    padding: 0;
    background: white;
}
/* =========================================================
   SÉLECTION ET DIRECTION D'ÉCRITURE
   ========================================================= */

.arepo-mc-case.arepo-mc-direction {
    background: #e8f8f7;
}

.arepo-mc-case.arepo-mc-selectionnee {
    background: #c8efec;

    box-shadow:
        inset 0 0 0 3px #0bb4aa;
}

.arepo-mc-case {
    font-size: clamp(15px, 2.5vw, 24px);
    font-weight: 700;
    text-transform: uppercase;
    color: #263333;
}
/* =========================================================
   CASES NOIRES
   ========================================================= */

.arepo-mc-outils {
    display: flex;
    gap: 10px;
    margin: 18px 0 10px;
}

.arepo-mc-outil {
    min-height: 42px;
    padding: 8px 14px;

    border: 1px solid #d9e1e1;
    border-radius: 8px;

    background: #fff;
    color: #263333;

    font-weight: 600;
    cursor: pointer;
}

.arepo-mc-outil.actif {
    background: #263333;
    color: #fff;
}

.arepo-mc-case.arepo-mc-noire {
    background: #263333;
}
/* =========================================================
   ESPACE DE TRAVAIL
   ========================================================= */

.arepo-mc-espace-travail {
    display: grid;
    grid-template-columns: minmax(300px, 600px) minmax(280px, 1fr);
    gap: 24px;
    align-items: start;
}


/* =========================================================
   PANNEAU DES DÉFINITIONS
   ========================================================= */

.arepo-mc-definitions {
    border: 1px solid var(--arepo-bordure);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.arepo-mc-onglets {
    display: grid;
    grid-template-columns: 1fr 1fr;

    border-bottom: 1px solid var(--arepo-bordure);
}

.arepo-mc-onglet {
    min-height: 46px;

    border: 0;
    border-bottom: 3px solid transparent;

    background: #fff;
    color: #687777;

    font-weight: 700;
    cursor: pointer;
}

.arepo-mc-onglet.actif {
    color: var(--arepo-texte);
    border-bottom-color: var(--arepo);

    background: var(--arepo-clair);
}


/* ---------- Liste ---------- */

#arepo-mc-liste-definitions {
    max-height: 500px;
    overflow-y: auto;

    padding: 8px 14px 14px;
}

.arepo-mc-definition {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 8px;

    padding: 12px 0;

    border-bottom: 1px solid var(--arepo-bordure);
}

.arepo-mc-numero-definition {
    font-weight: 800;
    color: var(--arepo);
}

.arepo-mc-mot {
    font-size: 15px;
    font-weight: 800;

    letter-spacing: 0.08em;
}

.arepo-mc-longueur {
    display: block;

    margin: 2px 0 6px;

    font-size: 11px;
    color: #788686;
}

.arepo-mc-champ-definition {
    width: 100%;

    padding: 8px 10px;

    border: 1px solid var(--arepo-bordure);
    border-radius: 6px;

    font-size: 14px;
}


/* ---------- Écrans étroits ---------- */

@media (max-width: 800px) {

    .arepo-mc-espace-travail {
        grid-template-columns: 1fr;
    }
}
/* =========================================================
   NUMÉROTATION DES CASES
   ========================================================= */

.arepo-mc-case {
    position: relative;
}

.arepo-mc-numero-case {
    position: absolute;

    top: 2px;
    left: 3px;

    font-size: 9px;
    line-height: 1;

    font-weight: 700;
    color: #526060;

    pointer-events: none;
}

.arepo-mc-lettre-case {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: inherit;
    font-weight: 700;

    pointer-events: none;
}
/* =========================================================
   ENREGISTREMENT DE LA GRILLE
   ========================================================= */

.arepo-mc-publication {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(250px, auto);
    gap: 8px 12px;
    align-items: end;

    margin: 24px 0;
    padding: 18px;

    border: 1px solid var(--arepo-bordure);
    border-radius: 12px;

    background: #fff;
}

.arepo-mc-publication label {
    grid-column: 1 / -1;

    font-size: 13px;
    font-weight: 700;
}

#arepo-mc-titre {
    width: 100%;
    min-height: 44px;

    padding: 8px 12px;

    border: 1px solid var(--arepo-bordure);
    border-radius: 7px;
}

.arepo-mc-bouton-enregistrer {
    min-height: 44px;

    padding: 8px 18px;

    border: 0;
    border-radius: 8px;

    background: #263333;
    color: #fff;

    font-weight: 700;
    cursor: pointer;
}

#arepo-mc-titre {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
}

#arepo-mc-enregistrer,
#arepo-mc-publier {
    justify-self: end;
    width: auto !important;
    min-width: 250px;
    max-width: 100%;
    white-space: nowrap;
}

#arepo-mc-enregistrer {
    grid-column: 2;
    grid-row: 2;
}

#arepo-mc-publier {
    grid-column: 2;
    grid-row: 3;
}

.arepo-mc-message {
    grid-column: 1 / -1;
    min-height: 20px;

    font-size: 13px;
    color: #526060;
}

@media (max-width: 600px) {

    .arepo-mc-publication {
        grid-template-columns: 1fr;
    }

    .arepo-mc-publication label,
    #arepo-mc-titre,
    #arepo-mc-enregistrer,
    #arepo-mc-publier,
    .arepo-mc-message {
        grid-column: auto;
        grid-row: auto;
        width: 100% !important;
    }
}
/* =========================================================
   LECTEUR DE MOTS CROISÉS
   ========================================================= */

.arepo-mc-jeu {
    --arepo: #0bb4aa;
    --arepo-clair: #e8f8f7;
    --arepo-bordure: #d9e1e1;
    --arepo-texte: #263333;

    max-width: 1100px;
    margin: 0 auto;
}

.arepo-mc-jeu-titre {
    margin-bottom: 24px;
}

.arepo-mc-jeu-espace {
    display: grid;
    grid-template-columns:
        minmax(300px, 520px)
        minmax(280px, 1fr);

    gap: 30px;
    align-items: start;
}

.arepo-mc-grille-jeu {
    width: 100%;
    max-width: 520px;
}

.arepo-mc-case-jeu {
    position: relative;
}

button.arepo-mc-case-jeu {
    border-radius: 0;
}

.arepo-mc-lettre-joueur {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: clamp(16px, 3vw, 28px);
    font-weight: 700;

    pointer-events: none;
}

.arepo-mc-definitions-jeu {
    padding: 20px;
}

.arepo-mc-colonne-definitions + 
.arepo-mc-colonne-definitions {
    margin-top: 28px;
}

.arepo-mc-colonne-definitions h3 {
    margin: 0 0 12px;

    font-size: 18px;
    color: var(--arepo-texte);
}

.arepo-mc-indice {
    padding: 7px 0;

    border-bottom:
        1px solid var(--arepo-bordure);

    font-size: 14px;
    line-height: 1.4;
}

.arepo-mc-indice strong {
    color: var(--arepo);
}

@media (max-width: 800px) {

    .arepo-mc-jeu-espace {
        grid-template-columns: 1fr;
    }

    .arepo-mc-grille-jeu {
        max-width: 600px;
        margin: 0 auto;
    }
}
/* =========================================================
   INTERACTION DU JOUEUR
   ========================================================= */

.arepo-mc-grille-jeu {
    outline: none;
}

.arepo-mc-grille-jeu
.arepo-mc-case-jeu.arepo-mc-jeu-mot-actif {
    background: #e8f8f7;
}

.arepo-mc-grille-jeu
.arepo-mc-case-jeu.arepo-mc-jeu-selectionnee {
    background: #c8efec;

    box-shadow:
        inset 0 0 0 3px #0bb4aa;
}
/* =========================================================
   CLAVIER TACTILE
   ========================================================= */

.arepo-mc-clavier-mobile {
    position: fixed;

    left: -1000px;
    bottom: 0;

    width: 1px;
    height: 1px;

    opacity: 0;

    font-size: 16px;
}
/* =========================================================
   VÉRIFICATION DE LA GRILLE
   ========================================================= */

.arepo-mc-verification {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;

    margin-top: 24px;
}

.arepo-mc-bouton-verifier {
    min-height: 44px;
    padding: 9px 20px;

    border: 0;
    border-radius: 8px;

    background: #0bb4aa;
    color: #062b29;

    font-weight: 700;
    cursor: pointer;
}

.arepo-mc-bouton-verifier:hover {
    background: #0aa59c;
}

.arepo-mc-bouton-verifier:disabled {
    opacity: 0.55;
    cursor: wait;
}

.arepo-mc-message-verification {
    font-size: 14px;
    font-weight: 600;
}

.arepo-mc-grille-jeu
.arepo-mc-case-jeu.arepo-mc-jeu-erreur {
    background: #ffdede;
}
/* =========================================================
   CATALOGUE DES MOTS CROISÉS
   ========================================================= */

.arepo-mc-catalogue {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(240px, 1fr)
        );

    gap: 20px;

    margin: 30px 0;
}

.arepo-mc-carte {
    display: flex;

    min-height: 190px;

    margin: 0;
    padding: 0;

    border:
        1px solid
        var(--arepo-bordure, #d9e1e1);

    border-radius: 12px;

    background: #fff;

    overflow: hidden;
}

.arepo-mc-carte-contenu {
    display: flex;
    flex-direction: column;

    width: 100%;

    padding: 22px;
}

.arepo-mc-carte-titre {
    margin: 0 0 12px;

    font-size: 20px;
}

.arepo-mc-carte-infos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-bottom: 22px;

    font-size: 13px;
    color: #687777;
}

.arepo-mc-carte-infos span {
    padding: 4px 8px;

    border-radius: 20px;

    background: #e8f8f7;
}

.arepo-mc-carte-jouer {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    align-self: flex-start;

    margin-top: auto;

    min-height: 42px;

    padding: 8px 18px;

    border-radius: 8px;

    background: #0bb4aa;

    color: #062b29 !important;

    font-weight: 700;
    text-decoration: none !important;
}

.arepo-mc-carte-jouer:hover {
    background: #0aa59c;
}

.arepo-mc-catalogue-vide {
    padding: 25px;

    border:
        1px solid
        #d9e1e1;

    border-radius: 12px;

    background: #fff;
}
/* =========================================================
   LECTEUR : DÉFINITION CONTEXTUELLE
   ========================================================= */

.arepo-mc-jeu-espace {
    display: block;
}

.arepo-mc-grille-jeu {
    width: min(100%, 620px);
    max-width: 620px;
    margin: 0 auto;
}

.arepo-mc-definitions-jeu {
    display: none;
}

.arepo-mc-indice-actif {
    width: min(100%, 620px);
    min-height: 92px;
    margin: 18px auto 0;
    padding: 16px 18px;
    border: 1px solid var(--arepo-bordure);
    border-radius: 10px;
    background: #fff;
    box-sizing: border-box;
}

.arepo-mc-indice-actif-meta {
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 700;
    color: var(--arepo);
}

.arepo-mc-indice-actif-texte {
    font-size: 17px;
    line-height: 1.4;
    color: var(--arepo-texte);
}

.arepo-mc-verification {
    width: min(100%, 620px);
    margin-left: auto;
    margin-right: auto;
}
/* =========================================================
   CLAVIER AREPO - IPHONE PORTRAIT
   ========================================================= */

.arepo-mc-clavier-compact {
    display: none;
}

@media (max-width: 600px) {

    /* Cache le champ destiné au clavier natif */
    .arepo-mc-clavier-mobile {
        display: none !important;
    }

    /* Laisse de la place sous le jeu */
    .arepo-mc-jeu {
        padding-bottom: 125px;
    }

    /* Clavier AREPO */
    .arepo-mc-clavier-compact {
        position: fixed !important;
        z-index: 99999 !important;

        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;

        display: grid !important;
        grid-template-columns: repeat(9, minmax(0, 1fr)) !important;

        gap: 3px !important;

        width: 100% !important;
        box-sizing: border-box !important;

        margin: 0 !important;

        padding:
            5px
            max(5px, env(safe-area-inset-right))
            calc(5px + env(safe-area-inset-bottom))
            max(5px, env(safe-area-inset-left)) !important;

        background: #f8fafa !important;
        border-top: 1px solid #d9e1e1 !important;
    }

    /* Touches */
    .arepo-mc-clavier-compact > .arepo-mc-touche {
        min-width: 0 !important;
        width: auto !important;
        max-width: none !important;

        height: 34px !important;
        min-height: 34px !important;

        margin: 0 !important;
        padding: 0 !important;

        box-sizing: border-box !important;

        border: 1px solid #d4dada !important;
        border-radius: 5px !important;

        background: #ffffff !important;
        color: #263333 !important;

        font-family: inherit !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        line-height: 1 !important;
    }

    .arepo-mc-clavier-compact > .arepo-mc-touche-effacer {
        background: #e8f8f7 !important;
        font-size: 17px !important;
    }
}
/* Retour visuel lors de l'appui sur une touche */
@media (max-width: 600px) {

    .arepo-mc-clavier-compact > .arepo-mc-touche:active {
        background: #0bb4aa !important;
        color: #062b29 !important;

        transform: scale(0.92);
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.18) !important;
    }

    .arepo-mc-clavier-compact > .arepo-mc-touche-effacer:active {
        background: #0bb4aa !important;
    }
}
/* =========================================================
   SAISIE TACTILE DU CONSTRUCTEUR
   Relais invisible pour le clavier iOS / iPadOS
   ========================================================= */

.arepo-mc-saisie-tactile {
    position: fixed !important;

    left: -1000px !important;
    bottom: 0 !important;

    width: 1px !important;
    height: 1px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
    opacity: 0 !important;

    font-size: 16px !important;

    pointer-events: none !important;
}
     
  
   

    
         


 