body {
    background-color: #01030b;
    color: #5b7cab;
    font-family: 'Georgia', serif;
    width: 100%;
    padding: 0;
    margin: 0;
}

.genre {
    color: #c5dbf5;
    border: solid 3px;
    width: 900px;
    height: 110px;
    border-radius: 10px;
    padding: 10px 10px 10px 10px;
    font-size: large;
    font-weight: 100;
    box-shadow: 0 4px 10px;

}

.Titre {
    text-align: center;
    color: #5b7cab;
    margin-bottom: 40px;
}

.couleur {
    text-align: center;
}

.Code {
    color: rgb(162, 185, 234);
    font-size: larger;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    font-style: oblique;
}

.liens {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    border-bottom: 5px solid;

    border-color: #1a2d4c;
}

p {
    margin: 0.75rem 0;
    line-height: 1.5;
}

a:link,
a:visited {
    color: #c5dbf5;
    text-decoration: none;
    margin-right: 100px;
}

.conteneur {
    width: 80%;
    margin: 0 auto;
}

.introduction {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    margin: 0 auto;
    max-width: 1100px;
    flex-wrap: wrap;
    gap: 5rem;
}

.couverture {
    max-width: 300px;
    margin-bottom: 20px;
    flex-shrink: 0;
    border-radius: 20px;
}

.contenu {
    text-align: left;
    max-width: 600px;
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-style: italic;
}

h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
}

blockquote {
    font-style: italic;
    font-size: 1.1rem;
    margin-top: 2rem;
}

.annotations {
    max-width: 350px;
    margin-bottom: 20px;
    flex-shrink: 0;
    border-radius: 20px;
}

.image {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lexique {
    color: #c5dbf5;
    border: dotted;
    width: 1000px;
    border-radius: 10px;
    padding: 10px 10px 10px 10px;
    font-size: large;
    list-style-type: none;
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 4px 10px;
}

/* ajout pour ma pal*/

.ajout-livre {
    margin-bottom: 20px;
}

.ajout-livre input {
    padding: 10px;
    border-radius: 15px;
    border: 1px solid #b5c9b7;
    width: 220px;
}

.ajout-livre button {
    padding: 10px 16px;
    border-radius: 15px;
    border: none;
    background-color: #9bb7a0;
    color: white;
    cursor: pointer;
    margin-left: 10px;
}

/* Roue de la fortune */
.roue-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    gap: 20px;
}

.roue-container {
    position: relative;
    width: 300px;
    height: 300px;
}

.roue {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid #5b7cab;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
    /* Ease-out pour un arrêt réaliste */
    position: relative;
    overflow: hidden;
}

.fleche {
    font-size: 3rem;
    color: #c5dbf5;
    position: absolute;
    top: -35px;
    /* Ajusté pour être bien au dessus */
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    /* Z-index supérieur à la roue */
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    /* Pour ne pas gêner */
}

#btnLancer {
    padding: 12px 24px;
    font-size: 1.2rem;
    border-radius: 25px;
    border: none;
    background-color: #5b7cab;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

#btnLancer:hover {
    background-color: #4a658a;
}

#btnLancer:disabled {
    background-color: #889bb5;
    cursor: not-allowed;
}

#resultat {
    color: #c5dbf5;
    font-size: 1.5rem;
    text-align: center;
    min-height: 2rem;
}

/* Texte sur la roue (généré par JS) */
.roue-label {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 40px;
    /* Hauteur suffisante pour le texte */
    transform-origin: 0 50%;
    /* Pivot sur le milieu du bord gauche */
    margin-top: -20px;
    /* Centrer verticalement (moitié de height) */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Texte vers l'extérieur */
    padding-right: 30px;
    /* Marge par rapport au bord */
    box-sizing: border-box;
    z-index: 15;
    pointer-events: none;
}

