/* ==========================================================================
   Ahl Al Arabiyah — feuille de style principale
   ========================================================================== */

:root {
  /* Palette issue du logo */
  --color-teal: #16A0A0;
  --color-teal-dark: #0C7373;
  --color-teal-10: rgba(22, 160, 160, 0.10);
  --color-navy: #103C46;
  --color-navy-dark: #0A2830;
  --color-navy-10: rgba(16, 60, 70, 0.08);
  --color-orange: #EE9A45;
  --color-orange-10: rgba(238, 154, 69, 0.14);
  --color-harakat-red: #C6362E;

  --color-bg: #F6FAFA;
  --color-bg-alt: #EFF6F6;
  --color-white: #FFFFFF;
  --color-text: #16262A;
  --color-text-light: #55696D;
  --color-border: #E1EBEB;

  --font-heading: 'Poppins', 'Cairo', sans-serif;
  --font-body: 'Inter', 'Cairo', sans-serif;
  --font-arabic: 'Amiri Quran', 'Amiri', 'Cairo', 'Inter', serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 26px;
  --shadow-sm: 0 2px 10px rgba(16, 60, 70, 0.06);
  --shadow-md: 0 12px 32px rgba(16, 60, 70, 0.10);
  --shadow-lg: 0 24px 60px rgba(16, 60, 70, 0.16);
  --container-w: 1180px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-navy);
  line-height: 1.2;
  margin: 0 0 .6em;
}
p { margin: 0 0 1em; }

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-navy);
  color: #fff;
  padding: 10px 16px;
  z-index: 999;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

section[id] { scroll-margin-top: 88px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn svg { flex-shrink: 0; }
.btn:hover { transform: translateY(-2px); }
.btn-sm { padding: 10px 20px; font-size: 0.88rem; }

.btn-primary {
  background: linear-gradient(135deg, var(--color-teal), var(--color-teal-dark));
  color: #fff;
  box-shadow: 0 10px 24px rgba(12, 115, 115, 0.28);
}
.btn-primary:hover { box-shadow: 0 14px 30px rgba(12, 115, 115, 0.36); }

.btn-outline {
  background: transparent;
  color: var(--color-navy);
  border-color: var(--color-border);
}
.btn-outline:hover { border-color: var(--color-teal); color: var(--color-teal-dark); }

.btn-white { background: #fff; color: var(--color-teal-dark); }
.btn-outline-white { background: transparent; border-color: rgba(255,255,255,0.55); color: #fff; }
.btn-outline-white:hover { border-color: #fff; background: rgba(255,255,255,0.08); }
.btn-ghost-white { background: rgba(255,255,255,0.12); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
  border-bottom-color: var(--color-border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-navy);
  white-space: nowrap;
}
.brand-tagline {
  font-family: var(--font-arabic);
  font-size: 0.8rem;
  color: var(--color-teal-dark);
}

.main-nav ul { display: flex; gap: 30px; }
.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text-light);
  position: relative;
  padding: 6px 0;
}
.nav-link:hover { color: var(--color-navy); }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--color-teal);
  transition: width .2s ease;
}
.nav-link:hover::after { width: 100%; }
.nav-link.is-active { color: var(--color-navy); }
.nav-link.is-active::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 14px; }

.lang-switch {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: .02em;
  color: var(--color-navy);
  transition: border-color .18s ease, color .18s ease;
}
.lang-switch:hover { border-color: var(--color-teal); color: var(--color-teal-dark); }
.lang-menu { position: relative; flex: none; }
.lang-menu summary { list-style: none; cursor: pointer; user-select: none; gap: 6px; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after {
  content: "";
  width: 5px; height: 5px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
.lang-menu[open] summary { border-color: var(--color-teal); color: var(--color-teal-dark); }
.lang-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 160px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  z-index: 60;
}
.lang-menu-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-navy);
}
.lang-menu-list a:hover { background: var(--color-teal-10); color: var(--color-teal-dark); }
.lang-menu-list a span { font-weight: 700; font-size: 0.72rem; color: var(--color-text-light); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--color-navy);
  transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 76px 0 100px;
  background: linear-gradient(180deg, var(--color-bg) 0%, #ffffff 100%);
}
.hero-decor {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 420px at 88% -8%, var(--color-teal-10), transparent 60%),
    radial-gradient(480px 380px at 8% 30%, var(--color-orange-10), transparent 65%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  grid-template-areas: "intro visual" "details visual";
  gap: 56px;
  align-items: center;
}
.hero-intro { grid-area: intro; }
.hero-details { grid-area: details; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-teal-dark);
  background: var(--color-teal-10);
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.eyebrow-center { display: block; width: fit-content; margin-left: auto; margin-right: auto; }
.eyebrow-invert { background: rgba(255,255,255,0.16); color: #fff; }

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.text-accent-teal { color: var(--color-teal); }

.hero-arabic {
  font-family: var(--font-arabic);
  font-size: 1.35rem;
  color: var(--color-navy);
  direction: rtl;
  margin-bottom: 18px;
}
.hero-text {
  color: var(--color-text-light);
  font-size: 1.05rem;
  max-width: 540px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 40px; }

.hero-stats {
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
  border-top: 1px solid var(--color-border);
  padding-top: 24px;
}
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-navy);
}
.hero-stats span { font-size: 0.85rem; color: var(--color-text-light); }

.hero-visual {
  grid-area: visual;
  position: relative;
  min-height: 420px;
}
.hero-card {
  position: absolute;
  width: 78%;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 6px solid #fff;
  background: #fff;
}
.hero-card img { width: 100%; height: 100%; object-fit: cover; }
.hero-card-back {
  right: 0;
  top: 10px;
  transform: rotate(6deg);
  opacity: 0.85;
  z-index: 1;
}
.hero-card-front {
  left: 0;
  top: 40px;
  transform: rotate(-4deg);
  z-index: 2;
  aspect-ratio: 3/4;
}
.hero-card-front img { height: 100%; }

.floating-badge {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-navy);
}
.badge-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--color-teal); flex: none; }
.badge-dot-orange { background: var(--color-orange); }
.badge-top { top: 8px; left: 6%; }
.badge-bottom { bottom: 18px; right: 2%; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--color-bg-alt); }
.section-head { max-width: 680px; margin: 0 auto 56px; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-lead { color: var(--color-text-light); font-size: 1.05rem; }

/* ---------- Feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 72px;
}
.feature-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 30px 26px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--icon-bg);
  color: var(--icon-fg);
  margin-bottom: 18px;
}
.feature-icon svg { width: 24px; height: 24px; }
.feature-card h3 { font-size: 1.08rem; margin-bottom: 8px; }
.feature-card p { color: var(--color-text-light); font-size: 0.94rem; margin: 0; }

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}
.step {
  position: relative;
  padding: 26px 20px 22px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.step-index {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-teal);
  margin-bottom: 10px;
}
.step h4 { font-size: 0.98rem; margin-bottom: 6px; }
.step p { font-size: 0.86rem; color: var(--color-text-light); margin: 0; }

/* ---------- Programmes ---------- */
.program-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.program-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.program-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.program-thumb {
  position: relative;
  aspect-ratio: 3/4;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--color-bg-alt);
}
.program-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.program-thumb-letters {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  padding: 24px 20px 20px;
  text-align: center;
  background: linear-gradient(160deg, var(--color-teal-10), var(--color-bg-alt) 75%);
}
.program-thumb-number {
  font-family: var(--font-arabic);
  font-size: 8rem;
  color: var(--color-orange);
  line-height: 1;
}
.program-thumb-list {
  font-family: var(--font-arabic);
  direction: rtl;
  font-size: 1.6rem;
  line-height: 1.6;
  color: var(--color-navy);
}
.program-card-free { border-color: var(--color-orange); }
.program-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: var(--color-orange);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.program-body { display: flex; flex-direction: column; flex: 1; padding: 22px; }
.program-btn-row { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 16px; }
.program-download {
  width: 100%;
  border-color: var(--color-orange);
  color: var(--color-orange);
}
.program-download:hover { background: var(--color-orange-10); border-color: var(--color-orange); color: var(--color-orange); }
.program-number {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--color-teal-dark);
  background: var(--color-teal-10);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.program-range {
  font-family: var(--font-arabic);
  direction: rtl;
  text-align: left;
  font-size: 0.92rem;
  color: var(--color-orange);
  margin-bottom: 8px;
}
.program-body h3 { font-size: 1.02rem; margin-bottom: 8px; }
.program-body p:not(.program-range) { font-size: 0.88rem; color: var(--color-text-light); margin: 0; }

/* ---------- Hub (accueil -> modules / jeux) ---------- */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.hub-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: 36px 30px;
  text-align: center;
}
.hub-card h3 { margin-bottom: 10px; }
.hub-card p { color: var(--color-text-light); margin-bottom: 22px; }

/* ---------- Pages Modules / Jeux (intro + retour) ---------- */
.page-intro { padding-top: 48px; }
.page-cta-back { text-align: center; margin: 40px 0 0; }
.game-types {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}
.game-type-pill {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-navy);
  background: var(--color-teal-10);
  padding: 8px 16px;
  border-radius: 999px;
}

