/* ============================================================
   GRIBOU — Style enfantin, colore, rond, tout au doigt
   Mobile-first : telephone d'abord, tablette ensuite
   ============================================================ */

@font-face {
  font-family: 'Fredoka';
  src: url('../assets/Fredoka-Variable.ttf') format('truetype');
  font-weight: 300 900;
  font-stretch: 75% 125%;
  font-display: swap;
}

:root {
  --primaire: #FF6B6B;
  --secondaire: #4ECDC4;
  --tertiaire: #FFE66D;
  --fond: #FFF8F0;
  --texte: #2D3047;
  --texte-clair: #6B6B8D;
  --succes: #51CF66;
  --avertissement: #FF922B;
  --mascotte-couleur: #FFB347;
  --mascotte-secondaire: #FFD699;
  --ombre-douce: 0 4px 15px rgba(0,0,0,0.10);
  --ombre-forte: 0 6px 25px rgba(0,0,0,0.15);
  --arrondi: 20px;
  --arrondi-petit: 12px;
  --gros-bouton: 56px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Fredoka', 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background: var(--fond);
  color: var(--texte);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* ===== ECRANS ===== */
.screen {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0; left: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.screen.active { display: flex; flex-direction: column; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.1); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes pop {
  0% { transform: scale(0); }
  80% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== TRANSITIONS DOUCES ===== */
.screen {
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.screen:not(.active) {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}
.screen.active {
  opacity: 1;
  transform: translateY(0);
}

.transition-fade-in {
  animation: fadeTransition 0.4s ease forwards;
}
.transition-slide-right {
  animation: slideRightTransition 0.35s ease forwards;
}
.transition-slide-left {
  animation: slideLeftTransition 0.35s ease forwards;
}
.transition-bounce-in {
  animation: bounceTransition 0.5s ease forwards;
}

@keyframes fadeTransition {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideRightTransition {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideLeftTransition {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes bounceTransition {
  0% { opacity: 0; transform: scale(0.92); }
  60% { opacity: 1; transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

/* Bouton audio haut-parleur (pour non-lecteurs) */
.gribou-btn-audio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.90);
  font-size: 17px;
  cursor: pointer;
  padding: 0;
  margin: 0 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: all 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  vertical-align: middle;
  line-height: 1;
}
.gribou-btn-audio:active {
  transform: scale(0.90);
  background: #FFF0E0;
  box-shadow: 0 2px 8px rgba(255,107,107,0.25);
}
.gribou-avec-audio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}

/* ===== BOUTON MUTE ===== */
.btn-mute {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: 2px solid rgba(0,0,0,0.08);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  transition: all 0.2s ease;
  touch-action: manipulation;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  /* Not safe-area-aware by default, bottom 20px should clear most notches */
  padding: 0;
}
.btn-mute:active {
  transform: scale(0.90);
}
.btn-mute:hover {
  background: rgba(255,255,255,0.95);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* ===== ELEMENTS FLOTTANTS MAISON ===== */
.fond-flottant {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.flottant-el {
  position: absolute;
  animation: flotter 14s ease-in-out infinite;
  opacity: 0.35;
  will-change: transform;
}
@keyframes flotter {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-12px) rotate(3deg); }
  50% { transform: translateY(-6px) rotate(-2deg); }
  75% { transform: translateY(-10px) rotate(2deg); }
}

/* La grille d univers et le header sont au-dessus */
#screen-maison .maison-header,
#screen-maison .maison-info-rapide,
#screen-maison .grille-univers,
#screen-maison .maison-jardin {
  position: relative;
  z-index: 1;
}

/* ===== ECRAN ACCUEIL ===== */
#screen-accueil {
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #FF6B6B 0%, #FFE66D 50%, #4ECDC4 100%);
}
.accueil-content {
  text-align: center;
  padding: 30px 20px;
}
.accueil-mascotte {
  font-size: 100px;
  animation: float 3s ease-in-out infinite;
  margin-bottom: 10px;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.15));
}
.mascotte-img-accueil {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255,255,255,0.40);
  padding: 12px;
  display: block;
}
.mascotte-img-maison {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 50%;
  background: var(--fond);
  padding: 4px;
  display: block;
}
.accueil-titre {
  font-size: 48px;
  font-weight: 900;
  color: white;
  text-shadow: 3px 3px 0 rgba(0,0,0,0.10);
  margin: 0;
  letter-spacing: -1px;
}
.accueil-sous-titre {
  font-size: 18px;
  color: rgba(255,255,255,0.90);
  margin: 8px 0 30px;
  font-weight: 500;
}

/* ===== BOUTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--arrondi);
  padding: 14px 28px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
  min-height: var(--gros-bouton);
  box-shadow: var(--ombre-douce);
}
.btn:active { transform: scale(0.95); }
.btn-primary {
  background: var(--primaire);
  color: white;
}
.btn-secondary {
  background: var(--secondaire);
  color: white;
}
.btn-tertiaire {
  background: var(--tertiaire);
  color: var(--texte);
}
.btn-mascotte {
  background: var(--mascotte-couleur);
  color: white;
}
.btn-small {
  padding: 10px 18px;
  font-size: 14px;
  min-height: 40px;
  border-radius: var(--arrondi-petit);
}
.btn-round {
  width: var(--gros-bouton);
  height: var(--gros-bouton);
  border-radius: 50%;
  padding: 0;
  font-size: 24px;
}
.btn-large {
  padding: 18px 40px;
  font-size: 22px;
  min-height: 64px;
}

/* ===== ECRAN CHOIX PROFIL ===== */
#screen-choix-profil {
  background: var(--fond);
  padding: 20px;
}
.choix-profil-header {
  text-align: center;
  padding: 20px 0 10px;
}
.choix-profil-header h2 { margin: 0; font-size: 24px; color: var(--texte); }
.choix-profil-header p { margin: 5px 0 0; color: var(--texte-clair); font-size: 16px; }
.liste-profils {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 0;
  overflow-y: auto;
}
.carte-profil {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border-radius: var(--arrondi);
  padding: 16px 20px;
  box-shadow: var(--ombre-douce);
  cursor: pointer;
  transition: all 0.2s;
  border: 3px solid transparent;
}
.carte-profil:active { transform: scale(0.97); border-color: var(--primaire); }
.carte-profil-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.carte-profil-info { flex: 1; }
.carte-profil-info h3 { margin: 0; font-size: 18px; }
.carte-profil-info p { margin: 2px 0 0; font-size: 14px; color: var(--texte-clair); }
.bouton-ajouter {
  margin-top: auto;
  padding: 16px;
  background: var(--secondaire);
  color: white;
  border: none;
  border-radius: var(--arrondi);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--ombre-douce);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--gros-bouton);
}
.bouton-ajouter:active { transform: scale(0.97); }

/* ===== ECRAN CREATION PROFIL ===== */
#screen-creation-profil {
  background: var(--fond);
  padding: 20px;
  justify-content: flex-start;
}
.creation-header {
  text-align: center;
  padding: 10px 0;
}
.creation-header h2 { margin: 0; font-size: 24px; }
.form-groupe {
  margin: 16px 0;
}
.form-groupe label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--texte);
  font-size: 16px;
}
.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 3px solid #E8E8E8;
  border-radius: var(--arrondi-petit);
  font-size: 18px;
  outline: none;
  transition: border-color 0.2s;
  background: white;
}
.form-input:focus { border-color: var(--secondaire); }
.selecteur-avatar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.avatar-option {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  border: 3px solid #E8E8E8;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}
.avatar-option.selected { border-color: var(--secondaire); transform: scale(1.1); }
.selecteur-age {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.age-option {
  flex: 1;
  min-width: 70px;
  padding: 14px 8px;
  border: 3px solid #E8E8E8;
  border-radius: var(--arrondi-petit);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  font-weight: 600;
  touch-action: manipulation;
  position: relative;
  z-index: 2;
}
.age-option.selected {
  border-color: var(--secondaire);
  background: #E8FFF8;
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.3);
  transform: scale(1.02);
}
.age-option:active { transform: scale(0.95); background: #F0F8F0; }
.age-option .age-icone { font-size: 24px; display: block; margin-bottom: 4px; }
.age-option .age-nom { font-size: 12px; color: var(--texte-clair); }
.creation-boutons {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding: 16px 0;
}
.creation-boutons .btn { flex: 1; }

/* ===== ECRAN MAISON ===== */
#screen-maison {
  background: linear-gradient(180deg, #87CEEB 0%, #E0F7FA 40%, var(--fond) 40%);
}
.maison-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 8px;
}
.maison-mascotte {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--mascotte-couleur);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  box-shadow: var(--ombre-douce);
  animation: float 3s ease-in-out infinite;
}
.maison-mascotte-talk {
  flex: 1;
  background: white;
  border-radius: var(--arrondi);
  padding: 10px 16px;
  font-size: 15px;
  box-shadow: var(--ombre-douce);
  position: relative;
  color: var(--texte);
}
.maison-mascotte-talk::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 20px;
  border: 8px solid transparent;
  border-right-color: white;
}
.grille-univers {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 16px;
  overflow-y: auto;
  align-content: start;
}
.tuile-univers {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  aspect-ratio: 1;
  border-radius: var(--arrondi);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--ombre-douce);
  padding: 16px;
  text-align: center;
  min-height: 120px;
  border: none;
  color: white;
  font-weight: 700;
  font-size: 15px;
  touch-action: manipulation;
}
.tuile-univers:active { transform: scale(0.95); }
.tuile-univers .tuile-icone { font-size: 42px; }
.tuile-univers .tuile-nom { font-size: 14px; }
.tuile-univers .tuile-badge {
  font-size: 11px;
  background: rgba(255,255,255,0.30);
  padding: 2px 10px;
  border-radius: 10px;
}
.tuile-univers.bientot { opacity: 0.70; }

