@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Outfit:wght@400;500;600;700&display=swap");

/* Palette reprise de la Feuille d'appels (artefact claude.ai, 2026-09) */
:root {
  --craie: #150a38;
  --craie-2: #463c73;
  --craie-3: #6f6496;
  --carte: #ffffff;
  --carte-2: #f1eefe;
  --trait: #e2dcf7;
  --vert: #0bbd7e;
  --rouge: #ff2d55;
  --or: #f79000;
  --b4: #4361ff;
  --rose: #e0007a;
  --g0: linear-gradient(150deg, #ffab1f, #ff4400);   /* triangle */
  --g1: linear-gradient(150deg, #ff3d9c, #cf0069);   /* losange */
  --g2: linear-gradient(150deg, #2ff0ad, #00a86e);   /* rond */
  --g3: linear-gradient(150deg, #5f74ff, #1520c9);   /* carré */
  --gp: linear-gradient(120deg, #ff3d9c, #ff7a18);   /* bouton principal */
  --ombre: 0 14px 34px rgba(42, 26, 85, .18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Outfit, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--craie);
  background:
    radial-gradient(880px 420px at 4% -6%, #9adcff 0%, transparent 54%),
    radial-gradient(820px 400px at 99% -2%, #ffb3e0 0%, transparent 52%),
    radial-gradient(700px 380px at 50% 106%, #9dffd2 0%, transparent 56%),
    linear-gradient(180deg, #f6f7ff, #e9edfb);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, .titre { font-family: Fredoka, Outfit, sans-serif; font-weight: 600; margin: 0; text-wrap: balance; }
.chiffre { font-family: Fredoka, sans-serif; font-variant-numeric: tabular-nums; font-weight: 700; }
button { font-family: inherit; cursor: pointer; border: 0; }
input { font-family: inherit; }

/* Bulles de couleur qui flottent derrière tout */
.bulles { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bulles i { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .45; animation: flotte 14s ease-in-out infinite alternate; }
.bulles i:nth-child(1) { width: 260px; height: 260px; background: #ffb3e0; left: -60px; top: 30%; }
.bulles i:nth-child(2) { width: 220px; height: 220px; background: #9adcff; right: -50px; top: 8%; animation-delay: -4s; }
.bulles i:nth-child(3) { width: 240px; height: 240px; background: #9dffd2; left: 30%; bottom: -80px; animation-delay: -8s; }
@keyframes flotte { to { transform: translate(40px, -60px) scale(1.15); } }

.page { min-height: 100dvh; display: flex; flex-direction: column; }
.entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.entete img { height: 24px; display: block; }
.badge { display: inline-flex; align-items: center; gap: 8px; background: var(--carte); border-radius: 999px; padding: 6px 12px 6px 6px;
         font-family: Fredoka; font-weight: 600; box-shadow: 0 4px 14px rgba(42,26,85,.12); }
.pastille { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 13px; flex: none;
            font-family: Fredoka; font-weight: 700; line-height: 1; vertical-align: middle; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.contenu { flex: 1; display: flex; flex-direction: column; padding: 4px 16px 18px; gap: 14px; min-height: 0; }
.centre { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }

.carte { background: var(--carte); border-radius: 22px; padding: 22px; box-shadow: var(--ombre); }
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 16px; padding: 16px 24px;
          font-family: Fredoka; font-weight: 600; font-size: 20px; color: #fff; background: var(--gp);
          box-shadow: 0 6px 0 #b8005a, 0 12px 24px rgba(207,0,105,.3); transition: transform .08s; }
.bouton:active { transform: translateY(4px); box-shadow: 0 2px 0 #b8005a; }
.bouton:disabled { filter: grayscale(.8); opacity: .5; }
.bouton.plein { width: 100%; }
.bouton.bleu { background: var(--g3); box-shadow: 0 6px 0 #0f17a0, 0 12px 24px rgba(21,32,201,.3); }
.bouton.discret { background: var(--carte); color: var(--craie-2); box-shadow: 0 4px 0 var(--trait); font-size: 16px; padding: 12px 18px; }
.erreur { color: var(--rouge); font-weight: 600; min-height: 1.3em; }
.sous { color: var(--craie-3); font-size: 15px; }

/* Réponses colorées */
.forme { width: 1.1em; height: 1.1em; flex: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.rep { color: #fff; border-radius: 18px; font-family: Fredoka; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.25);
       box-shadow: 0 6px 0 rgba(0,0,0,.18); display: flex; align-items: center; gap: 12px; transition: transform .12s, opacity .25s, filter .25s; }
.rep.c0 { background: var(--g0); } .rep.c1 { background: var(--g1); }
.rep.c2 { background: var(--g2); } .rep.c3 { background: var(--g3); }
.rep:active { transform: scale(.96); }
.rep.eteinte { opacity: .25; filter: grayscale(.6); }
.rep.choisie { outline: 5px solid var(--craie); outline-offset: 3px; }

/* Anneau du chronomètre */
.anneau { --p: 1; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none;
          background: conic-gradient(var(--rose) calc(var(--p) * 360deg), var(--trait) 0); }
.anneau span { width: 50px; height: 50px; border-radius: 50%; background: var(--carte); display: grid; place-items: center;
               font-family: Fredoka; font-weight: 700; font-size: 24px; }
.anneau.urgent span { color: var(--rouge); animation: battement .5s ease-in-out infinite alternate; }

/* Animations */
.pop { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.monte { animation: monte .45s ease-out both; }
.tremble { animation: tremble .5s ease-in-out; }
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes monte { 0% { transform: translateY(24px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes tremble { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
@keyframes battement { to { transform: scale(1.18); } }
@keyframes rebond { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes pousse { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes compte { 0% { transform: scale(2.2); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(.7); opacity: 0; } }

#confettis { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

.mode:empty { display: none; }