/* ---------- Modules ---------- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.module-card {
  min-width: 0;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: 22px 18px;
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.module-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.module-card-bonus { border-color: rgba(238,154,69,0.4); background: linear-gradient(180deg, rgba(238,154,69,0.06), #fff 60%); }
.module-number {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--color-teal-dark);
  background: var(--color-teal-10);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.module-letters {
  font-family: var(--font-arabic);
  direction: rtl;
  font-size: 2.1rem;
  line-height: 1.7;
  color: var(--color-navy);
  margin: 0 0 14px;
}
.module-progress {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.76rem;
  color: var(--color-orange);
  margin: -6px 0 14px;
}
.module-status {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.76rem;
  margin: -8px 0 14px;
}
.module-status-available, .module-status-unlocked { color: var(--color-teal-dark); }
.module-status-locked { color: var(--color-text-light); }
.module-status-override { color: var(--color-orange); }
.module-listen { width: 100%; white-space: normal; }
.btn-outline.module-listen { border-color: rgba(22,160,160,0.35); color: var(--color-teal-dark); }
.btn-outline.module-listen:hover { border-color: var(--color-teal); background: var(--color-teal-10); color: var(--color-teal-dark); }
.module-formlab { width: 100%; white-space: normal; margin-top: 8px; border-color: rgba(16,60,70,0.55); color: var(--color-navy); }
.module-formlab:hover { border-color: var(--color-navy); background: var(--color-navy-10); color: var(--color-navy); }
.module-shadda { width: 100%; white-space: normal; margin-top: 8px; border-color: rgba(238,154,69,0.45); color: var(--color-orange); }
.module-shadda:hover { border-color: var(--color-orange); background: var(--color-orange-10); color: var(--color-orange); }
.module-sunmoon { width: 100%; white-space: normal; margin-top: 8px; }

/* ---------- Audience ---------- */
.audience-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.audience-card {
  text-align: center;
  padding: 34px 22px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--color-border);
  transition: transform .2s ease, box-shadow .2s ease;
}
.audience-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.audience-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--color-navy-10);
  color: var(--color-navy);
  display: flex;
  align-items: center;
  justify-content: center;
}
.audience-icon svg { width: 26px; height: 26px; }
.audience-card h3 { font-size: 1rem; margin-bottom: 8px; }
.audience-card p { font-size: 0.88rem; color: var(--color-text-light); margin: 0; }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.gallery-item {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  padding: 0;
  cursor: zoom-in;
  aspect-ratio: 3/4;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.gallery-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform .35s ease;
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 12px 14px;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  text-align: left;
  background: linear-gradient(0deg, rgba(10,40,48,0.82), transparent);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(10, 30, 35, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: min(90vw, 620px);
  max-height: 86vh;
  max-height: 86svh;
  max-height: 86dvh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.lightbox-close {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  right: max(28px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255,255,255,0.24); }

/* ---------- Reader (lecture en ligne du fascicule) ---------- */
.reader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(9, 26, 31, 0.96);
  display: none;
  flex-direction: column;
}
.reader.is-open { display: flex; }
.reader-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 16px max(20px, env(safe-area-inset-left));
  flex: none;
}
.reader-title {
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reader-page-indicator {
  color: rgba(255,255,255,0.7);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  flex: none;
  white-space: nowrap;
}
.reader-close {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.reader-close:hover { background: rgba(255,255,255,0.24); }

.reader-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 20px 24px;
}
.reader-nav {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease, opacity .18s ease;
}
.reader-nav:hover { background: rgba(255,255,255,0.24); }
.reader-nav:disabled { opacity: 0.3; cursor: default; background: rgba(255,255,255,0.12); }
.reader-page-wrap {
  max-width: min(680px, 82vw);
  max-height: 100%;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.reader-page-wrap img { width: 100%; display: block; }

@media (max-width: 680px) {
  .reader-title { display: none; }
  .reader-bar { justify-content: flex-end; }
  .reader-nav { width: 38px; height: 38px; font-size: 1.4rem; }
  .reader-body { gap: 8px; padding: 0 10px 16px; }
  .reader-page-wrap { max-width: 100%; }
}

/* ---------- Letter lab (prononciation interactive) ---------- */
.letterlab-body {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 20px;
  padding: 0 20px 24px;
}
.letterlab-tabs {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}
.letterlab-tab {
  width: 56px;
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 14px;
  border: 2px solid transparent;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-family: var(--font-arabic);
  font-size: 1.6rem;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.letterlab-tab-char { display: block; transform: translateY(-50%); }
.letterlab-tab:hover { background: rgba(255,255,255,0.16); }
.letterlab-tab.is-active { background: var(--color-teal); border-color: #fff; }

.letterlab-panel {
  flex: 1;
  min-width: 0;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 28px;
  overflow-y: auto;
}
.letterlab-hint { color: var(--color-text-light); font-size: 0.88rem; margin: 0 0 14px; }
.letterlab-name {
  font-family: var(--font-arabic);
  font-size: 2.2rem;
  color: var(--color-navy);
  margin-bottom: 22px;
  direction: rtl;
}
.letterlab-pronunciation {
  background: var(--color-teal-10);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 0 0 22px;
  text-align: left;
}
.letterlab-pronunciation-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--color-teal-dark);
  margin: 0 0 6px;
}
.letterlab-pronunciation-text {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--color-text);
  margin: 0;
}
.letterlab-group { margin-bottom: 22px; }
.letterlab-group h4 {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-light);
  margin: 0 0 12px;
}
.letterlab-group[data-group="tanwin"] h4 { color: var(--color-orange); }
.letterlab-group[data-group="harakat"] h4 { color: var(--color-teal-dark); }
.letterlab-group[data-group="sukun"] h4 { color: var(--color-teal-dark); }
.letterlab-group[data-group="shadda"] h4 { color: var(--color-orange); }
.letterlab-group-arabic { font-family: var(--font-arabic); text-transform: none; letter-spacing: 0; font-size: 2.3em; }
.letterlab-grid { display: flex; gap: 10px; flex-wrap: wrap; direction: rtl; }
.letterlab-cell {
  min-width: 64px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 2px solid var(--color-border);
  background: var(--color-bg);
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  color: var(--color-navy);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
  direction: rtl;
}
.letterlab-cell:hover { border-color: var(--color-teal); transform: translateY(-2px); }
.letterlab-cell.is-playing { background: var(--color-teal); border-color: var(--color-teal); color: #fff; transform: scale(1.06); }
.letterlab-mark { color: var(--color-harakat-red); font-weight: 700; }
.letterlab-cell.is-playing .letterlab-mark { color: #fff; }
/* position:relative/top et non transform : verifie en pratique que
   "transform" n'a aucun effet ici (mesure DOM avant/apres : le rect ne
   bouge pas d'un pixel, quelle que soit la valeur) - la marque diacritique
   est un caractere Unicode "combinant" seul dans son span, et Chrome/
   Safari la peignent avec la lettre precedente au moment du shaping du
   texte, avant l'etape de transform. position:relative/top agit lui sur
   la boite avant le shaping et deplace donc reellement la marque. Sans
   risque pour la liaison cursive ici : ces classes ne servent que sur des
   lettres isolees (cartes du labo/jeux), jamais au milieu d'un mot avec
   d'autres lettres a lier autour (contrairement a .arabic-kasra-fix
   ci-dessous, qui reste en transform pour cette raison). */
.letterlab-mark-raised { position: relative; top: -0.5em; }
.letterlab-mark-tightened { position: relative; top: 0.1em; }
.letterlab-mark-widened { position: relative; top: 0.3em; }
.letterlab-mark-widened-tailed { position: relative; top: 0.55em; }
/* Meme correction que .letterlab-mark-widened (kasra qui se superpose a
   la hamza en dessous du "إ"), mais sans teinte rouge : utilisee dans
   les mots complets des jeux, pas seulement les cartes du labo. */
.arabic-kasra-fix { transform: translateY(0.3em); }

@media (max-width: 680px) {
  .letterlab-body { flex-direction: column; padding: 0 12px 16px; }
  .letterlab-tabs { flex-direction: row; overflow-x: auto; padding-bottom: 2px; }
  .letterlab-tab { width: 44px; height: 44px; font-size: 1.25rem; }
  .letterlab-panel { padding: 16px; }
  .letterlab-name { font-size: 1.7rem; margin-bottom: 14px; }
  .letterlab-cell { min-width: 52px; padding: 10px 12px; font-size: 1.15rem; }
}

/* ---------- Formes des lettres selon leur position ---------- */
.formlab-panel {
  max-width: min(560px, 82vw);
  max-height: 100%;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 28px;
}
.formlab-current { text-align: center; margin-bottom: 22px; }
.formlab-letter {
  display: block;
  font-family: var(--font-arabic);
  font-size: 3.2rem;
  line-height: 1.3;
  color: var(--color-navy);
  direction: rtl;
}
.formlab-name {
  display: block;
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  color: var(--color-text-light);
  direction: rtl;
  margin-top: 8px;
}
.formlab-examples { display: flex; flex-direction: column; gap: 14px; }
.formlab-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 16px 18px;
  text-align: center;
}
.formlab-card-label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--color-teal-dark);
  margin: 0 0 8px;
}
.formlab-word {
  font-family: var(--font-arabic);
  direction: rtl;
  font-size: 2.1rem;
  line-height: 1.6;
  color: var(--color-navy);
  margin: 0;
  word-break: break-word;
}
.formlab-highlight { color: var(--color-harakat-red); }
.formlab-note {
  font-family: var(--font-heading);
  font-size: 0.76rem;
  color: var(--color-text-light);
  text-align: center;
  margin: -2px 0 0;
}
.formlab-sunmoon {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.82rem;
  margin-top: 4px;
}
.formlab-sunmoon-sun { color: var(--color-orange); }
.formlab-sunmoon-moon { color: var(--color-teal-dark); }