/* Jardin en bas */
.maison-jardin {
  background: #90EE90;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  border-top: 3px solid #7CCD7C;
}
.jardin-label { font-size: 13px; font-weight: 600; color: #2D5016; flex-shrink: 0; }
.jardin-plantes {
  display: flex;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  font-size: 20px;
  padding: 2px 0;
}

/* ===== ECRAN UNIVERS (page interieure) ===== */
#screen-univers {
  background: var(--fond);
}
.univers-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.btn-retour {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  border: none;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--ombre-douce);
  cursor: pointer;
  flex-shrink: 0;
}
.btn-retour:active { transform: scale(0.90); }
.univers-titre {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}

/* ===== ECRAN ATELIER CREATIF ===== */
#screen-atelier {
  background: white;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
#screen-atelier.active {
  display: flex;
}
.atelier-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 2px solid #F0F0F0;
  flex-shrink: 0;
}
.atelier-titre {
  flex: 1;
  font-weight: 700;
  font-size: 16px;
  margin: 0;
}
.atelier-outils {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 2px solid #F0F0F0;
  flex-shrink: 0;
  overflow-x: auto;
}
.outil-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #E0E0E0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
  background: white;
  flex-shrink: 0;
}
.outil-btn.active { border-color: var(--secondaire); background: #E8FFF8; transform: scale(1.1); }
.outil-btn:active { transform: scale(0.90); }
.palette-couleurs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 12px;
}
.couleur-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.couleur-btn.active { border-color: var(--texte); transform: scale(1.15); }
.atelier-canvas-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  overflow: hidden;
}
.atelier-canvas {
  border: 3px solid #E0E0E0;
  border-radius: var(--arrondi-petit);
  background: white;
  touch-action: none;
}
.atelier-actions {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  flex-shrink: 0;
  overflow-x: auto;
  border-top: 2px solid #F0F0F0;
}

/* ===== FABRIQUE D HISTOIRES ===== */
#screen-fabrique {
  background: linear-gradient(180deg, #FFF8F0 0%, white 100%);
}
.fabrique-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--fond);
}
.fabrique-titre {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  flex: 1;
}
.bulle-mascotte {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 16px 12px;
  background: white;
  border-radius: var(--arrondi);
  padding: 12px 16px;
  box-shadow: var(--ombre-douce);
}
.bulle-mascotte-icone { font-size: 36px; flex-shrink: 0; }
.bulle-mascotte-texte { font-size: 16px; font-weight: 600; flex: 1; }

.fabrique-choix {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 12px;
}
.fabrique-choix h3 {
  font-size: 16px;
  margin: 12px 0 8px;
  font-weight: 700;
}
.fabrique-choix-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.fabrique-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: white;
  border-radius: var(--arrondi-petit);
  border: 2px solid #E8E8E8;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
  font-weight: 600;
}
.fabrique-option:active { transform: scale(0.95); }
.fabrique-option.selected { border-color: var(--secondaire); background: #E8FFF8; }
.fo-icone { font-size: 22px; }

.fabrique-generer {
  padding: 12px 16px 20px;
  flex-shrink: 0;
}

.fabrique-histoire {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
}
.fabrique-histoire-contenu {
  background: white;
  border-radius: var(--arrondi);
  padding: 20px;
  box-shadow: var(--ombre-douce);
  margin-bottom: 16px;
}
.histoire-illustration {
  text-align: center;
  font-size: 40px;
  margin: 8px 0;
}
.fabrique-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 16px;
  padding: 60px 20px;
  color: var(--texte-clair);
  font-size: 16px;
}
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #E8E8E8;
  border-top-color: var(--mascotte-couleur);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== MODE CHOIX (HISTOIRE INTERACTIVE) ===== */
.choix-aventure {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 20px;
  display: flex;
  flex-direction: column;
}
.choix-aventure-etape {
  text-align: center;
  font-size: 13px;
  color: var(--texte-clair);
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.choix-aventure-texte {
  background: white;
  border-radius: var(--arrondi);
  padding: 20px;
  font-size: 17px;
  line-height: 1.7;
  box-shadow: var(--ombre-douce);
  margin-bottom: 16px;
  white-space: pre-wrap;
}
.choix-aventure-boutons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.choix-btn {
  background: var(--mascotte-couleur);
  color: white;
  font-size: 16px;
  padding: 16px 20px;
  border-radius: var(--arrondi);
  border: none;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--ombre-douce);
  transition: all 0.2s;
  text-align: left;
  min-height: 56px;
  line-height: 1.3;
}
.choix-btn:active { transform: scale(0.97); }
.choix-btn:first-of-type {
  background: var(--secondaire);
}
.choix-btn:last-of-type {
  background: var(--mascotte-couleur);
}
.choix-aventure-fin-icone {
  text-align: center;
  font-size: 64px;
  margin: 16px 0;
  animation: bounceIn 0.6s ease;
}

