/* Family Portal — V1 navigation skeleton
   Tablet-first: large touch targets, big text, minimal chrome.
   No child-facing text lives here — copy comes from config/strings/fr.json. */

/* Typography (docs/art/spec_production_visuels_accueil.md item 6, chosen
   2026-09-10): Baloo 2 for titles/accroches (rounded display face, echoes
   the wordmark's bubble letters without duplicating it), Nunito for body
   text (neutral, soft terminals, reads well small for parent-facing
   paragraphs). Self-hosted (web/assets/fonts/) rather than loaded from the
   Google Fonts CDN per the fiche's RGPD note — a CDN call would send every
   visitor's IP/UA to Google on every visit. Only the "latin" subset is
   fetched (covers all of é/è/à/ç/œ — French accents live in the Latin-1
   range U+0000-00FF, œ/Œ is explicitly U+0152-0153, both inside this
   subset), not the other scripts Google Fonts also serves (cyrillic,
   vietnamese, devanagari...), which this project has no use for. Both
   files are variable fonts — one physical file per family covers both
   weights below; the browser picks the right instance from the file
   itself via each @font-face's own font-weight value, same as Google's
   own served CSS does. */
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/baloo2-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/baloo2-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/nunito-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/nunito-latin.woff2') format('woff2');
}