/* ---------- Lettres solaires et lunaires ---------- */
.sunmoon-table {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.sunmoon-table-col {
  flex: 1 1 220px;
  border-radius: 14px;
  padding: 16px 18px;
  text-align: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}
.sunmoon-table-sun { border-color: rgba(238,154,69,0.35); }
.sunmoon-table-moon { border-color: rgba(22,160,160,0.3); }
.sunmoon-table-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  margin: 0 0 10px;
}
.sunmoon-table-sun .sunmoon-table-title { color: var(--color-orange); }
.sunmoon-table-moon .sunmoon-table-title { color: var(--color-teal-dark); }
.sunmoon-table-letters {
  font-family: var(--font-arabic);
  direction: rtl;
  font-size: 1.7rem;
  line-height: 1.9;
  color: var(--color-navy);
  margin: 0;
  word-spacing: 4px;
}
.sunmoon-intro {
  color: var(--color-text-light);
  font-size: 0.92rem;
  text-align: center;
  margin: 0 0 22px;
}
.sunmoon-section-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 14px;
}
.sunmoon-section-title:not(:first-of-type) { margin-top: 28px; }
.sunmoon-section-sun { color: var(--color-orange); }
.sunmoon-section-moon { color: var(--color-teal-dark); }
.sunmoon-grid { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.sunmoon-grid .formlab-card { flex: 1 1 140px; max-width: 200px; }
.sunmoon-grid .formlab-word { font-size: 1.6rem; }
.sunmoon-word-card {
  cursor: pointer;
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s ease, transform .15s ease;
}
.sunmoon-word-card:hover, .sunmoon-word-card:focus-visible { border-color: var(--color-teal); transform: translateY(-2px); }
.sunmoon-word-play { display: block; font-size: 0.9rem; margin-top: 6px; opacity: 0.6; }

/* ---------- Jeux : cartes de la section JEUX ---------- */
.module-card-locked { opacity: .6; }
.module-badge-soon {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--color-text-light);
  background: var(--color-bg-alt);
  padding: 8px 14px;
  border-radius: 999px;
  width: 100%;
  box-sizing: border-box;
}