/* ===== LIVRE (BIBLIOTHEQUE) ===== */
.livre-compteur {
  text-align: center;
  font-size: 14px;
  color: var(--texte-clair);
  font-weight: 600;
  padding: 4px 16px 12px;
}
.livre-liste {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.livre-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border-radius: var(--arrondi-petit);
  padding: 14px 16px;
  box-shadow: var(--ombre-douce);
  transition: all 0.15s;
  min-height: 72px;
}
.livre-item:active { transform: scale(0.98); }
.livre-item-icone {
  font-size: 32px;
  flex-shrink: 0;
  width: 44px;
  text-align: center;
}
.livre-item-info {
  flex: 1;
  min-width: 0;
}
.livre-item-titre {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
  text-transform: capitalize;
}
.livre-item-extrait {
  font-size: 13px;
  color: var(--texte-clair);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.livre-item-date {
  font-size: 11px;
  color: #AAA;
  margin-top: 2px;
}
.livre-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ===== COMPTE ENFANT ===== */
#screen-compte-enfant {
  background: var(--fond);
}
.compte-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--fond);
  border-bottom: 2px solid #F0F0F0;
}
.compte-header-titre {
  flex: 1;
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}
.compte-carte-identite {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: white;
  margin: 0 16px 16px;
  border-radius: var(--arrondi);
  box-shadow: var(--ombre-douce);
}
.compte-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  flex-shrink: 0;
  box-shadow: var(--ombre-douce);
}
.compte-info { flex: 1; }
.compte-info h2 { margin: 0; font-size: 20px; }
.compte-info p { margin: 4px 0 0; font-size: 14px; color: var(--texte-clair); }
.compte-section {
  padding: 12px 16px;
  border-bottom: 2px solid #F0F0F0;
}
.compte-section-titre {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}
.compte-badges-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.compte-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px;
  background: #FFF8F0;
  border-radius: var(--arrondi-petit);
  min-width: 60px;
}
.compte-badge-icone { font-size: 28px; }
.compte-badge-nom { font-size: 11px; font-weight: 600; text-align: center; color: var(--texte-clair); }
.compte-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.compte-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.compte-stat strong { font-size: 18px; }
.compte-creations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.compte-creation-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
  background: linear-gradient(135deg, #FFF8F0, #FFF0E0);
}
.compte-creation-histoire-icone {
  font-size: 30px;
  margin-bottom: 4px;
}
.compte-creation-histoire-titre {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}
.compte-creation-histoire-extrait {
  font-size: 9px;
  color: var(--texte-clair);
  margin-top: 2px;
  line-height: 1.2;
}
.compte-etoile-section {
  background: linear-gradient(135deg, #FFF8E0, #FFF0C0);
  border-bottom: none;
}
.compte-etoile-du-jour {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.compte-etoile-icone {
  font-size: 32px;
  flex-shrink: 0;
  animation: float 3s ease-in-out infinite;
}
.compte-etoile-texte {
  font-size: 14px;
  font-style: italic;
  color: var(--texte);
  line-height: 1.4;
}
.compte-actions {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  flex-direction: column;
}
.compte-avatar-grand {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  flex-shrink: 0;
  box-shadow: var(--ombre-forte);
}
.compte-nom-age {
  flex: 1;
}
.compte-nom-age h2 {
  margin: 0;
  font-size: 22px;
}
.compte-nom-age p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--texte-clair);
}
.compte-humeur {
  text-align: center;
  padding: 8px 0;
}
.compte-humeur-emoji {
  font-size: 40px;
  margin-bottom: 4px;
}
.compte-titre {
  flex: 1;
  font-weight: 800;
  font-size: 20px;
  margin: 0;
}
.compte-vide {
  text-align: center;
  padding: 30px 20px;
  color: var(--texte-clair);
  font-size: 16px;
}
.compte-stat-puce {
  color: var(--mascotte-couleur);
  margin-right: 4px;
}
.compte-stat-valeur {
  font-weight: 700;
  font-size: 16px;
}
.compte-stats-ligne {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 4px 0;
}
.compte-section-titre {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Badges et récompenses */
.badges-grille {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.badge-carte {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  background: white;
  border-radius: var(--arrondi-petit);
  box-shadow: var(--ombre-douce);
  min-width: 64px;
}
.badge-emoji { font-size: 30px; }
.badge-nom { font-size: 11px; font-weight: 600; text-align: center; }
.badge-date { font-size: 10px; color: var(--texte-clair); }
.badge-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.badge-progress-emoji { font-size: 24px; }
.badge-progress-nom { flex: 1; font-size: 14px; font-weight: 600; }
.badge-progress-info { flex: 1; }
.badge-progress-bar-bg {
  height: 8px;
  background: #E8E8E8;
  border-radius: 4px;
  overflow: hidden;
}
.badge-progress-bar-fill {
  height: 100%;
  background: var(--mascotte-couleur);
  border-radius: 4px;
  transition: width 0.5s ease;
}
.badge-progress-chiffres {
  font-size: 12px;
  color: var(--texte-clair);
  margin-left: 8px;
  white-space: nowrap;
}
.coffre-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--fond);
}
.coffre-titre {
  flex: 1;
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}
.coffre-section {
  padding: 12px 16px;
}
.coffre-section-titre {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}
.coffre-grille {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.coffre-vide {
  text-align: center;
  padding: 30px;
  color: var(--texte-clair);
}
.objet-emoji { font-size: 28px; }
.objet-nom { font-size: 11px; font-weight: 600; text-align: center; }
.save-celebration-titre {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}
.save-celebration-sous-titre {
  font-size: 16px;
  color: var(--texte-clair);
  margin-bottom: 16px;
}
.save-celebration-icone {
  font-size: 60px;
  margin-bottom: 12px;
}
.confettis-titre {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}
.confettis-icone {
  font-size: 40px;
  animation: float 2s ease-in-out infinite;
}
.prochains-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0;
}
.suivi-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--fond);
}
.suivi-titre {
  flex: 1;
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}
.suivi-section {
  padding: 12px 16px;
  border-bottom: 2px solid #F0F0F0;
}
.suivi-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.suivi-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 16px;
  background: white;
  border-radius: var(--arrondi-petit);
  box-shadow: var(--ombre-douce);
  flex: 1;
  min-width: 80px;
}
.suivi-stat-chiffre {
  font-size: 28px;
  font-weight: 800;
  color: var(--primaire);
}
.suivi-stat-label {
  font-size: 12px;
  color: var(--texte-clair);
  text-align: center;
}
.suivi-stat-valeur {
  font-size: 14px;
  font-weight: 600;
}
.suivi-stat-desc {
  font-size: 11px;
  color: var(--texte-clair);
}
.suivi-stats-grille {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.suivi-carte-enfant {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: white;
  border-radius: var(--arrondi-petit);
  box-shadow: var(--ombre-douce);
  margin-bottom: 8px;
}
.suivi-avatar {
  font-size: 36px;
  flex-shrink: 0;
}
.suivi-infos {
  flex: 1;
}
.suivi-infos h4 {
  margin: 0;
  font-size: 16px;
}
.suivi-infos p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--texte-clair);
}
.suivi-activites {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.suivi-activite {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #F8F8F8;
  border-radius: var(--arrondi-petit);
}
.suivi-act-icone { font-size: 20px; }
.suivi-act-nom { flex: 1; font-size: 14px; }
.suivi-act-date { font-size: 12px; color: var(--texte-clair); }

/* Galerie espace parents */
.galerie-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.galerie-item {
  aspect-ratio: 1;
  border-radius: var(--arrondi-petit);
  overflow: hidden;
  background: white;
  box-shadow: var(--ombre-douce);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

/* Scrollbar stylise */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D0D0D0; border-radius: 3px; }

/* Info rapide dans la maison */
.maison-info-rapide {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 20px 0;
  font-size: 13px;
  color: var(--texte-clair);
}
.maison-separateur {
  color: #DDD;
}

/* Actions sur les cartes de profil (editer/supprimer) */
.carte-profil {
  position: relative;
}
.carte-profil-actions {
  display: flex;
  gap: 4px;
  margin-right: 4px;
}
.carte-profil-edit, .carte-profil-del {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  background: #F5F5F5;
  transition: all 0.15s;
  padding: 0;
}
.carte-profil-edit:active, .carte-profil-del:active { transform: scale(0.90); }
.carte-profil-del { background: #FFF0F0; }

/* Responsive compte */
@media (min-width: 768px) {
  .compte-creations-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .compte-carte-identite {
    padding: 24px 32px;
  }
}

/* ===== ECOUTE ET TROUVE ===== */
.ecoute-carte {
  transition: all 0.2s ease;
  touch-action: manipulation;
}
.ecoute-carte:active {
  transform: scale(0.93);
}

/* ===== TRESOR DE MOTS ===== */
.tresor-barre {
  animation: float 3s ease-in-out infinite;
  cursor: pointer;
}

/* ===== TRIER POUR LA PLANETE ===== */
.trier-poubelle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 80px;
  height: 100px;
  border-radius: var(--arrondi);
  padding: 12px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--ombre-douce);
  color: white;
  touch-action: manipulation;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.trier-poubelle:active { transform: scale(0.90); }
.trier-poubelle.correct {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(81, 207, 102, 0.5);
  animation: bounceIn 0.4s ease;
}
.trier-poubelle.wrong {
  transform: scale(0.90);
  opacity: 0.6;
  filter: grayscale(0.5);
  transition: all 0.3s ease;
}

/* ===== COMPTER AMELIORE ===== */
.compter-grille {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 10px 12px;
  background: white;
  border-radius: var(--arrondi);
  box-shadow: var(--ombre-douce);
  min-height: 80px;
  max-width: 340px;
  width: 100%;
  margin: 4px 0;
}
.compter-objet {
  font-size: 36px;
  animation: pop 0.3s ease backwards;
  transition: transform 0.15s ease;
}
.compter-objet:nth-child(1) { animation-delay: 0.00s; }
.compter-objet:nth-child(2) { animation-delay: 0.05s; }
.compter-objet:nth-child(3) { animation-delay: 0.10s; }
.compter-objet:nth-child(4) { animation-delay: 0.15s; }
.compter-objet:nth-child(5) { animation-delay: 0.20s; }
.compter-objet:nth-child(6) { animation-delay: 0.25s; }
.compter-objet:nth-child(7) { animation-delay: 0.30s; }
.compter-objet:nth-child(8) { animation-delay: 0.35s; }
.compter-objet:nth-child(9) { animation-delay: 0.40s; }
.compter-objet:nth-child(10) { animation-delay: 0.45s; }
.compter-objet:nth-child(11) { animation-delay: 0.50s; }
.compter-objet:nth-child(12) { animation-delay: 0.55s; }
.compter-objet:nth-child(13) { animation-delay: 0.60s; }
.compter-objet:nth-child(14) { animation-delay: 0.65s; }
.compter-objet:nth-child(15) { animation-delay: 0.70s; }

.compter-choix {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 4px 0;
}
.compter-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--secondaire);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--ombre-douce);
  touch-action: manipulation;
}
.compter-btn:active { transform: scale(0.90); }
.compter-btn.correct {
  background: var(--succes);
  transform: scale(1.15);
  box-shadow: 0 0 20px rgba(81, 207, 102, 0.4);
  animation: bounceIn 0.4s ease;
}
.compter-btn.wrong {
  background: #FF6B6B;
  transform: scale(0.85);
  opacity: 0.5;
}
.compter-msg {
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  min-height: 24px;
  color: var(--texte-clair);
  padding: 2px 0;
}

