/* Quiz du jour — iPad d'Alix. Grosses cibles, gros texte, zéro surprise tactile (skill mobile-native). */
:root {
  --fond: #FFF7EC;
  --carte: #FFFFFF;
  --encre: #2B2140;
  --doux: #6E6585;
  --accent: #7B61FF;
  --accent-fonce: #5B43E0;
  --vert: #22A86B;
  --vert-pale: #DDF6EA;
  --rouge: #E5484D;
  --rouge-pale: #FDE4E4;
  --jaune: #FFC94D;
  --ombre: 0 2px 0 rgba(43, 33, 64, .08), 0 8px 24px rgba(43, 33, 64, .06);
  --rayon: 22px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body { min-height: 100dvh; }

#app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 24px) calc(env(safe-area-inset-right) + 20px)
           calc(env(safe-area-inset-bottom) + 24px) calc(env(safe-area-inset-left) + 20px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

h1 { font-size: 34px; margin: 0; letter-spacing: -.5px; }
h2 { font-size: 24px; margin: 0; }
p { margin: 0; line-height: 1.4; }
.sous-titre { color: var(--doux); font-size: 18px; }
.centre { text-align: center; }

button {
  font: inherit;
  color: inherit;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
button:disabled { cursor: default; }

.bouton {
  background: var(--accent);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  padding: 20px 28px;
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--accent-fonce);
  transition: transform .12s ease, box-shadow .12s ease;
}
.bouton:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-fonce); }
.bouton.secondaire { background: var(--carte); color: var(--encre); box-shadow: 0 4px 0 #E4DDD0; }

/* ---------- PIN */
.pin-points { display: flex; justify-content: center; gap: 18px; margin: 8px 0; }
.pin-points span {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--accent); transition: background .12s ease;
}
.pin-points span.plein { background: var(--accent); }
.pin-points.erreur { animation: secoue .35s ease; }
@keyframes secoue { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }

.clavier {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  width: min(100%, 360px); margin: 0 auto;
}
.clavier button {
  aspect-ratio: 1.3; font-size: 32px; font-weight: 700;
  background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre);
}
.clavier button:active { background: #EFEAFF; }

/* ---------- Accueil */
.progres-jour {
  background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre);
  padding: 20px; display: flex; align-items: center; gap: 16px;
}
.etoiles { font-size: 40px; letter-spacing: 4px; }
.carte-quiz {
  width: 100%; text-align: left;
  background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre);
  padding: 22px; display: flex; align-items: center; gap: 16px; font-size: 22px;
}
.carte-quiz .titre { font-weight: 700; flex: 1; }
.carte-quiz .etat { font-size: 18px; color: var(--doux); }
.carte-quiz.reussi { background: var(--vert-pale); }
.carte-quiz.rate { background: #F4F1EC; }
.carte-quiz:disabled .titre { color: var(--doux); }
.bravo {
  background: var(--jaune); border-radius: var(--rayon); padding: 24px;
  text-align: center; font-size: 26px; font-weight: 800;
}
.bandeau-essai {
  background: #EFEAFF; color: var(--accent-fonce); border-radius: 12px;
  padding: 10px 14px; font-size: 15px; font-weight: 600; text-align: center;
}

/* ---------- Question */
.entete-question { display: flex; align-items: center; gap: 14px; }
.barre { flex: 1; height: 14px; background: #EDE6DA; border-radius: 999px; overflow: hidden; }
.barre > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.compte { font-weight: 700; color: var(--doux); font-variant-numeric: tabular-nums; }
.matiere { font-size: 16px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; }
.enonce { font-size: 28px; font-weight: 700; line-height: 1.3; }
.choix { display: grid; gap: 14px; }
@media (min-width: 600px) { .choix { grid-template-columns: 1fr 1fr; } }
.choix button {
  background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre);
  min-height: 84px; padding: 16px 18px; font-size: 24px; font-weight: 600; text-align: center;
  border: 3px solid transparent; transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}
.choix button.bon { background: var(--vert-pale); border-color: var(--vert); }
.choix button.mauvais { background: var(--rouge-pale); border-color: var(--rouge); }
.choix button.eteint { opacity: .45; }
.retour {
  border-radius: var(--rayon); padding: 18px 20px; font-size: 20px; line-height: 1.4;
}
.retour.bon { background: var(--vert-pale); }
.retour.mauvais { background: var(--rouge-pale); }
.retour strong { display: block; font-size: 24px; margin-bottom: 4px; }

/* ---------- Fin */
.gros-score { font-size: 80px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.pousse { flex: 1; }

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