/* ---------- Jeux : modale "Quel son as-tu entendu ?" ---------- */
.game-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 0 20px 32px;
}
.game-body[hidden] { display: none; }
.game-panel { width: 100%; max-width: 620px; align-self: flex-start; background: #fff; border-radius: var(--radius-md); padding: 30px; text-align: center; }
.game-score {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--color-teal-dark);
  background: var(--color-teal-10);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.game-level-info { color: var(--color-orange); font-family: var(--font-heading); font-weight: 600; font-size: 0.8rem; margin: 0 0 6px; }
.game-back-btn {
  display: block;
  width: fit-content;
  margin: 0 0 16px;
  background: none;
  border: none;
  color: var(--color-teal-dark);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 0;
}
.game-back-btn:hover { text-decoration: underline; }
.game-end-back-btn {
  display: block;
  margin: 18px auto 0;
  background: none;
  border: none;
  color: rgba(255,255,255,0.75);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}
.game-end-back-btn:hover { color: #fff; text-decoration: underline; }
.game-instruction { color: var(--color-text-light); font-size: 0.95rem; margin: 0 0 22px; }
.game-play-btn { margin: 0 auto 26px; }

/* ---------- Menu des jeux (ecran intermediaire module -> jeu) ---------- */
.game-menu-screen {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 20px 20px 32px;
}
.game-menu-screen[hidden] { display: none; }
.game-menu-panel { width: 100%; max-width: 820px; align-self: flex-start; text-align: center; }
.game-menu-heading { color: #fff; font-family: var(--font-heading); font-weight: 700; font-size: 1.35rem; margin: 6px 0 6px; }
.game-menu-level-info { color: rgba(255,255,255,0.75); margin-bottom: 26px; }
.game-menu-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}
.game-menu-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 0 1 230px;
  min-height: 150px;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: 26px 16px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.game-menu-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.game-menu-icon { font-size: 2.8rem; line-height: 1; }
.game-menu-label { font-family: var(--font-heading); font-weight: 600; font-size: 0.95rem; color: var(--color-navy); }
.game-menu-card.is-disabled, .game-menu-card:disabled { opacity: 0.4; cursor: not-allowed; }
.game-menu-card.is-disabled:hover, .game-menu-card:disabled:hover { transform: none; box-shadow: var(--shadow-sm); }
.game-answers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.game-answers.game-answers-word { grid-template-columns: repeat(2, 1fr); }
.game-answer {
  min-width: 0;
  width: 100%;
  padding: 20px 8px;
  font-size: 1.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-answer-word { font-size: 1.4rem; padding: 18px 12px; }
.game-answer-script { font-size: 1.9rem; padding: 22px 14px; }
.game-answer.is-correct { background: var(--color-teal); border-color: var(--color-teal); color: #fff; }
.game-answer.is-correct .letterlab-mark { color: #fff; }
.game-answer.is-wrong { background: #E4534B; border-color: #E4534B; color: #fff; }
.game-answer.is-wrong .letterlab-mark { color: #fff; }
.game-answer:disabled { cursor: default; }
.game-answer:disabled:hover { transform: none; }
.game-feedback { font-family: var(--font-heading); font-weight: 600; font-size: 1rem; margin-bottom: 18px; min-height: 1.4em; }
#gameNextBtn[hidden] { display: none; }
#gamePlayBtn[hidden] { display: none; }
.game-feedback.is-correct { color: var(--color-teal-dark); }
.game-feedback.is-wrong { color: #C6362E; }
.game-read-panel { padding: 8px 0 4px; }
.game-read-hint { color: var(--color-text-light); font-size: 0.95rem; margin: 0 0 28px; }
.game-read-word {
  font-family: var(--font-arabic);
  direction: rtl;
  font-size: 3.4rem;
  line-height: 1.5;
  color: var(--color-navy);
  margin: 0 0 32px;
  word-break: break-word;
}

/* Dictee - Niveau 1 : toute la ligne (plusieurs mots) affichee d'un coup a
   la correction, contrairement a .game-read-word (un seul mot) - grille
   numerotee a 2 colonnes pour s'y retrouver quand il y a beaucoup d'items
   (jusqu'a 17 dans certaines entrees du niveau 3). Un seul item : colonne
   unique (voir .is-single) pour eviter une case vide a cote. */
.dictee1-words {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  direction: rtl;
  gap: 10px;
  margin: 0 0 32px;
}
.dictee1-words.is-single { grid-template-columns: 1fr; }
.dictee1-words[hidden] { display: none; }
.dictee1-word-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  direction: rtl;
  background: var(--color-bg-alt);
  border-radius: 10px;
  padding: 11px 12px;
}
.dictee1-word-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border-radius: 999px;
  background: var(--color-orange);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.dictee1-word {
  font-family: var(--font-arabic);
  font-size: 1.7rem;
  line-height: 2.1;
  color: var(--color-navy);
}
/* Ecran de choix de la lettre de Dictee - Niveau 1 (#gameMenuGrid) :
   reutilise .letterlab-cell (meme motif que le labo de lettres), en plus
   compact pour que les 28 lettres tiennent sur quelques lignes. */
.dictee1-letters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 22px;
}
.dictee1-letters .letterlab-cell {
  min-width: 40px;
  padding: 8px 10px;
  font-size: 1.38rem;
}
.game-read-panel .btn { margin: 6px 8px; }
#gameReadListenBtn { margin-bottom: 16px; }
#gameReadNextBtn[hidden] { display: none; }
#gameDicteeRevealBtn[hidden] { display: none; }
#gameDicteeNextBtn[hidden] { display: none; }
#gameDictee1RevealBtn[hidden] { display: none; }
#gameDictee1PrevBtn[hidden] { display: none; }
#gameDictee1NextBtn[hidden] { display: none; }
.game-end {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 20px 32px;
}
.game-end[hidden] { display: none; }
.game-end h3 { color: #fff; font-family: var(--font-heading); margin-bottom: 10px; }
.game-end p { color: rgba(255,255,255,0.85); margin-bottom: 24px; font-size: 1.3rem; }
.game-end-message {
  max-width: 420px;
  font-size: 1rem !important;
  line-height: 1.5;
  background: rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 14px 18px;
  margin: -8px 0 24px !important;
}
.game-end-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.game-end-actions[hidden] { display: none; }
#gameContinueBtn[hidden] { display: none; }

.game-harakat-panel { padding: 8px 0 4px; }
.game-harakat-panel[hidden] { display: none; }
.game-harakat-panel .btn { margin: 0 auto; }
#gameHarakatListenBtn { margin-bottom: 24px; }
.harakat-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  direction: rtl;
  margin-bottom: 24px;
}
.harakat-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font-family: var(--font-arabic);
}
/* line-height genereux : certaines lettres (ex. le point sous le baa)
   descendent sous la ligne de base et se faisaient rogner avec un
   line-height trop serre. */
.harakat-slot-base { font-size: 2.6rem; color: var(--color-navy); line-height: 1.6; }
.harakat-slot-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 2px dashed var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  color: var(--color-harakat-red);
  background: #fff;
}
.harakat-slot.is-armed .harakat-slot-placeholder { border-color: var(--color-orange); border-style: solid; }
.harakat-slot.is-correct .harakat-slot-placeholder { border-color: var(--color-teal); border-style: solid; background: var(--color-teal); color: #fff; }
.harakat-slot.is-wrong .harakat-slot-placeholder { border-color: #E4534B; border-style: solid; background: #E4534B; color: #fff; }
.harakat-picker { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 22px; }
.harakat-picker-btn {
  font-family: var(--font-arabic);
  font-size: 3.4rem;
  width: 90px;
  height: 90px;
  border-radius: 16px;
  border: 2px solid var(--color-border);
  background: #fff;
  color: var(--color-navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.harakat-picker-btn:hover { border-color: var(--color-teal); }
.harakat-picker-btn.is-armed { background: var(--color-orange); border-color: var(--color-orange); color: #fff; }
/* La kasra (marque sous la lettre) deborde sous le carre si on la centre
   comme fatha/damma (marques au-dessus) : on remonte son contenu pour
   qu'elle reste visible dans le cadre. */
.harakat-picker-btn-kasra, .harakat-picker-btn-shadda-kasra { padding-bottom: 36px; }
.harakat-slot-placeholder-kasra, .harakat-slot-placeholder-shadda-kasra { padding-bottom: 28px; }
@media (max-width: 480px) {
  .harakat-picker { gap: 10px; }
  .harakat-picker-btn { width: 72px; height: 72px; font-size: 2.7rem; }
  .harakat-picker-btn-kasra, .harakat-picker-btn-shadda-kasra { padding-bottom: 28px; }
  .harakat-slot-placeholder { width: 54px; height: 54px; font-size: 2.2rem; }
  .harakat-slot-placeholder-kasra, .harakat-slot-placeholder-shadda-kasra { padding-bottom: 22px; }
}
#gameHarakatCheckBtn[hidden] { display: none; }
#gameHarakatNextBtn[hidden] { display: none; }

/* "Solaire ou lunaire ?" : une lettre a classer, deux colonnes avec un
   logo au-dessus de chacune (soleil / lune). */
.game-sort-panel { padding: 8px 0 4px; text-align: center; }
.game-sort-letter {
  font-family: var(--font-arabic);
  font-size: 4rem;
  color: var(--color-navy);
  margin: 4px 0 26px;
}
.game-sort-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.game-sort-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 26px 12px;
  border-radius: 16px;
  border: 2px solid var(--color-border);
  background: #fff;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.game-sort-column:hover { transform: translateY(-2px); border-color: var(--color-teal); }
.game-sort-icon { font-size: 2.4rem; line-height: 1; }
.game-sort-label { font-family: var(--font-heading); font-weight: 600; color: var(--color-navy); }
.game-sort-column.is-correct { background: var(--color-teal); border-color: var(--color-teal); }
.game-sort-column.is-correct .game-sort-label { color: #fff; }
.game-sort-column.is-wrong { background: #E4534B; border-color: #E4534B; }
.game-sort-column.is-wrong .game-sort-label { color: #fff; }
.game-sort-column:disabled { cursor: default; }
.game-sort-column:disabled:hover { transform: none; border-color: var(--color-border); }
.game-sort-column.is-correct:disabled:hover, .game-sort-column.is-wrong:disabled:hover { border-color: inherit; }
#gameSortNextBtn[hidden] { display: none; }

/* "Trie toutes les lettres" : pool des 28 lettres + deux colonnes de
   depot (soleil / lune), remplies au fur et a mesure. */
.game-sortall-panel { text-align: center; padding: 8px 0 4px; }
.sortall-pool {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}
.sortall-letter.is-armed { background: var(--color-orange); border-color: var(--color-orange); color: #fff; }
.sortall-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 12px;
}
.sortall-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 120px;
  padding: 14px 10px;
  border-radius: 16px;
  border: 2px dashed var(--color-border);
  background: var(--color-bg);
  cursor: pointer;
  transition: border-color .15s ease;
}
.sortall-column:hover { border-color: var(--color-teal); }
.sortall-column-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-navy);
}
.sortall-icon { font-size: 1.4rem; line-height: 1; }
.sortall-column-body { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.sortall-tile {
  font-family: var(--font-arabic);
  font-size: 1.3rem;
  padding: 6px 10px;
  border-radius: 10px;
  background: #fff;
  border: 2px solid var(--color-border);
}
.sortall-tile.is-correct { background: var(--color-teal); border-color: var(--color-teal); color: #fff; }
.sortall-tile.is-wrong { background: #E4534B; border-color: #E4534B; color: #fff; }
.game-end-message-inline {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-teal-dark);
  font-size: 1.1rem;
  margin: 10px 0 18px;
}
#sortAllReplayBtn[hidden] { display: none; }

@media (max-width: 680px) {
  .game-sort-letter { font-size: 3rem; margin-bottom: 18px; }
  .game-sort-column { padding: 18px 8px; }
  .game-sort-icon { font-size: 1.9rem; }
  .sortall-tile { font-size: 1.1rem; padding: 5px 8px; }
  .sortall-column { min-height: 100px; }
  .game-answer { font-size: 1.5rem; padding: 16px 6px; }
  .game-answer-word { font-size: 1.1rem; padding: 14px 8px; }
  .game-answer-script { font-size: 1.5rem; padding: 18px 10px; }
  .game-panel { padding: 20px 16px; }
  .game-read-word { font-size: 2.4rem; margin-bottom: 24px; }
  .dictee1-word { font-size: 1.35rem; }
  .dictee1-words { grid-template-columns: 1fr; gap: 8px; margin-bottom: 24px; }
  .game-menu-grid { gap: 14px; }
  .game-menu-card { flex-basis: 150px; min-height: 130px; padding: 20px 10px; }
  .game-menu-icon { font-size: 2.3rem; }
  .game-menu-heading { font-size: 1.15rem; }
}

/* ---------- CTA ---------- */
.cta {
  background: linear-gradient(135deg, var(--color-navy), var(--color-teal-dark));
  padding: 90px 0;
  text-align: center;
  color: #fff;
}
.cta-inner { max-width: 680px; margin: 0 auto; }
.cta h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.1rem); }
.cta-text { color: rgba(255,255,255,0.82); font-size: 1.02rem; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 12px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-navy-dark); color: rgba(255,255,255,0.75); }
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  padding-top: 64px;
  padding-bottom: 44px;
}
.footer-logo {
  width: 64px;
  height: 64px;
  background: #fff;
  border-radius: 16px;
  padding: 6px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.footer-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.footer-arabic {
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  color: var(--color-teal);
  margin-bottom: 10px;
}
.footer-desc { font-size: 0.92rem; max-width: 320px; }
.footer-col h4 {
  color: #fff;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 18px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col a { font-size: 0.92rem; }
.footer-col a:hover { color: var(--color-teal); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 0;
  font-size: 0.82rem;
  text-align: center;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .program-grid { grid-template-columns: repeat(2, 1fr); }
  .module-grid { grid-template-columns: repeat(3, 1fr); }
  .audience-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .hero-inner {
    grid-template-columns: 1fr;
    grid-template-areas: "intro" "visual" "details";
  }
  .hero-visual { aspect-ratio: 4 / 5; width: 100%; max-width: 480px; margin: 12px auto 8px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 1000px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }

  .site-header.nav-open .main-nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    padding: 10px 24px 24px;
    max-height: calc(100vh - 100%);
    max-height: calc(100svh - 100%);
    max-height: calc(100dvh - 100%);
    overflow-y: auto;
  }
  .site-header.nav-open .main-nav ul { flex-direction: column; gap: 4px; }
  .site-header.nav-open .main-nav .nav-link { display: block; padding: 12px 4px; }
}

@media (max-width: 680px) {
  .section { padding: 68px 0; }
  .hero { padding: 52px 0 72px; }
  .feature-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .step:last-child { grid-column: 1 / -1; }
  .program-grid { grid-template-columns: 1fr; }
  .hub-grid { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .module-listen { font-size: 0.72rem; padding: 8px 10px; gap: 5px; }
  .module-formlab { font-size: 0.72rem; padding: 8px 10px; gap: 5px; }
  .module-shadda { font-size: 0.72rem; padding: 8px 10px; gap: 5px; }
  .module-sunmoon { font-size: 0.72rem; padding: 8px 10px; gap: 5px; }
  .audience-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .hero-stats { gap: 22px; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .header-inner { gap: 10px; }
  .brand { gap: 8px; }
  .brand-logo { width: 38px; height: 38px; border-radius: 10px; }
  .brand-name { font-size: 0.82rem; white-space: normal; line-height: 1.1; }
  .brand-tagline { display: none; }
  .header-actions { gap: 8px; }
  .header-actions .btn-primary { padding: 9px 14px; font-size: 0.78rem; }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .brand-text { display: none; }
  .header-actions { gap: 6px; }
  .header-actions .btn-primary { padding: 8px 12px; font-size: 0.72rem; }
  .lang-switch { padding: 7px 10px; font-size: 0.72rem; }
}

/* ---------- Arabe : mise en page de droite a gauche (html[dir="rtl"]) ---------- */
/* L'espacement entre lettres coupe la liaison arabe : interdit sur tout le
   texte d'interface en arabe. */
html[lang="ar"] * { letter-spacing: 0 !important; text-transform: none !important; }
html[dir="rtl"] .nav-link::after { left: auto; right: 0; }
html[dir="rtl"] .hero-card-back { right: auto; left: 0; transform: rotate(-6deg); }
html[dir="rtl"] .hero-card-front { left: auto; right: 0; transform: rotate(4deg); }
html[dir="rtl"] .badge-top { left: auto; right: 6%; }
html[dir="rtl"] .badge-bottom { right: auto; left: 2%; }
html[dir="rtl"] .program-badge { left: auto; right: 12px; }
html[dir="rtl"] .gallery-caption,
html[dir="rtl"] .letterlab-pronunciation,
html[dir="rtl"] .program-range { text-align: right; }
html[dir="rtl"] .lightbox-close { right: auto; left: max(28px, env(safe-area-inset-left)); }
/* skip-link : en RTL un decalage negatif a gauche agrandit la zone de defilement. */
html[dir="rtl"] .skip-link { left: auto; right: -999px; border-radius: 0 0 0 8px; }
html[dir="rtl"] .skip-link:focus { left: auto; right: 0; }

/* ---------- A propos ---------- */
.about-body { max-width: 760px; margin: 0 auto; }
.about-body p { color: var(--color-text-light); font-size: 1.02rem; line-height: 1.75; margin: 0 0 16px; }
.about-body .about-goal {
  color: var(--color-navy);
  font-weight: 600;
  border-inline-start: 4px solid var(--color-teal);
  padding-inline-start: 18px;
  margin-top: 26px;
}

/* ---------- Jeu : l'alphabet dans l'ordre ---------- */
.game-back-btn[hidden] { display: none; }
.game-order-panel { text-align: center; padding: 8px 0 4px; }
.order-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  direction: rtl;
  margin: 14px 0 18px;
}
.order-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  border: 2px dashed var(--color-border);
  border-radius: 10px;
  background: var(--color-bg);
  font-family: var(--font-arabic);
  font-size: 1.5rem;
  line-height: 1.5;
  color: var(--color-navy);
  cursor: pointer;
  min-height: 62px;
  transition: border-color .15s ease, background .15s ease;
}
.order-slot:hover { border-color: var(--color-teal); }
.order-slot.is-filled { border-style: solid; background: #fff; }
.order-slot.is-correct { background: var(--color-teal); border-color: var(--color-teal); color: #fff; }
.order-slot.is-wrong { background: #E4534B; border-color: #E4534B; color: #fff; }
.order-num {
  position: absolute;
  top: 2px; left: 0; right: 0;
  direction: ltr;
  font-family: var(--font-heading);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--color-text-light);
}
.order-slot.is-correct .order-num, .order-slot.is-wrong .order-num { color: rgba(255,255,255,0.85); }
.game-order-panel .btn { margin: 6px 8px; }
@media (max-width: 480px) {
  .order-grid { gap: 4px; }
  .order-slot { font-size: 1.2rem; min-height: 54px; }
}
#orderCheckBtn[hidden] { display: none; }
.game-score:empty { display: none; }
.order-pool {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  direction: rtl;
  margin-bottom: 14px;
}
.order-pool .sortall-letter { min-width: 0; padding: 9px 0; font-size: 1.4rem; line-height: 1.4; }
@media (max-width: 480px) {
  .order-pool { gap: 4px; }
  .order-pool .sortall-letter { padding: 6px 0; font-size: 1.2rem; }
}
.game-order-panel .btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.order-letter { display: block; position: relative; line-height: 1.5; }
.order-pool .sortall-letter { display: flex; align-items: center; justify-content: center; }
.order-baseline { display: inline-block; width: 0; height: 0; }

/* ---------- Nos formules ---------- */
.pricing-intro { padding-bottom: 8px; }
.pricing-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 24px; align-items: stretch; }
.pricing-grid .price-card { grid-column: span 2; }
.pricing-grid .price-card-wide { grid-column: span 3; }
.price-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 30px 26px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.price-card { position: relative; }
.price-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.price-card h3 { font-size: 1.2rem; margin-bottom: 6px; }
.price-lead { color: var(--color-text-light); font-size: 0.94rem; margin: 0 0 18px; }
.price-tag {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: .03em;
  color: var(--color-navy);
  background: var(--color-orange-10);
  border: 1px solid rgba(238, 154, 69, 0.45);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.price-rows { list-style: none; margin: 0; padding: 0; }
.price-rows li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--color-border);
}
.price-label { color: var(--color-text-light); font-size: 0.95rem; }
.price-amount {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-navy);
  white-space: nowrap;
}
.price-amount small { font-family: var(--font-body); font-weight: 500; font-size: 0.8rem; color: var(--color-text-light); }
.price-addon {
  margin-top: 22px;
  padding: 16px 16px 4px;
  background: var(--color-teal-10);
  border-radius: var(--radius-sm);
}
.price-addon-title { font-family: var(--font-heading); font-weight: 600; font-size: 0.9rem; color: var(--color-teal-dark); margin: 0 0 4px; }
.price-addon .price-rows li { border-top-color: rgba(16, 60, 70, 0.10); }

.level-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.level-card {
  text-align: center;
  padding: 22px 12px;
  background: linear-gradient(180deg, rgba(238,154,69,0.06), #fff 60%);
  border: 1px solid rgba(238, 154, 69, 0.4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.level-name { font-family: var(--font-heading); font-weight: 600; font-size: 0.85rem; color: var(--color-teal-dark); margin: 0 0 8px; }
.level-card .price-amount { font-size: 1.5rem; }
.pricing-note { text-align: center; color: var(--color-text-light); margin: 22px 0; }
.pack-was { color: var(--color-text-light); margin: 0; }
.pack-was s { text-decoration-thickness: 2px; }
.pack-price { font-family: var(--font-heading); font-weight: 800; font-size: 2.4rem; color: var(--color-navy); margin: 0; line-height: 1; }

.lifetime-price {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  line-height: 1;
  color: #fff;
  margin: 18px 0 14px;
}
.lifetime-note { color: rgba(255,255,255,0.7); font-size: 0.9rem; margin: 6px 0 0; }
.pricing-contact { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 22px; }

@media (min-width: 1001px) and (max-width: 1100px) {
  .main-nav ul { gap: 18px; }
  .nav-link { font-size: 0.9rem; }
}
.nav-link { white-space: nowrap; }
@media (max-width: 1024px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 24px; }
  .pricing-grid .price-card, .pricing-grid .price-card-wide { grid-column: span 1; }
  .pricing-grid .price-card:nth-child(3) { grid-column: 1 / -1; }
  .level-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .pricing-grid { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; gap: 28px; }
  .pricing-grid .price-card, .pricing-grid .price-card-wide, .pricing-grid .price-card:nth-child(3) { grid-column: 1 / -1; }
  .price-card { padding: 26px 20px; }
  .price-pack { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .level-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .level-card:last-child { grid-column: 1 / -1; }
}
.price-tag-top { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); margin: 0; background: #fff; white-space: nowrap; }

/* En-tete compact sur petits telephones : le menu deroulant des langues
   est plus large que l'ancienne pastille, on resserre pour eviter que le
   nom du site ne chevauche le selecteur. */
@media (max-width: 420px) {
  .header-inner { gap: 6px; }
  .brand { gap: 6px; }
  .header-actions { gap: 4px; }
  .header-actions .btn-primary { padding: 8px 10px; font-size: 0.72rem; }
  .lang-menu summary.lang-switch { padding: 7px 8px; gap: 4px; }
  .brand-name { font-size: 0.78rem; }
}
@media (max-width: 380px) {
  .brand-text { display: none; }
}
.pricing-intro + .section { padding-top: 40px; }
.level-card .price-amount { margin: 0; }
@media (max-width: 1024px) {
  .level-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
  .level-card { flex: 0 0 calc((100% - 32px) / 3); }
}
@media (max-width: 480px) {
  .level-grid { gap: 12px; }
  .level-card { flex: 0 0 calc((100% - 12px) / 2); }
}

/* Nos formules : cartes cote a cote (3 + 2), prix mis en avant */
.price-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.price-block { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 14px 12px; text-align: center; }
.price-block .price-label { margin: 0 0 6px; font-size: 0.82rem; font-weight: 600; font-family: var(--font-heading); }
.price-big { font-family: var(--font-heading); font-weight: 700; font-size: 1.45rem; line-height: 1.1; color: var(--color-navy); margin: 0; white-space: nowrap; }
.price-big small { display: block; margin-top: 4px; font-family: var(--font-body); font-weight: 500; font-size: 0.8rem; color: var(--color-text-light); }
.price-card > .eyebrow { align-self: flex-start; }
.price-card .level-grid { gap: 10px; }
.price-card .level-card { padding: 16px 6px; }
.price-card .level-card .price-amount { font-size: 1.2rem; }
.price-card .pricing-note { margin: 16px 0 22px; }
.price-pack {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: auto;
  background: #fff;
  border: 2px solid var(--color-orange);
  border-radius: var(--radius-sm);
  padding: 26px 22px 18px;
}
.price-pack h4 { font-size: 1.15rem; margin: 0 0 2px; }
.price-pack .pack-was { margin: 0; }
.price-pack .pack-price { font-size: 2rem; }
.price-card-dark {
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--color-navy), var(--color-teal-dark));
  border-color: transparent;
  color: #fff;
}
.price-card-dark h3 { color: #fff; font-size: clamp(1.4rem, 2.6vw, 1.8rem); }
.price-card-dark .price-lead { color: rgba(255,255,255,0.85); margin-bottom: 6px; font-size: 1.02rem; }
.price-card-dark .eyebrow { align-self: center; }

/* Nos formules : chaque prix est un bouton cliquable (lien de paiement) */
.price-buy { color: inherit; text-decoration: none; cursor: pointer; }
.price-buy:focus-visible { outline: 3px solid var(--color-teal); outline-offset: 2px; }
.price-rows li { display: block; padding: 0; }
.price-rows li > .price-buy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px;
  margin: 0 -10px;
  border-radius: 12px;
  transition: background .15s ease;
}
.price-rows li > .price-buy:hover { background: var(--color-teal-10); }
.price-rows .price-buy .price-amount {
  padding: 5px 14px;
  border: 1.5px solid rgba(22, 160, 160, 0.35);
  border-radius: 999px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.price-rows .price-buy:hover .price-amount {
  color: #fff;
  background: linear-gradient(135deg, var(--color-teal), var(--color-teal-dark));
  border-color: transparent;
}
.price-rows .price-buy:hover .price-amount small { color: rgba(255,255,255,0.85); }
a.price-block { display: block; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease; }
a.price-block:hover {
  transform: translateY(-3px);
  border-color: transparent;
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--color-teal), var(--color-teal-dark));
}
a.price-block:hover .price-label, a.price-block:hover .price-big, a.price-block:hover .price-big small { color: #fff; }
a.level-card { display: block; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
a.level-card:hover { transform: translateY(-3px); border-color: var(--color-orange); box-shadow: var(--shadow-md); }
a.price-pack { transition: background .15s ease, box-shadow .15s ease; }
a.price-pack:hover { background: var(--color-orange-10); box-shadow: var(--shadow-md); }
.lifetime-wrap { margin: 18px 0 14px; line-height: 1; }
.lifetime-buy {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3rem);
  line-height: 1;
  color: var(--color-teal-dark);
  background: #fff;
  padding: 14px 36px;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  transition: transform .15s ease, box-shadow .15s ease;
}
.lifetime-buy:hover { transform: scale(1.04); box-shadow: var(--shadow-lg); }
.price-card-dark .price-buy:focus-visible { outline-color: #fff; }
.level-grid > * { min-width: 0; }
.price-perk {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: var(--color-teal-10);
  border-radius: var(--radius-sm);
  color: var(--color-teal-dark);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}
.price-perk::before { content: "\2713"; font-weight: 800; flex: none; }

/* ---------- Jeu : retrouve le son dans le tableau (Module 15) ---------- */
.game-sound-panel { text-align: center; padding: 4px 0; }
.sound-setup-group { margin: 16px 0 6px; }
.sound-setup-label { font-family: var(--font-heading); font-weight: 600; font-size: 0.9rem; color: var(--color-text-light); margin-bottom: 8px; }
.sound-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sound-choice {
  padding: 10px 16px;
  border: 2px solid var(--color-border);
  border-radius: 999px;
  background: #fff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-navy);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.sound-choice:hover { border-color: var(--color-teal); }
.sound-choice.is-selected { background: var(--color-navy); border-color: var(--color-navy); color: #fff; }
.game-sound-panel .btn { margin: 6px 6px; }
#soundStartBtn { margin-top: 22px; }

.sound-hud {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
  padding: 6px 0 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}
.sound-hud-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--font-heading); font-weight: 600; font-size: 0.85rem; color: var(--color-text-light); }
.sound-timer { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 4px 0; }
.sound-timer-num { min-width: 2ch; font-family: var(--font-heading); font-weight: 700; font-size: 2.1rem; line-height: 1; color: var(--color-navy); font-variant-numeric: tabular-nums; }
.sound-timer-track { flex: 1; max-width: 360px; height: 12px; border-radius: 999px; background: var(--color-border); overflow: hidden; }
.sound-timer-track span { display: block; height: 100%; width: 100%; background: var(--color-teal); border-radius: 999px; transition: width .1s linear, background .2s ease; }
.sound-timer-track.is-low span { background: #E8A33D; }
.sound-timer-track.is-critical span { background: #E4534B; }
.sound-timer-track.is-critical + .sound-timer-num, .sound-timer.is-critical .sound-timer-num { color: #C6362E; }
.sound-hud-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; min-height: 40px; }
.sound-hud-actions .btn { margin: 0; }
.sound-feedback { margin: 0; min-height: 0; }
.sound-feedback:empty { display: none; }
.sound-quit { background: none; border: 0; padding: 2px 4px; font: inherit; color: var(--color-teal-dark); text-decoration: underline; cursor: pointer; }

.sound-table {
  display: grid;
  grid-template-columns: 1.15fr repeat(9, 1fr);
  direction: rtl;
  gap: 1px;
  background: var(--color-navy);
  border: 2px solid var(--color-navy);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 6px;
}
.sound-th {
  display: flex; align-items: center; justify-content: center;
  padding: 6px 2px;
  background: #fff;
  font-family: var(--font-arabic);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--color-navy);
}
.sound-th-letter { font-size: 0.7rem; }
.sound-th-group { font-size: 0.95rem; font-weight: 700; }
.sound-kind-harakat.sound-th, .sound-kind-harakat.sound-cell { background: #E4FBF2; }
.sound-kind-moudoud.sound-th, .sound-kind-moudoud.sound-cell { background: #F0F0F0; }
.sound-kind-tanwin.sound-th, .sound-kind-tanwin.sound-cell { background: #FFE6E6; }
.sound-letter {
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  font-family: var(--font-arabic);
  font-size: 1.6rem;
  line-height: 1.6;
  color: var(--color-navy);
}
.sound-cell {
  display: flex; align-items: center; justify-content: center;
  min-width: 0;
  padding: 0;
  min-height: 80px;
  border: 0;
  font-family: var(--font-arabic);
  font-size: 1.5rem;
  line-height: 1.6;
  color: var(--color-navy);
  cursor: pointer;
  box-shadow: inset 0 0 0 3px transparent;
  transition: box-shadow .15s ease, background .15s ease;
}
.sound-cell:hover { box-shadow: inset 0 0 0 3px var(--color-teal); }
.sound-cell.is-correct { background: #B8EBD4; box-shadow: inset 0 0 0 4px var(--color-teal); }
.sound-cell.is-wrong { background: #F8C9C5; box-shadow: inset 0 0 0 4px #E4534B; }
@media (max-width: 480px) {
  .sound-letter { font-size: 1.3rem; }
  .sound-cell { font-size: 1.2rem; min-height: 68px; }
  .sound-th-form { font-size: 0.62rem; }
  .sound-th-group { font-size: 0.8rem; }
  .sound-th-letter { font-size: 0.58rem; }
  .sound-timer-num { font-size: 1.8rem; }
}
.sound-hud-actions .btn[hidden], .game-sound-panel [hidden] { display: none; }
/* ج ح خ : l'encre descend sous la ligne de base, on remonte la lettre pour la centrer dans sa case */
.sound-letter.sound-tailed .sound-letter-ink { position: relative; top: -0.3em; }
.sound-cell.sound-tailed .letterlab-form { position: relative; top: -0.14em; }
/* Le degrade "background-clip:text" (voyelle + prolongation en rouge) ne peint que
   dans la boite de l'element : les deux points de ي et la kasra, sous la ligne,
   en sortaient et disparaissaient. Marge verticale = zone de peinture elargie. */
.sound-cell .letterlab-form { padding: 0.5em 0; }

/* Ecran final du jeu "Retrouve le son" : score colore selon le pourcentage */
#soundEnd { text-align: center; padding: 8px 0; }
#soundEnd .game-end-score { font-family: var(--font-heading); font-weight: 700; font-size: 1.5rem; margin: 10px 0 6px; }
#soundEnd .sound-end-message { font-weight: 600; font-size: 1rem; line-height: 1.5; margin: 0 auto 20px; text-align: center; max-width: 420px; }
.sound-score-high { color: #1F8A4C; }
.sound-score-mid { color: #D9730D; }
.sound-score-low { color: #C6362E; }

/* Pastille "exercice d'ecoute" sur la carte du jeu Module 15 */
.module-audio-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px auto 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(22,160,160,0.12);
  color: var(--color-teal-dark);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.78rem;
}

/* Jeu "Reconnaitre le mot" : message avant l'apparition des propositions */
.game-answers-hint {
  grid-column: 1 / -1;
  margin: 18px 0;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-light);
  text-align: center;
}

/* Propositions du jeu "Reconnaitre le mot" : fondu progressif, une par une.
   Invisibles (et non cliquables) tant que leur tour n'est pas venu. */
.game-answer-fadein {
  animation: gameAnswerFadeIn 0.8s ease both;
}
@keyframes gameAnswerFadeIn {
  from { opacity: 0; pointer-events: none; }
  to { opacity: 1; pointer-events: auto; }
}

/* ---------- Ecran de fin des jeux : version joyeuse, coloree selon le score ---------- */
.game-end { position: relative; overflow: hidden; }
.game-end-badge {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 6px;
  animation: endBadgePop 0.7s cubic-bezier(.2, 1.6, .4, 1) both, endBadgeBob 2.4s ease-in-out 0.8s infinite;
}
.game-end-badge[hidden] { display: none; }
.game-end.is-win #gameEndScore, .game-end.is-mid #gameEndScore, .game-end.is-lose #gameEndScore {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 3.2rem;
  line-height: 1.1;
  margin-bottom: 20px;
  animation: endScorePop 0.6s 0.15s cubic-bezier(.2, 1.5, .4, 1) both;
}
.game-end.is-win #gameEndScore { color: #4ADE80; text-shadow: 0 0 28px rgba(74, 222, 128, 0.55); }
.game-end.is-mid #gameEndScore { color: #FBBF24; text-shadow: 0 0 28px rgba(251, 191, 36, 0.5); }
.game-end.is-lose #gameEndScore { color: #FB7185; text-shadow: 0 0 28px rgba(251, 113, 133, 0.5); }
.game-end.is-win .game-end-message { background: rgba(74, 222, 128, 0.16); border: 1px solid rgba(74, 222, 128, 0.5); }
.game-end.is-mid .game-end-message { background: rgba(251, 191, 36, 0.14); border: 1px solid rgba(251, 191, 36, 0.5); }
.game-end.is-lose .game-end-message { background: rgba(251, 113, 133, 0.14); border: 1px solid rgba(251, 113, 133, 0.5); }
.game-end.is-win { background: radial-gradient(ellipse at 50% 28%, rgba(74, 222, 128, 0.22), transparent 62%); }
.game-end.is-mid { background: radial-gradient(ellipse at 50% 28%, rgba(251, 191, 36, 0.18), transparent 62%); }
.game-end.is-lose { background: radial-gradient(ellipse at 50% 28%, rgba(251, 113, 133, 0.2), transparent 62%); }
@keyframes endBadgePop { from { transform: scale(0) rotate(-25deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes endBadgeBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes endScorePop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.game-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.game-confetti span {
  position: absolute;
  top: -24px;
  border-radius: 2px;
  opacity: 0;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0.9; }
}
@media (prefers-reduced-motion: reduce) {
  .game-end-badge, .game-end.is-win #gameEndScore, .game-end.is-mid #gameEndScore, .game-end.is-lose #gameEndScore { animation: none; }
}

/* ---------- Score parfait (10/10) : trophee, rayons dores, score dore scintillant ---------- */
.game-end.is-perfect > *:not(.game-confetti) { position: relative; z-index: 1; }
.game-end.is-perfect::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 36%;
  width: 780px;
  height: 780px;
  margin: -390px 0 0 -390px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(251, 191, 36, 0.24) 0 8deg, transparent 8deg 20deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, transparent 66%);
  mask-image: radial-gradient(circle, #000 0, transparent 66%);
  animation: perfectRays 16s linear infinite;
  pointer-events: none;
}
.game-end.is-perfect { background: radial-gradient(ellipse at 50% 30%, rgba(251, 191, 36, 0.3), transparent 64%); }
.game-end.is-perfect .game-end-badge {
  font-size: 5.2rem;
  filter: drop-shadow(0 0 22px rgba(251, 191, 36, 0.85));
  animation: perfectBadgeIn 0.9s cubic-bezier(.2, 1.6, .4, 1) both, perfectBadgeWiggle 2.6s ease-in-out 1s infinite;
}
.game-end-perfect-label {
  display: inline-block;
  margin: 0 0 10px !important;
  padding: 5px 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, #F59E0B, #FDE68A, #F59E0B);
  color: #5B3A00 !important;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.6);
  animation: perfectLabelIn 0.6s 0.2s cubic-bezier(.2, 1.5, .4, 1) both;
}
.game-end.is-perfect #gameEndScore {
  font-size: 4rem;
  background: linear-gradient(100deg, #FDE68A 0%, #F59E0B 30%, #FFF7CC 50%, #F59E0B 70%, #FDE68A 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 18px rgba(251, 191, 36, 0.7));
  animation: endScorePop 0.6s 0.15s cubic-bezier(.2, 1.5, .4, 1) both, perfectShimmer 2.4s linear infinite;
}
.game-end.is-perfect .game-end-message { background: rgba(251, 191, 36, 0.16); border: 1px solid rgba(251, 191, 36, 0.6); }
.game-confetti-star { background: none !important; width: auto !important; height: auto !important; line-height: 1; }
@keyframes perfectRays { to { transform: rotate(360deg); } }
@keyframes perfectShimmer { from { background-position: 0% 0; } to { background-position: -250% 0; } }
@keyframes perfectBadgeIn { from { transform: scale(0) rotate(-200deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes perfectBadgeWiggle { 0%, 100% { transform: rotate(0) scale(1); } 25% { transform: rotate(-8deg) scale(1.06); } 75% { transform: rotate(8deg) scale(1.06); } }
@keyframes perfectLabelIn { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .game-end.is-perfect::before, .game-end.is-perfect .game-end-badge, .game-end-perfect-label, .game-end.is-perfect #gameEndScore { animation: none; }
}
.game-end-back-btn[hidden] { display: none; }

/* Choix des lettres du jeu "Retrouve le son" : pastilles arabes (5 lettres au plus) */
.sound-choice-letters { font-family: var(--font-arabic); font-size: 1.15rem; font-weight: 400; direction: rtl; letter-spacing: 0.08em; padding: 8px 16px; }
.sound-choice-letters { flex: 0 0 calc(33.333% - 8px); min-width: 0; padding-left: 6px; padding-right: 6px; }
@media (max-width: 420px) { .sound-choice-letters { flex-basis: calc(50% - 8px); } }

/* ---------- "Retrouve le son" : grosses lettres, tableau entierement visible sans defilement ---------- */
/* Hauteur d'une ligne = (hauteur de l'ecran - bandeau, en-tetes et marges) / 5 lignes. */
.game-body.is-sound-play {
  --sound-row: clamp(56px, min(calc((100vh - 345px) / 4), 20vw), 108px);
  padding: 0 12px 10px;
}
@supports (height: 100dvh) {
  .game-body.is-sound-play { --sound-row: clamp(56px, min(calc((100dvh - 345px) / 4), 20vw), 108px); }
}
.game-body.is-sound-play .game-panel { max-width: 800px; padding: 10px 16px 12px; }
.game-body.is-sound-play .sound-hud { padding-top: 0; margin-bottom: 6px; }
.game-body.is-sound-play .sound-timer { margin: 2px 0; }
.game-body.is-sound-play .sound-timer .btn { flex: 0 0 auto; white-space: nowrap; }
.game-body.is-sound-play .sound-hud-actions { min-height: 38px; }
.game-body.is-sound-play .sound-cell {
  min-height: var(--sound-row);
  font-size: clamp(1.2rem, min(calc(var(--sound-row) * 0.4), 5.2vw), 2.7rem);
}
.game-body.is-sound-play .sound-letter {
  font-size: clamp(1.4rem, min(calc(var(--sound-row) * 0.5), 6.6vw), 3.3rem);
}
.game-body.is-sound-play .sound-th-letter { font-size: clamp(0.58rem, 1.6vw, 0.8rem); }
.game-body.is-sound-play .sound-th-form { font-size: clamp(0.62rem, 1.7vw, 0.85rem); }
.game-body.is-sound-play .sound-th-group { font-size: clamp(0.8rem, 2.2vw, 1.05rem); }
.game-body.is-sound-play .sound-cell { line-height: 1.1; }
.game-body.is-sound-play .sound-cell .letterlab-form { padding: 0.35em 0; }
.game-body.is-sound-play .sound-letter { line-height: 1.1; }
.game-body.is-sound-play .sound-hud-actions { display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; gap: 8px; min-height: 46px; }
.game-body.is-sound-play .sound-feedback { flex: 1 1 auto; margin: 0; font-size: 0.85rem; line-height: 1.25; text-align: center; }
.game-body.is-sound-play .sound-feedback:empty { display: block; }
.game-body.is-sound-play .sound-hud-actions .btn { flex: 0 0 auto; }

/* Tableau "Retrouve le son" : la kasra / kasratan (sous la lettre) restent dans leur propre case.
   - le decalage vers le bas prevu pour les cartes du labo est supprime ici ;
   - la zone de peinture du degrade est agrandie (marge compensee) pour ne couper ni la kasra
     ni les deux points du ya. */
.sound-cell .letterlab-mark-widened { top: -0.16em; }
.sound-cell .letterlab-mark-widened-tailed { top: -0.1em; }
.game-body.is-sound-play .sound-cell .letterlab-form { padding: 0.7em 0; margin: -0.7em 0; }

/* Tableau "Retrouve le son" : police Amiri (marques bien placees), marque en rouge via ::highlight,
   plus aucun decalage manuel (position:relative) qui pouvait faire chevaucher lettres et marques. */
.sound-table { font-family: 'Scheherazade New', 'Amiri', serif; }
.sound-cell, .sound-letter { font-family: 'Scheherazade New', 'Amiri', serif; }
.sound-form { display: inline-block; line-height: 1.7; }
.sound-cell.sound-tailed .sound-form { position: relative; top: -0.14em; }

/* Voyelle rouge a sa place naturelle : copie rouge (lettre + marque) sous une copie bleue (lettre seule). */
.sound-form { position: relative; display: inline-block; }
.sound-form-full { color: var(--color-harakat-red); }
.sound-form-base {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  color: var(--color-navy);
  pointer-events: none;
}

/* Alif : glyphe haut (tout au-dessus de la ligne) -> on le descend pour le centrer dans la case */
.sound-cell.sound-alif .sound-form, .sound-cell.sound-alif .letterlab-form { position: relative; top: 0.16em; }
.sound-letter.sound-alif .sound-letter-ink { position: relative; top: 0.16em; }

/* Lettres du tableau "Retrouve le son" : graisse normale partout (pas de gras). */
.sound-table, .sound-table * { font-weight: 400; }

/* Centrage vertical lettre + marque : decalages cumules par variables (marque, lettre a queue, alif). */
.sound-form { top: calc(var(--m, 0em) + var(--t, 0em) + var(--a, 0em)); }
.sound-form-above { --m: 0.12em; }
.sound-form-above-tall { --m: 0.22em; }
.sound-form-below { --m: -0.07em; }
.sound-cell.sound-tailed .sound-form { --t: -0.14em; top: calc(var(--m, 0em) + var(--t, 0em) + var(--a, 0em)); }
.sound-cell.sound-alif .sound-form { --a: 0.16em; top: calc(var(--m, 0em) + var(--t, 0em) + var(--a, 0em)); }
/* Alif + hamza + marque : forme tres haute, legerement reduite pour rester dans la case */
.sound-cell.sound-alif .sound-form { font-size: 0.86em; --a: 0.14em; }
/* Formes a prolongation (degrade) des lettres a queue : pas de remontee, la marque du dessus restait collee au bord haut */
.sound-cell.sound-tailed .letterlab-form { top: 0; }

/* Texte d'objectif sous l'ecran de reglages du jeu "Retrouve le son" */
.sound-goal {
  margin: 22px auto 0;
  max-width: 460px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(22, 160, 160, 0.08);
  border: 1px solid rgba(22, 160, 160, 0.22);
  color: var(--color-text-light);
  font-size: 0.88rem;
  line-height: 1.55;
  text-align: center;
}

/* Fascicule complet / toutes les lettres : plus de 5 lignes, hauteur fixe, on fait defiler le tableau */
.game-body.is-sound-play.is-sound-long { --sound-row: clamp(56px, 18vw, 70px); }

/* 7 groupes de 4 lettres : 4 pastilles par ligne (3 sur petit telephone) */
.sound-choice-letters { flex-basis: calc(25% - 9px); }
@media (max-width: 420px) { .sound-choice-letters { flex-basis: calc(33.333% - 8px); } }

/* ---------- Nos formules : choix de la formule puis des modules ---------- */
.module-picker { margin-top: 6px; }
.picker-step { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; font-family: var(--font-heading); font-weight: 600; font-size: 0.92rem; color: var(--color-navy); }
.picker-step-num { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--color-teal); color: #fff; font-size: 0.78rem; font-weight: 700; }
.picker-counter { font-weight: 500; color: var(--color-text-light); }
.module-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.module-plan {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 12px; text-align: left;
  border: 2px solid var(--color-border); border-radius: 12px; background: #fff;
  font: inherit; color: var(--color-navy); cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.module-plan .price-label { font-size: 0.82rem; color: var(--color-text-light); }
.module-plan .price-amount { font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; }
.module-plan:hover { border-color: var(--color-teal); }
.module-plan.is-selected { background: var(--color-navy); border-color: var(--color-navy); color: #fff; }
.module-plan.is-selected .price-label { color: rgba(255,255,255,0.8); }
.module-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.module-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 0; padding: 8px 4px;
  border: 2px solid var(--color-border); border-radius: 12px; background: #fff;
  font: inherit; color: var(--color-navy); cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, opacity .15s ease;
}
.module-chip:disabled { cursor: default; opacity: 0.55; }
.module-chip:not(:disabled):hover { border-color: var(--color-teal); }
.module-chip.is-selected { background: var(--color-teal); border-color: var(--color-teal); color: #fff; opacity: 1; }
.module-chip:disabled.is-selected { opacity: 0.85; }
.module-chip-num { font-family: var(--font-heading); font-weight: 600; font-size: 0.74rem; letter-spacing: 0.02em; }
.module-chip-letters { font-family: var(--font-arabic); font-size: 1.15rem; line-height: 1.5; white-space: nowrap; }
.picker-free { margin: 10px 0 0; font-size: 0.84rem; color: var(--color-text-light); }
.picker-hint { min-height: 1.3em; margin: 6px 0 0; font-size: 0.84rem; font-weight: 600; color: #C6362E; }
.picker-pay {
  display: block; margin-top: 8px; padding: 14px 16px; border-radius: 999px; text-align: center;
  background: var(--color-border); color: var(--color-text-light);
  font-family: var(--font-heading); font-weight: 700; font-size: 0.95rem; text-decoration: none;
  cursor: not-allowed; transition: background .15s ease, color .15s ease, transform .15s ease;
}
.picker-pay.is-ready { background: linear-gradient(135deg, var(--color-teal), var(--color-teal-dark)); color: #fff; cursor: pointer; box-shadow: 0 8px 20px rgba(22,160,160,0.25); }
.picker-pay.is-ready:hover { transform: translateY(-1px); }
.picker-pay:focus-visible { outline: 3px solid var(--color-teal); outline-offset: 2px; }
.module-plan.is-selected .price-amount { color: #fff; }
.picker-free [lang="ar"] { font-family: var(--font-arabic); font-size: 1.15rem; }

/* "Place les harakat" : voyelles en rouge (tatwil bleu fonce dessous/dessus) */
.harakat-form { position: relative; display: inline-block; }
.harakat-form-full { color: var(--color-harakat-red); }
.harakat-form-base { position: absolute; top: 0; left: 0; right: 0; color: var(--color-navy); }
.harakat-picker-btn.is-armed .harakat-form-full, .harakat-picker-btn.is-armed .harakat-form-base { color: #fff; }

/* ---------- "5 lettres dans l'ordre" (Module 14) ---------- */
.order5-round { margin: 4px 0 0; font-family: var(--font-heading); font-weight: 600; font-size: 0.9rem; color: var(--color-text-light); }
.order5-grid { grid-template-columns: repeat(5, 1fr); max-width: 460px; margin-left: auto; margin-right: auto; gap: 10px; }
.order5-grid .order-slot { min-height: 92px; font-size: 2.2rem; }
.order5-pool { grid-template-columns: repeat(5, 1fr); max-width: 460px; margin-left: auto; margin-right: auto; gap: 10px; min-height: 64px; }
.order5-pool .sortall-letter { padding: 14px 0; font-size: 2.1rem; }
.order5-grid, .order5-pool { direction: rtl; }
#order5CheckBtn[hidden], #order5NextBtn[hidden], #order5RevealBtn[hidden] { display: none; }
@media (max-width: 480px) {
  .order5-grid, .order5-pool { gap: 6px; }
  .order5-grid .order-slot { min-height: 76px; font-size: 1.8rem; }
  .order5-pool .sortall-letter { padding: 10px 0; font-size: 1.7rem; }
}
.order5-compare-label { margin: 12px 0 4px; font-family: var(--font-heading); font-weight: 600; font-size: 0.85rem; color: var(--color-text-light); }
.order5-answer { margin-bottom: 14px; }
.order5-answer .order-slot { cursor: default; }
#orderRevealBtn[hidden] { display: none; }
.order-answer { margin-bottom: 14px; }
.order-answer .order-slot { cursor: default; }

/* Resultat "x / 28" du jeu de l'alphabet : carte ludique coloree */
.order-score {
  --tier: #1F8A4C; --tier-bg: rgba(31, 138, 76, 0.10);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  max-width: 360px; margin: 10px auto 12px; padding: 14px 18px 12px;
  border: 2px solid var(--tier); border-radius: 18px; background: var(--tier-bg);
  animation: orderScorePop 0.55s cubic-bezier(.2, 1.5, .4, 1) both;
}
.order-score-high { --tier: #1F8A4C; --tier-bg: rgba(31, 138, 76, 0.10); }
.order-score-mid { --tier: #D9730D; --tier-bg: rgba(217, 115, 13, 0.10); }
.order-score-low { --tier: #C6362E; --tier-bg: rgba(198, 54, 46, 0.09); }
.order-score-emoji { font-size: 2.2rem; line-height: 1; animation: endBadgeBob 2.2s ease-in-out 0.6s infinite; }
.order-score-num { font-family: var(--font-heading); font-weight: 800; font-size: 2.6rem; line-height: 1; color: var(--tier); text-shadow: 0 0 18px var(--tier-bg); }
.order-score-bar { display: block; width: 100%; height: 12px; border-radius: 999px; background: rgba(16, 60, 70, 0.10); overflow: hidden; }
.order-score-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--tier); transition: width 0.9s cubic-bezier(.2, .8, .2, 1); }
.order-score-msg { font-family: var(--font-heading); font-weight: 700; font-size: 0.95rem; color: var(--tier); }
@keyframes orderScorePop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .order-score, .order-score-emoji { animation: none; } .order-score-bar i { transition: none; } }