/* Celebration fin du jeu Compter */
.compter-celebration {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 30px 20px;
  animation: fadeIn 0.5s ease;
}
.compter-celeb-icone {
  font-size: 70px;
  animation: bounceIn 0.6s ease;
}
.compter-celeb-titre {
  font-size: 28px;
  font-weight: 900;
  margin: 0;
  color: var(--texte);
}
.compter-celeb-texte {
  font-size: 16px;
  color: var(--texte-clair);
  margin: 0;
}
.compter-etoiles {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}
.compter-etoile {
  font-size: 36px;
  transition: all 0.3s ease;
}
.compter-etoile.obtenue {
  animation: bounceIn 0.4s ease backwards;
}
.compter-etoile.obtenue:nth-child(1) { animation-delay: 0.1s; }
.compter-etoile.obtenue:nth-child(2) { animation-delay: 0.2s; }
.compter-etoile.obtenue:nth-child(3) { animation-delay: 0.3s; }
.compter-etoile.obtenue:nth-child(4) { animation-delay: 0.4s; }
.compter-etoile.obtenue:nth-child(5) { animation-delay: 0.5s; }

/* ============================================================
   PASSE 9 — RESPONSIVE MOBILE / TABLETTE + ACCESSIBILITE
   ============================================================ */

/* ----- TELEPHONE ETROIT (<400px) ----- */
@media (max-width: 399px) {
  /* Accueil : reduire les tailles */
  .accueil-mascotte { font-size: 72px; }
  .accueil-titre { font-size: 34px; }
  .accueil-sous-titre { font-size: 15px; }
  .accueil-content { padding: 20px 12px; }
  .btn-large { padding: 14px 24px; font-size: 18px; min-height: 54px; }

  /* Choix profil */
  .choix-profil-header h2 { font-size: 20px; }
  .choix-profil-header p { font-size: 14px; }
  .carte-profil { padding: 12px 14px; gap: 12px; }
  .carte-profil-info h3 { font-size: 16px; }
  .carte-profil-avatar { width: 42px; height: 42px; font-size: 22px; }

  /* Maison */
  .maison-header { padding: 12px 14px 6px; gap: 8px; }
  .maison-mascotte { width: 48px; height: 48px; font-size: 26px; }
  .maison-mascotte-talk { font-size: 13px; padding: 8px 12px; }
  .maison-mascotte-talk::before { top: 16px; }
  .grille-univers { gap: 8px; padding: 8px 10px; }
  .tuile-univers { padding: 10px; min-height: 100px; }
  .tuile-univers .tuile-icone { font-size: 34px; }
  .tuile-univers .tuile-nom { font-size: 12px; }
  .maison-info-rapide { font-size: 11px; padding: 0 14px; }
  .maison-jardin { padding: 6px 10px; min-height: 42px; }

  /* Fabrique */
  .fabrique-header { padding: 12px 14px; }
  .fabrique-titre { font-size: 18px; }
  .fabrique-option { padding: 8px 10px; font-size: 12px; }
  .bulle-mascotte { padding: 10px 12px; margin: 0 10px 8px; }
  .bulle-mascotte-icone { font-size: 28px; }
  .bulle-mascotte-texte { font-size: 14px; }
  .fabrique-choix h3 { font-size: 14px; margin: 8px 0 6px; }
  .fabrique-generer { padding: 8px 12px 14px; }
  .fabrique-histoire-contenu { padding: 14px; }
  .histoire-texte { font-size: 15px !important; }

  /* Mode choix histoire */
  .choix-aventure-texte { font-size: 15px; padding: 14px; }
  .choix-btn { font-size: 14px; padding: 14px 16px; min-height: 48px; }

  /* Compte enfant */
  .compte-header { padding: 12px 14px; }
  .compte-titre { font-size: 18px; }
  .compte-carte-identite { padding: 14px; margin: 0 10px 12px; gap: 12px; }
  .compte-avatar-grand { width: 60px; height: 60px; font-size: 36px; }
  .compte-nom-age h2 { font-size: 18px; }
  .compte-section { padding: 8px 12px; }
  .compte-stats-ligne { gap: 10px; }

  /* Casse-tete / menu */
  .ct-header { padding: 10px 12px; }
  .ct-titre { font-size: 17px; }
  .ct-menu { padding: 8px 12px; gap: 8px; }
  .ct-menu-tuile { padding: 12px 14px; gap: 10px; }
  .ct-menu-icone { font-size: 28px; }
  .ct-menu-info h3 { font-size: 15px; }
  .ct-menu-info p { font-size: 12px; }

  /* Univers header */
  .univers-header { padding: 12px 14px; }
  .univers-titre { font-size: 18px; }

  /* Atelier */
  .atelier-header { padding: 6px 8px; }
  .atelier-titre { font-size: 14px; }
  .outil-btn { width: 38px; height: 38px; font-size: 16px; }
  .palette-couleurs { gap: 3px; }
  .couleur-btn { width: 30px; height: 30px; }
  .atelier-actions-bas .btn { font-size: 11px; padding: 6px 10px; min-height: 36px; }
  .sticker-panel { max-height: 50%; }
  .sticker-grid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 4px; padding: 6px 8px; }
  .sticker-btn { font-size: 22px; }

  /* Creation profil */
  .creation-header h2 { font-size: 20px; }
  .form-groupe { margin: 12px 0; }
  .form-groupe label { font-size: 14px; }
  .avatar-option { width: 48px; height: 48px; font-size: 26px; }
  .age-option { min-width: 60px; padding: 10px 6px; }
  .age-option .age-icone { font-size: 20px; }

  /* Apprendre */
  .ct-progress { font-size: 13px; padding: 6px; }

  /* Langues */
  .ecoute-carte { width: calc(50% - 6px) !important; }
  .ecoute-carte div[style*="font-size:56px"] { font-size: 40px !important; }
  #screen-langues .ct-suite-choice { width: auto; min-width: 44px; padding: 12px 14px; font-size: 14px; }
  .ct-suite-choice { min-width: 60px; padding: 12px 14px; font-size: 14px; }
  .ct-enigme-choice { padding: 14px 16px; font-size: 15px; }
}

/* ----- TABLETTE (600-1024px) -- adaptations pour confort pouce ----- */
@media (min-width: 600px) and (max-width: 1024px) {
  .grille-univers {
    grid-template-columns: 1fr 1fr 1fr;
    max-width: 700px;
    margin: 0 auto;
  }
  .tuile-univers {
    min-height: 140px;
  }
  .tuile-univers .tuile-icone { font-size: 52px; }
  .tuile-univers .tuile-nom { font-size: 16px; }

  /* Compte enfant: plus grand */
  .compte-carte-identite { padding: 24px 32px; }
  .compte-avatar-grand { width: 100px; height: 100px; font-size: 60px; }
  .compte-nom-age h2 { font-size: 26px; }
  .compte-creations-grid { grid-template-columns: repeat(4, 1fr); }

  /* Casse-tete menu */
  .ct-menu { max-width: 600px; margin: 0 auto; }
  .ct-menu-tuile { padding: 18px 24px; }
  .ct-menu-icone { font-size: 42px; }
  .ct-menu-info h3 { font-size: 20px; }
  .ct-menu-info p { font-size: 15px; }

  /* Fabrique */
  .fabrique-choix { max-width: 600px; margin: 0 auto; }
  .fabrique-choix-options { gap: 10px; }
  .fabrique-option { padding: 14px 18px; font-size: 16px; }
  .fabrique-histoire { max-width: 600px; margin: 0 auto; }

  /* Mode aventure */
  .choix-aventure { max-width: 600px; margin: 0 auto; }

  /* Atelier */
  #screen-atelier { max-width: 700px; margin: 0 auto; }

  /* Apprendre */
  #screen-apprendre { max-width: 600px; margin: 0 auto; }

  /* Choix profil */
  .liste-profils { max-width: 500px; margin: 0 auto; }

  /* Creation profil */
  #screen-creation-profil { max-width: 500px; margin: 0 auto; }

  /* Meilleure lisibilité tablette */
  .bulle-mascotte-texte { font-size: 18px; }
  .btn { padding: 16px 32px; font-size: 20px; min-height: 60px; }
  .btn-small { padding: 12px 22px; font-size: 16px; min-height: 48px; }
  .btn-large { padding: 20px 48px; font-size: 24px; min-height: 72px; }

  /* Langues */
  .ecoute-carte div[style*="font-size:56px"] { font-size: 72px !important; }
}