.roue-label span {
    font-size: 14px;
    font-weight: bold;
    color: #01030b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}
/*ajout pour ma page challenge */ 

.bingo {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  max-width: 800px;
  margin: auto;
}

.case {
  padding: 12px;
  background-color: #e6efe8;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  transition: 0.2s;
}

.case:hover {
  background-color: #d6e4d9;
}

.case.active {
  background-color: #9bb7a0;
  color: white;
}

footer {
    background-color: #1a2d4c; /* Le même bleu que la bordure du menu */
    color: #c5dbf5;
    padding: 20px 0;
    margin-top: 50px;
    border-top: 3px solid #5b7cab; /* Une petite ligne de séparation */
    width: 100%;
    text-align: center;
    position: relative;
}

.free {
  background-color: #c4d6c8;
  font-weight: bold;
}

/* --- Bouton Dark/Light Mode --- */
.theme-btn {
    position: fixed; /* Fixé à l'écran */
    right: 20px;     /* À droite */
    top: 50%;        /* Centré verticalement */
    transform: translateY(-50%);
    z-index: 1000;   /* Au-dessus du reste */
    
    background-color: #1a2d4c;
    border: 2px solid #5b7cab;
    border-radius: 30px; /* Forme de pilule */
    width: 40px;
    height: 80px;    /* Hauteur plus grande pour l'effet switch */
    box-sizing: border-box; /* Assure que la taille inclut les bordures */
    cursor: pointer;
    color: #c5dbf5;
    transition: all 0.3s ease;
    
    /* Gestion de l'icône */
    padding: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.theme-btn:hover {
    transform: translateY(-50%) scale(1.1); /* On garde le centrage vertical + agrandissement */
    box-shadow: 0 0 15px rgba(91, 124, 171, 0.6);
    background-color: #5b7cab;
    color: #fff;
}

.theme-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    position: absolute; /* Positionnement libre dans le bouton */
    left: 50%;
    top: 6px; /* La lune calée en haut */
    transform: translateX(-50%); /* Centrage horizontal parfait */
    transition: transform 0.3s ease;
}

/* --- Styles Light Mode (Mode Clair) --- */
body.light-mode {
    background-color: #f4f6f8; /* Fond gris très clair */
    color: #1a2d4c; /* Texte bleu foncé */
}

body.light-mode .genre,
body.light-mode .lexique {
    color: #1a2d4c;
    border-color: #1a2d4c;
    background-color: #ffffff;
}

body.light-mode .Titre,
body.light-mode .couleur,
body.light-mode #resultat,
body.light-mode .fleche {
    color: #1a2d4c;
}

body.light-mode .liens {
    border-color: #9bb7a0;
}

body.light-mode a:link,
body.light-mode a:visited {
    color: #2c5282;
}

body.light-mode footer {
    background-color: #e6efe8;
    color: #1a2d4c;
    border-top-color: #9bb7a0;
}

body.light-mode .roue {
    border-color: #1a2d4c;
}

body.light-mode .theme-btn {
    background-color: #fff;
    border-color: #9bb7a0;
    color: #f39c12;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Déplace l'icône vers le bas en mode clair */
body.light-mode .theme-btn svg {
    transform: translateX(-50%) translateY(40px); /* Le soleil descend de 40px */
}

/* --- Formulaire de Contact --- */
.contact-box {
    border: 3px solid #5b7cab;
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    margin: 50px auto; /* Centré avec marge */
    background-color: rgba(26, 45, 76, 0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    color: #c5dbf5;
}

.contact-box h2 {
    text-align: center;
    color: #5b7cab;
    margin-top: 0;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.contact-box input,
.contact-box textarea {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #5b7cab;
    background-color: #01030b;
    color: #c5dbf5;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
}

.contact-box input:focus,
.contact-box textarea:focus {
    outline: none;
    border-color: #c5dbf5;
    box-shadow: 0 0 8px rgba(91, 124, 171, 0.4);
}

.contact-box button {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 25px;
    border: none;
    background-color: #5b7cab;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s;
}

.contact-box button:hover {
    background-color: #4a658a;
}

/* Adaptation Light Mode pour le formulaire */
body.light-mode .contact-box {
    background-color: #ffffff;
    border-color: #1a2d4c;
    color: #1a2d4c;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

body.light-mode .contact-box h2 {
    color: #1a2d4c;
}

body.light-mode .contact-box input,
body.light-mode .contact-box textarea {
    background-color: #f4f6f8;
    color: #1a2d4c;
    border-color: #9bb7a0;
}

body.light-mode .contact-box button {
    background-color: #1a2d4c;
}

body.light-mode .contact-box button:hover {
    background-color: #2c5282;
}

/* --- Modal Bingo (Carte en avant) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Fond sombre transparent */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-card {
    background-color: #01030b;
    border: 3px solid #5b7cab;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 0 20px rgba(91, 124, 171, 0.5);
    transform: scale(0.7);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Effet rebond */
    position: relative;
}

.modal-overlay.open .modal-card {
    transform: scale(1);
}

.modal-card h3 {
    color: #c5dbf5;
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.modal-btn {
    padding: 12px 24px;
    border-radius: 25px;
    border: none;
    background-color: #9bb7a0;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.modal-btn:hover {
    background-color: #7a9680;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    color: #5b7cab;
    cursor: pointer;
    line-height: 1;
}

/* Adaptation Light Mode pour la carte */
body.light-mode .modal-card {
    background-color: #ffffff;
    border-color: #1a2d4c;
}

body.light-mode .modal-card h3 {
    color: #1a2d4c;
}

/* --- Liens du Footer (Style moins formel) --- */
.footer-links {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;       /* Le bloc s'adapte à la largeur du texte */
    margin: 0 auto 15px auto; /* Centre le bloc horizontalement */
    padding-left: 0;
    gap: 8px;
}

.footer-links a {
    margin: 0;
    font-size: 0.9rem;
    color: #889bb5; /* Couleur plus discrète */
    display: inline-block;
}

.footer-links a:hover {
    color: #c5dbf5;
    text-decoration: underline;
}

/* --- Menu Burger (Mobile) --- */
.hamburger {
    display: none; /* Caché sur PC */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    position: absolute;
    top: 25px;
    left: 20px;
    z-index: 101;
}

.hamburger span {
    width: 30px;
    height: 3px;
    background: #5b7cab;
    border-radius: 10px;
    transition: all 0.3s linear;
    transform-origin: 1px;
}

/* Animation du burger */
.hamburger.open span:nth-child(1) {
    transform: rotate(45deg);
}
.hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}
.hamburger.open span:nth-child(3) {
    transform: rotate(-45deg);
}

/* Adaptation Light Mode pour le burger */
body.light-mode .hamburger span {
    background: #1a2d4c;
}

/* --- Adaptation Mobile (Media Queries) --- */
@media screen and (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    /* Navigation : menu déroulant */
    .liens {
        display: none; /* Caché par défaut */
        flex-direction: column;
        gap: 15px;
        padding: 20px 0;
        width: 100%;
        background-color: #01030b; /* Fond opaque */
        border-bottom: 2px solid #5b7cab;
        animation: slideDown 0.3s ease-in-out;
    }

    .liens.open {
        display: flex;
    }

    /* Animation d'ouverture */
    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* Adaptation fond menu en light mode */
    body.light-mode .liens {
        background-color: #f4f6f8;
    }

    /* Ajustement titre pour ne pas chevaucher le burger */
    .Titre {
        padding: 0 50px;
    }

    /* On annule la grande marge des liens du menu */
    .liens a {
        margin-right: 0;
        margin-bottom: 5px;
    }

    /* Bingo : 2 colonnes au lieu de 7 pour la lisibilité */
    .bingo {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Images : s'adaptent à la largeur de l'écran */
    .couverture, 
    .annotations {
        max-width: 100%;
        height: auto;
    }

    /* Sur mobile, on remet le bouton au centre */
    .footer-action {
        position: static;
        margin: 20px 0;
        transform: none;
    }
}

/* --- Chronomètre --- */
.chrono-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
    gap: 30px;
}

.chrono-display {
    font-size: 4rem;
    font-family: 'Courier New', Courier, monospace;
    color: #c5dbf5;
    text-shadow: 0 0 15px rgba(91, 124, 171, 0.5);
    border: 4px solid #5b7cab;
    padding: 20px 40px;
    border-radius: 20px;
    background-color: rgba(26, 45, 76, 0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    letter-spacing: 5px;
}

.chrono-controls {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.chrono-btn {
    padding: 12px 25px;
    font-size: 1.1rem;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    color: white;
    font-family: 'Georgia', serif;
}

.chrono-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.chrono-btn.start { background-color: #9bb7a0; }
.chrono-btn.pause { background-color: #eebb4d; color: #01030b; }
.chrono-btn.reset { background-color: #d9534f; }

/* Adaptation Light Mode pour le chrono */
body.light-mode .chrono-display {
    color: #1a2d4c;
    border-color: #1a2d4c;
    background-color: #ffffff;
    text-shadow: none;
}

/* --- Pomodoro Controls --- */
.pomodoro-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: #c5dbf5;
    font-size: 1.2rem;
}

.pomodoro-controls input[type=range] {
    width: 300px;
    height: 8px;
    background: #1a2d4c;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.pomodoro-controls input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #5b7cab;
    border-radius: 50%;
    border: 2px solid #c5dbf5;
    transition: background .3s;
}

.pomodoro-controls input[type=range]::-webkit-slider-thumb:hover {
    background: #9bb7a0;
}

/* Adaptation Light Mode pour le slider */
body.light-mode .pomodoro-controls {
    color: #1a2d4c;
}
body.light-mode .pomodoro-controls input[type=range] {
    background: #c5dbf5;
}

/* --- Bouton Footer Chrono --- */
.btn-footer-chrono {
    background-color: #5b7cab;
    color: white !important; /* Force la couleur blanche sur le lien */
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: 2px solid transparent;
    animation: glowing 2s infinite alternate;
}

.btn-footer-chrono:hover {
    background-color: #9bb7a0;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(155, 183, 160, 0.4);
}

/* Adaptation Light Mode */
body.light-mode .btn-footer-chrono {
    background-color: #1a2d4c;
}

/* Positionnement du bouton footer à droite */
.footer-action {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
}

/* Animation Glowing (Lueur) */
@keyframes glowing {
    from { box-shadow: 0 0 5px #5b7cab, 0 0 10px #5b7cab; }
    to { box-shadow: 0 0 20px #5b7cab, 0 0 20px #9bb7a0; }
}

/* --- Page Avis --- */
.avis-category {
    margin-bottom: 50px;
}

.avis-category-title {
    color: #5b7cab;
    border-bottom: 2px solid #1a2d4c;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.avis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.avis-card {
    background-color: rgba(26, 45, 76, 0.3);
    border: 2px solid #5b7cab;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avis-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(91, 124, 171, 0.4);
}

.avis-card-img {
    width: 100%;
    height: 200px;
    background-color: #1a2d4c;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 3rem; /* Pour les émojis placeholders */
}

.avis-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avis-card h3 {
    color: #c5dbf5;
    font-size: 1.2rem;
    margin: 10px 0 5px 0;
}

.avis-card p {
    color: #889bb5;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.avis-link {
    background-color: #5b7cab;
    color: white !important;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-right: 0 !important; /* Annule la marge par défaut des liens */
    transition: background 0.3s;
}

.avis-link:hover {
    background-color: #9bb7a0;
}

/* Adaptation Light Mode pour les avis */
body.light-mode .avis-category-title {
    color: #1a2d4c;
    border-color: #9bb7a0;
}

body.light-mode .avis-card {
    background-color: #ffffff;
    border-color: #1a2d4c;
}

body.light-mode .avis-card h3 {
    color: #1a2d4c;
}

body.light-mode .avis-card-img {
    background-color: #e6efe8;
}