/* ─────────────────────────────────────────────────────────────────────────
   Cible des diviseurs / Cible des multiples (fun/diviseurs, fun/multiples)
   Moteur : js/cible-nombres.js
   ───────────────────────────────────────────────────────────────────────── */
:root { --c-encre: #1e293b; --c-ok: #16a34a; --c-ko: #dc2626; --c-oubli: #f59e0b; }
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100dvh; padding: 72px 14px 28px; color: var(--c-encre);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(120% 80% at 50% 0%, #1e3a5f 0%, #0f1b33 55%, #0a1224 100%) fixed;
}
:root.fv-dys body { font-family: inherit; }
.fv-header{position:fixed;top:0;left:0;width:100%;z-index:1000;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;padding:10px 31px 10px 16px;background:linear-gradient(135deg,#1a1a2e,#16213e);color:#fff;box-shadow:0 2px 10px rgba(0,0,0,.35);}
.fv-header .left{justify-self:start;} .fv-header .center{justify-self:center;font-weight:700;text-align:center;} .fv-header .right{justify-self:end;}
.btn-nav{padding:6px 14px;border-radius:8px;border:1px solid rgba(255,255,255,.35);background:rgba(255,255,255,.12);color:#fff;font-size:.9em;text-decoration:none;white-space:nowrap;display:inline-block;}
.btn-nav:hover{background:rgba(255,255,255,.22);}

.cb-carte {
  position: relative; z-index: 10; width: min(760px, 100%); margin: 6px auto 0;
  background: #fff; border-radius: 26px; padding: 16px 18px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 1px 0 #fff;
}
.cb-haut { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.cb-haut h1 { margin: 0; font-size: clamp(1.25em, 3.4vw, 1.6em); font-weight: 900; color: #0f172a; }
.cb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cb-chip {
  padding: 5px 12px; border-radius: 999px; background: #f1f5f9; border: 1px solid #e2e8f0;
  font-weight: 800; font-size: .9em; color: #0f172a; font-variant-numeric: tabular-nums;
}
.cb-consigne { margin: 8px 0 2px; text-align: center; color: #475569; font-weight: 600; }
.cb-consigne b { color: #0f172a; }

/* La cible à anneaux */
.cb-cible-zone { display: flex; justify-content: center; margin: 8px 0 10px; }
.cb-cible {
  position: relative; width: clamp(118px, 24vw, 150px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 30%, #dc2626 30% 44%, #fff 44% 58%, #dc2626 58% 72%, #fff 72% 86%, #dc2626 86% 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25), inset 0 0 0 3px rgba(0, 0, 0, .12);
  display: grid; place-items: center;
}
.cb-cible > .cb-num {
  min-width: 56%; padding: 4px 8px; border-radius: 16px; text-align: center;
  background: #0f172a; color: #fff; font-weight: 900; font-size: clamp(26px, 5.5vw, 38px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .35); font-variant-numeric: tabular-nums;
}
.cb-cible.touche { animation: cbTouche .35s ease; }
@keyframes cbTouche { 40% { transform: scale(1.08); } }
.cb-fleche { position: absolute; z-index: 2; font-size: 20px; line-height: 1; transform: translate(-50%, -85%); pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.cb-cible > .cb-num { position: relative; z-index: 1; }

/* Fléchette en vol (posée en position fixe par le moteur) */
.cb-vol {
  position: fixed; z-index: 2000; pointer-events: none; font-size: 26px; font-weight: 900;
  transition: transform .45s cubic-bezier(.3, .7, .3, 1), opacity .45s;
}

/* Tuiles */
.cb-grille { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 520px; margin: 0 auto; }
.cb-tuile {
  position: relative; min-height: 64px; border-radius: 16px; cursor: pointer;
  font: inherit; font-weight: 900; font-size: clamp(20px, 4.4vw, 28px); color: #0f172a;
  background: linear-gradient(180deg, #fff, #f1f5f9); border: 2px solid #cbd5e1; box-shadow: 0 5px 0 #b8c4d6;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; font-variant-numeric: tabular-nums;
  transition: transform .07s, box-shadow .07s, background .2s, border-color .2s;
}
.cb-tuile:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #b8c4d6; }
@media (hover: hover) { .cb-tuile:hover:not(:disabled) { border-color: #3b82f6; } }
.cb-tuile:disabled { cursor: default; }
.cb-tuile.ok { color: #14532d; background: #dcfce7; border-color: var(--c-ok); box-shadow: 0 5px 0 #15803d; }
.cb-tuile.ko { color: #7f1d1d; background: #fee2e2; border-color: var(--c-ko); box-shadow: 0 5px 0 #b91c1c; animation: cbSecoue .3s; }
.cb-tuile.ko::after { content: "✕"; position: absolute; top: 3px; right: 8px; font-size: .55em; }
.cb-tuile.oubli { background: #fffbeb; border: 3px dashed var(--c-oubli); box-shadow: none; color: #92400e; }
.cb-tuile .cb-detail { display: block; font-size: .42em; font-weight: 800; opacity: .8; margin-top: 2px; }
@keyframes cbSecoue { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.cb-actions { display: flex; justify-content: center; gap: 10px; margin: 14px 0 8px; flex-wrap: wrap; }
.cb-btn {
  min-height: 48px; padding: 10px 24px; border-radius: 999px; border: none; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 1.05em; color: #fff; touch-action: manipulation;
  background: linear-gradient(180deg, #3b82f6, #2563eb); box-shadow: 0 4px 0 #1d4ed8;
}
.cb-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #1d4ed8; }
.cb-btn.vert { background: linear-gradient(180deg, #22c55e, #16a34a); box-shadow: 0 4px 0 #15803d; }
.cb-btn:disabled { opacity: .45; cursor: default; }

.cb-barre { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.cb-barre > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f59e0b, #dc2626); transition: width .4s; }
.cb-message { min-height: 1.5em; margin-top: 8px; text-align: center; font-weight: 800; }
.cb-pourquoi { display: inline-block; margin-top: 6px; padding: 8px 14px; border-radius: 12px; background: #fff7ed; border: 2px solid #fdba74; color: #431407; font-size: 1.1em; line-height: 1.5; }
.cb-pourquoi b { color: #dc2626; font-size: 1.15em; } .cb-pourquoi small { font-size: .78em; font-weight: 700; color: #7c2d12; }
.cb-pourquoi .cb-enc { color: #15803d; white-space: nowrap; }
body[class*="theme-"] .cb-pourquoi, body[class*="theme-"] .cb-pourquoi small { color: #431407 !important; -webkit-text-fill-color: #431407 !important; }
body[class*="theme-"] .cb-pourquoi b { color: #dc2626 !important; -webkit-text-fill-color: #dc2626 !important; }
body[class*="theme-"] .cb-pourquoi .cb-enc { color: #15803d !important; -webkit-text-fill-color: #15803d !important; }
.cb-message.ok { color: #15803d; } .cb-message.ko { color: #b91c1c; } .cb-message.info { color: #1d4ed8; }

/* Correction de fin de manche : la leçon */
.cb-lecon {
  margin-top: 10px; padding: 12px 14px; border-radius: 18px; background: #f0fdf4; border: 2px solid #86efac; color: #14532d;
  text-align: center; animation: cbApparait .3s ease;
}
.cb-lecon h3 { margin: 0 0 6px; font-size: 1em; }
.cb-bravo { font-weight: 900; font-size: 1.15em; color: #15803d; margin-bottom: 4px; }
.cb-paires { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cb-paires span { padding: 3px 10px; border-radius: 10px; background: #fff; border: 1px solid #bbf7d0; }
.cb-paires mark { background: #fde68a; color: inherit; border-radius: 4px; padding: 0 2px; }
.cb-lecon .cb-btn { margin-top: 10px; min-height: 40px; font-size: .95em; padding: 8px 18px; }
@keyframes cbApparait { from { opacity: 0; transform: translateY(6px); } }

.cb-fin { text-align: center; padding: 10px 0 4px; }
.cb-fin h2 { margin: 6px 0; font-size: 1.8em; }
.cb-fin p { margin: 4px 0 12px; font-size: 1.1em; }

@media (max-width: 520px) { .cb-grille { gap: 7px; } .cb-tuile { min-height: 56px; } }
