/* ==========================================================================
   Les Aventures d'Eden — feuille de style principale
   Colorée, très lisible, gros boutons : pensée pour une enfant de 8 ans.
   ========================================================================== */

:root {
    --bleu-ciel:   #7ec8f2;
    --bleu-fonce:  #1d5f9e;
    --vert:        #58c472;
    --jaune:       #ffd23f;
    --orange:      #ff9a3c;
    --rose:        #ff7eb0;
    --violet:      #a78bfa;
    --rouge:       #ff6b6b;
    --blanc:       #ffffff;
    --creme:       #fff8ec;
    --texte:       #2b2b3d;
    --ombre:       0 6px 0 rgba(0, 0, 0, 0.14);
    --rayon:       20px;
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
    margin: 0;
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Segoe UI', sans-serif;
    color: var(--texte);
    background: linear-gradient(180deg, var(--bleu-ciel) 0%, #c9ecff 55%, #ffe9b8 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img { max-width: 100%; }

a { color: var(--bleu-fonce); }

/* ---------- Entête ---------- */
.entete {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 4px solid var(--jaune);
    position: sticky;
    top: 0;
    z-index: 50;
}
.entete-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    font-size: 1.05rem;
    color: var(--texte);
    text-decoration: none;
}
.logo-etoile { width: 32px; height: 32px; }
.entete-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.lien-nav {
    text-decoration: none;
    background: var(--creme);
    border: 3px solid var(--bleu-ciel);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-weight: bold;
    font-size: 0.95rem;
    color: var(--texte);
    cursor: pointer;
}
.lien-nav:hover { background: var(--jaune); }
.form-deconnexion { margin: 0; }
.bouton-quitter { font-family: inherit; }

/* ---------- Contenu ---------- */
.contenu {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem 1rem 2.5rem;
}
.pied {
    text-align: center;
    padding: 0.75rem;
    font-size: 0.8rem;
    color: #5a5a74;
}

/* ---------- Messages flash ---------- */
.flash {
    border-radius: var(--rayon);
    padding: 0.8rem 1.1rem;
    margin-bottom: 1rem;
    font-weight: bold;
    border: 3px solid transparent;
}
.flash-succes { background: #e2f9e9; border-color: var(--vert); }
.flash-erreur { background: #ffe3e3; border-color: var(--rouge); }
.flash-info   { background: #e3f2ff; border-color: var(--bleu-ciel); }

/* ---------- Boutons ---------- */
.bouton {
    display: inline-block;
    border: none;
    border-radius: var(--rayon);
    padding: 0.9rem 1.6rem;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: bold;
    color: #fff;
    background: var(--orange);
    box-shadow: var(--ombre);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: transform 0.08s ease;
}
.bouton:hover  { transform: translateY(-2px); }
.bouton:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.14); }
.bouton-vert  { background: var(--vert); }
.bouton-bleu  { background: var(--bleu-fonce); }
.bouton-rose  { background: var(--rose); }
.bouton-violet{ background: var(--violet); }
.bouton-gris  { background: #9aa0b5; }
.bouton-grand { font-size: 1.4rem; padding: 1.1rem 2.2rem; }
.bouton:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ---------- Cartes ---------- */
.carte {
    background: var(--blanc);
    border-radius: var(--rayon);
    padding: 1.25rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* ---------- Formulaires ---------- */
.champ { margin-bottom: 1rem; }
.champ label { display: block; font-weight: bold; margin-bottom: 0.35rem; }
.champ input, .champ select, .champ textarea {
    width: 100%;
    font-family: inherit;
    font-size: 1.1rem;
    padding: 0.7rem 0.9rem;
    border: 3px solid var(--bleu-ciel);
    border-radius: 14px;
    background: var(--creme);
    color: var(--texte);
}
.champ input:focus, .champ select:focus, .champ textarea:focus {
    outline: none;
    border-color: var(--orange);
}

/* ---------- Page d'accueil (choix du profil) ---------- */
.accueil-hero { text-align: center; padding: 2rem 0 1rem; }
.accueil-hero h1 { font-size: 2.2rem; margin: 0 0 0.3rem; }
.accueil-hero p  { font-size: 1.15rem; color: #4a4a66; }
.accueil-choix {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}
.carte-profil {
    width: 300px;
    text-align: center;
    padding: 2rem 1.5rem;
    text-decoration: none;
    color: var(--texte);
    border-radius: var(--rayon);
    background: var(--blanc);
    box-shadow: var(--ombre);
    transition: transform 0.12s ease;
}
.carte-profil:hover { transform: translateY(-6px) rotate(-1deg); }
.carte-profil .dessin { font-size: 4.5rem; line-height: 1; }
.carte-profil h2 { margin: 0.75rem 0 0.25rem; }
.carte-profil p { margin: 0; color: #5a5a74; }

/* ---------- Étoiles ---------- */
.etoiles { color: var(--jaune); letter-spacing: 2px; text-shadow: 0 1px 0 #b8860b; }
.etoile-eteinte { color: #d9d9e3; text-shadow: none; }

/* ---------- Connexion ---------- */
.connexion-boite { max-width: 420px; margin: 2rem auto; }
.connexion-boite h1 { text-align: center; }
.mascotte {
    font-size: 4.5rem;
    text-align: center;
    animation: rebond 2.4s ease-in-out infinite;
}
@keyframes rebond {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}
.petit { font-size: 0.85rem; color: #5a5a74; text-align: center; }

.pin-affiche {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin: 0.5rem 0 1rem;
}
.pin-point {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e6e6f0;
    border: 3px solid var(--bleu-ciel);
}
.pin-point.plein { background: var(--orange); border-color: var(--orange); }

.pave-numerique {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    max-width: 300px;
    margin: 0 auto;
}
.touche {
    font-family: inherit;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 0.8rem 0;
    border-radius: 16px;
    border: 3px solid var(--bleu-ciel);
    background: var(--blanc);
    color: var(--texte);
    box-shadow: var(--ombre);
    cursor: pointer;
}
.touche:hover { background: var(--creme); }
.touche:active { transform: translateY(2px); box-shadow: none; }
.touche-ok    { background: var(--vert); color: #fff; border-color: var(--vert); }
.touche-effacer { background: var(--creme); }

/* ---------- Espace enfant : carte et niveaux ---------- */
.carte-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.monde-titre { margin: 0; font-size: 1.6rem; }
.monde-sous-titre { margin-top: 0; }
.joueur-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--blanc);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.joueur-avatar { font-size: 2rem; }
.compteurs { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.compteur {
    background: var(--blanc);
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    text-decoration: none;
    color: var(--texte);
}
.compteur-etoiles { border: 3px solid var(--jaune); }
.compteur-pieces { border: 3px solid var(--orange); }

.mondes-grille {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}
.carte-monde {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: var(--blanc);
    border: 5px solid var(--couleur-monde, var(--bleu-ciel));
    border-radius: 26px;
    padding: 1.5rem 1rem;
    text-decoration: none;
    color: var(--texte);
    box-shadow: var(--ombre);
    transition: transform 0.12s ease;
}
.carte-monde:hover { transform: translateY(-6px) scale(1.02); }
.monde-icone { font-size: 3.6rem; line-height: 1; }
.monde-nom { font-weight: bold; font-size: 1.15rem; text-align: center; }
.monde-progres {
    width: 100%;
    height: 14px;
    background: #eeeaf4;
    border-radius: 999px;
    overflow: hidden;
}
.monde-progres span { display: block; height: 100%; background: var(--couleur-monde, var(--vert)); border-radius: 999px; }
.monde-detail { font-size: 0.85rem; color: #5a5a74; }

.niveaux-liste {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.25rem;
}
.carte-niveau {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--blanc);
    border-radius: 20px;
    padding: 0.9rem 1.1rem;
    text-decoration: none;
    color: var(--texte);
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: transform 0.1s ease;
}
a.carte-niveau:hover { transform: translateX(6px); }
.carte-niveau-ferme { opacity: 0.65; background: #f0f0f5; }
.niveau-num {
    min-width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--jaune);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: bold;
}
.niveau-infos { flex: 1; display: flex; flex-direction: column; }
.niveau-infos em { font-style: normal; font-size: 0.85rem; color: #5a5a74; }
.niveau-etoiles { font-size: 1.2rem; white-space: nowrap; }

/* ---------- Mascotte ---------- */
.bulle-mascotte {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 1.25rem 0;
}
.mascotte-mini { font-size: 2.6rem; }
.bulle {
    background: var(--blanc);
    border: 3px solid var(--bleu-ciel);
    border-radius: 18px;
    padding: 0.6rem 1rem;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}
.bulle-positive { border-color: var(--vert); }

/* ---------- Moteur de jeu ---------- */
.moteur { margin-top: 0.5rem; }
.jeu-barre {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.bouton-quitter-jeu {
    text-decoration: none;
    background: var(--blanc);
    border: 3px solid var(--rouge);
    color: var(--rouge);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}
.jeu-progression {
    flex: 1;
    height: 18px;
    background: var(--blanc);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.jeu-progression span { display: block; height: 100%; background: linear-gradient(90deg, var(--vert), var(--jaune)); }
.jeu-compteur { font-weight: bold; background: var(--blanc); border-radius: 999px; padding: 0.25rem 0.8rem; }
.jeu-pieces { font-weight: bold; background: var(--blanc); border: 3px solid var(--orange); border-radius: 999px; padding: 0.25rem 0.8rem; }

.carte-question { position: relative; padding: 2rem 1.5rem; }
.bouton-voix {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    font-size: 1.4rem;
    background: var(--creme);
    border: 3px solid var(--bleu-ciel);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    cursor: pointer;
}
.bouton-voix:hover { background: var(--jaune); }
.question-texte { font-size: 1.35rem; font-weight: bold; margin: 0 0 1.5rem; padding-right: 3.5rem; }

.qcm-choix { display: flex; flex-direction: column; gap: 0.8rem; }
.choix {
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: bold;
    padding: 1rem 1.2rem;
    border-radius: 18px;
    border: 4px solid var(--bleu-ciel);
    background: var(--creme);
    color: var(--texte);
    cursor: pointer;
    text-align: left;
    box-shadow: 0 3px 0 rgba(0,0,0,0.1);
}
.choix:hover:not(:disabled) { background: var(--jaune); }
.choix:disabled { opacity: 0.75; }
.choix.mauvais { border-color: var(--rouge); background: #ffe3e3; opacity: 1; }

.saisie-zone { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.saisie-champ {
    flex: 1;
    min-width: 200px;
    font-family: inherit;
    font-size: 1.3rem;
    padding: 0.8rem 1rem;
    border: 4px solid var(--bleu-ciel);
    border-radius: 16px;
    background: var(--creme);
}
.bouton-ecoute { font-size: 1.1rem; }

.association-grille {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.association-colonne { display: flex; flex-direction: column; gap: 0.6rem; }
.asso-item {
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: bold;
    padding: 0.85rem;
    border-radius: 16px;
    border: 4px solid var(--violet);
    background: var(--blanc);
    cursor: pointer;
}
.asso-item.choisi { background: var(--jaune); border-color: var(--orange); }
.asso-item.apparie { opacity: 0.55; }
.association-valider { margin: 0 auto; display: block; }

.explication {
    margin-top: 1.25rem;
    background: #e3f2ff;
    border: 3px dashed var(--bleu-fonce);
    border-radius: 16px;
    padding: 1rem;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    animation: apparait 0.35s ease;
}
@keyframes apparait { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.piko-zone { display: flex; align-items: center; gap: 0.7rem; margin-top: 1.25rem; }

/* ---------- Fin de niveau ---------- */
.fin-niveau {
    text-align: center;
    background: var(--blanc);
    border-radius: 26px;
    padding: 2rem 1.5rem;
    box-shadow: var(--ombre);
    animation: apparait 0.4s ease;
}
.fin-etoiles { font-size: 3.2rem; margin: 0.75rem 0; }
.fin-etoile { filter: grayscale(1); opacity: 0.4; display: inline-block; }
.fin-etoile-gagnee { filter: none; opacity: 1; animation: pop 0.5s ease; }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.4); } 100% { transform: scale(1); } }
.fin-stats { font-size: 1.1rem; margin: 0.35rem 0; }
.fin-badges { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin: 1rem 0; }
.fin-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    background: var(--creme);
    border: 3px solid var(--jaune);
    border-radius: 16px;
    padding: 0.6rem 1rem;
    font-weight: bold;
    font-size: 0.9rem;
}
.fin-badge-icone { font-size: 2rem; }
.fin-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.25rem; }

/* ---------- Boutique, avatars ---------- */
.boutique-titre { margin-top: 2rem; }
.boutique-grille {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
}
.carte-article {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: var(--blanc);
    border-radius: 20px;
    padding: 1.1rem 0.8rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    text-align: center;
}
.article-possede { outline: 4px solid var(--jaune); }
.article-icone { font-size: 3rem; line-height: 1; }
.article-nom { font-weight: bold; }
.article-prix { font-size: 0.9rem; color: #5a5a74; }
.article-acquis { color: var(--vert); font-weight: bold; }

/* ---------- Mon île ---------- */
.ile-scene { overflow-x: auto; }
.ile-grille {
    display: grid;
    grid-template-columns: repeat(10, 52px);
    grid-auto-rows: 52px;
    gap: 4px;
    background: linear-gradient(180deg, #b8ecff 55%, #ffe9b8 55.5%);
    border: 5px solid var(--bleu-fonce);
    border-radius: 20px;
    padding: 8px;
    width: max-content;
    margin: 0 auto;
}
.ile-case { margin: 0; }
.ile-vide {
    width: 100%;
    height: 100%;
    border: 2px dashed rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    cursor: pointer;
}
.ile-vide:hover { background: rgba(255,255,255,0.5); }
.ile-objet {
    width: 100%;
    height: 100%;
    font-size: 1.8rem;
    background: rgba(255,255,255,0.75);
    border: none;
    border-radius: 10px;
    cursor: pointer;
}
.objets-liste {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: var(--blanc);
    border-radius: 20px;
    padding: 1rem;
}
.objet-choix {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border: 3px solid var(--bleu-ciel);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    font-weight: bold;
}
.objet-choix:has(input:checked) { background: var(--jaune); border-color: var(--orange); }
.objet-choix input { display: none; }
.objet-icone { font-size: 1.6rem; }

/* ---------- Hub ---------- */
.jeu-canvas {
    width: 100%;
    max-width: 960px;
    aspect-ratio: 16 / 9;
    margin: 0 auto;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--ombre);
    background: #c9ecff;
}
.jeu-canvas canvas { display: block; }
.hub-lien-liste { max-width: 960px; margin: 0.6rem auto 0; }

.overlay-pause {
    position: absolute;
    inset: 0;
    background: rgba(29, 60, 110, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
    border-radius: 24px;
    cursor: pointer;
}
.overlay-pause-boite {
    font-family: 'Comic Sans MS', 'Segoe UI', sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-align: center;
    background: rgba(255, 255, 255, 0.18);
    border: 4px solid rgba(255, 255, 255, 0.6);
    border-radius: 22px;
    padding: 1.4rem 2.2rem;
    animation: apparait 0.6s ease infinite alternate;
}

/* ---------- Espace parent ---------- */
.stats-cartes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}
.stat-carte {
    background: var(--blanc);
    border-radius: 20px;
    padding: 1.1rem;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.stat-valeur { font-size: 1.7rem; font-weight: bold; color: var(--bleu-fonce); }
.stat-libelle { font-size: 0.85rem; color: #5a5a74; }

.parent-bloc {
    background: var(--blanc);
    border-radius: 20px;
    padding: 1.25rem 1.5rem;
    margin: 1.25rem 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}
.parent-bloc h2 { margin-top: 0; }
.note { color: #4a4a66; }
.liste-consolider li { margin: 0.35rem 0; }

.graphique-barres {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 140px;
    padding-top: 0.5rem;
}
.barre-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 0.3rem;
}
.barre {
    width: 100%;
    max-width: 46px;
    background: linear-gradient(180deg, var(--bleu-ciel), var(--bleu-fonce));
    border-radius: 8px 8px 0 0;
    min-height: 4px;
}
.barre-etoile { background: linear-gradient(180deg, #ffe58a, var(--orange)); }
.barre-libelle { font-size: 0.7rem; color: #5a5a74; white-space: nowrap; }

.tableau-defile { overflow-x: auto; }
.tableau {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.tableau th, .tableau td {
    text-align: left;
    padding: 0.55rem 0.7rem;
    border-bottom: 2px solid #eeeaf4;
    vertical-align: top;
}
.tableau th { background: #f6f4fb; }
.ligne-inactive { opacity: 0.55; }
.actions-cellule { white-space: nowrap; }
.actions-cellule > * { display: inline-block; margin: 0.15rem 0.2rem; }
.form-inline { display: inline; }
.mini-bouton {
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: bold;
    text-decoration: none;
    background: var(--creme);
    border: 2px solid var(--bleu-ciel);
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    color: var(--texte);
    cursor: pointer;
}
.mini-bouton:hover { background: var(--jaune); }
.filtre-niveau { margin: 1rem 0; }

/* ---------- Utilitaires ---------- */
.texte-centre { text-align: center; }
.marge-haut { margin-top: 1.5rem; }

@media (max-width: 640px) {
    html { font-size: 16px; }
    .accueil-choix { flex-direction: column; align-items: center; }
    .carte-profil { width: 100%; max-width: 340px; }
}
