/* =====================================================================
   Mode Guidé / Accompagné — "Le Navire IA"  (carte au trésor + lecteur pas-à-pas)
   Palette marque : bleu marine #053685 + or #C9A227. Préfixe .gd- pour éviter
   toute collision avec .lms- / .block-. Mobile-first.
   ===================================================================== */
:root {
  --gd-navy: #053685;
  --gd-navy-dark: #032454;
  --gd-navy-soft: #0A5BB5;
  --gd-gold: #C9A227;
  --gd-gold-soft: #E3C766;
  --gd-sea: #0A5BB5;
  --gd-ink: #0A0F1A;
  --gd-paper: #f3f1e7; /* parchemin */
  --gd-ok: #18A957;
}

/* ---------- Conteneur global ---------- */
.gd-wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 120px; color: var(--gd-ink); }
.gd-wrap * { box-sizing: border-box; }

/* ---------- Barre d'état (streak / XP / objectif / mascotte) ---------- */
.gd-topbar {
  position: sticky; top: 64px; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, var(--gd-navy) 0%, var(--gd-navy-dark) 100%);
  color: #fff; border-radius: 0 0 18px 18px;
  padding: 12px 16px; margin: 0 -16px 18px; box-shadow: 0 6px 18px rgba(5,54,133,.25);
}
.gd-topbar__mascot { width: 46px; height: 46px; border-radius: 50%; background: #fff;
  object-fit: contain; padding: 2px; border: 2px solid var(--gd-gold); flex-shrink: 0; }
.gd-stat { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: .98rem; }
.gd-stat small { display: block; font-weight: 500; font-size: .62rem; opacity: .8; letter-spacing: .03em; text-transform: uppercase; }
.gd-stat__flame { font-size: 1.15rem; }
.gd-topbar__spacer { flex: 1; }

/* anneau objectif du jour */
.gd-ring { --p: 0; width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--gd-gold) calc(var(--p) * 1%), rgba(255,255,255,.18) 0);
  display: grid; place-items: center; position: relative; }
.gd-ring::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--gd-navy); }
.gd-ring span { position: relative; z-index: 1; font-size: .68rem; font-weight: 800; }

/* ---------- Quêtes du jour ---------- */
.gd-quests { display: grid; gap: 8px; margin: 0 0 20px; }
.gd-quest { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #e6e2d2;
  border-left: 4px solid var(--gd-gold); border-radius: 12px; padding: 10px 12px; }