/* ----- GRAND ECRAN (>1024px) ----- */
@media (min-width: 1025px) {
  .grille-univers {
    grid-template-columns: 1fr 1fr 1fr;
    max-width: 700px;
    margin: 0 auto;
  }
  .tuile-univers { min-height: 150px; }
  .tuile-univers .tuile-icone { font-size: 56px; }
}

/* ----- ACCESSIBILITE : CONTRASTE ----- */
/* Amelioration du contraste des textes clairs sur fond colore */
.btn-primary { color: #FFFFFF; }
.btn-secondary { color: #FFFFFF; }
.btn-mascotte { color: #FFFFFF; }
.choix-btn { color: #FFFFFF; }

/* Contraste suffisant pour les textes gris */
.compte-section-titre { color: #2D3047; }
.badge-nom { color: #2D3047; }
.badge-date { color: #6B6B8D; }
.coffre-titre { color: #2D3047; }
.ct-titre { color: #2D3047; }

/* Labels de formulaire bien visibles */
.form-groupe label { color: #2D3047; font-weight: 700; }

/* ----- ACCESSIBILITE : ZONES DE CLIC SUFFISANTES ----- */
/* Tous les elements interactifs < 44x44px sont agrandis */
.outil-btn { width: 44px; height: 44px; }  /* Deja 42px -> 44px */
.carte-profil-edit, .carte-profil-del { width: 36px; height: 36px; font-size: 16px; }
.avatar-option { width: 52px; height: 52px; }  /* Deja 56px, OK mais ajoutons min */
.age-option { min-height: 52px; }
.couleur-btn { width: 36px; height: 36px; }
.couleur-btn.active { transform: scale(1.10); }

/* Zone de clic pour les boutons de reponse des modules apprendre et langues */
.ct-suite-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  background: white;
  border: 3px solid #E8E8E8;
  border-radius: var(--arrondi-petit);
  font-size: 16px;
  font-weight: 700;
  color: var(--texte);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--ombre-douce);
  touch-action: manipulation;
  min-width: 80px;
  min-height: 52px;
  text-align: center;
  line-height: 1.2;
  box-sizing: border-box;
}
.ct-suite-choice:active { transform: scale(0.95); border-color: var(--secondaire); }
.ct-suite-choice.correct {
  border-color: var(--succes);
  background: #E8FFE8;
  box-shadow: 0 0 15px rgba(81, 207, 102, 0.3);
  animation: bounceIn 0.4s ease;
}
.ct-suite-choice.wrong {
  border-color: var(--primaire);
  background: #FFE8E8;
  animation: shake 0.3s ease;
}

.ct-enigme-choice {
  display: block;
  width: 100%;
  padding: 16px 20px;
  background: white;
  border: 3px solid #E8E8E8;
  border-radius: var(--arrondi-petit);
  font-size: 17px;
  font-weight: 700;
  color: var(--texte);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--ombre-douce);
  touch-action: manipulation;
  min-height: 56px;
  text-align: center;
  line-height: 1.3;
}
.ct-enigme-choice:active { transform: scale(0.97); border-color: var(--secondaire); }
.ct-enigme-choice.correct {
  border-color: var(--succes);
  background: #E8FFE8;
  box-shadow: 0 0 15px rgba(81, 207, 102, 0.3);
  animation: bounceIn 0.4s ease;
}
.ct-enigme-choice.wrong {
  border-color: var(--primaire);
  background: #FFE8E8;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.ct-memory-card { min-width: 56px; min-height: 56px; }
.ct-laby-btn { min-width: 52px; min-height: 52px; }

/* Bouton mute agrandi en zone de toucher */
.btn-mute { min-width: 48px; min-height: 48px; }

/* ----- BOUTEILLE MUTE ET JARDIN : NE PAS GENENT LE CONTENU ----- */
/* Le bouton mute est fixed, il flotte au-dessus. OK. */
/* Le jardin est en bas de la maison, padding suffisant. */
/* Ajouter un espace en bas des ecrans longs pour eviter le cache par le mute */
.screen {
  padding-bottom: 0;
}
.screen:not(#screen-maison) .ct-menu:last-child,
.screen:not(#screen-maison) .fabrique-choix:last-child {
  padding-bottom: 60px; /* Depasser le bouton mute */
}

/* ----- CLAVIER NE CACHE PAS LES CHAMPS DE SAISIE ----- */
.form-input, #ia-imagine-input, #parents-code {
  font-size: 16px; /* Evite le zoom automatique sur iOS */
}

/* ----- BARRE DU BOUTON PROGRESSION MAISON ----- */
.btn-progression {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  border: none;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--ombre-douce);
  flex-shrink: 0;
  transition: all 0.15s;
  padding: 0;
}
.btn-progression:active { transform: scale(0.90); }

/* ----- ATELIER — STYLES MANQUANTS ----- */
/* Ces classes sont utilisees par atelier.js mais n'avaient pas de CSS */
.atelier-barre-outils {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  flex-wrap: wrap;
  border-bottom: 2px solid #F0F0F0;
  flex-shrink: 0;
  overflow-x: auto;
}
.outil-barre-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #E0E0E0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
  background: white;
  flex-shrink: 0;
  touch-action: manipulation;
  padding: 0;
}
.outil-barre-btn.active { border-color: var(--secondaire); background: #E8FFF8; transform: scale(1.1); }
.outil-barre-btn:active { transform: scale(0.90); }
.palette-container {
  border-bottom: 2px solid #F0F0F0;
  flex-shrink: 0;
}
.palette-categories {
  display: flex;
  gap: 4px;
  padding: 4px 10px;
  overflow-x: auto;
}
.palette-cat-btn {
  padding: 4px 10px;
  border: 2px solid #E0E0E0;
  border-radius: 12px;
  background: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  min-height: 32px;
}
.palette-cat-btn.active { background: var(--secondaire); color: white; border-color: var(--secondaire); }
.palette-cat-btn:active { transform: scale(0.95); }
.couleur-perso {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
}
.couleur-input-picker {
  width: 36px;
  height: 36px;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
}
.toile-container {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 4px;
  overflow: hidden;
  position: relative;
  min-height: 200px;
}
.toile-cadre {
  border: 3px solid #E0E0E0;
  border-radius: var(--arrondi-petit);
  overflow: hidden;
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  position: relative;
}
#canvas-dessin {
  display: block;
  width: 100%;
  touch-action: none;
}
.modele-chooser {
  border-bottom: 2px solid #F0F0F0;
  padding: 6px 10px;
  flex-shrink: 0;
}
.modele-themes {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 4px;
}
.modele-theme-btn {
  padding: 6px 12px;
  border: 2px solid #E0E0E0;
  border-radius: 14px;
  background: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: all 0.15s;
  min-height: 36px;
}
.modele-theme-btn.active { border-color: var(--secondaire); background: #E8FFF8; }
.modele-theme-btn:active { transform: scale(0.95); }
.modele-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}
.modele-btn {
  padding: 8px 16px;
  border: 2px solid #E0E0E0;
  border-radius: 12px;
  background: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  min-height: 36px;
}
.modele-btn:active { transform: scale(0.95); }
.taille-selector {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px 10px;
  border-bottom: 2px solid #F0F0F0;
  overflow-x: auto;
  flex-shrink: 0;
}
.taille-btn {
  border-radius: 50%;
  background: #E0E0E0;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  border: 3px solid transparent;
}
.taille-btn.active { border-color: var(--secondaire); background: var(--secondaire); }
.taille-btn:active { transform: scale(0.90); }
.tampon-selecteur {
  display: flex;
  gap: 4px;
  padding: 6px 10px;
  overflow-x: auto;
  border-bottom: 2px solid #F0F0F0;
  flex-shrink: 0;
}
.tampon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #E0E0E0;
  background: white;
  font-size: 22px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
}
.tampon-btn.active { border-color: var(--mascotte-couleur); background: #FFF8E8; transform: scale(1.12); }
.tampon-btn:active { transform: scale(0.90); }

/* ----- PANNEAU AUTOCOLLANTS / STICKERS ----- */
.sticker-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.97);
  border-top: 3px solid #E0E0E0;
  border-radius: var(--arrondi) var(--arrondi) 0 0;
  box-shadow: 0 -6px 25px rgba(0,0,0,0.12);
  z-index: 30;
  max-height: 45%;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.sticker-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 2px solid #F0F0F0;
  flex-shrink: 0;
}
.sticker-panel-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--texte);
}
.sticker-panel-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #E0E0E0;
  background: white;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.sticker-panel-close:active { transform: scale(0.90); }
.sticker-categories {
  display: flex;
  gap: 4px;
  padding: 6px 10px;
  overflow-x: auto;
  flex-shrink: 0;
  border-bottom: 2px solid #F0F0F0;
}
.sticker-cat-btn {
  padding: 5px 12px;
  border: 2px solid #E0E0E0;
  border-radius: 14px;
  background: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 34px;
}
.sticker-cat-btn.active {
  border-color: var(--mascotte-couleur);
  background: #FFF8E8;
  transform: scale(1.05);
}
.sticker-cat-btn:active { transform: scale(0.95); }
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 6px;
  padding: 8px 10px;
  overflow-y: auto;
  flex: 1;
  align-content: start;
}
.sticker-btn {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid #E8E8E8;
  border-radius: var(--arrondi-petit);
  background: white;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  touch-action: manipulation;
}
.sticker-btn:active { transform: scale(0.90); border-color: var(--mascotte-couleur); background: #FFF8E8; }
.sticker-btn.selected { border-color: var(--mascotte-couleur); background: #FFF8E8; transform: scale(1.08); box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

/* Sticker place sur la toile — deplacable */
.sticker-place {
  position: absolute;
  font-size: 40px;
  cursor: grab;
  touch-action: none;
  z-index: 10;
  transform: translate(-50%, -50%);
  transition: box-shadow 0.15s;
  line-height: 1;
}
.sticker-place.grabbing {
  cursor: grabbing;
  z-index: 15;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
  transition: none;
}
.sticker-place .sticker-del {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primaire);
  color: white;
  border: 2px solid white;
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  padding: 0;
  line-height: 1;
}
.sticker-place:hover .sticker-del,
.sticker-place:focus-within .sticker-del,
.sticker-place.touched .sticker-del {
  display: flex;
}
.atelier-actions-bas {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  flex-shrink: 0;
  border-top: 2px solid #F0F0F0;
  overflow-x: auto;
  justify-content: center;
}
.pasapas-panel {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.95);
  padding: 16px;
  border-radius: var(--arrondi);
  box-shadow: var(--ombre-forte);
  z-index: 20;
  margin: 8px;
  backdrop-filter: blur(4px);
}
.pasapas-panel h3 { margin: 0 0 8px; font-size: 18px; }
.pasapas-panel p { margin: 0 0 6px; font-size: 15px; }
.pasapas-etapes {
  display: flex;
  gap: 4px;
  margin: 8px 0;
}
.pasapas-etape {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #E0E0E0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #999;
}
.pasapas-etape.done { background: var(--succes); color: white; }
.pasapas-etape.current { background: var(--mascotte-couleur); color: white; transform: scale(1.15); }

/* Galerie atelier */
.compte-creation-item {
  aspect-ratio: 1;
  border-radius: var(--arrondi-petit);
  overflow: hidden;
  background: white;
  box-shadow: var(--ombre-douce);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.compte-creation-item:active { transform: scale(0.95); }
.compte-creation-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.compte-creation-dessin {
  background: #F8F8F8;
}
.compte-creation-histoire {
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  text-align: center;
}

/* ----- AMELIORATIONS CONFORT POUCE ----- */
/* Si un bouton est trop pres du bord, ajouter du padding */
.screen { padding-bottom: env(safe-area-inset-bottom, 0px); }
#app { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* Boutons retours: pas de texte invisible */
.btn-retour[aria-label] { font-size: 22px; line-height: 1; }

/* ----- BOUTON BIENTOT ----- */
.bientot-icone { font-size: 64px; text-align: center; padding: 40px 20px 10px; }
.bientot-titre { text-align: center; font-size: 24px; font-weight: 800; margin: 0 0 8px; }
.bientot-texte { text-align: center; font-size: 16px; color: var(--texte-clair); margin: 0 0 24px; padding: 0 20px; }

/* ----- AMELIORATIONS CONFINEMENT POUCE SUR TABLETTE ----- */
@media (pointer: coarse) {
  /* Tous les elements cliquables ont au moins 44px de zone */
  .carte-profil { min-height: 56px; }
  .livre-item { min-height: 64px; }
  .ct-menu-tuile { min-height: 60px; }
  .ct-suite-choice { min-width: 60px; min-height: 56px; }
  .compter-btn { width: 60px; height: 60px; }
}

/* ----- CHAMP IDEE + MICRO DICTEE VOCALE ----- */
.fabrique-idee {
  margin: 16px 16px 0;
  padding: 12px 16px;
  background: rgba(255,255,255,0.5);
  border-radius: 16px;
  border: 2px dashed var(--mascotte-couleur);
}
.fabrique-idee h3 {
  font-size: 18px;
  margin: 0 0 8px;
  color: var(--texte);
}
.fabrique-idee-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.fabrique-idee-input {
  flex: 1;
  min-height: 60px;
  padding: 10px 14px;
  border: 2px solid var(--mascotte-couleur);
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  background: white;
  resize: vertical;
  outline: none;
  line-height: 1.4;
}
.fabrique-idee-input:focus {
  border-color: var(--primaire);
  box-shadow: 0 0 0 3px rgba(255,107,107,0.2);
}
.btn-micro {
  min-width: 48px;
  height: 60px;
  font-size: 28px;
  background: var(--mascotte-couleur);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
  transition: transform 0.15s;
}
.btn-micro:active {
  transform: scale(0.92);
}
.fabrique-micro-ecoute {
  text-align: center;
  font-size: 20px;
  color: var(--mascotte-couleur);
  padding: 8px 0;
  animation: pulse-ecoute 1.2s ease-in-out infinite;
  font-weight: 600;
}
@keyframes pulse-ecoute {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.fabrique-micro-pulse::after {
  content: '...';
  animation: points 1.5s steps(3, end) infinite;
}
@keyframes points {
  0% { content: '.'; }
  33% { content: '..'; }
  66% { content: '...'; }
}

/* ============================================================
   LIRE ET ECRIRE — univers violet #A78BFA
   ============================================================ */
#screen-lecture-ecriture {
  background: linear-gradient(180deg, #EDE9FE 0%, #FFF8F0 50%, white 100%);
}
#screen-lecture-ecriture.active {
  display: flex;
  flex-direction: column;
}
.le-header {
  flex-shrink: 0;
}

/* Decouverte lettre */
.le-lettre-decouverte {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 16px;
}
.le-lettre-paire {
  display: flex;
  gap: 16px;
  align-items: center;
}
.le-lettre-maj {
  font-size: 120px;
  font-weight: 900;
  color: #7C3AED;
  text-shadow: 4px 4px 0 #DDD6FE;
  line-height: 1;
}
.le-lettre-min {
  font-size: 72px;
  font-weight: 700;
  color: #A78BFA;
  line-height: 1;
}
.le-lettre-mot {
  font-size: 24px;
  font-weight: 700;
  color: var(--texte);
  text-align: center;
}
.le-btn-ecouter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: #7C3AED;
  color: white;
  border-radius: var(--arrondi);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--ombre-douce);
  touch-action: manipulation;
}
.le-btn-ecouter:active {
  transform: scale(0.95);
}
.le-btn-ecouter-mot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: #DDD6FE;
  color: #5B21B6;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin: 4px 0;
  touch-action: manipulation;
}
.le-btn-ecouter-mot:active {
  transform: scale(0.93);
}
.le-btn-reentendre {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: #7C3AED;
  color: white;
  border: none;
  border-radius: var(--arrondi);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
.le-btn-reentendre:active {
  transform: scale(0.93);
}

/* Quiz lettres */
.le-quiz-consigne {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
}
.le-quiz-icone {
  font-size: 48px;
}
.le-quiz-texte {
  font-size: 22px;
  font-weight: 700;
  color: var(--texte);
}
.le-quiz-grille {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 16px;
  flex: 1;
  align-content: center;
  max-width: 400px;
  margin: 0 auto;
  width: 100%;
}
.le-quiz-grille-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.le-quiz-grille-2x2 {
  grid-template-columns: 1fr 1fr;
}
.le-quiz-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px;
  background: white;
  border-radius: var(--arrondi);
  box-shadow: var(--ombre-douce);
  cursor: pointer;
  transition: all 0.15s;
  min-height: 100px;
  touch-action: manipulation;
  border: 3px solid transparent;
}
.le-quiz-btn:active {
  transform: scale(0.93);
}
.le-quiz-btn.correct {
  border-color: var(--succes);
  background: #E8FFE8;
  animation: bounceIn 0.3s ease;
  box-shadow: 0 0 20px rgba(81,207,102,0.3);
}
.le-quiz-btn.wrong {
  border-color: #FF6B6B;
  background: #FFE8E8;
  transform: scale(0.90);
}
.le-quiz-lettre {
  font-size: 52px;
  font-weight: 900;
  color: #7C3AED;
  line-height: 1;
}
.le-quiz-min {
  font-size: 24px;
  color: #A78BFA;
  line-height: 1;
}
.le-quiz-btn-syllabe {
  min-height: 80px;
}
.le-syllabe-texte {
  font-size: 36px;
  font-weight: 800;
  color: #7C3AED;
}
.le-quiz-btn-img {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: white;
  border-radius: var(--arrondi);
  box-shadow: var(--ombre-douce);
  cursor: pointer;
  transition: all 0.15s;
  min-height: 100px;
  touch-action: manipulation;
  border: 3px solid transparent;
}
.le-quiz-btn-img:active {
  transform: scale(0.93);
}
.le-quiz-btn-img.correct {
  border-color: var(--succes);
  background: #E8FFE8;
  animation: bounceIn 0.3s ease;
  box-shadow: 0 0 20px rgba(81,207,102,0.3);
}
.le-quiz-btn-img.wrong {
  border-color: #FF6B6B;
  background: #FFE8E8;
  transform: scale(0.90);
}
.le-img-emoji {
  font-size: 56px;
}
.le-quiz-msg {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  padding: 8px 16px 16px;
  min-height: 32px;
  color: var(--texte-clair);
  flex-shrink: 0;
}

