:root {
  --creme: #fff6e8; --blanc: #ffffff; --encre: #2d2540; --doux: #6f6785; --corail: #ff6b4a; --corail-fonce: #e5502f; --jaune: #ffc93c; --vert: #2bb673; --vert-fonce: #1c8f58;
  --violet: #6c4ab6; --bleu: #3da5ff; --rose: #ff8fb1; --rouge: #e5484d; --ligne: #f0e3cf; --ombre: 0 6px 0 rgba(45, 37, 64, .08), 0 10px 24px rgba(45, 37, 64, .08);
  --rayon: 22px; --barre-h: 66px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--creme); }
body { margin: 0; font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--encre); background:
  radial-gradient(circle at 10% -5%, #ffe0b8 0, transparent 40%), radial-gradient(circle at 100% 5%, #ffd3dd 0, transparent 35%), var(--creme); min-height: 100vh; min-height: 100dvh; font-size: 17px; line-height: 1.4;
  padding-top: env(safe-area-inset-top); }
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; }
#app.en-chargement { opacity: .7; transition: opacity .2s; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.15rem; margin-bottom: .5rem; } h3 { font-size: .95rem; color: var(--doux); }
p { margin: .4rem 0; }
a { color: var(--violet); }
button { font: inherit; color: inherit; }
.chargement { text-align: center; padding: 4rem 1rem; font-size: 1.2rem; }
.petit { font-size: .85rem; } .discret { color: var(--doux); } .centre { text-align: center; justify-content: center; }
.contenu { padding: 14px 14px calc(var(--barre-h) + 70px + env(safe-area-inset-bottom)); }
.contenu.plein { padding-bottom: 40px; }
.ecran { display: flex; flex-direction: column; gap: 14px; }
.titre-page { padding: 6px 4px 0; }
.retour { text-decoration: none; font-weight: 700; padding: 4px; align-self: flex-start; }

