/* ===== Charline : fenêtre et bulles des tutoriels (js/charline.js, js/tutoriel.js) ===== */
.ch-fig { pointer-events: none; }
.ch-fig canvas { display: block; width: 100%; height: 100%; }
.ch-hide { visibility: hidden; }

/* ----- Scène : Charline en pied à gauche, sa bulle à droite. Taille fixe d'une étape à l'autre ----- */
.guide-dialog, .gd-bubble, .ch-goal { --ch-bg: #fdeecc; --ch-ink: #4a3018; --ch-soft: #6f5230; --ch-title: #8a4a0c; --ch-do: #27602c; --ch-dot: rgba(90, 58, 24, .3); }
html.dark-win .guide-dialog, html.dark-win .gd-bubble, html.dark-win .ch-goal { --ch-bg: #2e2219; --ch-ink: #f1e6d4; --ch-soft: #c9b28f; --ch-title: #f0c75e; --ch-do: #9fe0a0; --ch-dot: rgba(255, 235, 200, .28); }
.guide-dialog { width: min(920px, calc(100vw - 32px)); height: min(600px, calc(100dvh / var(--page-zoom, 1) - 32px)); max-width: none; max-height: none;
  padding: 0; border: 0; background: none; box-shadow: none; overflow: hidden; }
.guide-dialog::backdrop { background: radial-gradient(ellipse at 50% 45%, rgba(96, 58, 40, .72), rgba(12, 7, 5, .88)); }
.guide-dialog .gd-modal { position: relative; display: block; box-sizing: border-box; width: 100%; height: 100%; max-width: none; max-height: none; overflow: hidden; padding: 0; border: 0; background: none; box-shadow: none; text-align: left; }
.ch-scene-fig { position: absolute; z-index: 2; left: 0; bottom: 0; width: 300px; height: 100%; animation: chIn .55s cubic-bezier(.2, .9, .3, 1.15); }
.ch-scene-fig canvas { filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .5)); }
@keyframes chIn { from { transform: translateX(-60px) rotate(-3deg); } to { transform: none; } }
.ch-say { position: absolute; left: 254px; right: 0; top: 34px; bottom: 34px; box-sizing: border-box; padding: 26px 28px 20px 66px;
  display: flex; flex-direction: column; gap: 12px; color: var(--ch-ink); background: var(--ch-bg); border-radius: 22px;
  font-size: 19px; line-height: 1.45; transform-origin: 0 30%; animation: chPop .4s cubic-bezier(.2, .9, .3, 1.25); }
@keyframes chPop { from { transform: scale(.94); } to { transform: none; } }
.ch-name { align-self: flex-start; padding: 5px 16px 7px; border-radius: 14px; background: #a43c74; color: #fff; font: 17px/1.2 var(--font-title); }
.ch-top { display: flex; align-items: center; gap: 14px; }
.ch-top .gd-illu { flex: none; width: 72px; height: 72px; }
.guide-dialog .gd-modal h2 { margin: 0; justify-content: flex-start; color: var(--ch-title); font-size: 25px; line-height: 1.2; }
.ch-say .tuto-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; color: inherit; }
.ch-say .tuto-body p { margin: 0 0 10px; }
.ch-say .muted, .gd-bubble .muted { color: var(--ch-soft); }
.ch-say .tuto-foot { flex: none; flex-wrap: wrap; }
/* Étincelles autour de Charline */
.ch-stars i { position: absolute; z-index: 1; width: 22px; height: 22px; opacity: .75; background: radial-gradient(circle, #fff4b8 0 8%, rgba(255, 214, 110, .55) 22%, transparent 62%); animation: chStar 4.5s ease-in-out infinite; }
.ch-stars i:nth-child(1) { left: 18px; top: 22%; }
.ch-stars i:nth-child(2) { left: 214px; top: 8%; animation-delay: -1.3s; }
.ch-stars i:nth-child(3) { left: 46px; top: 58%; animation-delay: -2.2s; }
.ch-stars i:nth-child(4) { left: 226px; top: 66%; animation-delay: -3.1s; }
.ch-stars i:nth-child(5) { left: 8px; top: 84%; animation-delay: -.6s; }
@keyframes chStar { 0%, 100% { transform: translateY(8px) scale(.6); } 50% { transform: translateY(-16px) scale(1.15); } }

/* ----- Bulle : buste de Charline à gauche, texte à droite ----- */
.gd-bubble { width: min(470px, calc(100vw - 16px)); min-height: 200px; padding: 14px 16px 12px 142px; border: 0; border-radius: 18px;
  color: var(--ch-ink); background: var(--ch-bg); font-size: 16px; box-shadow: 0 12px 30px rgba(0, 0, 0, .6); }
.ch-bust { position: absolute; left: 8px; bottom: 0; width: 126px; height: 188px; overflow: hidden; border-radius: 0 0 0 14px; -webkit-mask: linear-gradient(#000 86%, transparent); mask: linear-gradient(#000 86%, transparent); }
.gd-bubble .gd-title { color: var(--ch-title); }
.gd-bubble .gd-do, .ch-say .gd-do { color: var(--ch-do); }
.gd-bubble .gd-body { flex: 1 1 auto; }
.gd-bubble .gd-link { color: var(--ch-soft); }
.gd-bubble .gd-link:hover { color: var(--ch-ink); }
.gd-bubble .tuto-dots i:not(.on), .guide-dialog .tuto-dots i:not(.on) { background: var(--ch-dot); border-color: transparent; }
.gd-bubble .gd-arrow { border: 0; background: var(--ch-bg) !important; }
/* Couleurs de qualité (choisies pour un fond sombre) : pastille brune */
.gd-bubble .gd-body b[style] { padding: 0 7px; border-radius: 7px; background: #3b2c1f; }

/* ----- Objectif de Charline : petite fiche en bas à gauche, entre le démarrage et le Bâton du corbeau ----- */
.ch-goal { position: fixed; z-index: 700; left: 16px; bottom: 16px; width: 330px; box-sizing: border-box; min-height: 132px; padding: 12px 14px 14px 100px;
  color: var(--ch-ink); background: var(--ch-bg); border-radius: 16px; box-shadow: 0 10px 24px rgba(0, 0, 0, .55); font-size: 16px; line-height: 1.3; }
.ch-goal[hidden] { display: none; }
.ch-goal.ch-right { left: auto; right: 16px; } /* panneau Quêtes dessous (Guide.goal) */
.ch-goal .ch-bust { left: 6px; width: 86px; height: 128px; }
.ch-goal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ch-title); font: 17px/1.2 var(--font-title); }
.ch-goal-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; width: 100%; margin-top: 8px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; }
button.ch-goal-row { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ch-goal-row b { text-align: right; }
.ch-goal-row .ch-bar { grid-column: 1 / -1; height: 8px; border-radius: 4px; overflow: hidden; background: var(--ch-dot); }
.ch-goal-row .ch-bar i { display: block; height: 100%; border-radius: 4px; background: #4f9a4f; }
.ch-goal-row.ok .ch-bar i { background: #d9a531; }

@media (max-width: 760px) {
  .ch-scene-fig, .ch-stars { display: none; }
  .ch-say { left: 0; padding: 20px; }
}
@media (max-width: 520px) { .gd-bubble { padding-left: 110px; } .gd-bubble .ch-bust { width: 96px; height: 144px; } .ch-goal { width: calc(100vw - 32px); } }
@media (prefers-reduced-motion: reduce) { .ch-scene-fig, .ch-say, .ch-stars i { animation: none; } }
