/* ================================
   Thème enfantin 8–12 ans
   ================================ */
:root {
  --bg: #fffaf5;
  --panel: #ffffff;
  --card: #fff1e6;
  --text: #333333;
  --muted: #666666;
  /* Couleurs pastels */
  --primary: #ff9f1c;   /* orange soleil */
  --secondary: #2ec4b6; /* vert menthe */
  --accent: #e71d36;    /* framboise */
  --highlight: #ffbf69; /* jaune doux */
  --radius: 24px;
  --shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

/* Reset de base */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: "Baloo 2", "Fredoka", sans-serif;
  background: var(--bg); color: var(--text);
}

.logo { width: 60px; height: 60px; }

/* Header */
.site-header {
  text-align: center; padding: 32px 16px;
  background: linear-gradient(135deg, var(--primary), var(--highlight));
  color: white;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  box-shadow: var(--shadow);
}
.site-header h1 { margin: .4rem 0; font-size: 2.4rem; }
.tagline { margin: 0; font-size: 1.2rem; font-weight: 500; }

/* Container */
.container { max-width: 1100px; margin: 0 auto; padding: 16px; }

/* Bibliothèque */
.library {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; margin-top: 20px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s ease;
  border: 3px solid transparent;
}
.card:hover { transform: scale(1.04); border-color: var(--primary); }
.card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.card-content { padding: 16px; }
.card h3 { margin: .2rem 0; font-size: 1.4rem; color: var(--primary); }
.card p { margin: .2rem 0; color: var(--muted); }

/* Boutons */
.btn {
  display: inline-block; padding: 12px 18px; border: none;
  border-radius: var(--radius); font-weight: bold; font-size: 1rem;
  cursor: pointer; margin-top: 8px; transition: all .2s ease;
}
.btn.primary { background: var(--primary); color: white; }
.btn.primary:hover { background: var(--highlight); }
.btn.secondary { background: var(--secondary); color: white; }
.btn.secondary:hover { background: #25a398; }
.btn.ghost { background: transparent; color: var(--accent); border: 2px dashed var(--accent); }
.btn.ghost:hover { background: var(--accent); color: white; }

/* Lecteur */
.player {
  display: none; background: var(--panel); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-top: 20px;
}
.player-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.player-header h2 { margin: 0; color: var(--secondary); }

.scene { display: grid; gap: 16px; }
.scene-image { width: 100%; border-radius: var(--radius); border: 3px solid var(--highlight); }
.scene-text {
  background: #fff6e9; border-radius: var(--radius); padding: 16px;
  line-height: 1.6; font-size: 1.1rem; border: 2px solid #ffe3c0;
}

/* Contrôles */
.controls { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

/* Choix */
.choices {
  margin-top: 16px; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px;
}
.choice {
  padding: 14px; background: var(--secondary); color: white; font-weight: bold;
  border-radius: var(--radius); text-align: center; cursor: pointer; transition: background .2s;
}
.choice:hover { background: #25a398; }

/* Narration */
.narration-bar {
  display: grid; grid-template-columns: auto auto 1fr 1fr 1fr;
  gap: 10px; align-items: center; margin-top: 10px; padding: 12px;
  background: #fff; border: 2px solid #ffd9a8; border-radius: var(--radius); box-shadow: var(--shadow);
}
.narration-bar label { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #444; }
.narration-bar input[type="range"] { width: 100%; }

.scene-text .highlight {
  background: #ffeb99; border-radius: 8px; padding: 0 2px;
}

/* Footer */
.site-footer { text-align: center; color: var(--muted); padding: 20px 12px; margin-top: 30px; font-size: .9rem; }

/* Accessibilité */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