:root {
  --color-bg: #fdf6e9;
  --color-surface: #ffffff;
  --color-text: #2c2c2c;
  --color-text-muted: #6b6b6b;
  --color-primary: #3b6fa4;
  --color-primary-dark: #274b73;
  --color-accent: #f2994a;
  --color-border: #d8d0bd;
  --radius-lg: 24px;
  --radius-md: 16px;
  --touch-min: 56px;
  --font-heading: 'Baloo 2', Verdana, "Segoe UI", sans-serif;
  --font-body: 'Nunito', Verdana, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

h1, h2, h3,
.app-title,
.section-title,
.btn,
.hub-card-title {
  font-family: var(--font-heading);
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-narrow {
  max-width: 480px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.top-bar-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* dashboard.php: keeps its "Page des enfants" button right next to the H1
   instead of pushed to the far end of .top-bar's own space-between — that
   parent rule still applies, but with only this one grouped child inside
   it now, it just sits at the start. Reused for the "Ajouter un profil
   enfant" heading + Masquer/Afficher button too. */
.top-bar-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* .app-title (the dashboard H1) already has margin:0, which is why that
   first usage centered against its button with no help needed. .section-title
   does not (32px/16px top/bottom by default) — reused here as a flex child,
   that asymmetric margin skewed align-items:center against a near-zero-
   margin button next to it. Neutralized so centering only ever depends on
   the wrapper's own layout; space above the whole group is controlled by
   .top-bar-title-group-spaced on the wrapper instead of the heading's own
   margin, so the two concerns don't fight each other. */
.top-bar-title-group .section-title {
  margin: 0;
}

/* Same spacing value as .section-title-spaced (see exercise_hub.php's "Les
   jeux" heading), applied to the wrapper instead of the heading for the
   reason above — dashboard.php's "Ajouter un profil enfant" row, to clear
   it from the child cards above it. */
.top-bar-title-group-spaced {
  margin-top: 64px;
}

/* web/parent/dashboard.php — same button row, reused at the bottom of the
   page instead of in the top-bar. */
.dashboard-footer-links {
  justify-content: center;
  margin-top: 40px;
}

/* web/parent/dashboard.php — separator between its blocks (children / referral / test exercises / footer links). */
.dashboard-sep {
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  margin: 40px 0;
}

.app-title {
  font-size: 1.75rem;
  margin: 0;
  color: var(--color-primary-dark);
}

.app-title img {
  height: 56px;
  width: auto;
  display: block;
}

/* web/index.php's child-grid view — 2x the base .app-title img size (the
   landing/marketing header has its own separate scaling, see home.css's
   .landing-menu .app-title img, so this doesn't touch that). Qualified with
   both .app-title and the element type (".app-title img.app-title-logo-lg",
   not just ".app-title-logo-lg") so its specificity actually beats the
   plain ".app-title img" rule above instead of losing to it. */
.app-title img.app-title-logo-lg {
  height: 112px;
  width: auto;
  display: block;
}

.app-logo-link {
  display: flex;
  align-items: center;
}

/* web/parent/dashboard.php's header logo — same 2x size as .app-title-logo-lg
   above, kept as its own class since it isn't nested inside .app-title there. */
.app-title-logo {
  height: 112px;
  width: auto;
  display: block;
}

.section-title {
  font-size: 1.4rem;
  color: var(--color-primary-dark);
  margin: 32px 0 16px;
}

/* exercise_hub.php's "Les jeux" title — extra clearance above it, since the
   curated exercise cards above (see .hub-grid-exercises) already bleed
   past their own bottom edge with the character art. */
.section-title-spaced {
  margin-top: 64px;
}

/* Buttons — 3 flat button-background assets (Notion "FunDrill v2.2 (charte
   graphique)" > Boutons pour toutes les pages), applied as a stretchable
   border-image (fill keyword renders the source's own center fill too, not
   just its edges) rather than a plain background so buttons of any width
   keep the asset's own rounded corners undistorted. border-image-slice is
   an estimate of the asset's own corner size in source pixels (all 3 share
   roughly the same ~270x153 canvas/corner radius) — re-check visually
   against docs/art/UI/button_*.png if a future asset revision changes the
   corner proportions.
   - button_basic.png (cream/tan): the default/neutral button — most of the
     app's buttons (Recommencer/Quitter, Lancer un exercice, nav links,
     dense parent-zone admin rows...).
   - button_green.png: an affirmative/primary action — Valider, Se
     connecter, Créer un compte.
   - button_red.png: a destructive or session-ending action — Se
     déconnecter, supprimer/désactiver (parent zone).
   Text stays dark ink on the cream background (already readable) but must
   switch to white on the green/red fills — flat colors under thin text
   would fail contrast otherwise. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  padding: 12px 28px;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s ease;
  background: none;
  border-style: solid;
  border-width: 18px;
  border-image-repeat: stretch;
  border-image-slice: 44 fill;
  border-image-width: 18px;
  /* Fallback in case the border-image asset fails to load (offline, blocked
     request...) — still reads as a button rather than plain text. */
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  /* Same soft-shadow-under-a-pill-button look already used everywhere in
     the exercise/game mechanics (e.g. web/exercises/type_word/play.html's
     .reset/.validate-btn) — a neutral shadow by default, overridden to a
     shadow tinted to match the button's own fill below. */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.btn:active {
  transform: scale(0.97);
}

/* "In alpha" until a form's required fields are all filled (see
   web/assets/js/form_gate.js) — a plain opacity fade rather than a
   greyed-out fill swap, since buttons use an image border (border-image)
   that doesn't respond to a background-color change. */
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn:disabled:active {
  transform: none;
}

/* Keyboard-focus ring (FUN-146): the border-image asset paints a plain
   rectangle underneath its own rounded corners, so the browser's default
   focus outline — which traces that rectangle, not the visible pill shape —
   read as the flat square-cornered button from before this border-image
   redesign. An explicit rounded outline (border-radius here does apply to
   outline even though the border-image ignores it) keeps the focus ring
   consistent with the new look. */
.btn:focus-visible {
  outline: 3px solid var(--color-primary-dark);
  outline-offset: 4px;
  border-radius: var(--radius-md);
}

.btn-primary {
  border-image-source: url('../images/ui/button_green.png');
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(60, 174, 112, 0.4);
}

.btn-secondary {
  border-image-source: url('../images/ui/button_basic.png');
  color: var(--color-text);
}

/* A standalone OAuth button (Google sign-in/signup) placed above its
   email/password form alternative — centered on its own line, with room
   below it so it doesn't read as glued to the form that follows. */
.oauth-button-row {
  display: flex;
  justify-content: center;
  margin: 0 0 24px;
}

.btn-danger {
  border-image-source: url('../images/ui/button_red.png');
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(241, 106, 84, 0.4);
}

/* Child picker */

.child-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
}

/* FUN-203 : espace parents (dashboard.php) — sur tablette, exactement 3 cartes enfant par ligne (donc plus
   grandes) au lieu de 4 étroites + un reste. Les téléphones gardent le nombre de colonnes automatique. */
@media (min-width: 600px) {
  .child-grid-tablet3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* .child-grid's own grid-template-columns (minmax(160px, 1fr)) always
   divides the full row width evenly across however many cards there are —
   fine for the 120px avatar it was tuned for, but with the doubled
   .child-avatar-xl (240px) that even share can come out narrower than the
   avatar itself (e.g. 3 cards in the page's 960px max-width), and the
   overflowing avatar then renders hard against the card's left edge
   instead of centered. Fixed-width flex cards that wrap and center
   (per CLAUDE.md's "wrapped item rows" rule) sidestep this instead of
   trying to out-guess the grid's column math. */
.child-grid-spaced {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 32px 0 48px;
}

.child-grid-spaced .child-card {
  width: 340px;
}

/* web/index.php's no-children-yet state (family logged in, zero child
   profiles created): a random schoolkid character (tranche B) centered
   above the "come create a profile" hint. */
.home-empty-state {
  text-align: center;
  margin: 32px 0 48px;
}

.home-empty-state img {
  max-width: 180px;
  height: auto;
}

.child-card {
  padding: 24px 16px;
  text-align: center;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.15s ease;
  background: none;
  border-style: solid;
  border-width: 20px;
  border-image-source: url('../images/ui/button_basic.png');
  border-image-slice: 44 fill;
  border-image-width: 20px;
  border-image-repeat: stretch;
  border-radius: var(--radius-lg);
  background-color: var(--color-surface);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.child-card:active {
  transform: scale(0.96);
}

.child-card-inactive {
  opacity: 0.55;
}

.child-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-border);
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 auto 12px;
}

.child-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Home page (web/index.php) only — doubles the shared .child-avatar size for
   the child picker's own cards, without touching the base size still used by
   parent/dashboard.php. */
.child-avatar-xl {
  width: 240px;
  height: 240px;
  font-size: 5rem;
}

.child-avatar-sm {
  width: 56px;
  height: 56px;
  font-size: 1.4rem;
  margin: 0;
}

/* exercise_hub.php, and (2026-09-16 user request: "doubler la taille de la
   photo") child_detail.php's own header — 2x .child-avatar-sm. Not applied
   to all_exercises.php/change_photo.php's own .child-avatar-sm usage. */
.child-avatar-lg {
  width: 112px;
  height: 112px;
  font-size: 2.8rem;
  margin: 0;
}

/* web/child/exercise_hub.php only: wraps the child's own avatar so the
   "changer de photo" affordance (see .child-avatar-edit) can be pinned to
   its bottom-right corner and only shown on hover/focus — replaces the
   earlier always-visible "Changer de photo" text button (user request
   2026-09-27). child_detail.php keeps its own separate, always-visible
   "Changer de photo" button unrelated to this wrapper. */
.child-avatar-wrap {
  position: relative;
  display: inline-flex;
  /* Now the actual flex child of .child-header (the avatar itself no longer
     is, see .child-avatar-lg's own flex:0 0 auto rule below) — same
     no-shrink protection so it isn't squished into an oval in that row. */
  flex: 0 0 auto;
}

.child-avatar-edit {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.child-avatar-wrap:hover .child-avatar-edit,
.child-avatar-wrap:focus-within .child-avatar-edit {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.child-avatar-edit img {
  width: 20px;
  height: 20px;
}

/* Dictionary/"page des enfants" buttons in web/child/exercise_hub.php's
   header — the icon is shown bigger than the button itself and bleeds
   past its edges, the same "art overflows its own control" treatment as
   .hub-card-character on an exercise card, scaled down for a .btn-sm row.
   padding-left on the button clears room for it instead of the icon
   sitting inline with the text. */
/* Combined with .btn-sm for higher specificity than that class's own
   shorthand `padding` rule (defined later in this file) — a plain
   .child-header-btn { padding-left } would otherwise be silently reset by
   .btn-sm's shorthand regardless of source order. */
.child-header-btn.btn-sm {
  position: relative;
  overflow: visible;
  padding-left: 64px;
}

.child-header-btn-bleed-icon {
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  height: 60px;
  width: auto;
  max-width: 70px;
  object-fit: contain;
  pointer-events: none;
}

.child-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.child-name {
  font-size: 1.3rem;
  font-weight: 700;
  display: block;
}

/* exercise_hub.php only — wraps .child-name plus the small access-control
   reminder caption below it (Notion "Étape v2.3" #5), so the caption
   stacks under the name instead of sitting beside it in .child-header's
   own flex row. */
.child-name-group {
  display: flex;
  flex-direction: column;
}

.child-access-caption {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* exercise_hub.php's blocked-access state (outside allowed hours / daily
   time cap reached) — replaces the exercises/games grids with a single
   centered message, same idea as .no_exercises/.no_games's plain <p> but
   with its own "Retour aux enfants" button since there's nothing else to
   click on this page while blocked. */
.access-blocked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  padding: 48px 16px;
}

.access-blocked-message {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text-muted);
}

/* exercise_hub.php while a daily cycle limit is set and the balance already pays a game: takes the place of the
   exercise cards ("Tu as assez d'<étoile> pour faire un jeu !"), the games below stay. The star is the balance
   badge's own picture, set inline in the sentence — a child who cannot read yet follows the picture and the
   games right underneath. */
.cycle-game-due {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  text-align: center;
  padding: 24px 16px;
}

.cycle-game-due-mascot {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.cycle-game-due-message {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
}

.cycle-game-due-star {
  width: 1.3em;
  height: 1.3em;
  vertical-align: -0.25em;
  margin: 0 2px;
}

.child-level {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  display: block;
}

.child-last-activity {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: block;
}

.token-badge {
  background: var(--color-accent);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  /* Colored shadow (tinted to the badge's own fill, same pattern as
     .btn-primary/.btn-danger above) rather than the neutral black shadow
     used elsewhere — makes the star counter pop more. */
  box-shadow: 0 6px 14px rgba(242, 153, 74, 0.45);
}

/* Replaces the "jetons" text label on the token balance badge — a young
   non-reading child recognizes the star icon faster than the word. */
.token-badge-star {
  width: 22px;
  height: 22px;
  /* Also used plain inline (child_detail.php's balance line, not inside
     .token-badge's own flex/align-items) — keeps it level with the digits
     there too. */
  vertical-align: middle;
}

/* Forms */

.form-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* parent/dashboard.php's "Créer un profil enfant" form only — half the
   width of the page's own 960px max-width, rather than stretching to fill
   it like every other .form-card on this page. */
.form-card-narrow {
  max-width: 480px;
}

/* parent/dashboard.php's "Créer un profil enfant" form — small breathing
   room from the heading/Masquer row right above it. */
.form-card-top-spaced {
  margin-top: 16px;
}

/* parent/dashboard.php's referral link widget (Notion "Etape v2.5
   (parrainage)" Ordre 2) — deliberately NOT a .form-card: sits directly on
   the page's standard background rather than a white surface, separated
   from the "Créer un profil enfant" section above it by a rule instead of
   a card boundary (2026-09-15, moved here from above the children section
   per user feedback). The rule is the dashboard's own <hr class="dashboard-sep">
   in front of the block (added 2026-10-08); this class used to draw one itself
   with a border-top, which showed two lines in a row until 2026-10-11. */
.referral-card {
  margin-top: 0;
}

.referral-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* The "Parrainer" button sits on its own row under the hint (2026-10-07, owner; one button since 2026-10-23). */
.referral-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  /* A line of air under the button, so the block sits balanced between the two <hr> around it. */
  margin-bottom: 24px;
}

/* One-click share (2026-10-23): a single "Parrainer" button opens this dialog, one button per network inside. */
.referral-dialog {
  box-sizing: border-box;
  width: min(calc(100vw - 32px), 420px);
  padding: 20px;
  border: 2px solid var(--color-border);
  border-radius: 12px;
}

.referral-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.referral-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.referral-dialog-title {
  margin: 0;
}

/* Cross at the top right: the dialog has no "Fermer" button any more (2026-10-25). */
.referral-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
}

.referral-close:hover {
  border-color: var(--color-primary);
}

.referral-networks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.referral-net-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Group 1 (Facebook, LinkedIn): the text has to be pasted, so the pair is framed and carries a one-line note. */
.referral-paste-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
  border: 2px solid var(--color-primary);
  border-radius: 12px;
  background: #eaf1f8;
}

.referral-paste-note {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
}

.referral-paste-note svg {
  flex: 0 0 auto;
}

.referral-networks .referral-net {
  flex: 1 1 130px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.referral-net-icon {
  flex: 0 0 auto;
}

/* The usual brand colours, so each network is recognised at a glance. */
.referral-net-whatsapp .referral-net-icon { color: #25d366; }
.referral-net-facebook .referral-net-icon { color: #1877f2; }
.referral-net-telegram .referral-net-icon { color: #229ed9; }
.referral-net-x .referral-net-icon { color: #000000; }
.referral-net-linkedin .referral-net-icon { color: #0a66c2; }
.referral-net-sms .referral-net-icon { color: #34a853; }
.referral-net-email .referral-net-icon { color: #5f6b7a; }

.referral-dialog .referral-link-row {
  margin-top: 12px;
}

.referral-dialog .referral-actions {
  margin-bottom: 0;
}

/* Sign-up screens: who invited the visitor, and the optional "code de parrainage" field. */
.referral-invite-banner {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
}

.referral-code-field summary {
  cursor: pointer;
}

.referral-code-field input {
  margin-top: 8px;
  text-transform: uppercase;
}

/* free_month mode: the follow-up under the share buttons — who signed up through the link, and the free months
   they earned. */
.referral-followup {
  margin-top: 8px;
  margin-bottom: 24px;
}

.referral-followup-title {
  font-size: 1.05rem;
  margin: 0 0 8px;
}

.referral-followup-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.referral-followup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.referral-followup-name {
  font-weight: 700;
}

.referral-followup-months {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

/* free_month mode: the picture (two houses, a gift above each) sits to the right of the text block, and drops
   under it on a narrow screen. */
.referral-card-layout {
  display: flex;
  align-items: center;
  gap: 24px;
}

.referral-card-main {
  flex: 1 1 auto;
  min-width: 0;
}

.referral-card-art {
  flex: 0 0 auto;
  width: 220px;
  height: auto;
}

@media (max-width: 640px) {
  .referral-card-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .referral-card-art {
    align-self: center;
    width: 160px;
  }
}

.referral-link-row input[type="text"] {
  flex: 1 1 260px;
  min-height: 36px;
  padding: 4px 8px;
  font-size: 0.9rem;
  border-radius: 8px;
  border: 2px solid var(--color-border);
  font-family: inherit;
}

.referral-copy-feedback {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--color-success, #2e7d32);
}

/* Without this, the unconditional display:inline-block above beats the
   [hidden] attribute's UA display:none (author styles always outrank UA
   defaults), so the "Lien copié !" feedback showed permanently instead of
   only after a real copy click. Found 2026-09-15 while screenshotting the
   referral widget's new position. */
.referral-copy-feedback[hidden] {
  display: none;
}

/* Referral scene widget — fixed, hand-authored decor layout (2026-09-18,
   replacing the earlier per-family random/seeded decor + flexbox-scroll +
   JS-measured path — see docs/implementation_log.md's decor-pivot-to-
   manual entry and SceneLayoutTable). Every family sees the exact same
   scene: a fixed-aspect-ratio canvas (config/referral_scene_layout.json's
   own canvas.width/height, via the --rs-canvas-w/h custom properties set
   inline from PHP) with no scroll, scaling down responsively since every
   child is positioned by percentage. The dashed connecting line is the
   only SVG element; dots/decor/the star marker/the landmark are plain
   absolutely-positioned elements emitted in y-ascending DOM order, so
   normal sibling stacking gives the iso depth-sort for free — an item
   lower on the canvas paints over one higher up — with no numeric z-index
   bookkeeping needed. */
.referral-scene {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
  --rs-green: #5f9e52;
}

.referral-scene-intro {
  margin: 0 0 4px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.referral-scene-intro-coupon {
  height: 1.1em;
  width: auto;
  vertical-align: text-bottom;
}

.referral-scene-caption {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* No background. The stage is ONE canvas the full width of the widget, laid
   out server-side (fp_build_referral_scene()): the current palier's content
   — cropped to the horizontal extent it really covers, so it starts flush
   against the left edge — fills 950 of the stage's 1200 authored px, the
   future palier the remaining 250, and the dashed path runs on across both
   up to the future palier's image (2026-09-18/19 per direct feedback).
   .rs-stage is a size container so every fixed-px measurement authored in
   the layout tool (decor heights, dots, star, crown, coupons...) scales with
   it through --rs-u (set inline: 100cqw / 1200) instead of staying a
   constant px, keeping the exact proportions the author saw.
   --rs-landmark-w (also inline) is the palier images' own width, the 28% of
   the authored canvas the tool previews them at. */
.referral-scene-canvas-wrap {
  width: 100%;
}

/* Headroom for whatever pokes out of the stage's top edge (crown, coupon row,
   the star above a palier...) is computed per scene by fp_build_referral_
   scene() and set inline as padding-top on this wrap. */

.rs-stage {
  position: relative;
  width: 100%;
  aspect-ratio: var(--rs-canvas-w, 1300) / var(--rs-canvas-h, 600);
  container-type: inline-size;
}

.rs-scene-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Non-scaling: a fixed on-screen dotted trail whatever the stage's width. */
.rs-path-line {
  stroke: var(--color-border);
  stroke-width: 2px;
  stroke-dasharray: 2 7;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.rs-item {
  position: absolute;
}

/* Dots anchor centered on their point; decor "stands" on its point
   (bottom-anchored), matching a 2D iso game's sprite anchor convention —
   taller props grow upward from the same footpoint a short one would use.
   NOT the sprite's own literal lowest pixel, though: an iso game's ground
   contact point sits roughly a fifth of the sprite's height ABOVE its
   bottom edge (the perspective/depth of the object's own base extends
   toward the viewer below the true footprint) — translate's -80% (not
   -100%) is exactly that fifth-height offset (2026-09-18, lowered from
   -75%/a quarter per direct feedback). */
.rs-item-dot {
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rs-item-decor {
  transform: translate(-50%, -80%);
}

/* Oval rather than circular — matches the iso art's own ground-plane
   perspective (a flat circle on the ground reads as an ellipse from that
   camera angle). */
.rs-track-dot {
  width: calc(var(--rs-u) * 40);
  height: calc(var(--rs-u) * 22);
  border-radius: 50%;
  background: var(--color-border);
}

.rs-track-dot.rs-dot-green {
  background: var(--rs-green);
}

/* "vous êtes ici" (idle marker) / départ (stage zero) — a soft glow halo
   behind the star so it reads as the one special element on the scene,
   not just another prop. Unlike decor above, the star doesn't "stand" on
   its point at all — it hovers to indicate position without covering the
   dot underneath, so it's center-anchored (like the dot itself) PLUS an
   extra fixed lift of 60px (2026-09-18, raised from 32px by half the
   star's own 56px height again per direct feedback — this in-line lift is
   deliberately NOT the same figure a star resting on a palier/landmark
   will need; that's its own separate calibration, still to come). */
.rs-item-star {
  width: calc(var(--rs-u) * 56);
  height: calc(var(--rs-u) * 56);
  transform: translate(-50%, -50%) translateY(calc(var(--rs-u) * -60));
}

/* The star resting above a palier's image (paid exactly on a palier): its
   position is already computed clear of the image server-side, so it doesn't
   take the extra hover lift of the in-line marker. */
.rs-item-star-static {
  transform: translate(-50%, -50%);
}

.rs-item-star::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--rs-u) * 76);
  height: calc(var(--rs-u) * 76);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(242, 153, 74, 0.38) 0%, rgba(242, 153, 74, 0) 70%);
  border-radius: 50%;
  z-index: -1;
}

.rs-item-star img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3));
}

.rs-item-decor img {
  display: block;
  width: auto;
}

/* The previous palier — the image authored in the layout tool's "Palier
   précédent" element, part of the scene itself (the dashed path starts from
   it) and bottom-anchored like decor/the landmark. Width is a ratio of the
   landmark's own (--rs-landmark-w), set inline per scene. */
.rs-item-prev {
  transform: translate(-50%, -80%);
  aspect-ratio: 3 / 2;
  opacity: 0.7;
}

.rs-prev-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* The palier still to come, in the 250px strip right of the current palier's
   zone — the summit (crown + "gratuit à vie") for every stretch before it,
   the next palier once past that. Bottom-anchored on its ground point like
   every other image, the dashed path ending there. Width (--rs-future-w,
   inline) is 80% of the targeted palier's own. */
.rs-future-art {
  position: absolute;
  transform: translate(-50%, -80%);
  width: var(--rs-future-w);
  aspect-ratio: 3 / 2;
  opacity: 0.85;
}

.rs-future-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Crown 33% of the art's width, resting on its top edge (bottom: 96% — a
   slight overlap); fp_build_referral_scene()'s headroom math assumes the same
   figures. */
.rs-future-crown {
  position: absolute;
  width: 33%;
  aspect-ratio: 1;
  object-fit: contain;
  bottom: 96%;
  left: 50%;
  transform: translateX(-50%);
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3));
}

/* Name / filleul-count cartouche of a palier: SOLID white (no alpha, so
   nothing shows through it; a hairline border + soft shadow keep it legible
   on the page's cream ground), painted after — so over — every image, since
   it's emitted last in the stage. Anchored at the palier's ground point and
   hanging below it. */
.rs-cartouche {
  position: absolute;
  transform: translate(-50%, 4px);
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  color: var(--color-text);
  border-radius: 10px;
  padding: 3px 10px;
  text-align: center;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

/* Text follows the stage's own scale (--rs-u) between a readable floor and
   the full desktop size, so the cartouche doesn't swamp the art on a phone. */
.rs-cartouche-title {
  font-size: clamp(0.62rem, calc(var(--rs-u) * 24), 1rem);
}

.rs-cartouche-line {
  font-size: clamp(0.52rem, calc(var(--rs-u) * 18), 0.8rem);
}

.rs-cartouche-small .rs-cartouche-line {
  font-size: clamp(0.5rem, calc(var(--rs-u) * 17), 0.74rem);
}

/* The landmark — always the palier currently being approached, so always
   rendered at its "big/current" size (the previous palier is .rs-item-prev
   above, the next one .rs-future-art). Sorted by its own y with the rest of
   the backdrop, so decor standing in front of it paints over it and decor
   behind it under it. Width is --rs-landmark-w, the 28% of the authored
   canvas the layout tool previews it at — production used to render it at
   clamp(220px, 40%, 420px), about a third bigger than authored (2026-09-18
   per direct feedback). Bottom-anchored (not centered) — iso convention:
   landmark_position is where the diorama's own ground sits, not the box's
   visual center, which matters for the dashed path line actually meeting
   the image at its base rather than piercing through its middle. */
.rs-landmark {
  position: absolute;
  transform: translate(-50%, -80%);
  width: var(--rs-landmark-w);
}

.rs-diorama {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
}

.rs-diorama-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Crown + coupon row stacked (crown on top) just above the diorama's own
   box, out of flow so their height never moves the diorama off its
   authored ground point (.rs-landmark's translate is relative to the
   diorama box alone — same as the layout tool's own preview). */
.rs-landmark-extras {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rs-landmark-crown {
  width: calc(var(--rs-u) * 84);
  height: calc(var(--rs-u) * 84);
  object-fit: contain;
  margin-bottom: calc(var(--rs-u) * 2);
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3));
}

.rs-diorama-mascot {
  position: absolute;
  height: 62%;
  width: auto;
  right: -10%;
  top: -12%;
  filter: drop-shadow(0 4px 5px rgba(20, 14, 4, 0.35));
}

.rs-landmark-coupons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(var(--rs-u) * 4);
  margin-bottom: calc(var(--rs-u) * 6);
  /* Wide enough for the 6-coupon wallet cap on a single row, so the row's
     height stays predictable (dashboard.php's headroom / crop math assumes
     the same 52px icons, 4px gap up to 2 coupons, overlap beyond). */
  max-width: calc(var(--rs-u) * 340);
}

/* From 3 coupons up they overlap a little (each covers 18px of the previous
   one, later ones on top) so the row doesn't get too wide. */
.rs-landmark-coupons-overlap {
  gap: 0;
}

.rs-landmark-coupons-overlap .rs-landmark-coupon-icon + .rs-landmark-coupon-icon {
  margin-left: calc(var(--rs-u) * -18);
}

.rs-landmark-coupon-icon {
  width: calc(var(--rs-u) * 52);
  height: auto;
  display: block;
}

/* Coupon wallet (Ordre 7) — real, credited coupons, so unlike
   .referral-potential above this is NOT muted: it's an actual balance the
   parent can act on. */
.referral-wallet {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

.referral-wallet-flash {
  font-weight: 700;
  margin: 0 0 6px;
}

.referral-wallet-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.referral-wallet-actions form {
  margin: 0;
}

/* Referral scene "cheat" — dev-environment families only (see the PHP-side
   gate), so deliberately styled as an obvious tool rather than a normal
   product action: dashed border, muted background, small print. */
.referral-cheat {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
}

.referral-cheat-label {
  margin: 0 0 6px;
  font-size: 0.76rem;
  color: var(--color-text-muted);
}

.referral-cheat-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.referral-cheat-form {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.referral-cheat-form input[type="number"] {
  width: 3.5em;
  min-height: 30px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 2px solid var(--color-border);
  font-family: inherit;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-field label {
  font-size: 1.05rem;
  font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
  min-height: var(--touch-min);
  padding: 12px 14px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  background: #ffffff;
  font-family: inherit;
}

.form-field textarea {
  font-family: monospace;
  resize: vertical;
}

.form-field span {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.form-field-checkbox label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 400;
}

.form-field-checkbox input[type="checkbox"] {
  min-height: unset;
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 2px;
}

.form-error {
  color: #b3261e;
  font-weight: 700;
  margin-bottom: 16px;
}

/* Password show/hide toggle (FUN v2.2 item 14) — web/assets/js/password_toggle.js
   wraps every input[type=password] in this div at runtime (no markup change
   needed on the pages themselves) and appends the eye/eye-slash button
   inside it, absolutely positioned over the input's own right padding. */
.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  color: var(--color-text-muted);
  cursor: pointer;
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.9);
}

.password-toggle svg {
  width: 22px;
  height: 22px;
}

/* Exercise / game hub */

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

/* Games section only (web/child/exercise_hub.php) — fixed at 3 cards per
   row regardless of viewport width, wrapping after that rather than
   auto-fit-ing to however many 200px cards happen to fit. Flexbox so rows
   wrap cleanly; justify-content: flex-start (not center, unlike CLAUDE.md's
   general "wrapped item rows" rule) per explicit user request 2026-09-30 —
   games should read left to right, row by row, a partial last row (e.g. 4
   games -> 3 + 1) stays flush-left instead of centering. */
.hub-grid-games {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 20px;
}

.hub-grid-games .hub-card-game {
  width: calc((100% - 40px) / 3);
}

/* "Voir tous les exercices" under the curated hub grid (see
   Family\Exercise\ExerciseCurator) — a low-key escape hatch, not another
   button competing with the exercise cards themselves. */
.link-discreet {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-decoration: underline;
}

/* Dev hub sort/filter bar — client-side only (see web/dev/index.php's inline
   script), so it never touches the server-rendered card list itself, just
   reorders/hides the existing .hub-card elements. */
.dev-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
}

.dev-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.dev-filters select {
  font-size: 0.9rem;
  padding: 4px 6px;
}

/* Forces its own line below the filter selects, inside the same white
   .dev-filters box (flex-wrap + flex-basis:100%, same trick as
   .inline-form-lines .form-break above). */
.dev-filter-count {
  flex: 0 0 100%;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.hub-card {
  position: relative;
  padding: 24px 20px 24px 26px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: var(--color-text);
  background: none;
  border-style: solid;
  border-width: 16px;
  border-image-source: url('../images/ui/button_basic.png');
  border-image-slice: 44 fill;
  border-image-width: 16px;
  border-image-repeat: stretch;
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease;
}

/* Liseré : la couleur du sujet (--card-accent, posée inline par PHP —
   web/dev/index.php, web/child/exercise_hub.php/all_exercises.php) ou,
   pour un jeu (pas de sujet), --color-accent — remplace l'ancien
   border-left plat maintenant qu'un border-image commun occupe les 4
   côtés (border-image, une fois actif, couvre tout le cadre, on ne peut
   plus garder un côté en couleur unie via border-left-color). */
.hub-card::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 6px;
  border-radius: 3px;
  background: var(--card-accent, var(--color-primary));
}

.hub-card-game::before {
  background: var(--color-accent);
}

.hub-card:active {
  transform: scale(0.97);
}

.hub-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  /* Leaves room so long titles don't run under the subject badge, which is
     absolutely positioned over the top-right corner (see .hub-card-subject
     below) rather than laid out in flow — the badge needs to sit at a fixed
     corner regardless of how tall the title/status text stack gets. */
  padding-right: 64px;
}

.hub-card-level {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.hub-card-level-star {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-left: 3px;
}

/* Subject badge (top-right) + colored left border ("liseré") — see
   docs/family_technical.md "Theme system": this is the `subject` metadata
   field (math/French/English...), a different concept from the cosmetic
   `theme` system (vehicles/farm_animals/toys), so it gets its own config
   (config/subjects.json) and its own class names here rather than reusing
   "theme" anywhere in code. Color comes from that config via a plain inline
   `style="border-left-color: ..."` set per card in PHP, not a fixed set of
   CSS classes, since new subjects can be added without a matching CSS rule.
   Added 2026-08-13 at the user's request, closing the "exercise theme/
   subject tagging" item that docs/family_design.md had deliberately listed
   as a later addition. */

.hub-card-subject {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--color-text-muted);
  text-align: right;
}

/* Subject icon (web/assets/images/subjects/<code>.png) — a faint background
   illustration on the card's right side, purely decorative (the color
   liseré + name label above already carry the actual subject information,
   this is just a visual hint for non-reading children). Rendered as the
   *first* child in the card markup so later elements (title/level/subject
   spans) simply paint over it in normal DOM order, no z-index needed.
   Added 2026-08-16 at the user's request, child hub only — not shown on
   web/dev/index.php's cards. */
.hub-card-subject-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  bottom: 8px;
  width: 60%;
  background-repeat: no-repeat;
  background-position: right center;
  background-size: contain;
  opacity: 1;
  pointer-events: none;
}

/* Game card only (scoped past .hub-card-subject-icon's shared base rule,
   which all_exercises.php's plain .hub-card cards also use): the icon used
   to be absolutely positioned over the card (top/bottom:8px, 60% width)
   with the title/level/age text simply painting over it in normal flow —
   relying on .hub-card-title's own padding-right to dodge it was fragile
   (only the title got that padding; nothing guaranteed the icon's vertical
   reach never crossed into the level/age lines below it for every possible
   title length/wrap). Restructured as a real 2-column flex row instead —
   text stack on the left (.hub-card-game-text), the icon as a normal (not
   absolutely-positioned) flex item on the right sized by its own
   width/height — so overlap is impossible by construction, not by
   arithmetic. */
.hub-card-game {
  flex-direction: row;
  justify-content: space-between;
  gap: 10px;
}

/* Relies on .hub-card-game's own align-items:stretch (the flex default —
   deliberately NOT overridden to flex-start here, which was tried first and
   broke this: a top-aligned text column is only as tall as its own content,
   so justify-content:space-between below had no extra space to distribute
   and .hub-card-age never actually reached the card's bottom edge). Stretch
   makes this column match the row's height (set by the taller icon), so
   the title lands at the very top and .hub-card-age at the very bottom —
   level with the accent bar's own top/bottom (.hub-card::before). */
.hub-card-game-text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* Without this a flex child's default min-width:auto keeps it as wide as
     its longest unbreakable word, which could push the icon column out
     past the card's own edge instead of wrapping the title text first. */
  min-width: 0;
}

.hub-card-game-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hub-card-game .hub-card-title {
  padding-right: 0;
}

/* No longer inside the <a> in normal flow like .hub-card-title/-level —
   overrides the shared .hub-card-subject-icon rule's absolute positioning
   entirely (top/right/bottom/width/opacity). Sized/rounded per the user's
   own mockup (2026-09-14): a real thumbnail-sized image with rounded
   corners, not a small flat icon — background-size:cover since these
   game-icon assets are already filled edge-to-edge scene art (sand/grass/
   walls behind the vehicle), not a transparent glyph that needs
   letterboxing via :contain. */
.hub-card-game .hub-card-subject-icon {
  position: static;
  flex: 0 0 auto;
  width: 110px;
  height: 90px;
  border-radius: var(--radius-md);
  background-size: cover;
  background-position: center;
}

/* Restores the shared .hub-card-subject-icon rule's default-faded/
   hover-to-full-opacity behavior, dropped by mistake when this icon was
   restructured into a static-layout thumbnail above (opacity:1 was
   hardcoded there, which both flattened the default fade and made the
   hover transition a no-op since it was already at full opacity). */
/* Hub enfant : images matière/jeu en pleine opacité (plus d'alpha), et effet
   « bob » au survol — un peu grossi puis réduit, en boucle. */
@keyframes hub-icon-bob {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
.hub-card-game:hover .hub-card-subject-icon,
.hub-card-game:focus-visible .hub-card-subject-icon,
.hub-card-exercise:hover .hub-card-subject-end-icon,
.hub-card-exercise:focus-visible .hub-card-subject-end-icon {
  animation: hub-icon-bob 0.7s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .hub-card-game:hover .hub-card-subject-icon,
  .hub-card-exercise:hover .hub-card-subject-end-icon { animation: none; }
}

/* Progression puzzle entry (web/child/exercise_hub.php, "Mon puzzle" section between the exercises and the games): the
   same card as an exercise (.hub-card-exercise, picture in the .hub-card-character slot) with a fixed picture and one
   word — the card itself never shows the puzzle's progress. When pieces are waiting in the tray it beats gently and
   carries a count badge (the only moving parts). */
.hub-grid-exercises.hub-grid-puzzle {
  margin-top: 16px;
}
.hub-card-puzzle .hub-card-title {
  font-size: 1.4rem;
}
/* The picture is an icon, not a full-height costumed character: it is centred vertically on the card (check exercices 18)
   instead of standing on the card's bottom edge like a costume, and the desktop box is smaller than .hub-card-character
   (the phone layout below already sizes the width/height). */
.hub-card-puzzle .hub-card-character {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  background-position: center;
}
@media (min-width: 701px) {
  .hub-card-puzzle .hub-card-character {
    left: 50px;
    width: 150px;
    height: 130px;
  }
}
.hub-puzzle-badge {
  position: absolute;
  top: -22px;
  right: -22px;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: #e8453c;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
@keyframes hub-puzzle-beat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.hub-puzzle-waiting {
  animation: hub-puzzle-beat 1.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .hub-puzzle-waiting { animation: none; }
}

/* "You won a piece" popup over the hub (once per visit, Family\Puzzle\PuzzleProgress::sync()). */
.puzzle-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
}
.puzzle-popup[hidden] { display: none; }
.puzzle-popup-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 460px;
  padding: 24px 28px 28px;
  text-align: center;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.puzzle-popup-star {
  width: 160px;
  height: 160px;
}
.puzzle-popup-text {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}
.puzzle-popup-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Small on purpose ("vraiment en petit" — user request) — sits inside the
   button as the text stack's last line, pinned to the bottom via
   .hub-card-game-text's own justify-content:space-between, never touching
   the icon column since that's a separate flex item entirely (see above),
   not an absolutely-positioned layer text could ever cross. */
.hub-card-age {
  font-size: 0.65rem;
  color: var(--color-text-muted);
}

/* Exercise card v5 (2026-09-10): 2/3-width rows, alternating left/right
   (every other row flush against its own side, no shared gutter), with a
   costumed character at a fixed true size (250px wide, see
   .hub-card-character) — its own box height is independent of the card's,
   so shrinking the card never shrinks the character (v4's mistake: tying
   the character's box height to the card's made it shrink along with a
   shorter card, since background-size:contain was then height-limited).
   The character bleeds upward past the card's top edge as needed and its
   feet poke a little past the bottom edge; horizontally it stays flush
   with the card's own left edge, never bleeding into the page margin. At
   the opposite end, the subject icon (flag/calculator/globe/...) at 40%
   opacity with its subject name printed underneath as a caption.
   Deliberately its own class set rather than variants of .hub-grid/
   .hub-card — those stay exactly as they are for the games section,
   web/child/all_exercises.php and web/dev/index.php, none of which this
   redesign covers. */
.hub-grid-exercises {
  display: flex;
  flex-direction: column;
  /* Wider than a plain card gap (was 24px) — the character art (see
     .hub-card-character) bleeds above/below each card, so a tighter gap
     let neighbouring rows crowd each other. */
  gap: 48px;
  /* Clearance so the first row's character (taller than its own card, see
     .hub-card-character) doesn't bleed up into the section title above it. */
  margin-top: 60px;
}

.hub-card-exercise {
  position: relative;
  display: flex;
  align-items: center;
  width: 66%;
  height: 134px;
  text-decoration: none;
  color: var(--color-text);
  background: none;
  border-style: solid;
  border-width: 16px;
  border-image-source: url('../images/ui/button_basic.png');
  border-image-slice: 44 fill;
  border-image-width: 16px;
  border-image-repeat: stretch;
  border-radius: var(--radius-md);
  background-color: var(--color-bg);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  /* Visible (not hidden) so the character (see .hub-card-character) can
     bleed past the card's top edge and its feet past the bottom edge. */
  overflow: visible;
  transition: transform 0.15s ease;
}

/* Liseré : voir la même note sur .hub-card::before — --card-accent (posé
   inline par web/child/exercise_hub.php) remplace l'ancien border-left
   plat. Offset un peu plus généreux ici (border-image plus épais que sur
   .hub-card) pour rester visuellement à l'intérieur du cadre. */
.hub-card-exercise::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 14px;
  bottom: 14px;
  width: 6px;
  border-radius: 3px;
  background: var(--card-accent, var(--color-primary));
}

/* "Calés ou à gauche ou à droite" — odd rows flush against the container's
   left edge, even rows flush against its right edge, every other row. */
.hub-grid-exercises .hub-card-exercise:nth-child(odd) {
  align-self: flex-start;
}

.hub-grid-exercises .hub-card-exercise:nth-child(even) {
  align-self: flex-end;
}

.hub-card-exercise:active {
  transform: scale(0.97);
}

/* Fixed box size, deliberately NOT derived from the card's own height —
   tying it to the card (top:0/bottom:-20px with height:auto) squashed the
   character down every time the card got shorter, since
   background-size:contain is limited by whichever box dimension runs out
   first (found the hard way: shrinking the card by a third visibly shrank
   the character too, which wasn't the intent). 220px is the box height
   that read right against a 250px-wide character during design — kept as
   a fixed constant here so a future card-height tweak never resizes the
   character again; it bleeds upward past the card's top edge as needed
   (into the row above, not literally full natural size — a truly
   unclipped 250px-wide character needs ~420px of box height given these
   costumes' aspect ratios, which bled 2+ rows up and was worse) plus the
   feet poking past the bottom. */
.hub-card-character {
  position: absolute;
  left: 0;
  /* -20px shifted to -50px (30px further down) per request. */
  bottom: -50px;
  width: 250px;
  height: 220px;
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: contain;
  pointer-events: none;
}

.hub-card-exercise-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  padding: 10px 118px 10px 260px;
  overflow: hidden;
}

.hub-card-exercise-body .hub-card-title {
  padding-right: 0;
  line-height: 1.2;
}

/* "avec <enfant>" caption, printed under the exercise title — names the
   character randomly drawn per-card (see exercise_hub.php's per-exercise
   $character draw), later reused as the same character shown top-left on
   that exercise's own play.html. */
.hub-card-character-caption {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* Hidden here — the subject name now lives in .hub-card-subject-caption
   instead (under the endcap icon), not as a second line under the title. */
.hub-card-exercise-body .hub-card-subject {
  display: none;
}

/* Right-end cluster: the subject's own icon (flag/calculator/globe/...)
   at 40% opacity with its name printed underneath as a plain caption —
   one uniform treatment for every subject, language ones included (their
   "icon" already is the flag, so no separate opaque badge is needed on
   top of it any more). */
.hub-card-subject-end {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  width: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.hub-card-subject-end-icon {
  width: 85px;
  height: 85px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 1;
}

.hub-card-subject-caption {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--color-text-muted);
  text-align: center;
}

/* FUN-201 — hub enfant sur téléphone et tablette (web/child/exercise_hub.php).
   - l'avatar de l'enfant reste rond : dans le bandeau flex il se faisait écraser en ovale ;
   - téléphone et petite tablette (<= 700px) : une carte d'exercice = toute la largeur, dans l'ordre personnage -> titre (+ « avec … »)
     -> matière, et une carte sur deux INVERSÉE (matière -> titre -> personnage, le personnage passe à droite) ;
     plus d'espace entre les cartes, le personnage débordant au-dessus de la sienne ;
   - jeux : 1 par ligne sous 480px, 2 par ligne sur les petits écrans et tablettes en portrait, 3 au-delà
     (tablettes en paysage inchangées). */
.child-avatar-lg {
  flex: 0 0 auto;
  aspect-ratio: 1;
}

/* Le bandeau (avatar, nom, boutons) passe à la ligne au lieu de dépasser la largeur de l'écran. */
.child-header {
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .hub-grid-exercises {
    gap: 68px;
    margin-top: 84px;
  }

  .hub-grid-exercises .hub-card-exercise,
  .hub-grid-exercises .hub-card-exercise:nth-child(odd),
  .hub-grid-exercises .hub-card-exercise:nth-child(even) {
    align-self: stretch;
    width: 100%;
    box-sizing: border-box;
    height: 126px;
  }

  .hub-card-character {
    left: -6px;
    bottom: -14px;
    width: 104px;
    height: 156px;
  }

  .hub-card-exercise-body {
    padding: 8px 84px 8px 104px;
  }

  .hub-card-exercise-body .hub-card-title {
    font-size: 1rem;
  }

  .hub-card-subject-end {
    right: 8px;
    width: 68px;
  }

  .hub-card-subject-end-icon {
    width: 58px;
    height: 58px;
  }

  .hub-card-subject-caption {
    font-size: 0.65rem;
  }

  /* Une carte sur deux, inversée : matière | titre | personnage. */
  .hub-grid-exercises .hub-card-exercise:nth-child(even) .hub-card-character {
    left: auto;
    right: -6px;
  }

  .hub-grid-exercises .hub-card-exercise:nth-child(even) .hub-card-exercise-body {
    padding: 8px 104px 8px 84px;
  }

  .hub-grid-exercises .hub-card-exercise:nth-child(even) .hub-card-subject-end {
    right: auto;
    left: 8px;
  }

  /* Liseré de couleur (.hub-card-exercise::before, voir plus haut) retiré
     sur écran étroit — demande utilisateur 2026-09-22 : la bande verticale
     n'apporte rien sur ce format déjà très serré et gêne visuellement à
     côté du personnage. */
  .hub-grid-exercises .hub-card-exercise::before {
    display: none;
  }
}

@media (max-width: 479px) {
  .hub-grid-games .hub-card-game {
    width: 100%;
  }
}

@media (min-width: 480px) and (max-width: 1000px) and (orientation: portrait) {
  .hub-grid-games .hub-card-game {
    width: calc((100% - 20px) / 2);
  }
}

/* Shown on a game card when web/assets/js/exercise_launch.js's log_start.php
   call is rejected (insufficient balance, unknown/unpublished game) — unlike
   an exercise, a failed game launch must actually block navigation (see that
   file's comment), so the child needs some feedback instead of just nothing
   happening on tap. */
.hub-card-blocked-toast {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  background: rgba(58, 46, 42, 0.9);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
}

.hub-card-blocked-toast-star {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  margin: 0 2px;
}

/* Interaction/mechanic type — dev hub only, never shown to parents/children
   (see CLAUDE.md "Language convention": this is an internal/code-facing
   label, not runtime content, so it stays in English and only appears where
   web/dev/index.php renders it). */
.hub-card-interaction {
  position: absolute;
  bottom: 10px;
  right: 16px;
  font-size: 0.7rem;
  font-style: italic;
  color: var(--color-text-muted);
  opacity: 0.65;
}

/* Per-exercise token-gain multiplier badge ("xN", FUN-32) — dev-only ledger
   in config/exercise_multipliers.json (see web/dev/multipliers.php), only
   rendered on the card when set above the implicit default of 1. Visual is
   deliberately plain per the issue ("on ajustera le visuel plus tard") —
   black text in a yellow circle, bottom-right corner. On the dev hub, where
   .hub-card-interaction also sits bottom-right, that label is shifted left
   inline (see web/dev/index.php) when both are present on the same card. */
.hub-card-multiplier {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffd60a;
  color: #000;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Admin/parent-dashboard tables — plain and functional on purpose, see
   parental_controls_brief.md ("not meant to be polished"). */

.admin-table-wrap {
  overflow-x: auto;
  margin-bottom: 16px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 0.95rem;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.admin-table th {
  background: var(--color-bg);
  font-weight: 700;
  color: var(--color-primary-dark);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

/* Wide period tables (dev activity reports): the first column (who) and the last one (total) stay in view while the
   periods in between scroll sideways. Sticky cells need the table to stop being its own clipping box
   (overflow:visible, so .admin-table-wrap is the scroller) and separate borders, otherwise the cell borders stay
   behind when the cell moves. */
.admin-table.admin-table-pinned {
  overflow: visible;
  border-collapse: separate;
  border-spacing: 0;
}

.admin-table-pinned th:first-child,
.admin-table-pinned td:first-child,
.admin-table-pinned th:last-child,
.admin-table-pinned td:last-child {
  position: sticky;
  z-index: 1;
  background: var(--color-surface);
}

.admin-table-pinned th:first-child,
.admin-table-pinned th:last-child {
  background: var(--color-bg);
}

.admin-table-pinned th:first-child,
.admin-table-pinned td:first-child {
  left: 0;
  max-width: 14em;
  box-shadow: 2px 0 0 var(--color-border);
}

.admin-table-pinned th:last-child,
.admin-table-pinned td:last-child {
  right: 0;
  box-shadow: -2px 0 0 var(--color-border);
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
}

/* child_detail.php's stars block: title and balance on one line, then the +/- buttons and "Remettre à zéro" on one
   row (wrapping only if the screen is too narrow). */
.tokens-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 14px;
}

.tokens-balance {
  display: inline-block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

/* The star's bottom sits on the digits' baseline (the generic rule above centres it on the x-height). */
.tokens-balance .token-badge-star {
  vertical-align: baseline;
}

.tokens-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* FUN-204 (fiche enfant : horaires et temps quotidien) — sur téléphone, un retour à la ligne avant le « à » et
   avant chaque bouton « Changer » (les .form-break du markup, invisibles au-dessus de 600px). */
.inline-form-lines .form-break {
  display: none;
}

@media (max-width: 600px) {
  .inline-form-lines {
    display: flex;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .inline-form-lines .form-break {
    display: block;
    flex: 0 0 100%;
    height: 0;
  }
}

/* child_detail.php's "Horaires et temps d'utilisation": the three controls (hours, daily time, cycles) are bullets,
   one per line. A line only wraps when the screen is too narrow for it, so the phone's forced breaks above are
   switched off here; the cycles explanation sits under its own control instead of being squeezed into the row. */
.access-list {
  list-style: disc;
  margin: 0 0 8px;
  padding-left: 1.4rem;
}

.access-list > li {
  margin: 10px 0;
}

.access-list .inline-form-lines {
  display: flex;
  flex-wrap: wrap;
  row-gap: 8px;
}

.access-list .inline-form-lines .form-break {
  display: none;
}

/* Half of the default 210px so "De [..] à [..] [Changer]" stays on one line. */
.inline-form select.select-hour {
  width: 105px;
}

.access-list-caption {
  margin: 6px 0 0;
  max-width: 60ch;
  line-height: 1.4;
}

.admin-table td.stat-cell {
  text-align: center;
}

/* child_detail.php's "Facteurs par matière" table — on a narrow phone/
   tablet screen the normal 6-column table (.subject-table-wide) is
   replaced by two separate, narrower tables stacked vertically
   (.subject-table-narrow) instead of forcing a horizontal scroll, same
   700px breakpoint already used elsewhere in this stylesheet (see
   .child-header/.hub-grid-exercises). See child_detail.php's own comment
   on why the factor slider needs its own separate <input> per table. */
.subject-table-narrow {
  display: none;
}

@media (max-width: 700px) {
  .subject-table-wide {
    display: none;
  }

  .subject-table-narrow {
    display: block;
  }

  .subject-table-narrow .admin-table-wrap:first-child {
    margin-bottom: 20px;
  }

  /* FUN-709 : sur 360-375 px le tableau Sujet / Facteur / Réalisés mesurait 337 px dans une boîte de 312 px et défilait. Curseur et
     marges resserrés pour qu'il tienne (le défilement horizontal reste en filet de sécurité, jamais atteint). */
  .subject-table-narrow .admin-table th,
  .subject-table-narrow .admin-table td {
    padding-left: 8px;
    padding-right: 8px;
  }

  .subject-table-narrow .subject-factor-input {
    width: 88px;
    max-width: 100%;
  }
}

/* Suivi des mises à jour (web/dev/updates.php) — pastille staging/prod. */
.update-live {
  color: var(--color-success, #2e7d32);
  font-weight: 700;
}

.update-pending {
  color: var(--color-text-muted);
}

/* Spacer column between success/abandon rate in the subject-stats table
   (FUN-40) — reads as a divider strip running the full height of the
   table, its border-bottom left un-overridden so each row's divider line
   still runs through it instead of leaving a gap. The header cell keeps
   the header row's own background like every other <th>; the body cells
   are filled plain white instead (2026-09-16 user request) rather than
   also carrying that background, so the divider reads as a clean gap
   against the row's own rateBarStyle() fill. */
.admin-table th.stat-spacer {
  padding: 0;
  width: 24px;
}

.admin-table td.stat-spacer {
  padding: 0;
  width: 24px;
  background: var(--color-surface);
}

/* Activity-history chart (FUN-42): period/subject filter controls above a
   hand-rolled SVG line chart (no charting library — see
   renderHistoryChart() in child_detail.php). Same green/red as the
   subject-stats table's rateBarStyle() rgb() values, kept as CSS classes
   here instead since these are strokes/fills, not background bars. */
.history-chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.history-chart-wrap {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 16px;
}

.history-chart {
  width: 100%;
  height: auto;
  display: block;
}

.history-chart-grid {
  stroke: var(--color-border);
  stroke-width: 1;
}

.history-chart-axis-label {
  fill: var(--color-text-muted, #8a8378);
  font-size: 10px;
}

.history-chart-line-success {
  fill: none;
  stroke: rgb(76, 175, 80);
  stroke-width: 2;
}

.history-chart-line-abandon {
  fill: none;
  stroke: rgb(244, 67, 54);
  stroke-width: 2;
}

.history-chart-line-success-dot {
  fill: rgb(76, 175, 80);
}

.history-chart-line-abandon-dot {
  fill: rgb(244, 67, 54);
}

.history-chart-legend {
  display: flex;
  gap: 16px;
  margin-top: 4px;
  font-size: 0.85rem;
}

.history-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.history-chart-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
}

/* .history-chart-line-success/-abandon set SVG fill/stroke for the chart's
   own <polyline> elements, which have no effect on a plain <span> — the
   legend swatch needs its own background-color instead. */
.history-chart-legend-swatch.history-chart-line-success {
  background: rgb(76, 175, 80);
}

.history-chart-legend-swatch.history-chart-line-abandon {
  background: rgb(244, 67, 54);
}

.history-day {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.history-day summary {
  cursor: pointer;
  font-size: 0.95rem;
}

.history-day summary::marker {
  color: var(--color-primary-dark);
}

.history-day[open] summary {
  margin-bottom: 8px;
}

/* child_detail.php's per-day "Supprimer la journée" button, above that
   day's own entries table. */
.history-day-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.inline-form input[type="number"],
.inline-form input[type="text"],
.inline-form select {
  min-height: 36px;
  padding: 4px 8px;
  font-size: 0.9rem;
  border-radius: 8px;
  border: 2px solid var(--color-border);
  font-family: inherit;
  width: 110px;
}

/* Wider than the plain 110px input width above — a period/subject select's
   own option text ("Dernière semaine", "Depuis le début"...) was cramped at
   that width, unlike the numeric +/- amount field it was sized for. */
.inline-form select {
  width: 210px;
}

/* child_detail.php's dropdown options sat flush against the widget's own
   edges by default — a little padding gives the label text room to
   breathe (user request 2026-09-16). */
.inline-form select option {
  padding: 6px 10px;
}

.btn-sm {
  min-height: 36px;
  padding: 4px 12px;
  font-size: 0.9rem;
  border-radius: 8px;
  /* Smaller than .btn's default 18px — at full size the border-image eats
     most of a button this small (dense admin rows: +100/+1000/réinitialiser). */
  border-width: 9px;
  border-image-width: 9px;
}

/* Half .btn's default 56px height (parent/register.php's "Retirer le 2e
   parent" button, user request 2026-09-18) — smaller still than .btn-sm. */
.btn-half {
  min-height: 28px;
  padding: 2px 12px;
  font-size: 0.85rem;
  border-radius: 8px;
  border-width: 6px;
  border-image-width: 6px;
}

.badge-inactive {
  color: var(--color-text-muted);
  font-style: italic;
}

.subject-factor-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.subject-factor-row label {
  width: 110px;
  font-weight: 700;
}

.subject-factor-row output {
  width: 36px;
  text-align: right;
  font-weight: 700;
}

/* Legal pages (web/legal/cgu.php, confidentialite.php) — plain long-form
   text, not a touch-target UI like the rest of the app. */

.legal-wip-banner {
  background: #fff3cd;
  border: 2px solid #f2994a;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-weight: 700;
  color: #7a4a12;
  margin-bottom: 24px;
}

.legal-content {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  line-height: 1.6;
}

.legal-article-heading {
  font-size: 1.1rem;
  color: var(--color-primary-dark);
  margin: 28px 0 8px;
}

.legal-article-heading:first-child {
  margin-top: 0;
}

.legal-content blockquote {
  margin: 8px 0;
  padding: 8px 16px;
  border-left: 4px solid var(--color-border);
  color: var(--color-text-muted);
  font-style: italic;
}

/* Legal-links bar — kept visually minimal (small text, muted) so it doesn't
   compete with the "top-bar" it sits next to. Most pages place it above the
   app title; the home page (web/index.php) places it at the bottom instead. */
.legal-links-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 0.8rem;
  padding: 6px 0;
  margin-top: 32px;
  margin-bottom: 12px;
}

.legal-links-bar a {
  color: var(--color-text-muted);
  text-decoration: underline;
}

/* avatar_picker.php's gallery tiles: in mode=change each tile is its own
   <form> (a real POST straight to change_photo.php, no JS needed) wrapping
   a .child-card-styled <button> — display:contents drops the form from the
   box tree so the button itself is the .child-grid item, same as the plain
   <a class="child-card"> used everywhere else this grid appears. */
.avatar-picker-tile-form {
  display: contents;
}

/* avatar_picker.php: only one representative tile per mascot/bank shows by
   default (see renderAvatarTile()'s call sites) — the rest sit behind this
   <details> disclosure, same collapsed-by-default pattern as
   child_detail.php's "Paramètres"/ledger sections (.history-day), reused
   here rather than a new one-off look. */
.avatar-picker-more {
  margin: 8px 0 24px;
}

.avatar-picker-more summary {
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--color-primary-dark);
}

.avatar-picker-more[open] summary {
  margin-bottom: 12px;
}

/* avatar_picker.php's own grid: the default .child-grid/.child-avatar sizing
   (120px avatar, 160px min column) is tuned for a handful of child-picker
   cards, not a dense 19-20-tile-per-group gallery — at real window widths
   this crowded tiles enough to read as overlapping (2026-09-13 user report).
   Smaller avatar + tighter card padding/gap/min column fixes the density
   without touching .child-grid/.child-card anywhere else they're used.
   Went through 3 sizing passes the same day: 72px avatar (still too tight)
   -> 56px (turned out to be judged against a browser-cached stylesheet,
   so untrustworthy — see docs/implementation_log.md) -> the real rendered
   56px read as genuinely too small once the cache was cleared, so scaled
   every dimension here back up by ~1/3 to the current values. Border-image
   still thinned from .child-card's default 20px (same trick as .btn-sm),
   just less aggressively than the 56px pass needed. */
/* Overrides .child-grid's own display:grid — CSS Grid always fills a
   partial last row starting from the first column (see CLAUDE.md's
   "Wrapped item rows must center every row" rule), which is exactly the
   "avatars pas centrés" regression a user hit here (2026-09-16): this page
   was never migrated to the flex/justify-content:center fix already
   applied everywhere else (FUN-13) when it was first built. Tiles need a
   fixed width now instead of minmax(...,1fr)'s auto-stretch — 140px comfortably
   fits the 94px avatar plus this rule's own padding/border (136px), with a
   little slack. */
/* Wide screens: exactly 4 tiles per row, never more (user request 2026-09-22 — on a tablet or desktop the old
   fixed 140px tiles packed 7+ per row and the avatars read as small). Tiles are a share of the grid's width
   (--avatar-cols), and the grid itself is capped so the images grow without becoming huge on a very wide
   window; justify-content:center keeps a partial last row centered (see CLAUDE.md's wrapped-rows rule). The
   phone block below only overrides the column count, gap, border and padding. */
.avatar-picker-grid {
  --avatar-cols: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 11px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.avatar-picker-tile {
  font: inherit;
  width: calc((100% - (var(--avatar-cols) - 1) * 11px) / var(--avatar-cols));
  box-sizing: border-box;
  padding: 11px 8px;
  border-width: 13px;
  border-image-width: 13px;
}

.avatar-picker-tile .child-avatar {
  /* The avatar fills the tile's content box (about 170px in a 900px grid). */
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto 8px;
}

.avatar-picker-tile .child-name {
  font-size: 1rem;
  line-height: 1.2;
}

/* FUN-202 : tailles d'avatar selon l'écran. Sous 600px de large les tuiles ne sont plus à 140px fixes mais
   calculées pour un nombre de colonnes voulu (--avatar-cols) : 3 par ligne sur téléphone, 2 sur les écrans les
   plus étroits (< 340px, où 3 tuiles ne laisseraient que ~50px d'avatar), 4 en paysage sur téléphone. La bordure
   en image est amincie et l'avatar suit la largeur de la tuile. */
@media (max-width: 600px), (orientation: landscape) and (max-height: 500px) and (max-width: 950px) {
  .avatar-picker-grid {
    --avatar-cols: 3;
    gap: 8px;
  }

  .avatar-picker-tile {
    width: calc((100% - (var(--avatar-cols) - 1) * 8px) / var(--avatar-cols));
    box-sizing: border-box;
    padding: 6px 2px;
    border-width: 9px;
    border-image-width: 9px;
  }

  .avatar-picker-tile .child-avatar {
    max-width: 94px;
  }

  .avatar-picker-tile .child-name {
    font-size: 0.85rem;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 339px) {
  .avatar-picker-grid {
    --avatar-cols: 2;
  }
}

@media (orientation: landscape) and (max-height: 500px) and (max-width: 950px) {
  .avatar-picker-grid {
    --avatar-cols: 4;
  }
}

/* Referral-driven avatar unlock ladder (Notion "Etape v2.5 (parrainage)"
   Ordre 7.5) — a <div>, not a <button>/<form> like the unlocked tiles
   above, since a locked avatar must never be selectable. */
.avatar-picker-tile-locked {
  filter: grayscale(1);
  opacity: 0.55;
  cursor: default;
}

.avatar-picker-unlock-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.7rem;
  line-height: 1.2;
  color: var(--color-text-muted);
}

/* avatar_picker.php's tranche switcher (2026-09-17 simplification): plain
   GET links (?tranche=...), not JS, so the page reload stays the single
   source of truth for which tranche's tiles are shown/lockable. */
.avatar-picker-tranche-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0 20px;
}

.avatar-picker-tranche-current {
  opacity: 1;
  font-weight: 700;
  text-decoration: underline;
}

/* change_photo.php's "anciennes photos" section: a handful of past-photo
   thumbnails (capped at 8, see ChildProfileRepository::MAX_PHOTO_HISTORY),
   each its own <button class="child-avatar">. Flex + centered wrap, not
   .child-grid's CSS grid, per CLAUDE.md's "wrapped item rows" rule — with a
   count this small an uneven last row is common and must still center. */
.photo-history-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 16px 0;
}

.photo-history-tile {
  font: inherit;
  padding: 0;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.photo-history-tile:hover,
.photo-history-tile:focus-visible {
  border-color: var(--color-accent);
}

.photo-history-tile:active {
  transform: scale(0.94);
}

/* addchild.php / dashboard.php's create-child form: the catalog-avatar
   preview shown after picking one in the popup (hidden until then). */
.selected-avatar-preview {
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

/* An author rule always beats the UA [hidden]{display:none} regardless of
   specificity (origin outranks specificity in the cascade) — so `display`
   only gets set here, scoped to :not([hidden]), instead of unconditionally
   above, or toggling the hidden attribute would visibly do nothing. */
.selected-avatar-preview:not([hidden]) {
  display: flex;
}

.selected-avatar-preview img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

/* curriculum_acquisition.php's page subtitle — cites the official Bulletin
   officiel texts (data/curriculum/_sources.json) the programme data below
   was extracted from, with their publication dates (user request
   2026-09-16). Collapsed behind a "curriculum-sources-toggle" disclosure by
   default (user request 2026-09-27) since it's rarely useful and read as
   clutter above the actual programme. */
.curriculum-sources-details {
  margin-bottom: 24px;
}

.curriculum-sources {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--color-text-muted, #8a8378);
}

/* Shown when the level's data rows carry "officiel": false (TPS, 2026-10-13). */
.curriculum-unofficial-notice {
  margin: 0 0 16px;
  padding: 10px 14px;
  font-size: 0.9rem;
  border-left: 4px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

/* curriculum_acquisition.php — read-only "acquisition du programme
   officiel" view: matière > domaine > sous-domaine > exercice, each with a
   small icon timeline of the child's own attempts. --subject-color is set
   inline per <section> from config/subjects.json (same color used
   elsewhere for that subject's badges). */
.curriculum-subject {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border-left: 6px solid var(--subject-color, var(--color-border));
  padding: 12px 16px;
  margin-top: 24px;
  margin-bottom: 16px;
}

.curriculum-subject-title {
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.7rem;
  color: var(--subject-color, var(--color-primary-dark));
}

.curriculum-subject-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.curriculum-domain {
  margin: 12px 0;
}

.curriculum-domain-title {
  margin: 0 0 6px;
  color: var(--color-primary-dark);
}

.curriculum-subdomain {
  margin: 8px 0 8px 12px;
  padding: 8px 12px;
  background: var(--color-bg);
  border-radius: var(--radius-sm, 8px);
}

.curriculum-subdomain-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

/* History icons sit right after the exercise name, not pushed to the far
   right (user request 2026-09-16) — plain flex-start with a small gap
   instead of justify-content:space-between. */
.curriculum-exercise-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 4px 0;
  flex-wrap: wrap;
}

.curriculum-exercise-label {
  font-weight: 600;
}

/* Placeholder row for a "gap" (⚠️ no exercise built yet) or
   "hors_perimetre" (deliberately excluded) sous-domaine — no history to
   show, so it's a single label-only row, visually muted since it's
   informational rather than actionable. */
.curriculum-placeholder-row .curriculum-exercise-label {
  font-weight: 400;
  font-style: italic;
  color: var(--color-text-muted, #8a8378);
}

.curriculum-hors-perimetre-row {
  cursor: help;
}

.curriculum-hors-perimetre-row .curriculum-exercise-label {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.curriculum-history {
  display: flex;
  flex-wrap: nowrap;
  gap: 1px;
}

/* Plain colored emoji (✅ ❌ ✖️) rather than a hand-built colored badge —
   user request 2026-09-16 ("on n'a pas d'emoji de couleur ?"). Tightened
   further the same day so a long attempt history still fits on the
   exercise's own line instead of wrapping. */
.curriculum-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 16px;
  font-size: 0.75rem;
  cursor: default;
}

/* "Programme acquis" hero block — first block on child_detail.php (user
   request 2026-09-30): a precomputed summary of curriculum acquisition, so
   the page leads with the thing a parent actually cares about rather than
   burying it behind a "Voir le détail" link. See
   Family\Curriculum\AcquisitionCalculator for the "acquis" rule itself. */
.acquisition-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 28px 32px;
  margin: 24px 0 32px;
  box-shadow: 0 2px 10px rgba(44, 44, 44, 0.06);
}

.acquisition-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.acquisition-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--color-text);
}

.acquisition-subtitle {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.acquisition-note {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-style: italic;
  white-space: nowrap;
  padding-top: 4px;
}

.acquisition-divider {
  height: 1px;
  background: var(--color-border);
  margin: 20px 0;
}

.acquisition-divider-tight {
  margin: 16px 0;
}

.acquisition-body {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.acquisition-ring-block {
  flex-shrink: 0;
  width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0 auto;
}

.acquisition-ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
}

.acquisition-ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.acquisition-ring-percent {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  line-height: 1;
}

.acquisition-ring-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.acquisition-count {
  text-align: center;
}

.acquisition-count-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
}

.acquisition-count-caption {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.acquisition-vsep {
  width: 1px;
  align-self: stretch;
  background: var(--color-border);
}

.acquisition-subjects {
  flex-grow: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.acquisition-subject-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.acquisition-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.18);
}

.acquisition-subject-name {
  width: 140px;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}

.acquisition-track {
  position: relative;
  flex-grow: 1;
  height: 14px;
  border-radius: 7px;
  background: #f2ead9;
}

.acquisition-fill {
  position: absolute;
  inset: 0;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.18);
}

/* "En progrès" part of a subject bar: same colour, lighter, starting where the acquired part ends. The acquired
   fill is drawn after it, so its rounded end overlaps this one cleanly. */
.acquisition-fill-progress {
  right: auto;
  opacity: 0.38;
  box-shadow: none;
}

.acquisition-subject-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acquisition-percent {
  width: 42px;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
}

.acquisition-fraction {
  width: 48px;
  text-align: right;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.acquisition-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.acquisition-footer-link-only {
  justify-content: flex-end;
}

.acquisition-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.acquisition-chip-newly {
  background: #eaf1f8;
  color: var(--color-primary-dark);
}

.acquisition-chip-progress {
  background: #fdeee0;
  color: #a8611f;
}

.acquisition-link {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

.acquisition-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.acquisition-no-data {
  margin: 24px 0 32px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

@media (max-width: 700px) {
  .acquisition-card {
    padding: 20px;
  }

  .acquisition-head {
    flex-direction: column;
  }

  .acquisition-body {
    flex-direction: column;
    gap: 20px;
  }

  .acquisition-vsep {
    display: none;
  }

  .acquisition-subjects {
    width: 100%;
    min-width: 0;
  }

  .acquisition-subject-name {
    width: 108px;
    font-size: 0.78rem;
  }

  .acquisition-link {
    margin-left: 0;
  }
}

/* First steps: the onboarding strip, the temporary hint bubbles and the profile picker row
   (parent/register.php, parent/pin.php, parent/dashboard.php, index.php; user request 2026-10-13).
   Everything here exists only to tell a new parent what comes next — the bubbles disappear for good once one of
   the family's children has launched a game (Family::$firstCycleAt). */

/* Logo header of a centered narrow page (register.css does the same for register.php on its own). */
.top-bar-centered {
  justify-content: center;
  margin-bottom: 16px;
}

/* "1 Mon compte - 2 Code PIN - 3 Profil enfant": done steps are ticked, the current one is dark. */
.onboarding-steps {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.onboarding-steps li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.onboarding-step-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-border);
  color: #ffffff;
  font-size: 0.85rem;
}

.onboarding-step-done .onboarding-step-number {
  background: #3ca870;
}

.onboarding-step-current {
  color: var(--color-primary-dark);
}

.onboarding-step-current .onboarding-step-number {
  background: var(--color-primary-dark);
}

.onboarding-step-sep {
  width: 22px;
  height: 2px;
  background: var(--color-border);
}

/* The temporary explanation bubble: warm fill, orange border, the animated star mascot and, when it explains a
   control, a tail pointing at it (.hint-bubble-tail, centered; .hint-bubble-tail-right for a control at the
   right edge of the page). */
.hint-bubble {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 440px;
  margin: 0 auto 24px;
  padding: 12px 18px 12px 14px;
  text-align: left;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-text);
  background: #fff0d9;
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 10px rgba(242, 153, 74, 0.25);
}

.hint-bubble p {
  margin: 0;
}

.hint-bubble-star {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.hint-bubble-tail {
  margin: 20px auto 0;
}

.hint-bubble-tail::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  background: #fff0d9;
  border-top: 2px solid var(--color-accent);
  border-left: 2px solid var(--color-accent);
  transform: rotate(45deg);
}

.hint-bubble-tail-right {
  max-width: 300px;
  margin: 20px 0 0;
}

.hint-bubble-tail-right::before {
  left: auto;
  right: 74px;
}

/* dashboard.php, until a cycle has been played: the "Page des enfants" button with its bubble underneath, both
   flush right in the header. */
.top-bar-cta {
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}

/* index.php: the child's card with its explanation bubble right under it. */
.child-card-column {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.child-card-column .hint-bubble {
  width: 340px;
  max-width: 100%;
  margin-bottom: 0;
}

/* "Choisir une image  ou  Choisir une photo" on one line (dashboard.php's create-child form). */
.pick-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.pick-row-or {
  color: var(--color-text-muted);
}

.pick-row-file {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.field-hint {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.nowrap {
  white-space: nowrap;
}

/* ---- Parents' "parcours" (web/parent/parcours.php): steps as rows, school levels as columns ---- */
.pw-intro {
  margin: 8px 0 16px;
  color: var(--color-text-muted);
}

.pw-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.pw-tab {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 700;
}

.pw-tab-current {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.pw-card {
  margin-top: 12px;
}

.pw-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pw-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 16px 0 12px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.pw-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pw-scroll {
  overflow-x: auto;
}

.pw-grid {
  min-width: 720px;
}

.pw-row {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) repeat(9, 38px) 84px;
  align-items: center;
  column-gap: 2px;
}

.pw-row-head {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--color-text-muted);
  text-align: center;
  padding-bottom: 6px;
}

.pw-level {
  padding: 3px 0;
  border-radius: 8px;
}

.pw-step > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 0;
  border-top: 1px solid var(--color-border);
}

.pw-step > summary::-webkit-details-marker {
  display: none;
}

.pw-step[open] > summary {
  background: #faf5e8;
}

.pw-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 12px;
}

.pw-label-text {
  font-weight: 800;
}

.pw-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.pw-slot {
  display: flex;
  justify-content: center;
  align-self: stretch;
  align-items: center;
}

.pw-current {
  background: #eaf1f8;
}

.pw-count {
  font-size: 0.85rem;
  font-weight: 700;
  text-align: right;
  color: var(--color-text-muted);
}

.pw-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2px solid transparent;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  flex: none;
}

.pw-acquired {
  background: #4aa564;
  color: #fff;
}

.pw-in_progress {
  background: #fdeee0;
  border-color: var(--color-accent);
  color: #a8611f;
}

.pw-tried {
  background: #fff;
  border-color: var(--color-accent);
  color: #a8611f;
}

.pw-unseen {
  background: #e7e2d3;
}

.pw-no_exercise {
  background: transparent;
  border: 2px dashed var(--color-border);
}

.pw-objectives {
  list-style: none;
  margin: 0;
  padding: 8px 12px 14px;
  background: #faf5e8;
  display: grid;
  gap: 8px;
}

.pw-objectives li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
}

.pw-objective-level {
  flex: none;
  min-width: 34px;
  font-weight: 800;
  color: var(--color-primary-dark);
}

.pw-note {
  margin: 14px 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.pw-slot-level {
  display: none;
}

@media (max-width: 700px) {
  /* A phone cannot hold a 230px label plus nine columns: the label takes its own line, the nine levels sit below it,
     each cell naming its level (the header row is hidden). */
  .pw-grid {
    min-width: 0;
  }

  .pw-row-head {
    display: none;
  }

  .pw-row {
    grid-template-columns: repeat(9, 1fr) auto;
    row-gap: 6px;
  }

  .pw-label {
    grid-column: 1 / -1;
  }

  .pw-slot {
    flex-direction: column;
    gap: 2px;
    padding: 2px 0;
  }

  .pw-slot-level {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--color-text-muted);
  }

  .pw-cell {
    width: 24px;
    height: 24px;
  }

  .pw-count {
    padding-left: 6px;
    white-space: nowrap;
  }

  .acquisition-card.pw-card {
    padding: 20px 16px;
  }
}

/* ---- "Jardin des apprentissages" (web/parent/parcours.php, FUN-744): groves, small plants, the big plant ---- */
.pw-garden {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 24px 28px 28px;
  box-shadow: 0 2px 10px rgba(44, 44, 44, 0.06);
}

.pw-garden-title {
  margin: 0;
  font-size: 1.3rem;
}

.pw-garden-sub {
  margin: 2px 0 16px;
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.pw-groves {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px 40px;
}

.pw-grove {
  display: block;
  flex: 0 1 220px;
  border: 2px solid transparent;
  border-radius: 18px;
  color: inherit;
  text-align: center;
  text-decoration: none;
}

.pw-grove-pic {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  background: #eef3e6;
}

.pw-grove-pic img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 260 / 230;
}

.pw-grove-title {
  display: block;
  margin: 8px 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
}

.pw-grove:hover .pw-grove-pic {
  box-shadow: 0 3px 12px rgba(44, 44, 44, 0.18);
}

.pw-grove-on {
  border-color: var(--color-primary);
  padding: 4px;
}

.pw-theme {
  margin-top: 22px;
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
}

.pw-theme h3 {
  margin: 0 0 2px;
  font-size: 1.2rem;
}

.pw-theme-sub {
  margin: 0 0 8px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.pw-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  margin: 8px 0 0;
  color: var(--color-text-muted);
  font-size: 0.84rem;
}

.pw-key i {
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

.pw-key-leaf {
  width: 20px;
  height: 12px;
  border-radius: 70% 0 70% 0;
}

.pw-key-full {
  background: #46a35f;
}

.pw-key-part {
  background: linear-gradient(90deg, #46a35f 50%, transparent 50%);
  border: 2px dashed #c9c2ab;
}

.pw-key-future {
  border: 2px dashed #c9c2ab;
}

.pw-key-now {
  width: 26px;
  height: 14px;
  border-radius: 7px;
  background: rgba(59, 111, 164, 0.16);
}

.pw-minis {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 6px;
}

.pw-mini {
  display: block;
  width: 108px;
  padding: 6px 4px 8px;
  border: 2px solid transparent;
  border-radius: 14px;
  color: inherit;
  text-align: center;
  text-decoration: none;
}

.pw-mini:hover {
  background: #faf6ea;
}

.pw-mini-on {
  border-color: var(--color-primary);
  background: #f3f7fb;
}

.pw-mini svg {
  display: block;
  width: 84px;
  height: auto;
  margin: 0 auto;
}

.pw-mini-name {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.3em;
  margin-top: 2px;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.15;
}

.pw-mini-delta {
  display: block;
  min-height: 1em;
  color: #24703a;
  font-size: 0.72rem;
  font-weight: 800;
}

.pw-mini-todo {
  opacity: 0.55;
}

.pw-mini-todo .pw-mini-delta {
  color: var(--color-text-muted);
  font-weight: 700;
}

.pw-plant {
  margin-top: 18px;
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
}

.pw-plant h4 {
  margin: 0;
  font-size: 1.1rem;
}

.pw-plant-sub {
  margin: 2px 0 6px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.pw-plant-sub a {
  color: var(--color-primary);
  font-weight: 800;
  text-decoration: none;
}

.pw-big {
  max-width: 520px;
  margin: 0 auto;
}

.pw-block-title {
  margin: 18px 0 6px;
  padding-left: 10px;
  border-left: 4px solid #4f9a62;
  font-size: 1.05rem;
}

/* a branch: the same kind of plant, grafted under the trunk. The rule down its left side is the twig's line (dotted,
   solid green once the branch has been worked on); the picture's stem takes it up at the bottom, with no ground */
.pw-branch {
  margin: 18px 0 0 8px;
  padding: 4px 0 0;
  border-left: 4px dotted #bfb79c;
}

.pw-branch-grown {
  border-left: 4px solid #3d9a57;
}

.pw-branch h5,
.pw-branch .pw-plant-sub {
  padding-left: 12px;
}

.pw-branch h5 {
  margin: 0;
  font-size: 1.02rem;
}

.pw-big-svg {
  display: block;
  width: 100%;
  height: auto;
}

.pw-lab {
  fill: var(--color-text);
  font-weight: 800;
}

.pw-lab-off {
  fill: #9a9484;
  font-weight: 700;
}

/* two drawings of the big plant: the wide one on a screen, the narrow one (names on two lines) on a phone */
.pw-big-narrow {
  display: none;
}

@media (max-width: 700px) {
  .pw-groves {
    flex-direction: column;
    align-items: center;
  }

  .pw-grove {
    flex: 0 1 auto;
    width: 100%;
    max-width: 320px;
  }

  .pw-garden {
    padding: 18px 12px 22px;
  }

  .pw-mini {
    width: 31%;
  }

  .pw-big-wide {
    display: none;
  }

  .pw-big-narrow {
    display: block;
  }
}