.gd-quest--done { border-left-color: var(--gd-ok); background: #f1faf3; }
.gd-quest__icon { font-size: 1.3rem; }
.gd-quest__body { flex: 1; }
.gd-quest__label { font-weight: 700; font-size: .9rem; }
.gd-quest__bar { height: 6px; border-radius: 99px; background: #ece8d8; margin-top: 5px; overflow: hidden; }
.gd-quest__bar i { display: block; height: 100%; background: var(--gd-gold); border-radius: 99px; }
.gd-quest--done .gd-quest__bar i { background: var(--gd-ok); }
.gd-quest__check { color: var(--gd-ok); font-weight: 900; }

/* ---------- En-tête de carte ---------- */
.gd-hero { text-align: center; padding: 8px 0 4px; }
.gd-hero h1 { font-size: 1.5rem; margin: 0 0 4px; color: var(--gd-navy); }
.gd-hero p { margin: 0; color: #5a6472; font-size: .92rem; }

/* ---------- Carte au trésor (chemin vertical d'îles) ---------- */
.gd-map { position: relative; padding: 12px 0 0; }
.gd-island { margin: 8px 0 26px; }
.gd-island__head { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.gd-island__flag { font-size: 1.4rem; }
.gd-island__title { font-weight: 800; color: var(--gd-navy); font-size: 1.06rem; }
.gd-island__meta { margin-left: auto; font-size: .78rem; color: #8a93a2; font-weight: 600; }

/* la route serpentée : nœuds centrés, décalés gauche/droite */
.gd-nodes { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.gd-nodes::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 4px;
  transform: translateX(-50%); background: repeating-linear-gradient(var(--gd-gold) 0 8px, transparent 8px 16px); opacity: .5; }
.gd-node { position: relative; z-index: 1; width: 78px; height: 78px; border-radius: 50%;
  display: grid; place-items: center; text-align: center; cursor: pointer; border: none;
  font-weight: 800; color: #fff; background: var(--gd-navy);
  box-shadow: 0 6px 0 rgba(3,36,84,.5), 0 10px 20px rgba(5,54,133,.25); transition: transform .12s; }
.gd-node:nth-child(odd) { transform: translateX(-58px); }
.gd-node:nth-child(even) { transform: translateX(58px); }
.gd-node:hover { transform: scale(1.05) translateX(var(--shift, 0)); }
.gd-node:nth-child(odd):hover { --shift: -58px; }
.gd-node:nth-child(even):hover { --shift: 58px; }
.gd-node small { display: block; font-size: .58rem; font-weight: 600; opacity: .85; }
.gd-node__emoji { font-size: 1.5rem; line-height: 1; }
.gd-node--done { background: linear-gradient(135deg, var(--gd-gold), var(--gd-gold-soft)); color: var(--gd-navy-dark);
  box-shadow: 0 6px 0 #a9871c, 0 10px 20px rgba(201,162,39,.3); }
.gd-node--current { background: linear-gradient(135deg, var(--gd-navy-soft), var(--gd-navy)); animation: gd-pulse 1.8s infinite; }
.gd-node--locked { background: #cdd3dc; color: #fff; box-shadow: 0 6px 0 #b3bac6; cursor: not-allowed; }
.gd-node__label { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: .72rem; color: #5a6472; font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
@keyframes gd-pulse { 0%,100% { box-shadow: 0 6px 0 rgba(3,36,84,.5), 0 0 0 0 rgba(201,162,39,.55); } 50% { box-shadow: 0 6px 0 rgba(3,36,84,.5), 0 0 0 12px rgba(201,162,39,0); } }

/* badge "examen / certificat" en bas de carte */
.gd-finish { margin: 10px auto 0; max-width: 420px; text-align: center; background: var(--gd-paper);
  border: 2px dashed var(--gd-gold); border-radius: 16px; padding: 18px; }
.gd-finish h3 { margin: 0 0 6px; color: var(--gd-navy); }

/* ---------- Lecteur pas-à-pas (plein écran) ---------- */
.gd-player { position: fixed; inset: 0; z-index: 9000; background: #fbfbf7; display: flex; flex-direction: column; }
.gd-player__top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #ece8d8; }
.gd-player__close { border: none; background: #eee; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; flex-shrink: 0; }
.gd-progress { flex: 1; height: 12px; background: #ece8d8; border-radius: 99px; overflow: hidden; }
.gd-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gd-gold), var(--gd-gold-soft)); border-radius: 99px; transition: width .35s ease; }
.gd-player__count { font-size: .78rem; font-weight: 700; color: #8a93a2; flex-shrink: 0; }
.gd-player__stage { flex: 1; overflow-y: auto; padding: 22px 18px 40px; }
.gd-stage-inner { max-width: 680px; margin: 0 auto; animation: gd-slidein .3s ease; }
@keyframes gd-slidein { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.gd-step-kicker { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--gd-navy); background: #e7eefa; padding: 4px 10px; border-radius: 99px; margin-bottom: 12px; }

/* pied de page lecteur */
.gd-player__foot { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 16px; border-top: 1px solid #ece8d8; background: #fff; position: relative; }
.gd-player__help { position: absolute; left: 14px; bottom: 10px; width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--gd-gold); background: #fff; cursor: pointer; padding: 2px; }
.gd-player__help img { width: 100%; height: 100%; object-fit: contain; }
.gd-player__next { min-width: 200px; }
/* Mascotte qui "pop" pour encourager (quiz réussi, étape, fin de chapitre) */
.gd-pop { position: fixed; left: 18px; bottom: 92px; z-index: 9200; display: flex; align-items: flex-end; gap: 8px; animation: gd-pop-in .45s cubic-bezier(.2,1.5,.4,1); pointer-events: none; }
.gd-pop img { width: clamp(80px, 16vh, 120px); height: clamp(80px, 16vh, 120px); object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0,0,0,.28)); }
.gd-pop__bubble { background: #fff; border: 2px solid var(--gd-gold); border-radius: 14px 14px 14px 4px; padding: 10px 14px; font-weight: 800; color: var(--gd-navy); max-width: 220px; box-shadow: 0 10px 26px rgba(0,0,0,.2); }
.gd-pop--out { animation: gd-pop-out .4s ease forwards; }
@keyframes gd-pop-in { from { transform: translateY(40px) scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes gd-pop-out { to { transform: translateY(30px) scale(.7); opacity: 0; } }
@media (max-width: 560px) { .gd-player__help { width: 40px; height: 40px; } .gd-player__next { min-width: 150px; } .gd-pop img { width: 80px; height: 80px; } }

/* ===================== Chatbot Merlin (flottant, dispo partout) ===================== */
.merlin-fab { position: fixed; right: 20px; bottom: 92px; z-index: 8000; width: 62px; height: 62px; border-radius: 50%; border: 3px solid var(--gd-gold); background: var(--gd-navy); cursor: pointer; padding: 0; overflow: hidden; box-shadow: 0 8px 24px rgba(5,54,133,.45); animation: merlin-bob 3s ease-in-out infinite; }
.merlin-fab img { width: 100%; height: 100%; object-fit: cover; }
@keyframes merlin-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.merlin-fab__badge { position: absolute; top: -2px; right: -2px; background: var(--gd-gold); color: var(--gd-navy-dark); font-size: .62rem; font-weight: 900; border-radius: 99px; padding: 1px 5px; border: 2px solid #fff; }
.merlin-panel { position: fixed; right: 20px; bottom: 166px; z-index: 8001; width: min(370px, 92vw); height: min(560px, 70vh); background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.32); display: flex; flex-direction: column; overflow: hidden; animation: gd-pop-in .3s ease; }
.merlin-panel__head { background: linear-gradient(135deg, var(--gd-navy), var(--gd-navy-dark)); color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.merlin-panel__head img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--gd-gold); object-fit: cover; background: #fff; }
.merlin-panel__head b { font-size: .98rem; } .merlin-panel__head small { display: block; font-size: .7rem; opacity: .85; }
.merlin-panel__close { margin-left: auto; background: rgba(255,255,255,.16); border: none; color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 1rem; }
.merlin-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f7f8fc; }
.merlin-msg { max-width: 82%; padding: 10px 13px; border-radius: 14px; font-size: .9rem; line-height: 1.45; white-space: pre-wrap; }
.merlin-msg--bot { align-self: flex-start; background: #fff; border: 1px solid #e6e9f0; border-bottom-left-radius: 4px; color: #0A0F1A; }
.merlin-msg--me { align-self: flex-end; background: var(--gd-navy); color: #fff; border-bottom-right-radius: 4px; }
.merlin-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e6e9f0; background: #fff; flex-shrink: 0; }
.merlin-input textarea { flex: 1; resize: none; border: 1px solid #cdd3dc; border-radius: 10px; padding: 9px 11px; font: inherit; max-height: 90px; }
.merlin-input button { background: var(--gd-gold); color: var(--gd-navy-dark); border: none; border-radius: 10px; padding: 0 16px; font-weight: 800; cursor: pointer; font-size: 1.1rem; }
@media (max-width: 560px) { .merlin-fab { bottom: 80px; right: 14px; } .merlin-panel { bottom: 150px; right: 8px; left: 8px; width: auto; } }
.gd-btn { border: none; border-radius: 12px; padding: 14px 26px; font-weight: 800; font-size: 1rem; cursor: pointer;
  background: var(--gd-navy); color: #fff; box-shadow: 0 4px 0 var(--gd-navy-dark); transition: transform .1s; }
.gd-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--gd-navy-dark); }
.gd-btn--gold { background: var(--gd-gold); color: var(--gd-navy-dark); box-shadow: 0 4px 0 #a9871c; }
.gd-btn--ghost { background: #eee; color: #333; box-shadow: 0 4px 0 #ccc; }
.gd-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ---------- Bac à sable IA ---------- */
.gd-sandbox { border: 2px solid var(--gd-navy); border-radius: 16px; overflow: hidden; margin: 8px 0; }
.gd-sandbox__head { background: var(--gd-navy); color: #fff; padding: 10px 14px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.gd-sandbox__body { padding: 14px; }
.gd-sandbox textarea { width: 100%; min-height: 90px; border: 1px solid #cdd3dc; border-radius: 10px; padding: 10px; font: inherit; resize: vertical; }
.gd-sandbox__out { margin-top: 12px; background: #f3f1e7; border-left: 4px solid var(--gd-gold); border-radius: 10px; padding: 12px; white-space: pre-wrap; font-size: .92rem; display: none; }

/* ---------- Modales (serment / célébration / certificat) ---------- */
.gd-modal { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; padding: 20px;
  background: rgba(3,18,42,.6); backdrop-filter: blur(3px); animation: gd-fade .2s ease; }
@keyframes gd-fade { from { opacity: 0; } to { opacity: 1; } }
.gd-card { background: #fff; border-radius: 20px; max-width: 460px; width: 100%; padding: 28px 24px; text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.3); max-height: 90vh; overflow-y: auto; }
.gd-card__mascot { width: 120px; height: 120px; object-fit: contain; margin: -8px auto 6px; display: block; }
.gd-card h2 { color: var(--gd-navy); margin: 0 0 10px; }
.gd-card p { color: #5a6472; margin: 0 0 16px; line-height: 1.5; }
.gd-card textarea { width: 100%; min-height: 70px; border: 1px solid #cdd3dc; border-radius: 10px; padding: 10px; font: inherit; margin-bottom: 14px; }
.gd-card__row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* célébration : confettis + gros chiffres */
.gd-reward { display: flex; justify-content: center; gap: 18px; margin: 8px 0 18px; }
.gd-reward div { font-size: 1.8rem; font-weight: 900; color: var(--gd-gold); }
.gd-reward small { display: block; font-size: .66rem; color: #8a93a2; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.gd-confetti { position: fixed; top: -10px; width: 10px; height: 14px; z-index: 9600; pointer-events: none; animation: gd-fall linear forwards; }
@keyframes gd-fall { to { transform: translateY(105vh) rotate(540deg); opacity: .9; } }

/* ---------- Certificat ---------- */
.gd-cert { border: 6px double var(--gd-gold); border-radius: 14px; padding: 26px 20px; background: var(--gd-paper); text-align: center; margin: 0 0 14px; }
.gd-cert__title { font-size: 1.4rem; color: var(--gd-navy); font-weight: 900; letter-spacing: .04em; }
.gd-cert__name { font-size: 1.6rem; font-weight: 900; color: var(--gd-navy-dark); margin: 12px 0; }
.gd-cert__code { font-family: monospace; font-size: .8rem; color: #8a7320; margin-top: 10px; }

/* ---------- Bouton flottant de bascule de mode ---------- */
.gd-modeswitch { position: fixed; left: 16px; bottom: 84px; z-index: 60;
  background: var(--gd-navy); color: #fff; border: 2px solid var(--gd-gold); border-radius: 99px;
  padding: 10px 16px; font-weight: 800; cursor: pointer; box-shadow: 0 8px 24px rgba(5,54,133,.35); display: flex; align-items: center; gap: 8px; }
.gd-modeswitch img { width: 26px; height: 26px; object-fit: contain; }

/* ---------- Sélecteur de mode (onboarding) ---------- */
.gd-choose { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; margin: 18px 0; }
.gd-choose__card { border: 2px solid #e6e2d2; border-radius: 16px; padding: 20px; text-align: center; cursor: pointer; background: #fff; transition: border-color .15s, transform .1s; }
.gd-choose__card:hover { border-color: var(--gd-gold); transform: translateY(-3px); }
.gd-choose__card h3 { color: var(--gd-navy); margin: 10px 0 6px; }
.gd-choose__card p { font-size: .84rem; color: #5a6472; margin: 0; }
.gd-choose__emoji { font-size: 2.4rem; }

@media (max-width: 560px) {
  .gd-choose { grid-template-columns: 1fr; }
  .gd-node:nth-child(odd) { transform: translateX(-40px); }
  .gd-node:nth-child(even) { transform: translateX(40px); }
  .gd-node:nth-child(odd):hover { --shift: -40px; }
  .gd-node:nth-child(even):hover { --shift: 40px; }
}

/* ===================== Carte du monde (îles posées sur un fond généré IA) ===================== */
.gd-worldmap {
  position: relative; margin: 10px -6px 8px; padding: 18px 6px 26px; border-radius: 20px;
  overflow: hidden; isolation: isolate;
  /* Fallback parchemin/mer si l'image IA est absente */
  background:
    radial-gradient(circle at 18% 10%, rgba(255,255,255,.55), transparent 42%),
    radial-gradient(circle at 82% 82%, rgba(10,91,181,.14), transparent 46%),
    repeating-linear-gradient(45deg, rgba(201,162,39,.045) 0 14px, transparent 14px 28px),
    linear-gradient(160deg, #f5efdc 0%, #e9dfc2 55%, #dfe7ef 100%);
  border: 2px solid #e0d6b6; box-shadow: inset 0 0 70px rgba(120,90,30,.14);
}
.gd-worldmap__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.gd-worldmap__route { position: absolute; top: 34px; bottom: 34px; left: 50%; width: 0; transform: translateX(-50%);
  border-left: 4px dashed rgba(5,54,133,.32); z-index: 0; }

/* Une île + ses chapitres, disposées en zigzag sur la carte */
.gd-isle { position: relative; z-index: 1; width: 78%; max-width: 460px; margin: 0 0 32px;
  background: rgba(255,255,255,.84); border: 2px solid #e6ddc0; border-radius: 18px;
  padding: 12px 14px 14px; box-shadow: 0 10px 24px rgba(60,45,15,.16); }
.gd-isle--left { margin-right: auto; }
.gd-isle--right { margin-left: auto; }
.gd-isle--done { border-color: var(--gd-gold); background: rgba(255,253,243,.93); box-shadow: 0 10px 28px rgba(201,162,39,.32); }

.gd-isle__art { position: relative; width: 120px; height: 94px; margin: -36px auto 2px; display: grid; place-items: center; }
.gd-isle__img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0,0,0,.25)); }
.gd-isle__fallback { display: none; font-size: 4rem; line-height: 1; filter: drop-shadow(0 6px 8px rgba(0,0,0,.2)); }
.gd-isle__art--fb .gd-isle__fallback { display: block; }
.gd-isle__flag { position: absolute; top: -4px; right: 12px; font-size: 1.5rem; transform-origin: bottom left; animation: gd-wave 2.4s ease-in-out infinite; }
@keyframes gd-wave { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(9deg); } }

.gd-isle__plate { text-align: center; }
.gd-isle__name { display: block; font-weight: 800; color: var(--gd-navy); font-size: .98rem; }
.gd-isle__meta { display: block; font-size: .76rem; color: #8a7a4e; font-weight: 700; margin-top: 2px; }
.gd-isle--done .gd-isle__meta { color: #a9871c; }

.gd-isle__nodes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.gd-dot { width: 42px; height: 42px; min-width: 42px; border-radius: 50%; border: none; cursor: pointer; color: #fff;
  background: var(--gd-navy); box-shadow: 0 4px 0 rgba(3,36,84,.5); display: grid; place-items: center; font-size: 1rem; transition: transform .1s; }
.gd-dot:hover { transform: translateY(-2px) scale(1.06); }
.gd-dot:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(3,36,84,.5); }
.gd-dot--done { background: linear-gradient(135deg, var(--gd-gold), var(--gd-gold-soft)); color: var(--gd-navy-dark); box-shadow: 0 4px 0 #a9871c; }
.gd-dot--current { background: linear-gradient(135deg, var(--gd-navy-soft), var(--gd-navy)); animation: gd-pulse 1.8s infinite; }
.gd-dot__emoji { pointer-events: none; }

/* Bandeau d'identité du navire (cosmétiques rendus) */
.gd-shipid { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid #e6e2d2; border-radius: 14px; padding: 8px 12px; margin: 0 0 14px; font: inherit; }
.gd-shipid:hover { border-color: var(--gd-gold); }
.gd-shipid__flag { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-size: 1.2rem; color: #fff; flex-shrink: 0; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.gd-shipid__txt { flex: 1; line-height: 1.15; }
.gd-shipid__txt b { color: var(--gd-navy); font-size: .95rem; }
.gd-shipid__txt small { display: block; color: #8a93a2; font-size: .72rem; font-weight: 700; }
.gd-shipid__edit { opacity: .6; }

/* Bouton "précédent" + hint dans le lecteur */
.gd-player__back { position: absolute; left: 66px; bottom: 16px; width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid #cdd3dc; background: #fff; color: var(--gd-navy); font-size: 1rem; cursor: pointer; }
.gd-player__back:disabled { opacity: .35; cursor: not-allowed; }
.gd-player__hint { position: absolute; right: 16px; bottom: 22px; font-size: .76rem; color: #8a93a2; max-width: 36%; text-align: right; }

/* Mini spinner (bouton Continuer pendant l'enregistrement) */
.gd-spin { display: inline-block; width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: gd-spin .7s linear infinite; vertical-align: middle; }
@keyframes gd-spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .gd-isle { width: 92%; }
  .gd-player__back { left: 56px; width: 40px; height: 40px; }
  .gd-player__hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gd-isle__flag, .gd-dot--current, .merlin-fab, .gd-pop, .merlin-typing span { animation: none; }
}

/* ===================== Merlin : icônes header, saisie animée, bouton inline ===================== */
.merlin-panel__head > div { flex: 1; min-width: 0; }
.merlin-panel__icon { background: rgba(255,255,255,.16); border: none; color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: .92rem; flex-shrink: 0; }
.merlin-panel__icon:hover { background: rgba(255,255,255,.3); }
.merlin-typing { display: inline-flex; align-items: center; gap: 3px; }
.merlin-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9aa3b2; animation: merlin-blink 1.2s infinite both; }
.merlin-typing span:nth-child(2) { animation-delay: .2s; }
.merlin-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes merlin-blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.gd-ask-merlin { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; background: #eef4ff; border: 1px solid #cdd9f5; color: var(--gd-navy); border-radius: 99px; padding: 7px 13px; font-weight: 700; font-size: .82rem; cursor: pointer; }
.gd-ask-merlin:hover { background: #e2ecfd; }

/* ===================== #3 Quêtes récompensées : bouton Réclamer ===================== */
.gd-quest__claim { flex-shrink: 0; border: none; border-radius: 99px; padding: 8px 14px; font-weight: 800;
  font-size: .8rem; cursor: pointer; color: var(--gd-navy-dark); background: var(--gd-gold);
  box-shadow: 0 3px 0 #a9871c; animation: gd-claim-pulse 1.6s ease-in-out infinite; }
.gd-quest__claim:hover { filter: brightness(1.04); }
.gd-quest__claim:active { transform: translateY(2px); box-shadow: 0 1px 0 #a9871c; }
.gd-quest__claim:disabled { opacity: .6; cursor: default; animation: none; box-shadow: none; }
.gd-quest__check--claimed { color: var(--gd-gold); }
.gd-quest--claimed { border-left-color: var(--gd-gold); background: #fffdf3; }
@keyframes gd-claim-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* ===================== #31 Certificat : masquer les actions à l'impression ===================== */
@media print {
  .gd-noprint { display: none !important; }
  .gd-print-note { display: none !important; }
  .gd-cert { box-shadow: none !important; }
}

/* ===================== #26 / #28 / #13 Catalogue de badges (page profil) ===================== */
.lms-badges { display: flex; flex-direction: column; gap: 18px; }
.lms-badges__family-title { font-weight: 800; color: var(--gd-navy); font-size: .92rem; margin-bottom: 8px; }
.lms-badges__row { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.lms-badge { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  border: 1px solid #e1e4ea; border-radius: 14px; padding: 14px 8px 10px; background: #fff; min-height: 110px; }
.lms-badge--earned { border-color: var(--medal, var(--gd-gold)); background: #fffdf6;
  box-shadow: 0 2px 8px rgba(201,162,39,.16); }
.lms-badge--locked { filter: grayscale(1); opacity: .62; }
.lms-badge__medal { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%;
  color: #fff; font-size: .62rem; font-weight: 900; line-height: 18px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.lms-badge__icon { font-size: 1.8rem; line-height: 1; }
.lms-badge__name { font-weight: 800; color: var(--gd-navy); font-size: .8rem; margin-top: 6px; }
.lms-badge__crit { color: #7a828f; font-size: .68rem; margin-top: 3px; line-height: 1.25; }
.lms-badge__share { margin-top: 8px; border: 1px solid var(--gd-gold); background: #fff7e6; color: var(--gd-navy);
  border-radius: 99px; padding: 4px 10px; font-size: .68rem; font-weight: 800; cursor: pointer; }
.lms-badge__share:hover { background: var(--gd-gold); color: var(--gd-navy-dark); }
@media (max-width: 560px) {
  .lms-badges__row { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* ===================== #9 Aperçu live de la cabine ===================== */
.gd-cabprev { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #f7f9ff, #eef3fb);
  border: 1px solid #e6e2d2; border-radius: 14px; padding: 12px 14px; margin: 0 0 16px; }
.gd-cabprev__flag { width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; font-size: 1.5rem;
  color: #fff; flex-shrink: 0; box-shadow: inset 0 0 0 2px rgba(255,255,255,.3); }
.gd-cabprev__txt { flex: 1; line-height: 1.2; min-width: 0; }
.gd-cabprev__txt b { color: var(--gd-navy); font-size: 1rem; }
.gd-cabprev__txt small { display: block; color: #8a93a2; font-weight: 700; font-size: .78rem; }
.gd-cabprev__tag { font-size: .66rem; font-weight: 800; color: #a9871c; background: #fffdf3; border: 1px solid var(--gd-gold);
  border-radius: 99px; padding: 3px 8px; text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0; }
