/* Abby's French: "La grande aventure" (js/french/abby.js and
   js/french/abby-activities.js). Builds on css/learn.css tokens and
   css/french.css. Every class starts with fr-abby-. Targets are at least
   44px, nothing is wider than the screen at 375px, stars and states always
   carry symbols and words as well as colour, and motion stops under
   prefers-reduced-motion. No :has(), no nesting (Safari 15). */

.fr-abby { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }

/* ---------- top bar: level, XP, streak ---------- */

.fr-abby-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 22px;
  background: var(--learn-card);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.06);
}
.fr-abby-emblem { flex: none; width: 56px; height: 56px; font-size: 2.6rem; text-align: center; }
.fr-abby-level { flex: 1 1 auto; min-width: 0; }
.fr-abby-level-name { margin: 0; font-family: "Fredoka", system-ui, sans-serif; font-weight: 600; font-size: 1.15rem; overflow-wrap: anywhere; }
.fr-abby-xpbar {
  position: relative;
  height: 14px;
  margin: 4px 0;
  border-radius: 999px;
  background: var(--learn-soft);
  overflow: hidden;
}
.fr-abby-xpfill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--learn-accent), #4fa3e0);
  transition: width 0.6s ease;
}
.fr-abby-xptext { margin: 0; font-size: 0.85rem; font-weight: 700; opacity: 0.85; }
.fr-abby-streak { flex: none; margin: 0; font-size: 1.4rem; font-weight: 900; white-space: nowrap; }
.fr-abby-streak-off { opacity: 0.55; }
/* Today's Défi du jour not done yet: the flame waits, dimmed. Done: it is
   lit, with a ✓ as well as the glow. */