/* Tracer */
.le-tracer-consigne {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--texte);
  text-align: center;
}
.le-tracer-mot {
  font-size: 20px;
  font-weight: 700;
  color: #7C3AED;
  margin: 4px 0;
}
.le-tracer-progress {
  font-size: 13px;
  color: var(--texte-clair);
}
.le-tracer-modele {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 16px 8px;
}
.le-tracer-modele-lettre {
  font-size: 64px;
  font-weight: 900;
  color: #7C3AED;
  line-height: 1;
  text-shadow: 2px 2px 0 #DDD6FE;
}
.le-tracer-modele-lettre-min {
  font-size: 32px;
  color: #A78BFA;
}
.le-tracer-modele-texte {
  font-size: 32px;
  font-weight: 800;
  color: #7C3AED;
}
.le-tracer-canvas-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
}
.le-tracer-canvas {
  border-radius: var(--arrondi);
  box-shadow: var(--ombre-douce);
  touch-action: none;
  border: 3px solid #DDD6FE;
}
.le-tracer-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 8px 16px 16px;
  flex-shrink: 0;
}

/* Lire : syllabes, mots, phrases */
.le-lire-syllabe,
.le-lire-mot,
.le-lire-phrase {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
}
.le-lire-consigne {
  font-size: 18px;
  font-weight: 600;
  color: var(--texte);
  text-align: center;
}
.le-lire-syllabe-texte {
  font-size: 64px;
  font-weight: 900;
  color: #7C3AED;
  text-shadow: 3px 3px 0 #DDD6FE;
  line-height: 1.2;
}
.le-lire-mot-texte {
  font-size: 44px;
  font-weight: 800;
  color: #7C3AED;
  letter-spacing: 4px;
  line-height: 1.2;
}
.le-lire-phrase-texte {
  font-size: 24px;
  font-weight: 700;
  color: var(--texte);
  line-height: 1.5;
  text-align: center;
  max-width: 320px;
  padding: 16px;
  background: white;
  border-radius: var(--arrondi);
  box-shadow: var(--ombre-douce);
}
.le-lire-phrase-emoji {
  font-size: 48px;
}
.le-lire-comprehension {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.le-lire-compr-texte {
  font-size: 15px;
  color: var(--texte-clair);
  text-align: center;
}
.le-lire-compr-btn {
  padding: 14px 28px;
  background: var(--succes);
  color: white;
  border-radius: var(--arrondi);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--ombre-douce);
  touch-action: manipulation;
}
.le-lire-compr-btn:active {
  transform: scale(0.95);
}