/* Boutons */
.btn, .gros-bouton { font-weight: 800; border: 0; border-radius: 18px; background: var(--corail); color: #fff; padding: 14px 20px; font-size: 1.05rem; cursor: pointer; box-shadow: 0 5px 0 var(--corail-fonce); text-decoration: none; text-align: center; display: inline-block; transition: transform .08s, box-shadow .08s; }
.btn:active, .gros-bouton:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--corail-fonce); }
.btn:disabled { background: #d9d2c6; box-shadow: 0 5px 0 #bfb7a8; color: #8a8374; cursor: not-allowed; }
.btn-large { width: 100%; display: block; padding: 16px; font-size: 1.15rem; }
.btn-petit { padding: 8px 14px; font-size: .9rem; border-radius: 14px; box-shadow: 0 3px 0 var(--corail-fonce); }
.btn-doux { background: var(--blanc); color: var(--encre); box-shadow: 0 5px 0 var(--ligne); border: 2px solid var(--ligne); }
.btn-danger { background: var(--rouge); box-shadow: 0 3px 0 #b3282d; }
.lien-bouton { background: none; border: 0; text-decoration: underline; color: var(--doux); cursor: pointer; padding: 8px; font-size: .9rem; }
.rangee { display: flex; gap: 10px; flex-wrap: wrap; } .colonne { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.gros-bouton { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 26px; background: linear-gradient(135deg, #ff6b4a, #ff9a3c); box-shadow: 0 7px 0 #d94a2a, 0 14px 24px rgba(255, 107, 74, .35); color: #fff; }
.gb-emoji { font-size: 2.6rem; } .gb-texte { flex: 1; text-align: left; display: flex; flex-direction: column; font-size: 1.35rem; } .gb-texte small { font-weight: 600; font-size: .9rem; opacity: .95; } .gb-fleche { font-size: 1.4rem; }

/* Cartes */
.carte-blanche, .tuile, .carte-niveau, .menu { background: var(--blanc); border-radius: var(--rayon); padding: 16px; box-shadow: var(--ombre); }
.carte-niveau { background: linear-gradient(135deg, #7c5cd6, #a678f0); color: #fff; }
.carte-niveau .petit { color: rgba(255, 255, 255, .9); } .carte-niveau .discret { color: rgba(255, 255, 255, .8); }
.niveau-ligne { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; } .niveau-emoji { font-size: 2.6rem; background: rgba(255, 255, 255, .2); border-radius: 50%; width: 64px; height: 64px; display: grid; place-items: center; }
.niveau-nom { font-size: 1.35rem; font-weight: 900; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .tuile { text-align: center; } .tuile .gros { font-size: 1.9rem; font-weight: 900; } .tuile.serie.faite { background: linear-gradient(160deg, #fff, #ffe9b8); }
.ligne-espacee { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.entete-accueil { display: flex; align-items: flex-end; gap: 10px; padding: 6px 4px 0; }
.mascotte { font-size: 3.4rem; animation: sautille 2.4s ease-in-out infinite; } .mascotte.grande { font-size: 5rem; text-align: center; }
.bulle { background: var(--blanc); padding: 10px 14px; border-radius: 18px 18px 18px 4px; box-shadow: var(--ombre); display: flex; flex-direction: column; font-size: .95rem; }
@keyframes sautille { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }

/* Barres */
.barre { height: 14px; background: rgba(45, 37, 64, .1); border-radius: 99px; overflow: hidden; }
.barre span { display: block; height: 100%; width: var(--p, 0%); border-radius: 99px; background: linear-gradient(90deg, var(--corail), var(--jaune)); transition: width .6s cubic-bezier(.2, .9, .3, 1.2); }
.barre-niveau span { background: linear-gradient(90deg, var(--jaune), #ffe27a); } .barre-ok span { background: linear-gradient(90deg, var(--vert), #6be0a3); } .barre-recompense span { background: linear-gradient(90deg, #ff8fb1, var(--corail)); } .barre-jour span { background: linear-gradient(90deg, var(--bleu), #7fd0ff); }
.barre-temps { height: 10px; margin: 0 4px; } .barre-temps span { transition: none; background: linear-gradient(90deg, var(--rouge), var(--jaune)); }
.barre-quiz { flex: 1; }
.puces { display: flex; flex-wrap: wrap; gap: 8px; } .puce, .chip { display: inline-block; background: #f4ecff; color: var(--violet); border-radius: 99px; padding: 6px 12px; font-weight: 700; font-size: .9rem; text-decoration: none; }
.puce-lien { background: #fff1e6; color: var(--corail-fonce); } .chip-pt { background: #e2f8ec; color: var(--vert-fonce); } .chip-or { background: #fff3c9; color: #9a6b00; } .chip-feu { background: #ffe3dc; color: var(--corail-fonce); }
.pastille { display: inline-block; background: #fff1e6; color: var(--corail-fonce); border-radius: 99px; padding: 4px 12px; font-weight: 800; font-size: .8rem; }
.a-confirmer { display: inline-block; background: #fff3c9; color: #8a5a00; border: 2px dashed #f0c04a; border-radius: 12px; padding: 6px 10px; font-weight: 700; font-size: .9rem; }

/* Carte du menu */
.menu { padding: 16px 12px; } .menu-tete { display: flex; justify-content: space-between; align-items: baseline; } .menu-tete h2 { font-size: 1.4rem; margin: 0; }
.prix { background: var(--jaune); border-radius: 99px; padding: 4px 12px; font-weight: 900; }
.liste-plats { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.plat-carte { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; background: #fffaf2; border: 2px solid var(--ligne); border-radius: 18px; padding: 10px; }
.plat-carte:active { transform: scale(.985); }
.num { background: var(--corail); color: #fff; font-weight: 900; border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center; flex: none; font-size: .9rem; }
.plat-emoji { font-size: 1.8rem; } .plat-texte { flex: 1; display: flex; flex-direction: column; min-width: 0; } .plat-texte small { color: var(--doux); font-size: .78rem; }
.anneau { flex: none; min-width: 46px; text-align: center; font-weight: 800; font-size: .8rem; background: #f1ece2; border-radius: 99px; padding: 4px 6px; } .anneau.ok { background: #e2f8ec; font-size: 1.1rem; }
.menu-vide { background: transparent; border: 3px dashed var(--ligne); box-shadow: none; } .autre-menu { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; align-items: flex-start; }

/* Fiches */
.hero-fiche { text-align: center; background: linear-gradient(160deg, #fff, #ffe6d1); border-radius: 28px; padding: 18px 14px; box-shadow: var(--ombre); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hero-emoji { font-size: 4.2rem; animation: sautille 3s ease-in-out infinite; }
.carte-menu { background: #2d2540; color: #fff6e8; border-radius: var(--rayon); padding: 16px; box-shadow: var(--ombre); } .carte-menu h2 { color: var(--jaune); }
.ardoise { font-family: "Iowan Old Style", Georgia, "Times New Roman", serif; font-size: 1.15rem; line-height: 1.6; margin: .3rem 0; }
.carte-menu .discret { color: #c5bdd8; }
.champ { margin-bottom: 12px; } .champ:last-child { margin-bottom: 0; } .champ h3 { margin-bottom: 4px; } .valeur { margin: 0; font-size: 1.02rem; white-space: pre-wrap; }
.encart-general { background: #f3f3f6; border: 2px dashed #bdb8cf; border-radius: var(--rayon); padding: 14px; } .encart-general h2 { font-size: 1rem; color: var(--doux); }
.liste-simple { display: flex; flex-direction: column; gap: 10px; } .ligne-lien { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: #fffaf2; border: 2px solid var(--ligne); border-radius: 14px; padding: 10px 12px; } .ligne-lien small { color: var(--doux); }

/* Jeux */
.grille-jeux { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.jeu-carte { background: var(--blanc); border-radius: var(--rayon); padding: 14px 12px; box-shadow: var(--ombre); text-decoration: none; color: var(--encre); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-height: 150px; position: relative; }
.jeu-carte:nth-child(3n+1) { background: linear-gradient(160deg, #fff, #ffe7df); } .jeu-carte:nth-child(3n+2) { background: linear-gradient(160deg, #fff, #e3f6ec); } .jeu-carte:nth-child(3n) { background: linear-gradient(160deg, #fff, #ece4ff); }
.jeu-chrono { background: linear-gradient(160deg, #2d2540, #4a3a73) !important; color: #fff; grid-column: 1 / -1; min-height: 0; } .jeu-chrono small { color: #d6cdf0; }
.jeu-emoji { font-size: 2.2rem; } .jeu-carte small { color: var(--doux); font-size: .8rem; line-height: 1.25; } .compteur { margin-top: auto; background: var(--corail); color: #fff; font-weight: 800; border-radius: 99px; padding: 3px 10px; font-size: .78rem; } .compteur.doux { background: #eee6d8; color: var(--doux); }

/* Quiz */
.ecran-quiz { gap: 12px; padding-top: 4px; } .quiz-entete { display: flex; align-items: center; gap: 10px; } .quiz-quitter { border: 0; background: var(--blanc); border-radius: 50%; width: 40px; height: 40px; font-size: 1.1rem; box-shadow: var(--ombre); cursor: pointer; } .quiz-compteur { font-weight: 800; min-width: 44px; text-align: right; }
.quiz-theme { text-align: center; font-weight: 800; color: var(--violet); }
.quiz-question { background: var(--blanc); border-radius: 26px; padding: 16px; box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 12px; transition: background .3s; }
.quiz-question.bravo { background: #eafaf1; } .quiz-question.rate { background: #fff0ee; animation: secoue .4s; }
@keyframes secoue { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.prompt { font-size: 1.2rem; } .affirmation { margin: 0; font-size: 1.25rem; font-weight: 700; padding: 14px; background: #f4ecff; border-radius: 18px; border-left: 6px solid var(--violet); }
.reponses { display: grid; gap: 10px; } .duo-vf { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reponse { text-align: left; border: 3px solid var(--ligne); background: #fffaf2; border-radius: 18px; padding: 14px; font-size: 1.05rem; font-weight: 700; cursor: pointer; box-shadow: 0 4px 0 var(--ligne); min-height: 54px; }
.reponse:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ligne); }
.duo-vf .reponse { text-align: center; font-size: 1.3rem; padding: 22px 8px; } .vrai { border-color: #b9ecd0; } .faux-btn { border-color: #ffd0cc; }
.reponse.juste { background: #d7f5e5; border-color: var(--vert); box-shadow: 0 4px 0 var(--vert-fonce); } .reponse.faux { background: #ffdcd8; border-color: var(--rouge); box-shadow: 0 4px 0 #b3282d; }
.reponse:disabled { cursor: default; opacity: 1; color: inherit; }
.trou { display: inline-block; min-width: 4.5rem; border-bottom: 4px solid var(--corail); color: var(--corail); text-align: center; font-weight: 900; }
.indices { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 6px; } .indices li { background: #fff3c9; border-radius: 12px; padding: 8px 10px; list-style-position: inside; }
.emplacements { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: rang; } .emplacements li { counter-increment: rang; display: flex; gap: 8px; align-items: center; } .emplacements li::before { content: counter(rang); background: var(--corail); color: #fff; font-weight: 900; border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center; flex: none; }
.emplacements .vide span { flex: 1; border: 3px dashed var(--ligne); border-radius: 18px; padding: 12px; color: var(--doux); } .emplacements .rempli .reponse { flex: 1; background: #fff3c9; border-color: var(--jaune); }
.quiz-retour { display: flex; flex-direction: column; gap: 12px; } .retour-carte { border-radius: 20px; padding: 14px; } .retour-carte.ok { background: #d7f5e5; } .retour-carte.ko { background: #ffdcd8; }
.retour-carte strong { font-size: 1.1rem; }
.bilan { text-align: center; padding-top: 24px; display: flex; flex-direction: column; gap: 10px; align-items: center; } .bilan-emoji { font-size: 5rem; animation: sautille 1.5s infinite; } .bilan h1 { font-size: 3rem; } .bilan-message { font-size: 1.25rem; font-weight: 800; }
.niveau-up { background: linear-gradient(135deg, var(--jaune), var(--corail)); color: #fff; font-weight: 900; padding: 12px 18px; border-radius: 18px; font-size: 1.15rem; }
.bilan .colonne { width: 100%; }

/* Récompenses et badges */
.recompense { display: flex; justify-content: space-between; align-items: center; gap: 10px; } .recompense > div:first-child { display: flex; flex-direction: column; } .recompense small { color: var(--doux); }
.ligne-echange { display: flex; flex-direction: column; gap: 2px; } .statut { font-weight: 800; font-size: .85rem; } .statut-valide { color: var(--vert-fonce); } .statut-refuse { color: var(--rouge); } .statut-en_attente { color: #9a6b00; }
.grille-badges { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .badge { background: #f1ece2; border-radius: 18px; padding: 12px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; filter: grayscale(.9); opacity: .65; }
.badge.gagne { background: linear-gradient(160deg, #fff7d6, #ffe1a0); filter: none; opacity: 1; box-shadow: 0 4px 0 #f0c04a; } .badge-emoji { font-size: 2.2rem; } .badge small { font-size: .72rem; color: var(--doux); line-height: 1.2; }
.echelle { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; } .echelle li { padding: 8px 12px; border-radius: 12px; background: #f1ece2; } .echelle .passe { background: #e2f8ec; } .echelle .actuel { background: var(--jaune); font-weight: 900; } .echelle small { color: var(--doux); font-weight: 500; }

/* Navigation */
.onglets-bas { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 2px solid var(--ligne); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 5; }
.onglets-bas a { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 0; text-decoration: none; color: var(--doux); font-size: .72rem; font-weight: 800; padding: 6px 2px; border-radius: 14px; }
.onglets-bas .onglet-emoji { font-size: 1.5rem; filter: grayscale(.8); } .onglets-bas a.actif { color: var(--corail-fonce); background: #fff1e6; } .onglets-bas a.actif .onglet-emoji { filter: none; }
.onglets-bas.admin a { font-size: .66rem; }
.pied { text-align: center; margin-top: 18px; }
.bandeau-admin { display: flex; justify-content: space-between; align-items: center; background: var(--encre); color: #fff; padding: 8px 14px; font-weight: 800; position: sticky; top: 0; z-index: 4; } .bandeau-admin .lien-bouton { color: #d6cdf0; }

/* Connexion */
.ecran-connexion { justify-content: center; min-height: 100dvh; padding: 20px; } .connexion { background: var(--blanc); border-radius: 28px; padding: 22px; box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 14px; text-align: center; }
.connexion label { text-align: left; display: flex; flex-direction: column; gap: 4px; font-weight: 800; font-size: .9rem; color: var(--doux); }
input, textarea { font: inherit; border: 3px solid var(--ligne); border-radius: 16px; padding: 12px 14px; background: #fffaf2; color: var(--encre); width: 100%; }
input:focus, textarea:focus { outline: none; border-color: var(--corail); }
.erreur { color: var(--rouge); font-weight: 800; min-height: 1.4em; margin: 0; }

/* Admin */
.ecran-admin { gap: 14px; } .grille-kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .kpi { background: var(--blanc); border-radius: 18px; padding: 12px; box-shadow: var(--ombre); } .kpi-emoji { font-size: 1.4rem; } .kpi-valeur { font-size: 1.5rem; font-weight: 900; line-height: 1.1; }
.point { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #c9c1d6; margin-right: 6px; } .point.en-ligne { background: var(--vert); animation: pulse 1.4s infinite; } @keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(43, 182, 115, 0); } 0% { box-shadow: 0 0 0 0 rgba(43, 182, 115, .5); } }
.alerte { display: block; background: var(--jaune); border-radius: 16px; padding: 12px 14px; font-weight: 800; text-decoration: none; color: var(--encre); box-shadow: var(--ombre); }
.histogramme { display: flex; align-items: flex-end; gap: 3px; height: 140px; } .colonne-histo { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 2px; } .histo-barre { width: 100%; min-height: 3px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--corail), var(--jaune)); height: var(--p, 0%); max-height: calc(100% - 38px); } .histo-valeur { font-size: .65rem; font-weight: 800; min-height: 1em; } .histo-jour { font-size: .55rem; color: var(--doux); writing-mode: vertical-rl; transform: rotate(180deg); height: 30px; }
.boites { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; align-items: end; } .boite { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; } .boite-n { font-weight: 900; } .boite-barre { width: 100%; min-height: 6px; height: calc(var(--p, 0%) * 0.8 + 6px); border-radius: 8px 8px 0 0; background: var(--violet); } .boite-barre.b0 { background: #cfc8dd; } .boite-barre.b5 { background: var(--vert); } .boite .petit { font-size: .7rem; }
.ligne-rep { display: flex; gap: 10px; align-items: flex-start; } .ligne-rep > div { display: flex; flex-direction: column; min-width: 0; } .ligne-rep small { color: var(--doux); } .ligne-rep span:not(.ok-pastille):not(.ko-pastille) { font-size: .88rem; }
.ok-pastille, .ko-pastille { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: .8rem; } .ok-pastille { background: var(--vert); } .ko-pastille { background: var(--rouge); }
.echec { color: var(--rouge); } .ligne-progres { display: flex; flex-direction: column; gap: 4px; }
.onglets { display: flex; gap: 8px; } .onglet { flex: 1; border: 2px solid var(--ligne); background: var(--blanc); border-radius: 14px; padding: 10px; font-weight: 800; cursor: pointer; } .onglet.actif { background: var(--corail); color: #fff; border-color: var(--corail); }
.fiche-entete { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 0; background: none; text-align: left; font-weight: 800; cursor: pointer; padding: 0; } .reste { font-size: .75rem; border-radius: 99px; padding: 3px 10px; white-space: nowrap; } .reste.a-faire { background: #fff3c9; color: #8a5a00; } .reste.fini { background: #e2f8ec; color: var(--vert-fonce); }
.formulaire { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; } .champ-edit { display: flex; flex-direction: column; gap: 4px; font-weight: 800; font-size: .9rem; } .champ-edit span { color: var(--doux); } .case { display: flex; align-items: center; gap: 8px; font-weight: 700; } .case input { width: 22px; height: 22px; }
.notes { background: #fff3c9; border-radius: 12px; padding: 8px 12px; }
textarea { resize: vertical; min-height: 60px; }

/* Modale et toasts */
.fond-modal { position: fixed; inset: 0; background: rgba(45, 37, 64, .55); display: grid; place-items: center; z-index: 20; padding: 20px; } .modal { background: var(--blanc); border-radius: 24px; padding: 20px; max-width: 360px; width: 100%; display: flex; flex-direction: column; gap: 10px; } .modal .rangee { justify-content: flex-end; margin-top: 8px; }
.toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translate(-50%, -140%); background: var(--encre); color: #fff; padding: 12px 18px; border-radius: 99px; font-weight: 800; z-index: 30; transition: transform .3s; max-width: 92vw; text-align: center; box-shadow: var(--ombre); } .toast.visible { transform: translate(-50%, 0); } .toast-succes { background: var(--vert-fonce); } .toast-erreur { background: var(--rouge); }
#confettis { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 40; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (min-width: 700px) { body { font-size: 18px; } .onglets-bas { max-width: 560px; left: 50%; transform: translateX(-50%); border-radius: 22px 22px 0 0; } }
