/* Tableau des tâches — pensé pour l'Echo Show 15 en vertical (Amazon Silk) */

:root {
  --fond: #E7ECF0;        /* émail de frigo */
  --carte: #FFFFFF;
  --encre: #1C2430;
  --encre-2: #5A6573;
  --ligne: #D2DAE1;
  --fait-fond: #F1F4F6;
  --rayon: 1.1rem;
  --affichage: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --texte: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  font-size: clamp(16px, 2.55vw, 30px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--texte);
  line-height: 1.3;
  padding: 1.1rem 1rem 1.5rem;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible { outline: 3px solid var(--encre); outline-offset: 3px; }

/* ── En-tête ─────────────────────────────────────────────────────────── */
.tete { text-align: center; margin-bottom: 1rem; }
.tete-ligne { display: flex; align-items: center; gap: .6rem; }
.tete-texte { flex: 1; min-width: 0; }
h1 {
  font-family: var(--affichage);
  font-weight: 600;
  font-size: 2.3rem;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
}
#sous-titre { margin: .3rem 0 0; color: var(--encre-2); font-size: .95rem; }
.nav {
  width: 3rem; height: 3rem; flex: none;
  border-radius: 50%;
  background: var(--carte);
  border: 1px solid var(--ligne);
  font-size: 1.9rem; line-height: 1;
  font-family: var(--affichage);
}
.retour {
  margin-top: .7rem;
  padding: .55rem 1.2rem;
  border-radius: 999px;
  background: var(--encre);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
}

/* ── Aimants (lettres des enfants) — l'élément signature ──────────────── */
.aimant {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.9rem; height: 2.9rem; flex: none;
  font-family: var(--affichage);
  font-weight: 700;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--c);
  /* l'épaisseur du plastique, comme une lettre aimantée sur le frigo */
  text-shadow: 0 .12rem 0 var(--cf), 0 .2rem .25rem rgba(28, 36, 48, .18);
  transform: rotate(-4deg);
}
.aimant.petit { width: 1.6rem; height: 1.6rem; font-size: 1.5rem; vertical-align: middle; margin: 0 .2rem; }

/* ── Bandeau des enfants ─────────────────────────────────────────────── */
.enfants {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
  margin-bottom: 1rem;
}
.enfant {
  display: flex; flex-direction: column; align-items: center;
  padding: .6rem .3rem .65rem;
  background: var(--carte);
  border: 2px solid transparent;
  border-radius: var(--rayon);
  transition: opacity .2s, border-color .2s;
}
.enfant .aimant { width: 3.4rem; height: 3.4rem; font-size: 3.2rem; }
.enfant:nth-child(even) .aimant { transform: rotate(5deg); }
.enfant-age { font-size: .78rem; color: var(--encre-2); margin-top: .15rem; }
.enfant-compte { font-weight: 700; font-size: .95rem; margin-top: .1rem; }
.enfant.actif { border-color: var(--encre); }
.enfant.estompe { opacity: .4; }
.enfant.fini .enfant-compte { color: #11683F; }

.filtre {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  margin: -0.3rem 0 .9rem;
  font-weight: 700;
}
.filtre button {
  margin-left: .5rem;
  padding: .35rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--encre);
  font-size: .9rem;
}

/* ── Périodes ────────────────────────────────────────────────────────── */
.periode { margin-bottom: 1.1rem; }
.periode-tete {
  display: flex; align-items: baseline; gap: .6rem;
  width: 100%;
  padding: 0 .2rem .45rem;
  text-align: left;
}
.periode-titre {
  font-family: var(--affichage);
  font-weight: 600;
  font-size: 1.6rem;
}
.pastille {
  font-size: .78rem; font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: var(--encre); color: #fff;
  align-self: center;
}
.periode-compte { margin-left: auto; color: var(--encre-2); font-size: .95rem; }
.periode:not(.maintenant) .periode-titre { color: var(--encre-2); }
.periode.replie .periode-tete {
  background: var(--carte);
  border-radius: var(--rayon);
  padding: .8rem 1rem;
  align-items: center;
}
.periode.retard .periode-compte { color: #B4232F; font-weight: 700; }
.fleche { display: inline-block; margin-left: .3rem; }

ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }

/* ── Tâches ──────────────────────────────────────────────────────────── */
.tache {
  display: flex; align-items: center; gap: .9rem;
  width: 100%;
  min-height: 4.6rem;
  padding: .6rem 1rem .6rem .8rem;
  background: var(--carte);
  border-radius: var(--rayon);
  border: 1px solid var(--ligne);
  text-align: left;
  transition: background .2s;
}
.tache-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tache-nom { font-weight: 700; font-size: 1.15rem; }
.icone { margin-right: .45rem; }
.tache-detail { color: var(--encre-2); font-size: .92rem; margin-top: .1rem; }

.case {
  width: 2.5rem; height: 2.5rem; flex: none;
  border-radius: 50%;
  border: 3px solid var(--ligne);
  display: flex; align-items: center; justify-content: center;
}
.case svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }

.tache.fait { background: var(--fait-fond); border-color: transparent; }
.tache.fait .tache-nom { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--encre-2); }
.tache.fait .aimant { opacity: .55; }
.tache.fait .case { background: var(--encre); border-color: var(--encre); }
.tache.fait .case svg { opacity: 1; }

.tache.anime .case { animation: pop .35s ease-out; }
@keyframes pop {
  0% { transform: scale(.6); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.fete {
  text-align: center;
  font-family: var(--affichage);
  font-weight: 600;
  font-size: 1.4rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--carte);
  border-radius: var(--rayon);
}

.pied {
  text-align: center;
  color: var(--encre-2);
  font-size: .85rem;
  margin-top: 1.4rem;
}
.pied p { margin: .3rem 0; }
.synchro::before {
  content: '';
  display: inline-block;
  width: .6rem; height: .6rem;
  border-radius: 50%;
  margin-right: .4rem;
  background: #9AA5B1;
  vertical-align: middle;
}
.synchro.ok::before { background: #1E9E66; }
.synchro.horsligne { color: #B4232F; font-weight: 700; }
.synchro.horsligne::before { background: #B4232F; }

@media (prefers-reduced-motion: reduce) {
  .tache.anime .case { animation: none; }
  * { transition: none !important; }
}