/* ---- PROGRESSION BAR ---- */
.le-barre-progression {
  padding: 8px 16px 4px;
  text-align: center;
}
.le-barre-progression-label {
  font-size: 13px;
  font-weight: 700;
  color: #7C3AED;
  margin-bottom: 4px;
}
.le-barre-progression-track {
  height: 10px;
  background: #EDE9FE;
  border-radius: 10px;
  position: relative;
  overflow: visible;
  max-width: 360px;
  margin: 0 auto;
}
.le-barre-progression-fill {
  height: 100%;
  background: linear-gradient(90deg, #A78BFA, #7C3AED);
  border-radius: 10px;
  transition: width 0.4s ease;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
}
.le-barre-progression-dots {
  position: absolute;
  left: 0;
  top: -3px;
  width: 100%;
  height: 16px;
  display: flex;
  justify-content: space-between;
  z-index: 2;
  pointer-events: none;
}
.le-p-point {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #DDD6FE;
  border: 2px solid white;
  display: inline-block;
  transition: all 0.3s ease;
}
.le-p-done {
  background: #7C3AED;
  box-shadow: 0 0 6px rgba(124,58,237,0.4);
}
.le-p-current {
  background: #A78BFA;
  box-shadow: 0 0 10px rgba(167,139,250,0.6);
  animation: pulsePoint 1s infinite;
}
.le-p-future {
  background: #DDD6FE;
}

@keyframes pulsePoint {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* ---- FELICITATIONS ECRAN ---- */
.le-felicitations {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 16px;
  animation: fadeIn 0.5s ease;
}
.le-fel-etoiles {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}
.le-fel-etoile {
  font-size: 36px;
  transition: all 0.3s ease;
  filter: grayscale(1) opacity(0.3);
}
.le-fel-etoile-gagnee {
  filter: none;
  animation: popStar 0.4s ease;
}
@keyframes popStar {
  0% { transform: scale(0); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.le-fel-icone-grand {
  font-size: 72px;
  line-height: 1;
  animation: bounceIn 0.5s ease;
}
.le-fel-titre {
  font-size: 28px;
  font-weight: 900;
  color: #7C3AED;
  margin: 0;
  text-shadow: 2px 2px 0 #DDD6FE;
}
.le-fel-sous-titre {
  font-size: 16px;
  color: var(--texte-clair);
  text-align: center;
  margin: 0;
}

/* ---- MASCOTTE COMPACTE ---- */
.le-bulle-compacte {
  margin: 4px 12px 8px;
  padding: 6px 12px;
  background: #F5F3FF;
  border: 2px solid #DDD6FE;
  border-radius: 24px;
}
.le-bulle-compacte .bulle-mascotte-icone {
  font-size: 28px;
}
.le-bulle-compacte .bulle-mascotte-texte {
  font-size: 14px;
  font-weight: 600;
}

/* Animation bounceIn si pas deja definie */
@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.08); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}

/* Responsive : telephone etroit */
@media (max-width: 399px) {
  .le-lettre-maj { font-size: 80px; }
  .le-lettre-min { font-size: 48px; }
  .le-quiz-lettre { font-size: 40px; }
  .le-quiz-min { font-size: 20px; }
  .le-quiz-btn { min-height: 80px; padding: 12px; }
  .le-quiz-btn-img { min-height: 80px; padding: 14px; }
  .le-img-emoji { font-size: 40px; }
  .le-lire-syllabe-texte { font-size: 48px; }
  .le-lire-mot-texte { font-size: 32px; }
  .le-lire-phrase-texte { font-size: 20px; padding: 12px; }
  .le-syllabe-texte { font-size: 28px; }
  .le-tracer-modele-lettre { font-size: 48px; }
}

/* ===== TEMPS D ECRAN : overlays pause / blocage ===== */
.temps-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s ease;
}
.temps-overlay-total {
  background: rgba(255,248,240,0.97);
}
#screen-recreation .temps-overlay {
  background: rgba(255,248,240,0.95);
}
.temps-overlay-contenu {
  text-align: center;
  max-width: 360px;
  padding: 32px 24px;
  animation: bounceIn 0.5s ease;
}
.temps-pause-rec h2 {
  font-size: 22px;
  margin: 0 0 8px;
  color: #FF8FB1;
}
.temps-pause-total h2 {
  font-size: 22px;
  margin: 0 0 8px;
}


/* Bouton audio dans les tuiles univers : coin haut-droit, jamais coupe */
.tuile-univers { position: relative; }
.tuile-univers .gribou-btn-audio {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  font-size: 15px;
  margin: 0;
}

/* ============================================================
   LOOK ENFANT — MAISON (decor + tuiles bonbon) — override v2
   ============================================================ */
