/* =====================================================================
   📁 /generateur_crossword/crossword.css
   Compléments Bootstrap 5.3 pour le générateur de mots-croisés SC@LPA.
   ===================================================================== */

/* =====================================================================
   1. BASE
   ===================================================================== */

body {
    background: #f5f7fb;
}

.cw-source {
    min-height: 330px;
    resize: vertical;
    font-family: "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
    line-height: 1.45;
}

.cw-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 1rem;
    background: #f8fafc;
}

/* =====================================================================
   2. APERÇU GRILLE
   ===================================================================== */

.cw-grid-scroll {
    max-width: 100%;
    overflow: auto;
    padding: 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
}

.cw-grid {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    background: transparent;
    margin: 0 auto;
}

.cw-grid td {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    text-align: center;
    vertical-align: middle;
    position: relative;

    /*
       Important :
       chaque td garde une bordure transparente.
       Cela stabilise les dimensions des colonnes/lignes,
       même pour les cases vides.
    */
    border: 1px solid transparent;
}

.cw-grid .cw-black {
    background: transparent;
    border-color: transparent;
}

.cw-grid .cw-cell {
    background: #fff;

    /*
       Chaque cellule utile dessine haut + gauche.
       Les séparations internes sont donc dessinées une seule fois.
    */
    border-top-color: #64748b;
    border-left-color: #64748b;
}

.cw-grid .cw-border-right {
    border-right-color: #64748b;
}

.cw-grid .cw-border-bottom {
    border-bottom-color: #64748b;
}

.cw-num {
    position: absolute;
    left: 2px;
    top: 1px;
    font-size: 9px;
    line-height: 1;
    color: #475569;
    font-weight: 700;
}

.cw-letter {
    font-weight: 900;
    font-size: 17px;
    line-height: 1;
}

/* =====================================================================
   3. DÉFINITIONS
   ===================================================================== */

.cw-clue-list {
    padding-left: 1.7rem;
}

.cw-clue-list li {
    margin-bottom: .55rem;
    line-height: 1.35;
}

.cw-clue-list li::marker {
    font-weight: 700;
}

/* =====================================================================
   4. STATS / BADGES
   ===================================================================== */

.cw-stats {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.nav-tabs .nav-link {
    font-weight: 700;
}

.badge {
    letter-spacing: .01em;
}

/* =====================================================================
   5. CONFORT VISUEL
   ===================================================================== */

#messages .alert {
    border-radius: .75rem;
}

#preview {
    min-height: 220px;
}

#preview .row h3 {
    color: #334155;
}

/* =====================================================================
   6. RESPONSIVE
   ===================================================================== */

@media (max-width: 768px) {
    .cw-grid-scroll {
        padding: .75rem;
    }

    .cw-grid td {
        width: 27px;
        height: 27px;
        min-width: 27px;
    }

    .cw-letter {
        font-size: 15px;
    }

    .cw-num {
        font-size: 8px;
    }
}