.fr-abby-streak-dim { opacity: 0.7; filter: grayscale(0.6); }
.fr-abby-streak-lit { padding: 4px 10px; border-radius: 999px; background: #ffe7c2; color: #4a2a00; box-shadow: 0 0 0 3px #f29a2e, 0 0 14px rgba(242, 154, 46, 0.55); }

.fr-abby-title {
  margin: 0;
  text-align: center;
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(1.5rem, 6vw, 2rem);
}
.fr-abby-h-en { font-size: 0.6em; font-weight: 700; opacity: 0.8; }

/* ---------- map actions ---------- */

.fr-abby-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.fr-abby-daily {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 220px;
  min-height: 72px;
  padding: 10px 16px;
  border-radius: 24px;
  background: linear-gradient(135deg, #fff4d8, var(--learn-card));
  text-align: left;
  box-shadow: 0 0 0 4px var(--learn-sun), 0 6px 0 rgba(0, 0, 0, 0.08);
}
.fr-abby-daily-emoji { font-size: 2.2rem; line-height: 1; flex: none; }
.fr-abby-daily-text { display: flex; flex-direction: column; min-width: 0; }
.fr-abby-daily-title { font-family: "Fredoka", system-ui, sans-serif; font-weight: 600; font-size: 1.3rem; }
.fr-abby-daily-sub { font-size: 0.95rem; font-weight: 700; opacity: 0.85; }
.fr-abby-daily-done { background: linear-gradient(135deg, #e6f6e6, var(--learn-card)); box-shadow: 0 0 0 4px #5aa85a, 0 6px 0 rgba(0, 0, 0, 0.08); }
.fr-abby-passbtn { flex: 0 1 auto; min-height: 72px; border-radius: 24px; }
.fr-abby-count { font-size: 1rem; opacity: 0.85; }

/* ---------- the map and the route ---------- */

.fr-abby-mapart {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  border-radius: 24px;
  background: linear-gradient(180deg, #d6ecff, #eaf6e6);
  overflow: hidden;
}
.fr-abby-mapart .fr-art-emoji { font-size: 4rem; padding: 12px; }
.fr-abby-mapart .fr-art-img { display: block; width: 100%; height: auto; }

.fr-abby-route {
  list-style: none;
  margin: 0;
  padding: 0 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
/* The road the stops sit on. */
.fr-abby-route::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 12px;
  bottom: 12px;
  border-left: 4px dashed var(--learn-accent);
  opacity: 0.35;
}
.fr-abby-stop { position: relative; }
.fr-abby-stopbtn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 8px 12px;
  border-radius: 20px;
  text-align: left;
  border-color: var(--learn-soft);
}
body.learn .fr-abby-stopbtn { font-size: 1rem; }
.fr-abby-stopmark { flex: none; width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.fr-abby-stamp-sm { width: 48px; height: 48px; font-size: 2rem; text-align: center; }
.fr-abby-stoptext { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.fr-abby-place { font-family: "Fredoka", system-ui, sans-serif; font-weight: 600; font-size: 1.2rem; overflow-wrap: anywhere; }
.fr-abby-stopsub { font-size: 0.9rem; font-weight: 700; opacity: 0.85; overflow-wrap: anywhere; }
.fr-abby-stopstate { flex: none; font-size: 0.9rem; font-weight: 900; white-space: nowrap; }
.fr-abby-stop-done .fr-abby-stopbtn { border-color: var(--fr-right); background: var(--fr-right-bg); }
.fr-abby-stop-done .fr-abby-stopstate { color: var(--fr-right); }
.fr-abby-stop-current .fr-abby-stopbtn { border-color: var(--learn-accent); box-shadow: 0 0 0 4px var(--learn-sun), 0 4px 0 rgba(0, 0, 0, 0.08); }
.fr-abby-stop-current .fr-abby-stopstate { color: var(--learn-accent); }
.fr-abby-stop-locked .fr-abby-stopbtn { background: var(--learn-locked, #e7ebe6); opacity: 0.8; }

/* ---------- a stop ---------- */

.fr-abby-stophead { display: flex; align-items: center; gap: 14px; }
.fr-abby-stamp { width: 96px; height: 96px; font-size: 3.6rem; text-align: center; flex: none; }
.fr-abby-stopinfo { min-width: 0; }
.fr-abby-stopinfo p { margin: 0; }
.fr-abby-stopunit { font-family: "Fredoka", system-ui, sans-serif; font-weight: 600; font-size: 1.25rem; overflow-wrap: anywhere; }
.fr-abby-province { font-weight: 700; opacity: 0.85; }
.fr-abby-wordstars { font-weight: 700; }

.fr-abby-acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.fr-abby-act, .fr-abby-defibtn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 8px 14px;
  border-radius: 20px;
  text-align: left;
}
body.learn .fr-abby-act, body.learn .fr-abby-defibtn { font-size: 1rem; }
.fr-abby-act-emoji { font-size: 1.9rem; flex: none; }
.fr-abby-act-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.fr-abby-act-fr { font-family: "Fredoka", system-ui, sans-serif; font-weight: 600; font-size: 1.15rem; }
.fr-abby-act-en { font-size: 0.88rem; font-weight: 700; opacity: 0.85; }
.fr-abby-act-stars { flex: none; font-size: 0.95rem; white-space: nowrap; }
.fr-abby-act-go { flex: none; font-size: 1.1rem; color: var(--learn-accent); }
.fr-abby-act-next { box-shadow: 0 0 0 4px var(--learn-sun), 0 4px 0 rgba(0, 0, 0, 0.08); }
.fr-abby-defibtn { min-height: 80px; background: linear-gradient(135deg, var(--learn-soft), var(--learn-card)); }
body.learn .fr-abby-defibtn .fr-abby-act-fr { font-size: 1.35rem; }

/* ---------- passport ---------- */

.fr-abby-sub { margin: 6px 0 0; font-family: "Fredoka", system-ui, sans-serif; font-weight: 600; font-size: 1.25rem; }
.fr-abby-stamps, .fr-abby-badges {
  list-style: none;
  margin: 0;
  padding: 12px;
  display: grid;
  gap: 10px;
  border-radius: 22px;
  background: #fffaf0;
  border: 3px dashed rgba(0, 0, 0, 0.12);
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}
.fr-abby-stampcell, .fr-abby-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 4px;
  text-align: center;
  border-radius: 16px;
  background: var(--learn-card);
}
.fr-abby-stampcell .fr-abby-stamp { width: 72px; height: 72px; font-size: 2.8rem; }
.fr-abby-badgepic { width: 72px; height: 72px; font-size: 2.8rem; text-align: center; }
.fr-abby-cellname { font-weight: 800; font-size: 0.95rem; overflow-wrap: anywhere; }
.fr-abby-cellhint { font-size: 0.8rem; font-weight: 700; opacity: 0.85; overflow-wrap: anywhere; }
/* Not earned yet: a silhouette, with its hint underneath in words. */
.fr-abby-locked .fr-art, .fr-art.fr-abby-locked { filter: grayscale(1) brightness(0); opacity: 0.18; }

/* ---------- activities ---------- */

.fr-abby-status { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 28px; flex-wrap: wrap; }

/* Épelle! */
.fr-abby-spell-pic { font-size: 1rem; }
.fr-abby-spell-side { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fr-abby-slots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 100%; }
.fr-abby-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 52px;
  border-bottom: 4px solid var(--learn-accent);
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.8rem;
  font-weight: 600;
}
.fr-abby-slot-given { border-bottom-color: transparent; width: 20px; }
.fr-abby-slot-space { width: 16px; }
.fr-abby-slot-now { background: var(--learn-soft); border-radius: 8px 8px 0 0; }
.fr-abby-slots-done .fr-abby-slot { color: var(--fr-right); border-bottom-color: var(--fr-right); }
.fr-abby-tiles { max-width: 520px; }
.fr-abby-tile { min-width: 52px; min-height: 52px; text-transform: none; }
body.learn .fr-abby-tile { font-size: 1.5rem; }
.fr-abby-tile-used { visibility: hidden; }

/* Vite vite! */
.fr-abby-clock {
  position: relative;
  width: min(100%, 260px);
  height: 28px;
  border-radius: 999px;
  background: var(--learn-soft);
  overflow: hidden;
}
.fr-abby-clock-bar {
  --fr-left: 1;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  background: var(--learn-accent);
  transform-origin: left center;
  transform: scaleX(var(--fr-left));
  transition: transform 0.25s linear;
}
.fr-abby-clock-low .fr-abby-clock-bar { background: #c9503a; }
.fr-abby-clock-secs { position: relative; display: block; text-align: center; line-height: 28px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.fr-abby-tally { margin: 0; font-size: 1.4rem; font-weight: 900; }
.fr-abby-best { margin: 0; font-size: 1.2rem; font-weight: 800; }
.fr-abby-go { min-height: 72px; padding: 12px 24px; }

/* Le défi */
.fr-abby-hearts { margin: 0; font-size: 1.6rem; letter-spacing: 2px; }
.fr-abby-heart-lost { opacity: 0.6; }
.fr-abby-qnum { font-size: 1rem; font-weight: 800; letter-spacing: 0; }
.fr-abby-qcard { min-height: 140px; }
.fr-abby-words { display: flex; flex-direction: column; gap: 10px; width: min(100%, 360px); }
.fr-abby-wordchoice { position: relative; min-height: 56px; }
.fr-abby-wordchoice .fr-mark { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.fr-abby-restart { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.fr-abby-restart-emoji { margin: 0; font-size: 3.4rem; }

/* ---------- results, level up, stamp ceremony ---------- */

.fr-abby-gain { margin: 0; font-size: 1.6rem; font-weight: 900; color: var(--learn-accent); }
.fr-abby-score { margin: 0; font-family: "Fredoka", system-ui, sans-serif; font-size: 3rem; font-weight: 600; }
.fr-abby-bestline { margin: 0; font-size: 1.2rem; font-weight: 800; }
.fr-abby-levelup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, #fff4d8, var(--learn-soft));
  box-shadow: 0 0 0 4px var(--learn-sun);
  animation: fr-abby-pop 0.6s ease;
}
.fr-abby-emblem-big { width: 120px; height: 120px; font-size: 4.6rem; text-align: center; }
.fr-abby-levelup-text { margin: 0; font-family: "Fredoka", system-ui, sans-serif; font-size: 1.4rem; font-weight: 600; }

.fr-abby-passpage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 260px);
  min-height: 200px;
  border-radius: 18px;
  background: #fffaf0;
  border: 3px dashed rgba(0, 0, 0, 0.15);
}
.fr-abby-ceremony .fr-abby-stamp { width: 160px; height: 160px; font-size: 6rem; }
.fr-abby-stamp-drop { animation: fr-abby-stamp 0.9s cubic-bezier(0.2, 1.4, 0.4, 1) both; }

/* Défi du jour reward. */
.fr-abby-bigflame { margin: 0; font-size: 5rem; line-height: 1; animation: fr-abby-pop 0.6s ease; }
.fr-abby-dailyreward-en { margin: 0; font-size: 1.05rem; font-weight: 700; text-align: center; }
.fr-abby-dailyreward-streak { font-size: 1.8rem; }

/* XP toasts (decoration; the live region says the same in words). */
.fr-abby-toasts {
  position: fixed;
  right: 16px;
  top: 72px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}
.fr-abby-toast {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--learn-accent);
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  animation: fr-abby-toast 1.4s ease forwards;
}
.fr-abby-toast-level { background: #c98a12; }
.fr-abby-toast-badge { background: #6b4bb8; }

/* Text for screen readers only. */
.fr-abby-vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Le défi before the stop's games have stars: still a real button (it says
   why), drawn quieter. */
.fr-abby-defi-locked { opacity: 0.7; background: var(--learn-card); }

/* A badge earned by the activity just finished. */
.fr-abby-newbadge {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 24px;
  background: linear-gradient(135deg, #efe8ff, var(--learn-card));
  box-shadow: 0 0 0 4px #6b4bb8;
  animation: fr-abby-pop 0.6s ease;
}
.fr-abby-newbadge .fr-abby-badgepic { width: 72px; height: 72px; font-size: 3rem; flex: none; }
.fr-abby-newbadge-text { margin: 0; display: flex; flex-direction: column; text-align: left; min-width: 0; }
.fr-abby-newbadge-new { font-weight: 900; color: #6b4bb8; }
.fr-abby-newbadge-title { font-family: "Fredoka", system-ui, sans-serif; font-size: 1.3rem; font-weight: 600; }
.fr-abby-newbadge-en { font-size: 0.95rem; font-weight: 700; opacity: 0.85; }

@keyframes fr-abby-toast {
  0% { opacity: 0; transform: translateY(8px); }
  15% { opacity: 1; transform: translateY(0); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-14px); }
}
@keyframes fr-abby-stamp {
  0% { opacity: 0; transform: scale(2.2) rotate(-18deg); }
  70% { opacity: 1; transform: scale(0.92) rotate(4deg); }
  100% { opacity: 1; transform: scale(1) rotate(-6deg); }
}
@keyframes fr-abby-pop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 400px) {
  .fr-abby-top { padding: 8px; gap: 8px; }
  .fr-abby-emblem { width: 44px; height: 44px; font-size: 2rem; }
  .fr-abby-stamp { width: 72px; height: 72px; font-size: 2.8rem; }
  .fr-abby-slot { width: 32px; height: 46px; font-size: 1.5rem; }
  .fr-abby-stamps, .fr-abby-badges { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); padding: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .fr-abby-toast { animation: none; }
  .fr-abby-stamp-drop { animation: none; transform: rotate(-6deg); }
  .fr-abby-levelup, .fr-abby-newbadge, .fr-abby-bigflame { animation: none; }
  .fr-abby-xpfill, .fr-abby-clock-bar { transition: none; }
}
