/* style.css — thème « grands » (Noya / Elior). Gros boutons tactiles, FR + RTL. */

:root {
  --bg: #f3f7ff;
  --card: #ffffff;
  --accent: #4a6cf7;
  --accent-2: #22c58b;
  --danger: #ff6b6b;
  --ink: #222b45;
  --muted: #7a86a1;
  --radius: 20px;
  --shadow: 0 8px 24px rgba(74, 108, 247, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 1.15rem; margin: 0; }
.topbar .left { display: flex; align-items: center; gap: 10px; }

.container { max-width: 720px; margin: 0 auto; padding: 22px 18px 60px; }

.btn {
  border: none;
  border-radius: var(--radius);
  padding: 16px 22px;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
  transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: scale(.96); }
.btn.secondary { background: #e7ecfb; color: var(--accent); box-shadow: none; }
.btn.success { background: var(--accent-2); }
.btn.mini { padding: 8px 14px; font-size: .95rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.profil {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  border: 3px solid transparent;
  transition: transform .1s ease, border-color .15s ease;
}
.profil:active { transform: scale(.97); }
.profil:hover { border-color: var(--accent); }
.profil .avatar { font-size: 3.4rem; line-height: 1; display: inline-block; }
/* Photos d'enfants (rondes) */
img.avatar { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); }
.avatar-mini { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; vertical-align: middle; display: inline-block; }
img.avatar-mini { border: 2px solid #fff; }
.profil .nom { font-size: 1.3rem; font-weight: 800; margin-top: 8px; }
.profil .classe { color: var(--muted); margin-top: 2px; }

.matiere {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); cursor: pointer;
  font-size: 1.2rem; font-weight: 700;
  border: 3px solid transparent; transition: border-color .15s;
}
.matiere:hover { border-color: var(--accent); }
.matiere.locked { opacity: .55; cursor: default; }
.matiere.locked:hover { border-color: transparent; }
.matiere .badge {
  font-size: .8rem; font-weight: 600; color: var(--muted);
  background: #eef1f8; padding: 4px 10px; border-radius: 999px;
}

.title { font-size: 1.5rem; font-weight: 800; margin: 6px 0 20px; }

.carte-ex {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 34px 24px; text-align: center;
}
.enonce { font-size: 2.6rem; font-weight: 800; letter-spacing: 1px; margin: 10px 0 26px; }

/* Fraction empilée : numérateur / barre / dénominateur */
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 .18em; line-height: 1.05; }
.frac .num { padding: 0 .3em 2px; }
.frac .den { padding: 2px .3em 0; border-top: 4px solid currentColor; }
.reponse-input {
  width: 100%; max-width: 320px; padding: 16px; font-size: 1.8rem; text-align: center;
  border: 3px solid #dfe6f5; border-radius: var(--radius); outline: none;
}
.reponse-input:focus { border-color: var(--accent); }

.feedback { min-height: 34px; font-size: 1.3rem; font-weight: 800; margin: 18px 0; }
.feedback.ok { color: var(--accent-2); }
.feedback.ko { color: var(--danger); }

.progress-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 6px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: #dfe6f5; }
.dot.ok { background: var(--accent-2); }
.dot.ko { background: var(--danger); }

.stars { font-size: 2.4rem; letter-spacing: 6px; }
.stat-row { display: flex; gap: 12px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.stat {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 20px; min-width: 96px; text-align: center;
}
.stat .val { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.stat .lbl { color: var(--muted); font-size: .9rem; }

/* Le texte hébreu s'oriente tout seul (RTL) sans faire bouger la structure LTR. */
.enonce, .opt, [data-matiere], .nom, .topbar h1 span, .feedback { unicode-bidi: plaintext; }

/* Objectif d'étoiles du jour */
.objectif-label { font-weight: 700; margin-bottom: 8px; text-align: center; }
.barre { height: 22px; background: #e7ecfb; border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.08); }
.barre-in { height: 100%; background: linear-gradient(90deg, #ffd93b, #ff9f1a); border-radius: 999px; transition: width .5s ease; }
.objectif-ok {
  text-align: center; font-weight: 800; font-size: 1.2rem; color: #b8860b;
  background: #fff7db; border: 3px solid #ffd93b; border-radius: var(--radius); padding: 14px;
}

.center { text-align: center; }
.mt { margin-top: 22px; }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== Arbre de compétences (matiere.php) ===== */
.reco-carte {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 20px; margin-bottom: 22px; border: 3px solid var(--accent);
}
.reco-lbl { font-size: .82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.reco-titre { font-size: 1.25rem; font-weight: 800; unicode-bidi: plaintext; }

.cat-titre {
  font-size: 1.05rem; font-weight: 800; color: var(--accent);
  margin: 22px 0 10px; unicode-bidi: plaintext;
}
.comp {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  padding: 12px 16px; margin-bottom: 10px;
}
.comp.locked { opacity: .55; }
.comp-txt { flex: 1; min-width: 0; }
.comp-titre { font-size: 1.05rem; font-weight: 700; margin-bottom: 7px; unicode-bidi: plaintext; }
.comp-etat { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.mbadge { font-size: .78rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; unicode-bidi: plaintext; }
.mbar { display: flex; gap: 4px; }
.mbar .seg { width: 26px; height: 8px; border-radius: 999px; transition: background .4s ease; }
.comp .badge { font-size: .78rem; font-weight: 600; color: var(--muted); background: #eef1f8; padding: 4px 10px; border-radius: 999px; }
