/* ================================
   JEUX - Styles communs
   ================================ */

/* HEADER */
.header-jeux {
    background: linear-gradient(135deg, #232526 0%, #414345 100%);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 20px;
}

.header-content .logo {
    color: white;
    font-size: 1.4em;
    font-weight: 700;
    text-decoration: none;
}

.header-gauche {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-self: start;
}

.header-droite {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-self: end;
}

.header-menu-jeux {
    color: #232526;
    background: #5ced8c;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    transition: opacity 0.2s;
}

.header-menu-jeux:hover {
    opacity: 0.85;
}

.header-jeu-img {
    height: 50px;
    width: 50px;
    object-fit: contain;
    border-radius: 10px;
}

/* BOUTONS CONNEXION */
#btn-connexion, #btn-deconnexion {
    background: white;
    color: #232526;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85em;
}

#nom-joueur {
    color: white;
    font-size: 0.9em;
    margin-right: 10px;
}

/* HERO */
.hero-jeux {
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.hero-img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 300px;
    object-fit: cover;
    object-position: center;
}


/* CONTAINER PAGE ACCUEIL */
.container-jeux {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

main.container-jeux {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

/* CATEGORIES */
.categorie { margin-bottom: 50px; }

.titre-categorie-img {
    height: 110px;
    width: auto;
    margin-bottom: 15px;
    display: block;
    mix-blend-mode: lighten;
}

/* GRILLE DE JEUX */
.grille-jeux {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 15px;
}

/* CARTE JEU */
.carte-jeu {
    background: white;
    border-radius: 16px;
    padding: 15px 10px;
    text-align: center;
    text-decoration: none;
    color: #232526;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.carte-jeu:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.carte-jeu.bientot { opacity: 0.6; pointer-events: none; }
.carte-jeu p, .badge-gratuit, .badge-bientot { display: none; }

.carte-jeu-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: 16px;
}

.carte-jeu h3 {
    font-size: 0.9em;
    margin-bottom: 0;
    font-weight: 600;
}

/* ================================
   STYLES COMMUNS AUX PAGES DE JEU
   ================================ */

/* COLONNE GAUCHE */
.colonne-gauche {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* DÉFI DU JOUR */
.defi-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 12px;
    color: white;
}

.defi-locked {
    background: linear-gradient(135deg, #999 0%, #666 100%);
    opacity: 0.85;
}

.defi-titre {
    font-size: 0.75em;
    opacity: 0.9;
    margin-bottom: 5px;
    font-weight: 600;
}

.defi-label {
    font-size: 0.85em;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.btn-defi {
    background: white;
    color: #764ba2;
    border: none;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.8em;
    width: 100%;
}

.defi-fait {
    text-align: center;
    font-size: 0.85em;
}

#defi-resultat {
    margin-top: 4px;
    font-size: 0.8em;
    opacity: 0.9;
}

/* SÉPARATEUR */
.separateur {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #aaa;
    font-size: 0.75em;
}

.separateur::before,
.separateur::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

/* SÉLECTEUR DE NIVEAU */
.niveau-label {
    font-size: 0.75em;
    color: #888;
    display: block;
    margin-bottom: 5px;
}

.btns-niveau {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.btn-niveau {
    background: #eee;
    color: #555;
    border: none;
    padding: 5px 9px;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8em;
}

.btn-niveau.actif {
    background: #f65e3b;
    color: white;
}

/* SCORES */
.scores-2048 {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.score-box {
    background: #414345;
    color: white;
    padding: 9px 14px;
    border-radius: 10px;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.score-label {
    display: block;
    font-size: 0.65em;
    opacity: 0.9;
    margin-bottom: 2px;
}

.score-valeur {
    display: block;
    font-size: 1.3em;
    font-weight: 700;
}

/* BOUTONS JEU */
.boutons-2048 {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn-nouveau {
    background: #5ced8c;
    color: #232526;
    border: none;
    padding: 9px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85em;
    width: 100%;
}

.btn-annuler {
    background: #edcf72;
    color: #232526;
    border: none;
    padding: 9px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85em;
    width: 100%;
}

/* INSTRUCTIONS */
.instructions-2048 {
    color: #aaa;
    font-size: 0.75em;
    line-height: 1.7;
}

/* COLONNE CENTRALE */
.colonne-centrale {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    gap: 12px;
}

/* COMPTE À REBOURS */
.countdown-start {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    pointer-events: none;
}

#countdown-chiffre {
    font-size: 8em;
    font-weight: 900;
    color: white;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* CLASSEMENT */
.colonne-classement {
    background: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.colonne-classement h3 {
    font-size: 0.9em;
    color: #232526;
    margin-bottom: 10px;
    text-align: center;
}

.classement-ligne {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.78em;
}

.classement-rang {
    font-weight: 700;
    color: #999;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.classement-nom {
    flex: 1;
    color: #444;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.classement-score {
    font-weight: 700;
    color: #232526;
    flex-shrink: 0;
}

.classement-moi .classement-nom,
.classement-moi .classement-score,
.classement-moi .classement-rang { color: #f65e3b; font-weight: 700; }

.classement-separateur {
    text-align: center;
    color: #ccc;
    font-size: 0.8em;
    padding: 4px 0;
}

/* MESSAGE FIN */
.message-fin {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(238, 228, 218, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.message-contenu {
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.message-contenu h2 { font-size: 2em; color: #232526; margin-bottom: 10px; }
.message-contenu p  { font-size: 1.1em; color: #555; margin-bottom: 20px; }

.message-contenu button {
    background: #f65e3b;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
}

/* ENCART APP */
.encart-app {
    background: linear-gradient(135deg, #232526 0%, #414345 100%);
    padding: 30px 20px;
    margin-top: 40px;
}

.encart-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    color: white;
}

.encart-icon { font-size: 3em; }
.encart-content h3 { font-size: 1.3em; margin-bottom: 5px; }
.encart-content p  { opacity: 0.8; font-size: 0.95em; }

.btn-app {
    margin-left: auto;
    background: white;
    color: #232526;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

/* FOOTER */
.footer-jeux {
    text-align: center;
    padding: 30px 20px;
    color: #999;
    font-size: 0.9em;
}

.footer-jeux a { color: #666; }
.encart-icon-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 12px;
    flex-shrink: 0;
}
/* GRAND DÉFI ACCUEIL */
.grand-defi-accueil {
    text-align: center;
    margin: 10px auto;
    max-width: 300px;
}

.grand-defi-lien {
    display: block;
    transition: transform 0.2s;
}

.grand-defi-lien:hover {
    transform: scale(1.02);
}

.grand-defi-img {
    width: 100%;
    height: auto;
    cursor: pointer;
}
.enigme-img {
    width: 100%;
    height: auto;
    cursor: pointer;
}
.btn-voir-classement {
    display: block;
    text-align: center;
    margin: 8px auto 0;
    padding: 8px 20px;
    background: #764ba2;
    color: white;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9em;
    text-decoration: none;
    width: fit-content;
}
/* ========================================
   SEO CONTENT
======================================== */

.seo-content {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    color: #aaa;
    font-size: 0.9em;
    line-height: 1.6;
}

.seo-content h2 {
    font-size: 1.3em;
    color: #888;
    margin-bottom: 10px;
}

.seo-content h3 {
    font-size: 1.1em;
    color: #888;
    margin: 16px 0 8px;
}
.jeux-du-jour {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    margin: 20px auto;
    max-width: 800px;
    padding: 0 15px;
}

.jeux-du-jour .grand-defi-accueil {
    flex: 1;
}