#screen-maison{
  overflow-y:auto;
  background:
    radial-gradient(circle at 82% 6%, #FFE08A 0 64px, transparent 65px),
    linear-gradient(180deg,#8FD3FF 0%, #BDE7FF 30%, #FFF3DA 58%, #C9F0B0 100%);
  padding-bottom:24px;
}
.ciel-nuage{position:absolute;background:#fff;border-radius:50px;opacity:.9;z-index:0;pointer-events:none;}
.ciel-nuage.cn1{width:84px;height:28px;top:64px;left:18px;}
.ciel-nuage.cn1:before,.ciel-nuage.cn1:after{content:'';position:absolute;background:#fff;border-radius:50%;}
.ciel-nuage.cn1:before{width:40px;height:40px;top:-17px;left:12px;}
.ciel-nuage.cn1:after{width:28px;height:28px;top:-11px;left:44px;}
.ciel-nuage.cn2{width:64px;height:22px;top:128px;right:18px;}

/* Header */
#screen-maison .maison-header{
  position:relative;z-index:2;display:flex;align-items:center;gap:12px;
  padding:48px 16px 8px;background:none;
}
#screen-maison .masco-cercle{
  width:74px;height:74px;border-radius:50%;flex-shrink:0;
  background:radial-gradient(circle at 50% 40%,#FFF7E6,#FFE3A8);
  border:4px solid #fff;box-shadow:0 8px 18px rgba(255,150,40,.35);
  display:flex;align-items:flex-end;justify-content:center;overflow:hidden;
}
#screen-maison .masco-cercle img{width:88%;height:auto;display:block;}
#screen-maison .maison-bulle{
  flex:1;background:#fff;border-radius:22px;padding:11px 15px;position:relative;
  box-shadow:0 6px 16px rgba(60,80,140,.16);
}
#screen-maison .maison-bulle:before{content:'';position:absolute;left:-9px;top:24px;border:9px solid transparent;border-right-color:#fff;}
#screen-maison .bulle-hi{font-size:17px;font-weight:600;color:#3A2E5C;line-height:1.15;}
#screen-maison .bulle-sub{font-size:12px;color:#8A7FB0;margin-top:2px;font-weight:500;}
#screen-maison .masco-switch{
  width:40px;height:40px;border-radius:50%;border:none;background:#fff;flex-shrink:0;
  box-shadow:0 5px 12px rgba(60,80,140,.16);font-size:17px;cursor:pointer;
}
/* Pilule infos */
#screen-maison .maison-pilule{
  position:relative;z-index:2;display:inline-flex;align-items:center;gap:8px;
  margin:12px 16px 4px;background:#fff;border-radius:30px;padding:7px 15px;
  box-shadow:0 5px 14px rgba(60,80,140,.14);font-weight:600;font-size:13.5px;color:#FF8A3D;cursor:pointer;
}
#screen-maison .pil-age{color:#5BB85B;}
#screen-maison .pil-dot{width:5px;height:5px;border-radius:50%;background:#E5DCF2;}

/* Grille + tuiles bonbon */
#screen-maison .grille-univers{
  position:relative;z-index:2;display:grid;
  grid-template-columns:repeat(auto-fit, minmax(160px, 1fr));
  gap:18px;
  padding:18px 20px 16px;
  max-width:1100px;
  margin:0 auto;
  overflow:visible;
}
@media (min-width: 900px){
  #screen-maison .grille-univers{
    grid-template-columns:repeat(4, 1fr);
    gap:22px;
  }
  #screen-maison .tuile-univers{min-height:170px;}
}
@media (min-width: 1400px){
  #screen-maison .grille-univers{
    max-width:1300px;
  }
}
#screen-maison .tuile-univers{
  position:relative;border-radius:30px;padding:18px 12px 16px;min-height:146px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:11px;
  box-shadow:0 12px 22px rgba(40,40,90,.16), inset 0 -6px 0 rgba(0,0,0,.07);
  cursor:pointer;transition:transform .15s;overflow:hidden;border:none;
  aspect-ratio:auto;animation:tuilePop .5s both;
}
#screen-maison .tuile-univers:active{transform:scale(.95);}
#screen-maison .tuile-univers:nth-child(2){animation-delay:.05s}
#screen-maison .tuile-univers:nth-child(3){animation-delay:.10s}
#screen-maison .tuile-univers:nth-child(4){animation-delay:.15s}
#screen-maison .tuile-univers:nth-child(5){animation-delay:.20s}
#screen-maison .tuile-univers:nth-child(6){animation-delay:.25s}
#screen-maison .tuile-univers:nth-child(7){animation-delay:.30s}
#screen-maison .tuile-univers:nth-child(8){animation-delay:.35s}
#screen-maison .tuile-univers:nth-child(9){animation-delay:.40s}
@keyframes tuilePop{0%{opacity:0;transform:scale(.6) translateY(18px)}100%{opacity:1;transform:scale(1) translateY(0)}}

#screen-maison .tuile-badge-rond{
  width:74px;height:74px;border-radius:50%;background:rgba(255,255,255,.92);
  display:flex;align-items:center;justify-content:center;font-size:40px;
  box-shadow:0 6px 0 rgba(0,0,0,.07), 0 8px 14px rgba(0,0,0,.12);
}
#screen-maison .tuile-univers .tuile-nom{
  font-size:15px;font-weight:600;color:#fff;text-align:center;line-height:1.15;
  text-shadow:0 2px 4px rgba(0,0,0,.2);
}
#screen-maison .tuile-univers .gribou-btn-audio{
  position:absolute;top:9px;right:9px;width:33px;height:33px;min-width:33px;min-height:33px;
  font-size:15px;margin:0;background:rgba(255,255,255,.92);border:none;
  box-shadow:0 3px 8px rgba(0,0,0,.18);z-index:3;
}
#screen-maison .tuile-sparkle{position:absolute;color:rgba(255,255,255,.6);font-size:13px;pointer-events:none;}
#screen-maison .tuile-sparkle.tsp1{top:13px;left:13px;}
#screen-maison .tuile-sparkle.tsp2{bottom:14px;right:16px;font-size:10px;}
#screen-maison .tuile-univers .tuile-badge{
  font-size:11px;background:rgba(0,0,0,.18);color:#fff;padding:2px 12px;border-radius:12px;font-weight:600;
}
#screen-maison .tuile-univers.bientot{opacity:.75;}

/* Degrades par univers */
#screen-maison .g-atelier{background:linear-gradient(150deg,#FF9A6B,#FF5E7E);}
#screen-maison .g-casse{background:linear-gradient(150deg,#43E0C0,#1FB6A6);}
#screen-maison .g-langues{background:linear-gradient(150deg,#5EC8FF,#3B82F6);}
#screen-maison .g-ia{background:linear-gradient(150deg,#B69CFF,#7C5CFC);}
#screen-maison .g-fab{background:linear-gradient(150deg,#FFD36B,#FF9F45);}
#screen-maison .g-app{background:linear-gradient(150deg,#7BE08A,#34B86A);}
#screen-maison .g-recre{background:linear-gradient(150deg,#FF8AC2,#F0568F);}
#screen-maison .g-monde{background:linear-gradient(150deg,#7EC8E3,#45B7D1);}
#screen-maison .g-lire{background:linear-gradient(150deg,#9BA8FF,#6C63FF);}
#screen-maison .g-parents{background:linear-gradient(150deg,#C3C0DA,#9A95C0);}
#screen-maison .g-cahier{background:linear-gradient(150deg,#FFD08A,#FF8A4C);}
#screen-maison .g-pokawaa{background:linear-gradient(155deg,#514280 0%,#3B3467 50%,#FFB562 130%);}

/* Jardin */
#screen-maison .maison-jardin{
  position:relative;z-index:2;margin:6px 16px 10px;background:rgba(255,255,255,.55);
  border-radius:22px;padding:11px 16px;display:flex;align-items:center;gap:8px;
  box-shadow:0 6px 14px rgba(60,80,140,.12);
}
#screen-maison .maison-jardin .jardin-label{font-weight:600;color:#2D5016;font-size:14px;}

/* ============================================================
   FIX MOBILE HOME (v44) - 2 colonnes propres, plein ecran
   ============================================================ */
@media (max-width: 599px) {
  #screen-maison .grille-univers {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    padding: 12px 12px 16px !important;
    max-width: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }
  #screen-maison .tuile-univers {
    min-height: 130px !important;
    padding: 12px 8px !important;
    border-radius: 22px !important;
    gap: 8px !important;
  }
  #screen-maison .tuile-badge-rond {
    width: 58px !important;
    height: 58px !important;
    font-size: 30px !important;
  }
  #screen-maison .tuile-univers .tuile-nom {
    font-size: 13px !important;
    line-height: 1.1 !important;
  }
  #screen-maison .tuile-univers .gribou-btn-audio {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    font-size: 12px !important;
    top: 6px !important;
    right: 6px !important;
  }
  #screen-maison {
    overflow: hidden;
  }
  #screen-maison .maison-header {
    padding: 10px 12px 4px !important;
  }
}

/* v44b - force largeur pleine mobile (margin:auto en flex column collapse la grille) */
@media (max-width: 599px) {
  #screen-maison .grille-univers {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box;
  }
}
