/* Écran de tablette, lisible de loin : grandes lettres, gros boutons, couleurs du livre. */
:root {
  --papier: #FBF8F3;
  --encre: #3D3956;
  --doux: #6E6A85;
  --accent: #B5563A;
  --accent-clair: #F3E3DC;
  --trait: #E4DED3;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--papier);
  color: var(--encre);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 20px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

main { max-width: 960px; margin: 0 auto; padding: 24px 24px 40px; }

.ecran { display: flex; flex-direction: column; gap: 24px; }
.ecran[hidden] { display: none; }

h1 { font-size: 1.6rem; margin: 0; font-weight: 600; }

button, input { font: inherit; color: inherit; }

button {
  min-height: 56px;
  padding: 0 24px;
  border-radius: 14px;
  border: 2px solid var(--trait);
  background: #fff;
  cursor: pointer;
}
button:disabled { opacity: 0.45; cursor: default; }
button.principal { background: var(--encre); border-color: var(--encre); color: #fff; }
button.discret { border-color: transparent; background: transparent; color: var(--doux); padding: 0 8px; }

.formulaire { display: flex; flex-direction: column; gap: 16px; max-width: 520px; }
.formulaire label { display: flex; flex-direction: column; gap: 6px; }
input {
  min-height: 56px;
  padding: 0 16px;
  border: 2px solid var(--trait);
  border-radius: 12px;
  background: #fff;
}

.message { color: var(--doux); margin: 0; }

.barre { display: flex; align-items: center; gap: 16px; justify-content: space-between; }

.livres { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.livres li {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; background: #fff; border: 2px solid var(--trait); border-radius: 16px;
}
.livres .nom { font-weight: 600; }
.livres .detail { color: var(--doux); font-size: 0.9rem; }

details summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; }
details[open] summary { margin-bottom: 16px; }

/* Raconter */
.raconter { min-height: calc(100vh - 64px); }
.jauge { flex: 1; max-width: 420px; }
.jauge-fond { height: 10px; border-radius: 5px; background: var(--trait); overflow: hidden; }
.jauge-fond span { display: block; height: 100%; width: 0; background: var(--encre); transition: width 0.6s; }
.jauge p { margin: 6px 0 0; font-size: 0.85rem; color: var(--doux); text-align: center; }
.interrupteur { display: flex; align-items: center; gap: 8px; color: var(--doux); font-size: 0.9rem; }
.interrupteur input { width: 24px; min-height: 24px; }

.question {
  font-size: 2.1rem;
  line-height: 1.3;
  margin: 24px 0 0;
  min-height: 5.2em;
  text-wrap: pretty;
}

.attente { min-height: 1.5em; margin: 0; color: var(--accent); font-size: 1.05rem; }

.micro {
  align-self: center;
  width: 220px; height: 220px;
  border-radius: 50%;
  border: none;
  background: var(--encre);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgb(61 57 86 / 0.25);
}
.micro.enregistre { background: var(--accent); animation: battement 1.6s ease-in-out infinite; }
@keyframes battement {
  0%, 100% { box-shadow: 0 0 0 0 rgb(181 86 58 / 0.45); }
  50% { box-shadow: 0 0 0 24px rgb(181 86 58 / 0); }
}
@media (prefers-reduced-motion: reduce) { .micro.enregistre { animation: none; } }

.chrono { align-self: center; margin: 0; min-height: 1.5em; color: var(--doux); font-variant-numeric: tabular-nums; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

@media (max-width: 600px) {
  main { padding: 16px; }
  .question { font-size: 1.6rem; }
  .micro { width: 180px; height: 180px; }
  .barre { flex-wrap: wrap; }
}
